Move the code and terraform audits into the reviews plugin

Copy the standalone code-review and terraform-review skills into
plugins/reviews as audit-code and audit-terraform. The rename separates the
automated, linter-driven audits from the guided review-pr walkthrough that
already lived here.

Resolve bundled script paths through ${SKILL_DIR}, exported in a new step 0.
CLAUDE_PLUGIN_ROOT is not set in the Bash tool environment, so the obvious
substitution would have expanded to nothing and broken every collection
script invocation.

Replace the PLAN and DESIGN docs with READMEs written from the current
SKILL.md and scripts. The old docs had drifted badly: they named semgrep
where the code calls opengrep, scoped five review agents where there are
now eight, and predated Lua, PowerShell, and GitHub Actions support.

Add CONSISTENCY_NORMS to the audit-terraform agent inputs. The collection
script writes consistency_norms.json and the agent prompt declares it, but
SKILL.md never listed it, leaving the variable unsubstituted.

Drop the --ingest-verdicts instruction from both skills. review_stats.py
parses no arguments, so the ref-mode verdict template it told users to feed
back could never be read.

Point audit-terraform's smoke test at README.md and resolve its fixture
paths relative to the test file rather than an absolute home directory.

Tests: 197 passing (audit-code), 106 passing (audit-terraform).
This commit is contained in:
2026-07-21 11:11:05 -05:00
parent 600c1fef86
commit f5934181ec
179 changed files with 20779 additions and 3 deletions
@@ -0,0 +1,38 @@
# secrets-reviewer agent
You review gitleaks findings to separate real secret leaks from false
positives.
## Inputs
- `MANIFEST` — `manifest-secrets.json` (gitleaks findings + changed_files)
- `REPO`, `MODE`, `OUTPUT` as for the other agents.
## Task
1. For each gitleaks finding:
- Read the file at REPO/<file> around the reported line.
- Determine whether it's a real secret or a false positive:
- False positives: test fixtures with synthetic values, base64
lookalikes, environment variable NAMES that resemble secrets
but contain no value, redacted/placeholder strings, example
values in docs.
- Real positives: anything that looks like a live credential
checked into source.
2. For real positives:
- Set severity=critical.
- In `fix:` (local mode), prescribe: revoke the credential, rotate,
remove from history (`git filter-repo` / BFG), move to a secrets
manager.
- In `question:` (ref mode), ask: was this rotated? where is it now?
3. For findings on REMOVED lines (secret being deleted): confirm the
PR description mentions rotation. If unclear, emit a finding asking
for confirmation.
4. Emit JSON in the same schema as security-triage with
`"agent": "secrets-reviewer"`.
## Rules
- A redacted secret in this skill's own fixtures (`tests/fixtures/`) is
a false positive — drop it.
- DO NOT write anything other than the JSON document to OUTPUT.