api-pagination
Implement correct, fast API pagination — cursor vs offset trade-offs, opaque cursor encoding, stable sort keys, page-size limits, total-count costs, and…
Handle secrets safely across the lifecycle — keep them out of source, load from env or a secret manager, scope to least privilege, encrypt in transit and at rest, rotate on a schedule, and respond fast when one leaks. Deep reference with runbooks, examples, and a runnable leak
$ npx -y skills add vanara-agents/skills --skill secrets-management --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/secrets-managementContext preview
The summary Claude sees to decide when to auto-load this skill.
Handle secrets safely across the lifecycle — keep them out of source, load from env or a secret manager, scope to least privilege, encrypt in transit and at rest, rotate on a schedule, and respond fast when one leaks. Deep reference with runbooks, examples, and a runnable leak
name: secrets-management description: Handle secrets safely across the lifecycle — keep them out of source, load from env or a secret manager, scope to least privilege, encrypt in transit and at rest, rotate on a schedule, and respond fast when one leaks. Deep reference with runbooks, examples, and a runnable leak scanner. type: skill version: 2.0.1 updated: 2026-07-27
A secret committed to source control is **already compromised** — assume it is public the moment it lands in history, even on a private repo. Git history, CI logs, container layers, backups, and forks all retain it. The only safe response is rotation, not deletion. This skill is the deep reference for keeping secrets out of code, supplying them safely at runtime, and reacting correctly when one escapes. Heavy detail lives in `references/`; copy-paste material in `examples/`; a runnable leak scanner in `scripts/`.
Treat a secret as **runtime configuration**, never as code. Code is committed, reviewed, copied, and shipped to laptops; secrets must not ride along. Separate three concerns and never collapse them:
| Concern | Question | Answer | |---|---|---| | Storage | where does the truth live? | a secret manager (Vault, cloud KMS/Secrets Manager) | | Delivery | how does the app get it? | injected env var or a fetch at boot, over TLS | | Lifecycle | how does it change? | rotation on a schedule + on suspected leak |
The application code should only ever *read* a secret from its environment — it should never know the storage backend, the rotation cadence, or the raw value's origin. That decoupling is what lets you rotate a leaked key with **zero code changes**.
1. Never hardcode keys, tokens, passwords, connection strings, or private keys in source — not even "temporarily". Temporary hardcodes are how most leaks happen. 2. Commit a placeholder template (`.env.example`) with **fake** values and key names only; add the real `.env` to `.gitignore` before the first commit. 3. Add a secret scanner to pre-commit hooks **and** CI so a leak is caught before it reaches the remote. Run `scripts/detect-hardcoded.mjs` over diffs or files as a zero-dependency gate. 4. Load and validate required secrets at startup; fail fast with a clear message naming the missing var.
// Read from the environment; never embed the value. Validate at boot.
const required = ['DATABASE_URL', 'STRIPE_SECRET_KEY', 'JWT_SIGNING_KEY'];
const missing = required.filter((k) => !process.env[k]);
if (missing.length) {
throw new Error(`Missing required secrets: ${missing.join(', ')}`);
}
const stripeKey = process.env.STRIPE_SECRET_KEY; // if this leaks, rotate the value — no code changeEnv vars are the universal **delivery** mechanism, but they are not a secure **store** — they leak via `/proc`, crash dumps, child processes, and accidental `console.log(process.env)`. For anything beyond a single dev machine, the source of truth belongs in a manager.
| Approach | Good for | Watch out for | |---|---|---| | `.env` file (gitignored) | local dev only | easy to commit by accident; no rotation, no audit | | Platform env vars (CI/PaaS) | small apps, single-tenant | visible to anyone with dashboard access; static | | Secret manager (Vault, AWS/GCP/Azure) | production, teams | needs auth bootstrap; adds a runtime dependency | | Cloud KMS (envelope encryption) | encrypting data + secrets | key policy mistakes are silent until exploited |
A manager buys you **dynamic, short-lived credentials** (e.g. Vault issues a DB credential that auto-expires in 1 hour), centralized **audit logs**, and **rotation without redeploys**. See `references/secret-managers.md` for the comparison and bootstrap-auth patterns.
prod database write access.
minutes limits the blast radius of a leak to 15 minutes.
query params (they land in logs, proxies, and browser history) — use headers or the request body.
(a KMS-held key encrypts per-record data keys) rather than a single static key in config.
scanner's redaction logic and `references/leak-response.md`.
Rotation is the difference between "we had an incident" and "we had a non-event." Two triggers:
1. **Scheduled** — rotate on a fixed cadence (e.g. 90 days for static keys) so no credential is ancient. 2. **Reactive** — rotate **immediately** on any suspected exposure, no matter how minor it looks.
The safe pattern is **overlap**: provision the new credential, deploy it, verify, then revoke the old — so there is no downtime window. The full step-by-step is in [`references/rotation.md`](references/rotation.md) and a fill-in incident checklist is in `examples/rotation-runbook.md`.
it. Private is not secret.
caches, and PR mirrors. The credential is burned — rotate it.
🐒 Free agents, skills & packs for Claude Code One subscription. An army of Claude Code agents. 30 production-grade agents, skills, and packs for Claude Code — free, Apache-2.0, install with one command.
Repo: vanara-agents/skills
Implement correct, fast API pagination — cursor vs offset trade-offs, opaque cursor encoding, stable sort keys, page-size limits, total-count costs, and…
Deep reference for caching — what to cache, cache-aside vs read/write-through/write-behind, TTLs with jitter, eviction (LRU/LFU/FIFO), invalidation, and…
Write Conventional Commits — the type(scope)!: subject + body + footer spec — so history is readable and changelogs and SemVer bumps can be derived…
How to write safe, reversible, zero-downtime database schema migrations — additive-first changes, the expand/migrate/contract pattern, batched backfills,…
How to handle errors explicitly and consistently across an app — validate at boundaries, classify operational vs programmer errors, add context while…
Run git collaboration that scales — trunk-based vs git-flow decided by deploy cadence, branch protection and required checks, PR sizing and review etiquette,…