From sops
Use when encrypting or decrypting `.env`, `.yaml`, `.json`, or `.ini` secrets — even if the user does not say "SOPS" explicitly. Triggers on: storing secrets in Git safely, Age encryption, HashiCorp Vault transit, `SOPS_AGE_KEY_FILE`, `SOPS_AGE_RECIPIENTS`, `VAULT_ADDR`, or any request to keep config files secret while keeping diffs reviewable. Covers key generation, `.sops.yaml` creation rules, in-place editing, multi-recipient setups, and key rotation with `sops updatekeys`. Load for `.env`, YAML, JSON, INI, and binary file encryption tasks even when the user reaches for words like "encrypt my cluster secrets", "seal this config", or "share secrets with my team".
How this skill is triggered — by the user, by Claude, or both
Slash command
/sops:encryptThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Encrypt and decrypt secrets with [SOPS](https://github.com/getsops/sops) (Secrets OPerationS). SOPS encrypts only the *leaf values* in YAML/JSON/ENV/INI/BINARY files — keys stay in plaintext, keeping diffs reviewable in Git. This skill covers the **Age** and **HashiCorp Vault** backends.
Encrypt and decrypt secrets with SOPS (Secrets OPerationS). SOPS encrypts only the leaf values in YAML/JSON/ENV/INI/BINARY files — keys stay in plaintext, keeping diffs reviewable in Git. This skill covers the Age and HashiCorp Vault backends.
| Operation | Command | Reference |
|---|---|---|
| Encrypt (Age) | sops encrypt --age <pubkey> file.yaml > file.enc.yaml | age.rst |
| Encrypt (Vault) | sops encrypt --hc-vault-transit $VAULT_ADDR/v1/sops/keys/mykey file.yaml > file.enc.yaml | vault.rst |
| Decrypt to stdout | sops decrypt file.enc.yaml | age.rst |
| Edit in place | sops edit file.enc.yaml | age.rst |
| Rotate recipients | sops updatekeys file.enc.yaml | age.rst / vault.rst |
Init .sops.yaml | Add creation_rules to project root | both references |
.yaml, .json, .env, .ini). Use --input-type / --output-type only when the extension is ambiguous.--age / --hc-vault-transit on the CLI, or commit a .sops.yaml at the project root so SOPS picks up the right key automatically.sops encrypt, sops decrypt, or sops edit as needed.mkdir -p "$HOME/.config/sops/age"
age-keygen -o "$HOME/.config/sops/age/keys.txt"
The public key is printed to stderr — copy it into --age or .sops.yaml. The private key written to keys.txt is what SOPS uses for decryption. See age.rst for default lookup paths on Linux and macOS.
.sops.yaml WorkflowA .sops.yaml at the project root tells SOPS which key to use for each path, so you never need to pass --age or --hc-vault-transit manually:
creation_rules:
- path_regex: ^(secrets/|\.env)
encrypted_regex: ^(data|stringData|password|token|secret)$
age: >-
age1yt3tfqlfrwdwx0z0ynwplcr6qxcxfaqycuprpmy89nr83ltx74tqdpszlw,
age1s3cqcks5genc6ru8chl0hkkd04zmxvczsvdxq99ekffe4gmvjpzsedk23c
encrypted_regex scopes encryption to matching keys only — useful for Kubernetes secrets where you want data and stringData encrypted but not the rest of the manifest. Omit it to encrypt all leaf values.
After updating .sops.yaml with new recipients, re-encrypt the data key without touching plaintext values:
sops updatekeys secrets/prod.yaml
See the rotation subsections in age.rst and vault.rst for backend-specific steps.
{"data": [...]} instead of [...]..yaml to .txt causes a parse failure — use --input-type / --output-type if you must change it..env files decrypt to stdout by default. Pipe to a file (sops decrypt .env.enc > .env) or use sops decrypt -i .env.enc for in-place decryption.SOPS_AGE_KEY_FILE must point at an existing file. If the variable is set but the file is missing, SOPS fails with a confusing "no key found" error rather than "file not found".VAULT_ADDR and a valid token (env var or ~/.vault-token) are required by both operations — not just encryption..sops.yaml or --age. The private key file (keys.txt) should be in .gitignore.Load the appropriate reference based on the backend in use:
age-keygen, SOPS_AGE_KEY_FILE, or SOPS_AGE_RECIPIENTS.vault write -f .../rotate. Load this when the user mentions Vault, VAULT_ADDR, or hc_vault_transit_uri.Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Forks private projects, strips secrets/internal references, verifies cleanliness, and packages them with CLAUDE.md, README, and setup.sh for safe public release.
npx claudepluginhub nq-rdl/agent-extensions --plugin sops