PLUGIN brewtools / Skills

secrets-scan

sonnet 10 parallel agents user-invoked

Finds leaked credentials in git-tracked files before they reach a remote. The skill splits the file list into 10 chunks, scans them in parallel, ranks findings by severity and writes a report. Secrets committed to git stay in history even after deletion, so the cheapest fix is to catch them before the push.

Quick reference

FieldValue
Command/brewtools:secrets-scan
Arguments[prompt] [--fix] — no args = scan only, --fix = interactive remediation
Modelsonnet
Output.claude/reports/{TIMESTAMP}_secrets-scan/report.md (mode 600)

When to use

SituationCommand
Pre-push or pre-PR audit/brewtools:secrets-scan
Before open-sourcing a private repo/brewtools:secrets-scan --fix
Inherited a legacy codebase/brewtools:secrets-scan
Verify nothing else leaked after an incident/brewtools:secrets-scan

Example

/brewtools:secrets-scan check for secrets before I open-source this repo
## Secrets Scan Complete — FINDINGS

| Metric    | Value |
|-----------|-------|
| Files     | 342   |
| Unscanned | 0     |
| CRITICAL  | 1     |
| HIGH      | 3     |
| MEDIUM    | 7     |
| LOW       | 12    |

Report: .claude/reports/20260417-143022_secrets-scan/report.md (mode 600)

The verdict is CLEAN, FINDINGS or INCOMPLETE. It is never CLEAN while a chunk failed reconciliation.

The report never contains a secret value. Findings carry a length, a sha256[:12] fingerprint and a preview of at most 4 leading characters. Rotate any credential that was ever committed: removing it from the worktree leaves it in git history.

How it works

  1. Setup

    Checks for a git repo, builds the file list from git ls-files minus binaries, vendor dirs and lock files, and creates a mode 700 report directory.

  2. Scan

    Splits the list into 10 chunks and runs 10 haiku agents in one parallel call.

  3. Reconcile

    Each agent must account for every assigned file. A bad chunk is re-run once, then marked UNSCANNED and the verdict becomes INCOMPLETE.

  4. Report

    Merges, dedupes by path and line, sorts CRITICAL to LOW, writes the report and prints a summary table.

  5. Fix (optional)

    With --fix, or on your confirmation when CRITICAL or HIGH findings exist, walks each finding through one choice.

Technical details

Detection rules and severity #
CategoryPatterns
Passwordspassword, passwd, secret, pwd followed by = or : and a value
API keysapi_key, access_key, apikey, api_secret
Tokenstoken, bearer, auth_token, access_token
AWS credentialsAKIA[0-9A-Z]{16}, aws_secret, aws_access_key
Database URLsJDBC, MongoDB, MySQL, PostgreSQL strings with embedded credentials
Private keys-----BEGIN ... PRIVATE KEY-----, client_secret, encryption_key
LevelCriteria
CRITICALReal credentials, private keys, database connection strings with passwords
HIGHReal API keys or tokens, AWS credentials
MEDIUMSuspicious hardcoded values that may be secrets
LOWPlaceholders (changeme, YOUR_KEY, xxx, dummy)

Skipped automatically: env references (process.env.*, ${VAR}, os.getenv()), placeholders in doc comments, binary files.

Fix mode options #
OptionAction
FixDelete or replace the secret inline
Move to env varExtract the value into an environment variable reference
Add to .gitignoreAppend the path, then git rm --cached <path> (ignoring alone leaves a tracked file tracked)
Mark false positiveAcknowledge and skip, logged in the report
SkipLeave as is, next finding
Report contents and redaction #

The report directory is mode 700, the file mode 600. Setup appends .claude/reports/ to .gitignore when nothing ignores it, so a report that names where credentials live cannot be committed.

SectionContent
SummaryVerdict, file counts, severity breakdown
FindingsPer severity: path, line, category, value length, fingerprint, masked preview
Agent StatsAssigned, accounted, reconciled and finding counts per agent
UnscannedChunks that failed reconciliation twice
File InventoryScanned and skipped files with skip reasons

Agents run the skill’s redaction script for every hit and copy back only the length, fingerprint and preview. The raw value never enters an agent response, the report or the chat.

Delegation #

Each chunk agent gets one chunk and the same six-field brief; a repo too big for 10 chunks gets more chunks, not bigger ones. Brief fields and sizing rule: Delegation.

Limits #
  • Run it inside a git repository; outside one it stops with Not git repo.
  • It detects patterns, not every secret. Combine it with .gitignore rules and pre-commit hooks.
  • Expect false positives in fixtures, example configs and doc snippets; mark them in --fix.
  • Check LOW findings too: changeme sometimes reaches production configs unchanged.

Deploy skill

Ship changes via GitHub Actions and GHCR after a clean audit.

GitHub source

Source, detection patterns and agent prompt templates.

Brewtools overview

Commands, models and arguments for every brewtools skill.

Update: /brewtools:plugin-update, /reload-plugins, then /brewcode:setup-status upgrade - FAQ