Implementation Review
Task
What was implemented: Provided by the user as a task description or task tracker reference.
Process
Step 1: Resolve Task Reference
- If the invoker has already quoted the issue title and body in this prompt (typical when an orchestrator fetched the tracker in an earlier phase and passed the context forward), use those values as the canonical task description for all subsequent steps and do not re-fetch.
- Otherwise, if the task description above contains a GitHub issue URL (e.g.
https://github.com/owner/repo/issues/123) or a shorthand reference (e.g. owner/repo#123 or #123), run gh issue view <url-or-reference> --json title,body to fetch the issue title and body. Use the fetched title and body as the canonical task description for all subsequent steps.
- Otherwise, if the task description above contains a Jira issue URL (e.g.
https://yourcompany.atlassian.net/browse/PROJ-123), use appropriate Agent Skills and/or MCP tools to fetch the issue summary and description, and use those as the canonical task description for all subsequent steps.
- If the task description is plain text and no issue context was provided, skip this step.
Step 2: Understand the Project
Before evaluating any changes, build a mental model of the system:
- Read project context files:
CLAUDE.md, AGENTS.md, GEMINI.md, README.md, ARCHITECTURE.md, and anything in docs/.
- List the project root and key subdirectories to understand module structure and layering.
- Read build/dependency manifests to understand the tech stack.
- Search for code review standards or guidelines the project defines.
Step 3: Understand the Task
Analyze the task description to determine:
- What problem is being solved or what capability is being added?
- Which architectural layers and modules should be affected?
- What quality attributes matter most for this change (correctness, performance, security, maintainability)?
Step 4: Discover What Changed
Identify the implementation changes using all available signals:
- Run
git diff HEAD~1 (and git log --oneline -5 for context). If the change spans multiple commits, widen the range to capture the full scope.
- If the diff is inconclusive, search for files recently modified that relate to the task description.
- Read every changed file completely - not just the diff hunks. You need surrounding context to evaluate whether the change fits.
Build a change inventory:
| File |
Change type |
Lines changed |
Module/Layer |
Step 5: Evaluate the Implementation
For each changed file, assess:
- Correctness - Does the code do what the task requires? Are edge cases handled? Are there logic errors?
- Architectural fit - Does the change respect module boundaries, dependency direction, and the project's established patterns? Does it put logic in the right layer?
- Regression risk - Could this change break existing behavior? Are callers of modified interfaces updated? Are assumptions still valid?
- Error handling - Are errors handled consistently with the project's patterns? Are failure modes explicit?
- Naming and contracts - Do new identifiers communicate intent? Are public API contracts clear?
- Completeness - Is anything missing that the task implies? Migrations, config changes, documentation updates, test coverage?
- Simplicity - Is the solution the simplest that works, or is there unnecessary complexity, indirection, or premature abstraction?
Step 6: Prove a New Regression Test Can Fail
When the change is a bug fix that ships a test, reading the test is not enough. A test can name the defect, assert on a plausible observable, and still pass against the unfixed code, because something else already on that path produces the same observable. Such a test reads exactly like a real one and locks nothing.
Run the control:
- Check the change out in a throwaway
git worktree, so nothing here reaches the tree you work in.
- Revert only the production hunk, leaving the new test in place.
- Run just the new test.
- Restore, re-run, and confirm it is green again.
Green at step 3 is a High finding: the test does not lock the fix, and removing the fix later turns nothing red. Say so, and say what the assertion would have to move to - usually the observable only the fixed path can produce, rather than an end state the surrounding code reaches on its own.
The mechanics of the control - what counts as a valid break, restoring without disturbing the tree, cleaning up what a red run leaks - belong to prove-checks. Follow it rather than improvising.
When the session cannot run commands, do not skip the step silently. Record in the review that the new test was read but never observed red, so the reader knows that half of the evidence is missing.
Step 7: Produce the Review
Output Format
## Implementation Review: [task description, shortened]
### Change Summary
[2-3 sentences: what changed, across which modules, and the overall approach taken]
### Findings
#### [Finding title]
- **Severity:** Critical | High | Medium | Low
- **File:** `path/to/file` (lines N-M)
- **Issue:** [what is wrong, with code evidence]
- **Recommendation:** [concrete fix - not vague advice]
<repeat for each finding, severity-descending>
### What Works Well
[Brief - 1-3 sentences acknowledging sound decisions. Do not pad.]
### Verdict
- **Risk level:** Critical | High | Moderate | Low
- **Decision:** Block | Request changes | Approve with notes | Approve
- **Key actions:**
1. …
2. …
3. …
Severity Criteria
- Critical - Data loss, security vulnerability, correctness bug that affects users. Must fix before merge.
- High - Behavioral bug, broken contract, architectural violation that will cause pain. Should fix before merge.
- Medium - Maintainability concern, missing edge case in non-critical path, suboptimal but working approach. Fix soon.
- Low - Minor naming issue, opportunity for simplification, style inconsistency. Fix if convenient.
Rules
- Every finding must cite specific code. No finding without a file path and line reference.
- Do not comment on formatting, whitespace, or style unless it signals a real problem.
- Do not suggest refactors beyond the scope of the task. Review what was changed, not what was not.
- If the change is clean and correct, say so briefly. A short review of good code is more valuable than a long review searching for problems that are not there.
Save the Review
Write the review to .reviews/Review-impl-{slug}.md, where {slug} is a short kebab-case slug derived from the task description (3-5 words max).
Create the .reviews/ directory if it does not exist. If the file already exists, append a numeric index: -2, -3, etc.
After writing, print the path to the created file.
1---2name: review-impl3description: Review implementation changes for a given task against architectural standards. Use when reviewing a PR, evaluating recently committed code, assessing whether implementation changes are correct and architecturally sound, or when asked to 'review my changes', 'check this implementation', 'review what I built', 'is this PR ready', or 'audit recent commits'. Accepts a task description, task tracker URL, or issue shorthand (owner/repo#123, #123) as input. Produces a structured review with severity-rated findings, code evidence, and a verdict (Block / Request changes / Approve with notes / Approve). Saves the review to .reviews/Review-impl-{slug}.md. Do NOT use for specification review or spec-vs-implementation verification.4---5
6# Implementation Review
7
8## Task
9
10**What was implemented:** Provided by the user as a task description or task tracker reference.
11
12## Process
13
14### Step 1: Resolve Task Reference
15
16- If the invoker has already quoted the issue title and body in this prompt (typical when an orchestrator fetched the tracker in an earlier phase and passed the context forward), use those values as the canonical task description for all subsequent steps and **do not re-fetch**.
17- Otherwise, if the task description above contains a GitHub issue URL (e.g. `https://github.com/owner/repo/issues/123`) or a shorthand reference (e.g. `owner/repo#123` or `#123`), run `gh issue view <url-or-reference> --json title,body` to fetch the issue title and body. Use the fetched title and body as the canonical task description for all subsequent steps.
18- Otherwise, if the task description above contains a Jira issue URL (e.g. `https://yourcompany.atlassian.net/browse/PROJ-123`), use appropriate Agent Skills and/or MCP tools to fetch the issue summary and description, and use those as the canonical task description for all subsequent steps.
19- If the task description is plain text and no issue context was provided, skip this step.
20
21### Step 2: Understand the Project
22
23Before evaluating any changes, build a mental model of the system:
24
251. Read project context files: `CLAUDE.md`, `AGENTS.md`, `GEMINI.md`, `README.md`, `ARCHITECTURE.md`, and anything in `docs/`.
262. List the project root and key subdirectories to understand module structure and layering.
273. Read build/dependency manifests to understand the tech stack.
284. Search for code review standards or guidelines the project defines.
29
30### Step 3: Understand the Task
31
32Analyze the task description to determine:
33
34- What problem is being solved or what capability is being added?
35- Which architectural layers and modules should be affected?
36- What quality attributes matter most for this change (correctness, performance, security, maintainability)?
37
38### Step 4: Discover What Changed
39
40Identify the implementation changes using all available signals:
41
421. Run `git diff HEAD~1` (and `git log --oneline -5` for context). If the change spans multiple commits, widen the range to capture the full scope.
432. If the diff is inconclusive, search for files recently modified that relate to the task description.
443. Read every changed file completely - not just the diff hunks. You need surrounding context to evaluate whether the change fits.
45
46Build a change inventory:
47
48| File | Change type | Lines changed | Module/Layer |
49|---|---|---|---|
50
51### Step 5: Evaluate the Implementation
52
53For each changed file, assess:
54
551. **Correctness** - Does the code do what the task requires? Are edge cases handled? Are there logic errors?
562. **Architectural fit** - Does the change respect module boundaries, dependency direction, and the project's established patterns? Does it put logic in the right layer?
573. **Regression risk** - Could this change break existing behavior? Are callers of modified interfaces updated? Are assumptions still valid?
584. **Error handling** - Are errors handled consistently with the project's patterns? Are failure modes explicit?
595. **Naming and contracts** - Do new identifiers communicate intent? Are public API contracts clear?
606. **Completeness** - Is anything missing that the task implies? Migrations, config changes, documentation updates, test coverage?
617. **Simplicity** - Is the solution the simplest that works, or is there unnecessary complexity, indirection, or premature abstraction?
62
63### Step 6: Prove a New Regression Test Can Fail
64
65When the change is a bug fix that ships a test, reading the test is not enough. A test can name the defect, assert on a plausible observable, and still pass against the unfixed code, because something else already on that path produces the same observable. Such a test reads exactly like a real one and locks nothing.
66
67Run the control:
68
691. Check the change out in a throwaway `git worktree`, so nothing here reaches the tree you work in.
702. Revert only the production hunk, leaving the new test in place.
713. Run just the new test.
724. Restore, re-run, and confirm it is green again.
73
74Green at step 3 is a **High** finding: the test does not lock the fix, and removing the fix later turns nothing red. Say so, and say what the assertion would have to move to - usually the observable only the fixed path can produce, rather than an end state the surrounding code reaches on its own.
75
76The mechanics of the control - what counts as a valid break, restoring without disturbing the tree, cleaning up what a red run leaks - belong to `prove-checks`. Follow it rather than improvising.
77
78When the session cannot run commands, do not skip the step silently. Record in the review that the new test was read but never observed red, so the reader knows that half of the evidence is missing.
79
80### Step 7: Produce the Review
81
82## Output Format
83
84```
85## Implementation Review: [task description, shortened]
86
87### Change Summary
88[2-3 sentences: what changed, across which modules, and the overall approach taken]
89
90### Findings
91
92#### [Finding title]
93- **Severity:** Critical | High | Medium | Low
94- **File:** `path/to/file` (lines N-M)
95- **Issue:** [what is wrong, with code evidence]
96- **Recommendation:** [concrete fix - not vague advice]
97
98<repeat for each finding, severity-descending>
99
100### What Works Well
101[Brief - 1-3 sentences acknowledging sound decisions. Do not pad.]
102
103### Verdict
104- **Risk level:** Critical | High | Moderate | Low
105- **Decision:** Block | Request changes | Approve with notes | Approve
106- **Key actions:**
107 1. …
108 2. …
109 3. …
110```
111
112### Severity Criteria
113
114- **Critical** - Data loss, security vulnerability, correctness bug that affects users. Must fix before merge.
115- **High** - Behavioral bug, broken contract, architectural violation that will cause pain. Should fix before merge.
116- **Medium** - Maintainability concern, missing edge case in non-critical path, suboptimal but working approach. Fix soon.
117- **Low** - Minor naming issue, opportunity for simplification, style inconsistency. Fix if convenient.
118
119### Rules
120
121- Every finding must cite specific code. No finding without a file path and line reference.
122- Do not comment on formatting, whitespace, or style unless it signals a real problem.
123- Do not suggest refactors beyond the scope of the task. Review what was changed, not what was not.
124- If the change is clean and correct, say so briefly. A short review of good code is more valuable than a long review searching for problems that are not there.
125
126## Save the Review
127
128Write the review to `.reviews/Review-impl-{slug}.md`, where `{slug}` is a short kebab-case slug derived from the task description (3-5 words max).
129
130Create the `.reviews/` directory if it does not exist. If the file already exists, append a numeric index: `-2`, `-3`, etc.
131
132After writing, print the path to the created file.