agentleFS
bordenetbordenet/superpowers-plus/skills/engineering/progressive-code-review-gate/skill.md

progressive-code-review-gate

Skill8 starsChanged 6 months agoMITView on GitHub

Use when: committing or pushing code changes. Mandatory progressive review loop via sub-agent-code-reviewer. Skip only when the user explicitly says to skip review.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before every commit or push of code changes (mandatory, fires automatically)

    line 28
  2. Distinctive:

    When user says "ready to commit," "push this," or "commit and push"

    line 29
  3. Very specific:

    NOT for: PR-level review (providing-code-review), language/profanity audit (professional-language-audit)

    line 30
  4. Distinctive:

    If no diff exists in any of these, skip this gate.

    line 53
  5. Very specific:

    If the sentinel is valid for HEAD AND WORKTREE_CLEAN: battery already ran on this code.

    line 66
  6. Distinctive:

    Phase 4 — Escalation: if triggers fire (re-dispatch with diff + source context re-attached)

    line 73
  7. Very specific:

    Phase 5 — Convergence: check (stop/continue/escalate-to-human)

    line 74
  8. Distinctive:

    After fixing nits, run a targeted battery round:

    line 135
  9. Distinctive:

    Scope: Only the files touched by the nit fixes (not the full original diff)

    line 137
  10. Distinctive:

    Reviewers: Only the reviewer(s) that produced the nits in the previous round

    line 138
  11. Very specific:

    Does not run lint/typecheck/tests (that's pre-commit-gate, order 1)

    line 156
  12. Very specific:

    Does not enforce style guides (that's enforce-style-guide, order 2 — runs before this gate so style-induced code changes are covered by …

    line 157
  13. Very specific:

    Does not handle PR-level review (that's providing-code-review)

    line 158
  14. Very specific:

    Does not scan for unprofessional language (that's professional-language-audit, order 4)

    line 159

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

Progressive Code Review Gate

When to Use

  • Before every commit or push of code changes (mandatory, fires automatically)
  • When user says "ready to commit," "push this," or "commit and push"
  • NOT for: PR-level review (providing-code-review), language/profanity audit (professional-language-audit)

MANDATORY before every commit/push of code changes. Skip only when the human explicitly says to skip review.

Wrong skill? PR-level review of others' work → providing-code-review. File-protocol review → code-review.

Procedure

Step 1: Gather the diff

Determine what is being committed or pushed:

# For uncommitted changes (pre-commit):
git diff --staged                    # staged changes
git diff                             # unstaged changes

# For unpushed commits (pre-push):
git log --oneline @{u}..HEAD        # list unpushed commits
git diff @{u}..HEAD                 # diff of unpushed commits

If no diff exists in any of these, skip this gate.

Step 2: Check sentinel, then dispatch battery if needed

First, run the code-review-battery Phase 0 sentinel check:

SENTINEL="$(git rev-parse --show-toplevel 2>/dev/null || echo .)/.code-review-cleared"
cat "$SENTINEL" 2>/dev/null || echo "NO CLEARANCE"
echo "HEAD: $(git rev-parse HEAD 2>/dev/null)"
git diff --quiet && git diff --cached --quiet && echo "WORKTREE_CLEAN" || echo "WORKTREE_DIRTY"

If the sentinel is valid for HEAD AND WORKTREE_CLEAN: battery already ran on this code. Map the existing verdict to gate verdicts (see table below) and skip dispatch.

Otherwise: dispatch battery. Follow the code-review-battery skill procedure (Phase 1–5):

  1. Phase 1 — Triage the diff → select relevant specialists (monolith only via --all or manual request)
  2. Phase 2 — Diff + Source Context + Dispatch activated reviewers in parallel with diff + source context inline
  3. Phase 3 — Aggregate findings, triple-filter, classify Implement/Defer/Reject
  4. Phase 4 — Escalation if triggers fire (re-dispatch with diff + source context re-attached)
  5. Phase 5 — Convergence check (stop/continue/escalate-to-human)

Map battery output to gate verdicts:

Battery SeverityGate ClassificationGate Verdict
CriticalMUST-FIXFAIL
ImportantSHOULD-FIXFAIL (if ≥2) or PASS_WITH_NITS (if 1)
MinorNITPASS_WITH_NITS
All clean (✅)—PASS

On FAIL re-review rounds (Round 2+): skip triage, re-dispatch the SAME reviewers from Round 1. On PASS_WITH_NITS re-review: use targeted Step 3a below (scoped files + scoped reviewers).

Fallback (only if parallel sub-agent dispatch is impossible — e.g., platform does not support firing multiple sub-agents simultaneously):

Invoke a single reviewer with the monolithic prompt below. Use whatever sub-agent mechanism is available (e.g., sub-agent-code-reviewer on Augment, Task() on Claude Code). Give it a unique name per round (e.g., review-round-1).

The monolithic reviewer MUST receive:

  1. Repo path
  2. Exact diff command matching the review scope
  3. Instruction to read full source files
  4. The monolithic checklist covering all review dimensions:
Review the code changes in {repo_path}.
Run `cd {repo_path} && {exact_diff_command}` to see the diff.
Read the full source files for all changed code.

Be harsh and adversarial. Check for:
1. Logic errors, off-by-one, edge cases
2. Missing error handling or silent failures
3. Inconsistency with surrounding code patterns
4. Security issues (injection, secrets, unsafe operations)
5. Stale references (functions/variables that no longer exist)
6. Missing downstream changes (callers, tests, types, docs)
7. Style violations relative to the project's conventions

Classify each issue:
- MUST-FIX: Blocks commit (logic error, security, correctness)
- SHOULD-FIX: Strong recommendation (inconsistency, missing guard)
- NIT: Minor (won't block)

Verdict: PASS, PASS_WITH_NITS, or FAIL
If FAIL: list every MUST-FIX and SHOULD-FIX clearly.

Step 3: Process results

VerdictAction
PASSProceed to commit/push
PASS_WITH_NITSFix the nits, then go to Step 3a (targeted re-review)
FAILFix MUST-FIX and SHOULD-FIX items, then go to Step 2 (full re-review)

Step 3a: Targeted re-review (PASS_WITH_NITS loop)

After fixing nits, run a targeted battery round:

  1. Scope: Only the files touched by the nit fixes (not the full original diff)
  2. Reviewers: Only the reviewer(s) that produced the nits in the previous round
  3. Dispatch: Re-use the original diff command with -- <fixed-files> appended (see skills/engineering/code-review-battery/skill.md Phase 4 for scoping rules). Each reviewer instruction must include: reviewer prompt + diff + source context (per Phase 2 dispatch requirements).
  4. Verdict mapping: Same table as Step 2
  5. Exit conditions:
    • PASS → proceed to commit/push
    • PASS_WITH_NITS → fix and repeat Step 3a (counts toward Round 5 cap)
    • FAIL → fix and go to Step 2 (full re-review — nit fix introduced a real issue)

Why targeted, not full: Nit fixes are low-risk by definition. Re-reviewing the entire diff wastes time. But nit fixes can introduce new issues, so the affected reviewer must verify.

Step 4: Track rounds

  • Round 1: Initial review (Step 2)
  • Round 2+: Re-review after fixes (Step 2 for FAIL, Step 3a for PASS_WITH_NITS)
  • Round 5: STOP. Tell the human: "5 review rounds without clean pass. Please review manually."

What This Gate Does NOT Do

  • Does not run lint/typecheck/tests (that's pre-commit-gate, order 1)
  • Does not enforce style guides (that's enforce-style-guide, order 2 — runs before this gate so style-induced code changes are covered by this review)
  • Does not handle PR-level review (that's providing-code-review)
  • Does not scan for unprofessional language (that's professional-language-audit, order 4)

Anti-Patterns

WrongRight
Committing without review because "it's a small change"Every code change gets reviewed
Skipping re-review after fixesFixes can introduce new issues. Always re-review
Running review only when human asksReview is automatic. Human asks to SKIP, not to START

Failure Modes

FailureSymptomRecovery
Review loop (5+ rounds)Each fix introduces new findingsStop at Round 5. Tell the human. The change may need a different approach
Stale diff after fixesReviewer sees old diff because changes weren't stagedRe-run git diff or git diff --staged each round — never reuse prior output
Fix-induced regressionRound N fix breaks something Round N-1 passedReviewer must re-check ALL prior-passing areas, not just the new changes
Reviewer scope creepFlagging pre-existing code not in the diffRestrict to changed lines and their direct callers. Pre-existing issues are INFO at most
Skipping for "small changes"One-line fix committed without reviewSize doesn't determine risk. See Anti-Patterns table above

Commit Gate Chain

Preferred: use-skill unified-commit-gate loads all 5 gates in one load. Use this skill directly only for deep-dive when the code review gate fails.

pre-commit-gate (1) → enforce-style-guide (2) → progressive-code-review-gate (3) → professional-language-audit (4) → public-repo-ip-audit (5)

Companion Skills

  • code-review-battery: The review engine this gate dispatches
  • pre-commit-gate: Runs before this gate (lint/tests)
  • enforce-style-guide: Runs before this gate (style fixes)
  • providing-code-review: Engineering rigor checklist (informs review focus)
  • progressive-harsh-review: Progressive review enforcement
  • feature-development: Full feature workflow (uses this gate)
  • micro-harsh-review: Per-batch review (lighter)

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.