secrets-management-design
Design secrets management — vault selection, lifecycle (generation / distribution / rotation / revocation), access control, injection pattern, audit, CI/CD integration, break-glass.
What this skill does
# Secrets Management Design
You design secrets management: how secrets (API keys / DB passwords / certificates / JWT signing keys) are stored, distributed, rotated, and revoked.
## Core rules
- **No plaintext secrets in code / config / CI logs** — ever
- **No long-lived secrets where short-lived possible** — prefer dynamic credentials + OIDC federation
- **Centralized vault** — single source of truth, not per-service secret files
- **Automatic rotation** where feasible
- **Audit every access** — who / when / what secret
- **Break-glass procedure** — emergency manual access with extra audit
## Vault selection
| Vault | Best for |
|---|---|
| **HashiCorp Vault** | Self-hosted, feature-rich, dynamic secrets, multi-cloud |
| **AWS Secrets Manager** | AWS-native, IAM-integrated |
| **GCP Secret Manager** | GCP-native |
| **Azure Key Vault** | Azure-native, HSM option |
| **Doppler** | Developer UX, CI/CD focus |
| **1Password Secrets Automation** | Organizations already on 1Password |
| **Infisical** | Open-source developer-focused |
Pick based on cloud + existing tooling + feature needs (dynamic credentials / PKI / SSH cert).
## Secret types
| Type | Typical approach |
|---|---|
| **DB credentials** | Dynamic (Vault DB engine issues per-session creds) |
| **Cloud credentials** | OIDC federation (GitHub Actions → cloud IAM roles) — no stored secrets |
| **API keys (3rd party)** | Rotated via vendor + auto-update in vault |
| **Certificates** | ACME automation (Let's Encrypt / internal CA via Vault PKI) |
| **JWT signing keys** | Rotated per schedule + gradual rollover |
| **Encryption keys** | KMS-managed (see `encryption-strategy`) |
| **Service account tokens** | Workload identity (SPIFFE / cloud-native) |
## Lifecycle
1. **Generation** — inside vault, never outside
2. **Distribution** — never copy; fetch at runtime
3. **Access control** — per-service / per-env / per-user
4. **Rotation** — automated where feasible; scheduled cadence
5. **Revocation** — on compromise, on employee offboarding
6. **Audit** — every access logged
## Injection patterns
| Pattern | Notes |
|---|---|
| **Env variables** | Simple but leaks via `env` / crash dumps / logs |
| **Files** | Better — tmpfs, cleared on exit |
| **Sidecar** | Vault Agent / AWS-Secrets sidecar injects + rotates |
| **API fetch** | App fetches at startup + refreshes — most flexible |
| **Short-lived injection** | Secrets scoped to single operation / request |
Ranked: sidecar or API-fetch > files > env variables (least preferred).
## Per-environment separation
- **Development** — mock values or least-sensitive dev creds; never prod secrets
- **Staging** — staging-specific creds; never prod
- **Production** — prod vault; minimal human access; break-glass audited
Cross-environment secret leakage = common cause of incidents.
## CI/CD integration
- **OIDC federation** — CI authenticates to cloud via OIDC, not stored long-lived keys (GitHub Actions → AWS IAM; GitLab → GCP Workload Identity)
- **Short-lived tokens** for deploy steps
- **Secret scanning** — pre-commit + pre-push hooks + GitHub secret scanning
- **Rotation on commit leak** — detect + revoke + rotate automatically
## Break-glass procedure
For emergency: senior engineer + security approval + time-limited + extra audit + post-incident review.
## Common anti-patterns
- Secrets in `.env` committed to git
- Long-lived IAM access keys (use IAM roles instead)
- Shared credentials across environments
- No rotation (static secrets from years ago)
- Secrets in plaintext logs
- Secrets in error messages
## Diagram
```mermaid
flowchart LR
subgraph CI["CI/CD"]
BUILD["Build job"]
end
subgraph Vault["Vault"]
KV["Secret store"]
ROT["Rotation engine"]
end
subgraph App["Runtime"]
SIDECAR["Vault Agent sidecar"]
SVC["Service"]
end
BUILD -- "OIDC federation" --> Cloud["Cloud IAM"]
SIDECAR -- "fetch + refresh" --> KV
SVC -- "file / API" --> SIDECAR
ROT -- "rotates" --> KV
```
## Report
```markdown
# Secrets Management: [Scope]
## Vault Selection
[Chosen + rationale]
## Secret Types & Lifecycle
[Per type]
## Injection Patterns
[Per service]
## Environment Separation
[Dev / staging / prod]
## CI/CD Integration
[OIDC / secret scanning / rotation automation]
## Audit & Compliance
[Logging + retention]
## Break-glass Procedure
[Process + approvers + audit]
## Migration From Current State
[Anti-patterns to fix]
## Diagram
```
## Failure behavior
- Plaintext secrets in repo → immediate remediation plan
- No rotation → require schedule
- Long-lived cloud keys → OIDC federation migration
- mmdc failure → see mixin
Related in Design
contribute
IncludedLocal-only OSS contribution command center. Auto-refreshes the user's in-flight PR and issue state on invoke so conversations start with full context — no need to brief Claude on what's in flight. Helps the user find issues to contribute to on GitHub, builds per-repo dossiers of what each upstream expects (CLA, DCO, branch convention, AI policy, draft-first, review bots, issue templates), runs deterministic gates before any external action so AI-assisted contributions don't reach maintainers as slop. State is markdown-only: candidate files at ~/.contribute-system/candidates/, repo dossiers at ~/.contribute-system/research/, append-only event log at ~/.contribute-system/log.jsonl. No database, no cloud calls. Use when the user asks about their PRs / issues / contributions, wants to find new work to take on, claim an issue, build/refresh a repo's dossier, or draft a Design Issue or PR. Trigger with "/contribute", "what's my PR status", "find a contribution", "claim issue X", "draft a Design Issue for Y", "refresh dossier for Z".
architectural-analysis
IncludedUser-triggered deep architectural analysis of a codebase or scoped subtree across eight modes — information architecture, data flow, integration points, UI surfaces, interaction patterns, data model, control flow, and failure modes. This skill should be used when the user asks to "diagram this codebase," "map the architecture," "show the data flow," "give me an ERD," "trace control flow," "find the integration points," "verify the layout pattern," "audit the UX architecture," or any similar request whose primary deliverable is mermaid diagrams plus cited reports under docs/architecture/. Dispatches haiku/sonnet sub-agents in parallel for per-mode exploration, then verifies every citation mechanically before any node lands in a diagram. Not for one-off prose explanations of code (use code-explanation) or for high-level system design from scratch (use system-design).
mcp
IncludedModel Context Protocol (MCP) server development and tool management. Languages: Python, TypeScript. Capabilities: build MCP servers, integrate external APIs, discover/execute MCP tools, manage multi-server configs, design agent-centric tools. Actions: create, build, integrate, discover, execute, configure MCP servers/tools. Keywords: MCP, Model Context Protocol, MCP server, MCP tool, stdio transport, SSE transport, tool discovery, resource provider, prompt template, external API integration, Gemini CLI MCP, Claude MCP, agent tools, tool execution, server config. Use when: building MCP servers, integrating external APIs as MCP tools, discovering available MCP tools, executing MCP capabilities, configuring multi-server setups, designing tools for AI agents.
react-native-skia
IncludedDesign, build, debug, and optimise high-polish animated graphics in React Native or Expo using @shopify/react-native-skia, Reanimated, and Gesture Handler. Use when the user wants canvas-driven UI, shaders, paths, rich text, image filters, sprite fields, Skottie, video frames, snapshots, web CanvasKit setup, or performance tuning for custom motion-heavy elements such as loaders, hero art, cards, charts, progress indicators, particle systems, or gesture-driven surfaces. Also use when the user asks for fluid, glow, glass, blob, parallax, 60fps/120fps, or GPU-friendly animated effects in React Native, even if they do not explicitly say "Skia". Do not use for ordinary form/layout work with standard views.
plaid
IncludedProduct Led AI Development — guides founders from idea to launched product. Six capabilities: Idea (discover a product idea), Validate (pressure-test the idea against fatal flaws, problem reality, competition, and 2-week MVP feasibility), Plan (vision intake + document generation), Design (translate image references into a design.md spec), Launch (go-to-market strategy), and Build (roadmap execution). Use when someone says "PLAID", "plaid idea", "help me find an idea", "product idea", "idea from my business", "idea from my expertise", "plaid validate", "validate my idea", "pressure-test", "is this idea good", "find fatal flaws", "validate the problem", "plan a product", "define my vision", "generate a PRD", "product strategy", "plaid design", "design from image", "translate image to design", "create design.md", "extract design tokens", "plaid launch", "go-to-market", "launch plan", "GTM strategy", "launch playbook", "plaid build", "build the app", "start building", or "execute the roadmap".
nextjs-framer-motion-animations
IncludedAdds production-safe Motion for React or Framer Motion animations to Next.js apps, including reveal, hover and tap micro-interactions, whileInView, stagger, AnimatePresence, layout and layoutId transitions, reorder, scroll-linked UI, and lightweight route-content transitions. Use when the user asks to add, refactor, or debug Motion or Framer Motion in App Router or Pages Router codebases, especially around server/client boundaries, reduced motion, LazyMotion, bundle size, hydration, or route transitions. Avoid for GSAP-style timelines, WebGL or 3D scenes, heavy scroll storytelling, or CSS-only effects unless Motion is explicitly requested.