secret-setup

Solid

Extract hardcoded secrets from CLAUDE.md, .mcp.json, and project config into a gitignored env file, then wire a SessionStart hook to load them automatically. Use when user says "separate secrets", "extract API keys", "secret setup", "env var setup", "hardcoded credentials", ".env setup for Claude", "load secrets via hook", "protect credentials", or "clean up mcp secrets".

AI & Automation 48 stars 5 forks Updated 1 weeks ago MIT

Install

View on GitHub

Quality Score: 87/100

Stars 20%
56
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Secret Setup Extract hardcoded secrets from CLAUDE.md, `.mcp.json`, and project config into a gitignored env file, then wire up a SessionStart hook to load them automatically via `CLAUDE_ENV_FILE`. Secrets in CLAUDE.md and `.mcp.json` get committed to git, shared with collaborators, and cached in Claude's context. This skill moves them to a gitignored file and loads them through a hook or shell profile. If the user passes `scan-only`, stop after Phase 1 (report findings without modifying anything). ## Phase 1: Scan for secrets Read [references/detection-patterns.md](references/detection-patterns.md) for the full list of regex patterns and scan targets. Run Grep with each pattern against the scan targets. Present findings in a table: ``` | # | File | Line | Type | Value (masked) | |---|------|------|------|----------------| | 1 | CLAUDE.md:42 | API Key | sk-...abc1 | | 2 | CLAUDE.md:55 | DB URL | postgres://...@host/db | ``` Ask the user to confirm which items are actual secrets to extract. Some may be intentional examples or documentation — do not force extraction. ## Phase 2: Variable mapping For each confirmed secret, propose an environment variable name: - If the secret is already referenced by a known env var name in the project (e.g., `DATABASE_URL` in code), reuse that name. - Otherwise, derive a descriptive UPPER_SNAKE_CASE name from context. Present the mapping and ask for confirmation. Mark the source so MCP secrets get handled differently in Phase 4: ...

Details

Author
LeeJuOh
Repository
LeeJuOh/claude-code-zero
Created
6 months ago
Last Updated
1 weeks ago
Language
JavaScript
License
MIT

Integrates with

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Listed

secret-hygiene

Keep credentials out of source code and out of git. Use this skill WHENEVER writing, editing, or generating code that touches secrets of any kind — API keys, passwords, tokens, JWTs, private keys, connection strings, database URLs, webhook URLs, or deploy/SSH credentials — even when the user hasn't asked about security. Trigger it when adding config, writing deploy or automation scripts, wiring up a new service or SDK, creating a CLAUDE.md or README, or before proposing a git commit. Also use it when the user says a secret leaked, asks to scan a repo for exposed credentials, or wants a pre-commit hook. If a value looks like it could authenticate to something, this skill applies.

0 Updated 1 weeks ago
dimaad5017-dotcom
AI & Automation Solid

store-secret

Store secrets shared in chat into the cs session secret store. PROACTIVE - invoke immediately when the user shares API keys, passwords, tokens, or other credentials in their message; do not wait to be asked.

30 Updated 3 days ago
hex
Data & Documents Listed

handling-secrets-safely

Use when inspecting, probing, or reporting on any credential-bearing file (.mcp.json, .env, *.pem, ~/.git-credentials, ~/.netrc, a secret store) or when clearing a "no secrets" / security-sweep verdict - the mechanics that keep a well-intentioned command from leaking a value through tool output, a diff echo, a query error, or a shallow history scan. The high-level policy (where secrets live, rotation) is assumed; this is the HOW.

0 Updated yesterday
bim-ba