olafkfreund/cloud-projects-templates/secrets
Claude Code and agent skill by olafkfreund/cloud-projects-templates
- community
- ext:[{"type":"hook","description":"Pre/post lifecycle hooks"}]
Checking that the SKILL.md file is still in the repository.
Handle API keys, personal access tokens (PAT), cloud tokens and passwords safely in this project with agenix-format secrets (age encryption). Use whenever a task needs a credential or token (GitHub PAT, Infracost API key, TFE_TOKEN, Cloudflare/Datadog/API keys), when adding, rotating, rekeying or removing a secret, when onboarding or removing a teammate's key, when passing a secret to terraform, a CLI or an MCP server, or when you are tempted to put a secret in a file, env file, tfvars, code, log or chat. Covers secret-add, secret-edit, secret-list, secret-run --only, secret-rekey, secrets.nix recipients and leak response.
Install
npx vskill@latest install olafkfreund/cloud-projects-templates/secretsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
Secrets (agenix format)
Secrets live encrypted in secrets/<NAME>.age. The recipients for each file are listed in secrets.nix. The .age files are safe to commit, even in a public repo. Plaintext never touches disk. The format is standard agenix (age-encrypted files plus secrets.nix), so agenix -d and NixOS age.secrets can read these files.
Hard rules
- Never reveal a secret value. Don't print,
echo,cator log it. Don't paste it into chat, code, commit messages,*.tfvars,.envfiles,.mcp.jsonor any other file. Encryption doesn't help once a value is on screen or in a transcript. - Never decrypt a secret to a file. Don't run
age -d … > file. Values reach processes only throughsecret-run. - Give a command only the secrets it needs. Always prefer
secret-run --only NAME -- <cmd>over a baresecret-run, so a compromised tool sees only what it needs. - If a secret was exposed (printed, committed in plaintext, or pasted), treat it as compromised. Revoke it at the provider, then store a new value. See Leak response.
- Leave `secrets/` for encrypted files only. The pre-commit hook rejects anything there except
*.ageand.gitkeep. Don't bypass it.
Commands (available in devenv shell)
| Command | What it does | |
|---|---|---|
secret-add NAME | Encrypts a value read from stdin, or a hidden prompt, into secrets/NAME.age, and adds NAME to secrets.nix. NAME must match ^[A-Z][A-Z0-9_]*$ because it becomes an env var. | |
secret-edit NAME | Replaces the value (same as secret-add). | |
secret-delete NAME | Removes the encrypted file and its secrets.nix declaration after exact-name checks. Review the Git diff. | |
secret-list | Prints names only, never values. | |
secret-run [--only A,B] -- CMD… | Decrypts the selected secrets into env vars for CMD only, then runs it. Fails if an --only name doesn't exist. | |
secret-rekey | Re-encrypts every secret for the current secrets.nix recipients, in memory. | |
secret-user-add PUBLIC_KEY [LABEL] | Adds a validated SSH recipient and re-encrypts every secret. Review the Git diff. |
The decryption identity is $AGENIX_IDENTITY, defaulting to ~/.ssh/id_ed25519. An age-keygen key file also works.
Recipes
For Terraform, mark such variables sensitive = true. Prefer ephemeral or write-only arguments where the provider supports them, because values passed to normal arguments end up in state. See the terraform skill.
Team changes
Add a teammate:
- Run
secret-user-add 'ssh-ed25519 …' teammate. - Confirm the command rekeyed every secret successfully.
- Commit
secrets.nixandsecrets/.
secret-user-add changes the shared recipient list and refuses malformed or duplicate keys. It does not grant access to old Git revisions.
Delete a secret: run secret-delete NAME, then review the diff. If the value was exposed or committed previously, delete-and-rekey is not enough: rotate it at the provider.
Remove a teammate:
- Delete their key from
recipients. - Run
secret-rekey. - Commit.
- Rotate every secret they could read. They can still decrypt old ciphertext from git history, so rekeying alone doesn't remove their access.
Per-secret recipients: edit that secret's entry in secrets.nix, for example "secrets/PROD_TOKEN.age".publicKeys = [ "ssh-ed25519 …ops" ];, then run secret-rekey.
Leak response
- Revoke or rotate the credential at its provider (GitHub, cloud console, vendor dashboard) immediately.
- Store the new value:
… | secret-add NAME. - If plaintext was committed, rotating is the fix. Rewriting git history doesn't un-leak a pushed secret. Tell the user.
- Check the provider's audit log for use of the old credential.
Where secrets do not belong
- Runtime secrets for deployed workloads belong in the cloud secret store: AWS Secrets Manager or SSM SecureString, Azure Key Vault, GCP Secret Manager, or OCI Vault. They are provisioned by Terraform and read by the workload's identity. agenix is for developer and CI credentials used from this repo.
- Kubernetes: use External Secrets, Sealed Secrets, or the cloud CSI driver. Never commit plaintext
Secretmanifests.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingtemplates/cloudflare/.claude/skills/secrets/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
hookPre/post lifecycle hooks
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/olafkfreund/cloud-projects-templates/secrets)