secret-handling
БесплатноБез исполняемых скриптовНе проверенNever read .env files or write secrets to .squad/ committed files
от microsoft★ 1 527 звёзд на GitHubОб этом скилле
Context
Spawned agents have read access to the entire repository, including .env files containing live credentials. If an agent reads secrets and writes them to .squad/ files (decisions, logs, history), Scribe auto-commits them to git, exposing them in remote history. This skill codifies absolute prohibitions and safe alternatives.
Patterns
Prohibited File Reads
NEVER read these files:
.env(production secrets).env.local(local dev secrets).env.production(production environment).env.development(development environment).env.staging(staging environment).env.test(test environment with real credentials)- Any file matching
.env.*UNLESS explicitly allowed (see below)
Allowed alternatives:
.env.example(safe — contains placeholder values, no real secrets).env.sample(safe — documentation template).env.template(safe — schema/structure reference)
If you need config info:
- Ask the user directly — "What's the database connection string?"
- Read
.env.example— shows structure without exposing secrets - Read documentation — check
README.md,docs/, config guides
NEVER assume you can "just peek at .env to understand the schema." Use .env.example or ask.
Prohibited Output Patterns
NEVER write these to .squad/ files:
| Pattern Type | Examples | Regex Pattern (for scanning) |
|---|---|---|
| API Keys | OPENAI_API_KEY=sk-proj-..., GITHUB_TOKEN=ghp_... |
`[A-Z_]+(?:KEY |
| Passwords | DB_PASSWORD=super_secret_123, password: "..." |
`(?:PASSWORD |
| Connection Strings | postgres://user:pass@host:5432/db, Server=...;Password=... |
`(?:postgres |
| JWT Tokens | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... |
eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+ |
| Private Keys | -----BEGIN PRIVATE KEY-----, -----BEGIN RSA PRIVATE KEY----- |
-----BEGIN [A-Z ]+PRIVATE KEY----- |
| AWS Credentials | AKIA..., aws_secret_access_key=... |
`AKIA[0-9A-Z]{16} |
| Email Addresses | [email protected] (PII violation per team decision) |
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,} |
What to write instead:
- Placeholder values:
DATABASE_URL=<set in .env> - Redacted references:
API key configured (see .env.example) - Architecture notes: "App uses JWT auth — token stored in session"
- Schema documentation: "Requires OPENAI_API_KEY, GITHUB_TOKEN (see .env.example for format)"
Scribe Pre-Commit Validation
Before committing .squad/ changes, Scribe MUST:
Scan all staged files for secret patterns (use regex table above)
Check for prohibited file names (don't commit
.enveven if manually staged)If secrets detected:
- STOP the commit (do NOT proceed)
- Remove the file from staging:
git reset HEAD <file> - Report to user:
🚨 SECRET DETECTED — commit blocked File: .squad/decisions/inbox/river-db-config.md Pattern: DATABASE_URL=postgres://user:password@localhost:5432/prod This file contains credentials and MUST NOT be committed. Please remove the secret, replace with placeholder, and try again. - Exit with error (never silently skip)
If no secrets detected:
- Proceed with commit as normal
Implementation note for Scribe:
- Run validation AFTER staging files, BEFORE calling
git commit - Use PowerShell
Select-Stringorgit diff --cachedto scan staged content - Fail loud — secret leaks are unacceptable, blocking the commit is correct behavior
Remediation — If a Secret Was Already Committed
If you discover a secret in git history:
- STOP immediately — do not make more commits
- Alert the user:
🚨 CREDENTIAL LEAK DETECTED A secret was found in git history: Commit: abc1234 File: .squad/decisions/inbox/agent-config.md Pattern: API_KEY=sk-proj-... This requires immediate remediation: 1. Revoke the exposed credential (regenerate API key, rotate password) 2. Remove from git history (git filter-repo or BFG) 3. Force-push the cleaned history Do NOT proceed with new work until this is resolved. - Do NOT attempt to fix it yourself — secret removal requires specialized tools
- Wait for user confirmation before resuming work
Examples
✓ Correct: Reading Config Schema
Agent needs to know what environment variables are required:
Agent: "What environment variables does this app need?"
→ Reads `.env.example`:
OPENAI_API_KEY=sk-...
DATABASE_URL=postgres://user:pass@localhost:5432/db
REDIS_URL=redis://localhost:6379
→ Writes to .squad/decisions/inbox/river-env-setup.md:
"App requires three environment variables:
- OPENAI_API_KEY (OpenAI API key, format: sk-...)
- DATABASE_URL (Postgres connection s
Установить secret-handling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл secret-handling?
Never read .env files or write secrets to .squad/ committed files
Как установить скилл secret-handling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл secret-handling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic