skills/privacy-scan/SKILL.md
Dynamically scan files and content for secrets, PII, API keys, tokens, credentials, and privacy-compromising content before committing to version control or saving as durable context. Used by init-project and harvest-context hubs.
npx skillsauth add Thomashighbaugh/opencode privacy-scanInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Dynamically scan files and content for secrets, PII, and privacy-compromising content before they are committed to version control or saved as durable context.
.opencode/context/ (called by harvest-context)Analyze the provided content or file for:
| Category | Patterns |
|----------|----------|
| API Keys & Tokens | sk-[a-zA-Z0-9]{20,}, pk-[a-zA-Z0-9]{20,}, api_key, api_secret, bearer [token], auth_token |
| Passwords & Credentials | password=, passwd=, credential=, login=, pwd= |
| Private Keys | -----BEGIN (RSA\|DSA\|EC\|PGP\|OPENSSH) PRIVATE KEY----- |
| Connection Strings | mongodb(\+srv)?://[^@]+@, postgresql://[^@]+@, mysql://[^@]+@, redis://[^@]+@ |
| PII | Email addresses, IP addresses, phone numbers, SSN patterns |
| Session/Transcript Indicators | File paths containing session, chat, transcript, history under .opencode/ |
| Environment Variables | Hardcoded env var assignments with values (e.g., API_KEY=sk-...) |
| Risk | Meaning | Action | |------|---------|--------| | HIGH | Contains actual secrets, API keys, tokens, passwords, private keys | MUST be gitignored | | MEDIUM | Contains PII, email addresses, IPs, or patterns that look like secrets | Should be gitignored or sanitized | | LOW | Contains no detectable secrets or PII | Safe to commit | | UNCERTAIN | Ambiguous patterns that might be false positives | Flag for human review |
Derived knowledge (safe to commit):
Raw data (risky — scan for secrets):
session, chat, transcript, history## Privacy Scan Result
**Risk Level**: [HIGH|MEDIUM|LOW|UNCERTAIN]
**Findings**: [list of findings]
**Recommendation**: [gitignore|sanitize|commit|review]
[Details/Explanation]
A companion script at scripts/scan-privacy.mjs can be called programmatically:
# Scan a file
node scripts/scan-privacy.mjs --file path/to/file.md
# Scan content from stdin
echo '{"content": "..."}' | node scripts/scan-privacy.mjs --stdin
Returns JSON: { "risk": "low"|"medium"|"high"|"uncertain", "findings": [...], "recommendation": "commit"|"gitignore"|"sanitize"|"review", "details": "..." }
Exit code: 0 for LOW risk, 1 for HIGH/MEDIUM/UNCERTAIN.
When init-project creates or refreshes .opencode/ configuration, it uses privacy-scan to determine which additional patterns should be added to .gitignore.
Before any new context file is saved to .opencode/context/, harvest-context invokes privacy-scan. If the scan returns HIGH or MEDIUM risk, the file is added to .gitignore instead of being committed. LOW risk files are committed as normal durable context.
init-project skill — Uses privacy-scan during setup/refreshharvest-context skill — Uses privacy-scan before saving context filesrules/context-strategy.md — State vs context separation modeltools
Create valid, type-safe TypeScript tools for OpenCode — generates correct boilerplate, typed interfaces, and handler stubs. Use when building new tools for global config or per-project .opencode/tools/.
testing
Explore multiple solution branches in parallel, evaluate each, and recommend the best path. Use when the user explicitly invokes /ideation tree-of-thoughts or asks for "tree of thought" / "branching exploration".
testing
Run multiple independent reasoning passes and find consensus. Use when the decision is critically important, the stakes are high, or the user explicitly requests "run it multiple times" / "check consistency" / "self-consistency".
testing
Optimization by PROmpting — generate candidate prompt variations, test each against a benchmark, and report the best performer. Use when the user invokes /ideation opro or asks for "prompt optimization" / "OPRO".