Lab · Intermediate · 60 min
Implementer + Reviewer Subagent Split
Define a read-only reviewer subagent with a bug-hunting prompt, run it after the main agent implements a feature, and compare bugs found against self-review.
Claude Code · Cursor · GitHub Copilot
Show all 3 stepsHide list
Step 1 of 3
Lab brief
Goal
A reusable reviewer definition that catches real issues the implementer missed, with no write access.
Failure mode
Asking the same agent 'any bugs?' after it wrote the code — it rationalizes its own choices and approves.
Staff move
Isolate context and restrict tools: the reviewer sees only the diff and the spec, cannot edit, and must cite file and line for each finding.
Step 2 of 3
1. Define the reviewer
--- name: reviewer description: Reviews a diff against its spec for bugs, missing tests, and risky changes. Use after implementation, before commit. tools: Read, Grep, Glob, Bash(git diff:*) --- You did not write this code. Find problems, not praise. For each finding: file:line, severity, why it breaks, suggested fix. Check: edge cases, error paths, deleted/skipped tests, invented APIs, security (injection, secrets), and whether tests would fail without the change. If nothing is wrong, say so in one line.
Copilot equivalent: .github/agents/reviewer.md with a read-only tools list. Cursor: a custom subagent or a review skill run in a fresh context.
Step 3 of 3
2. Run the experiment
- Implement a small feature with the main agent
- Ask the main agent to self-review; record findings
- Run the reviewer subagent on the same diff; record findings
- Verify each finding by hand — count true positives and false positives
Stretch
Package implementer + reviewer + test-gate hook as a team plugin so every repo gets the same workflow.