Skip to content

feat: add review-sweep skill - #10

Open
sameerroboto wants to merge 1 commit into
mainfrom
skill/review-sweep
Open

feat: add review-sweep skill#10
sameerroboto wants to merge 1 commit into
mainfrom
skill/review-sweep

Conversation

@sameerroboto

@sameerroboto sameerroboto commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Problem / Intent

A session that just wrote code is the only one holding the context needed to review it accurately, but it is also the one most likely to rationalise its own defects. /review-sweep closes that gap: it reviews hot, then hands every finding to skeptics whose job is to refute it, so only what survives independent attack gets filed.

Approach

Adds skills/review-sweep/SKILL.md, a seven-step user-invocable skill:

  • Fixes the scope against a base ref and requires a clean tree before reviewing.
  • Fans finders out by failure dimension rather than by file, so bugs spanning several files are visible.
  • Runs a pipeline where each finding is refuted by two skeptics as it arrives; either refutation kills it, and a finding no skeptic answered is counted as unjudged rather than passed.
  • Fingerprints the working tree around the fan-out, since reviewers have written to the tree in past runs.
  • Merges survivors by defect, assigns class / cluster / severity, and files a parent issue plus one sub-issue per defect in the anatomy /review-crunch expects.
  • Fixes only the data-safety class in-session, behind a mutation check and a skeptic on the fix itself.

Summary by CodeRabbit

  • Documentation
    • Added a user-invocable review sweep procedure for conducting structured, adversarial reviews.
    • Documented diff coverage, evidence capture, finding validation, defect classification, and issue handoff requirements.
    • Added safeguards for read-only review work, tree-change detection, testing, and resource usage.
    • Defined a controlled workflow for addressing verified data-safety issues and reporting review results.

Fans out finders by failure dimension, refutes every finding with two
skeptics, and files the survivors as a parent issue plus one sub-issue
per defect for /review-crunch to fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X9kGPJFFrUM9XSDJQKmbQU
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Adds a user-invocable review-sweep skill defining adversarial diff review, finding refutation, defect filing, restricted data-safety hot-fixes, result handoff, and global agent guardrails.

Changes

Review sweep procedure

Layer / File(s) Summary
Discovery and finding refutation
skills/review-sweep/SKILL.md
Defines command usage, diff grouping, review dimensions, finder and skeptic coordination, retry handling, read-only enforcement, and tree-mutation checks.
Defect classification and issue filing
skills/review-sweep/SKILL.md
Defines survivor deduplication, required defect fields, disposition tracking, parent issue content, sub-issue structure, labels, and readiness conditions.
Data-safety hot-fixes and handoff
skills/review-sweep/SKILL.md
Restricts hot-fixes to data-safety tickets, specifies verification and readiness requirements, defines result handoff conventions, and establishes global agent constraints.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ReviewSweep
  participant FinderAgents
  participant SkepticAgents
  participant IssueTracker
  ReviewSweep->>FinderAgents: assign review dimensions
  FinderAgents->>ReviewSweep: return evidence-backed findings
  ReviewSweep->>SkepticAgents: request refutation verdicts
  SkepticAgents->>ReviewSweep: return survivor or refuted status
  ReviewSweep->>IssueTracker: file parent and defect issues
  ReviewSweep->>IssueTracker: comment the review handoff
Loading

Poem

I’m a rabbit with a checklist bright,
Finding flaws by lantern light.
Skeptics thump, “That claim won’t stay!”
Issues bloom in neat array.
Data-safe fixes hop in line—
Then handoff notes make all things fine.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately describes the main change: adding the review-sweep skill.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch skill/review-sweep

Comment @coderabbitai help to get the list of available commands.

@sameerroboto
sameerroboto marked this pull request as ready for review July 27, 2026 08:16

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/review-sweep/SKILL.md`:
- Around line 37-38: Update the “Done when” condition in the review-sweep
instructions to require a completely clean working tree, including untracked
files, before Step 1 proceeds. Use git status --porcelain as the authoritative
check, or explicitly stage/commit all session-owned files; do not rely on git
status showing no tracked changes or git diff --stat.
- Around line 92-94: Clarify the unjudged-finding workflow so self-adjudication
cannot promote findings into survivors without satisfying the two-skeptic gate.
Require rerunning both skeptic seats before promotion, or explicitly keep
unjudged findings excluded from survived/refuted counts while reporting them
separately in the parent.
- Around line 214-224: Update Step 6 to define the rejection path for the fix
skeptic: keep the data-safety ticket open, revert or amend the rejected fix,
then rerun verification and skeptic review. Only instruct the owner to comment
the fixing commit and mutation verdict and close the ticket after the fix is
accepted and the bar passes on the handed-over tree.
- Around line 76-78: Update the retry branch in the parallel mapping around
refutePrompt and agent so the missing skeptic retains its original index i; use
i rather than i + 1 for the seat argument, while keeping the retry suffix only
in the agent label metadata.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3828ed37-60b1-4acb-8d4a-0bd479423dc9

📥 Commits

Reviewing files that changed from the base of the PR and between a295639 and f4d337c.

📒 Files selected for processing (1)
  • skills/review-sweep/SKILL.md

Comment on lines +37 to +38
**Done when:** you can name the base SHA, every changed file, and which subsystems the
change touches; `git status` shows no tracked changes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Require a truly clean tree, including untracked files.

The completion condition only checks for tracked changes, while git diff --stat also omits untracked files. An untracked source or test file can therefore be excluded from the review scope. Require git status --porcelain to be empty before Step 1 proceeds, or explicitly stage/commit all session-owned files.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/review-sweep/SKILL.md` around lines 37 - 38, Update the “Done when”
condition in the review-sweep instructions to require a completely clean working
tree, including untracked files, before Step 1 proceeds. Use git status
--porcelain as the authoritative check, or explicitly stage/commit all
session-owned files; do not rely on git status showing no tracked changes or git
diff --stat.

Comment on lines +76 to +78
const retried = await parallel(vs.map((v, i) => () =>
v ? Promise.resolve(v)
: agent(refutePrompt(f, i + 1), { label: `refute:${f.key}:${i + 1}:retry`, phase: 'Refute', schema: VERDICT, model: 'opus' })))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Retry the same skeptic seat, not i + 1.

When seat 0 is empty, this retries it as seat 1, duplicating the other skeptic’s seat identity and weakening the required two-skeptic gate. Preserve the missing seat index; add retry metadata only to the label.

Proposed fix
-            : agent(refutePrompt(f, i + 1), { label: `refute:${f.key}:${i + 1}:retry`, phase: 'Refute', schema: VERDICT, model: 'opus' })))
+            : agent(refutePrompt(f, i), { label: `refute:${f.key}:${i}:retry`, phase: 'Refute', schema: VERDICT, model: 'opus' })))
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const retried = await parallel(vs.map((v, i) => () =>
v ? Promise.resolve(v)
: agent(refutePrompt(f, i + 1), { label: `refute:${f.key}:${i + 1}:retry`, phase: 'Refute', schema: VERDICT, model: 'opus' })))
const retried = await parallel(vs.map((v, i) => () =>
v ? Promise.resolve(v)
: agent(refutePrompt(f, i), { label: `refute:${f.key}:${i}:retry`, phase: 'Refute', schema: VERDICT, model: 'opus' })))
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/review-sweep/SKILL.md` around lines 76 - 78, Update the retry branch
in the parallel mapping around refutePrompt and agent so the missing skeptic
retains its original index i; use i rather than i + 1 for the seat argument,
while keeping the retry suffix only in the agent label metadata.

Comment on lines +92 to +94
A finding with `unjudged > 0` is **neither survived nor refuted** — nobody looked at it.
Set those aside and judge them yourself; count them separately in the parent, because
folding them into either number overstates the rigour of the funnel it publishes.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Do not let self-adjudication bypass the two-skeptic gate.

“Judge them yourself” is ambiguous: if that judgment can promote an unjudged finding, the workflow violates its stated rule that unjudged findings do not pass. Either rerun both skeptic seats or explicitly keep these findings excluded from survivors while reporting them separately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/review-sweep/SKILL.md` around lines 92 - 94, Clarify the
unjudged-finding workflow so self-adjudication cannot promote findings into
survivors without satisfying the two-skeptic gate. Require rerunning both
skeptic seats before promotion, or explicitly keep unjudged findings excluded
from survived/refuted counts while reporting them separately in the parent.

Comment on lines +214 to +224
- **Spawn one skeptic on the fix itself**, with the same refute framing as Step 3. You
wrote the code and you wrote the fix; the whole reason this pile exists is that an
author rationalises.

Per fix, in one turn: commit, comment the SHA and the evidence on its ticket, close it.
The same turn — a hot fix landed without its ticket is how six of the first pile's
findings reached the crunch already fixed, and the crunch paid a triage phase to discover
it.

**Done when:** no `data-safety` ticket is open, each closed one names the commit that
fixed it and its mutation verdict, and the bar passed on the tree you are handing over.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Define the failure path when the fix skeptic rejects the fix.

Step 6 requires a skeptic review, but then unconditionally instructs the owner to comment the SHA and close the ticket. A rejected fix could therefore leave a data-safety issue closed with an unsafe or incomplete change. Keep the ticket open, revert or amend the fix, and rerun verification and skeptic review before closure.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@skills/review-sweep/SKILL.md` around lines 214 - 224, Update Step 6 to define
the rejection path for the fix skeptic: keep the data-safety ticket open, revert
or amend the rejected fix, then rerun verification and skeptic review. Only
instruct the owner to comment the fixing commit and mutation verdict and close
the ticket after the fix is accepted and the bar passes on the handed-over tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant