You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Review a Claude Code plan file from a staff engineer perspective and provide structured feedback across 8 dimensions.
8
+
Review a Claude Code plan file from a staff engineer perspective and provide structured feedback across 8 dimensions. Optionally, when given a `--pr <comment-url>`, also verify the plan covers all feedback items from a specific PR review comment (Dimension 9).
9
9
10
10
## Arguments
11
11
12
12
`$ARGUMENTS` may contain:
13
13
-**Plan file path** (required): Path to the plan file, e.g., `~/.claude/plans/dreamy-coalescing-brook.md`
14
14
-`--updated` (optional): Signal that the plan has been revised since a prior review. Forces a fresh full review and includes a delta assessment of what changed.
15
+
-`--pr <comment-url>` (optional): URL of the specific PR comment whose feedback
16
+
the plan addresses. Accepts GitHub comment URLs in any of these formats:
Enables branch verification and PR feedback coverage checking (Dimension 9).
15
21
16
22
Parse `$ARGUMENTS` to extract:
17
23
-**--updated**: Split `$ARGUMENTS` on whitespace and check if any token is exactly `--updated`. Remove that token to get the remaining text.
18
-
-**Plan file path**: The remaining non-flag tokens after removing `--updated`, joined back together. The flag may appear before or after the path.
19
-
- If no path remains after stripping the flag, use AskUserQuestion to request it:
24
+
-**--pr**: Check if any token is exactly `--pr`. If found, take the next token as the comment URL and remove both tokens. If `--pr` is found with no following URL, use AskUserQuestion to request it:
25
+
```
26
+
What is the PR comment URL to check coverage against?
3. Full PR review: https://github.com/owner/repo/pull/42#pullrequestreview-345678
32
+
```
33
+
-**Plan file path**: The remaining non-flag tokens after removing `--updated` and `--pr <url>`, joined back together. All flags (`--updated`, `--pr <url>`) are position-independent relative to the path and to each other.
34
+
- If no path remains after stripping flags, use AskUserQuestion to request it:
20
35
```
21
36
Which plan file would you like me to review?
22
37
@@ -30,6 +45,7 @@ Options:
30
45
-**Advisory-only**: Provide feedback and recommendations. Do not implement fixes.
31
46
-**No code changes**: Do not modify any source code, test files, or documentation.
32
47
- Use the Read tool for files and the Glob/Grep tools for searching. Do not use Write, Edit, NotebookEdit, or any file-modifying Bash commands.
48
+
- The `gh api` calls used with `--pr` are read-only API requests, consistent with the read-only constraint.
33
49
34
50
## Instructions
35
51
@@ -66,9 +82,98 @@ Read the project's `CLAUDE.md` file to understand:
66
82
67
83
If the plan modifies estimator math, standard error formulas, inference logic, or edge-case handling, also read `docs/methodology/REGISTRY.md` to understand the academic foundations and reference implementations for the affected estimator(s).
Only perform this step when `--pr <comment-url>` was provided. Otherwise skip to Step 3.
88
+
89
+
**Parse the URL:**
90
+
- Strip query parameters from the URL before parsing: remove the query string (the `?...` portion) while preserving the `#` fragment. For example, `https://github.com/o/r/pull/1?notification_referrer_id=abc#issuecomment-123` becomes `https://github.com/o/r/pull/1#issuecomment-123`. If the fragment itself contains `?` (e.g., `#discussion_r123?foo=bar`), strip the `?` and everything after it from the fragment before pattern matching, since GitHub fragments never contain `?` as meaningful data.
91
+
- Only `github.com` URLs are supported. If the URL host is not `github.com`, report an error and stop.
92
+
- Extract `owner`, `repo`, `pr_number` from the URL path. The `pr_number` is always the path segment immediately after `/pull/`.
Compare `headRefName` against `git branch --show-current`:
123
+
-**Match**: Note "Branch verified" in output.
124
+
-**Mismatch**: Emit a warning in the output and note under Dimension 2 (Codebase Correctness) that code references may be inaccurate. Recommend the user checkout the PR branch first (`git checkout <headRefName>`), but do not block the review.
125
+
126
+
### Step 2c: Fetch the Specific Comment (if `--pr`)
127
+
128
+
Only perform this step when `--pr` was provided. Otherwise skip to Step 3.
129
+
130
+
Fetch the comment using the `gh api` endpoint from the table in Step 2b.
131
+
132
+
**For `pullrequestreview-` URLs**, fetch BOTH the review body AND its inline comments:
133
+
```bash
134
+
# Review body
135
+
gh api repos/{owner}/{repo}/pulls/{pr_number}/reviews/{id} --jq '{body: .body, user: .user.login, state: .state}'
-**404**: `Error: Comment not found at <url>. It may have been deleted or the URL may be incorrect.`
155
+
-**403 / other API errors**: `Error: GitHub API returned <status>. You may not have access to this repository, or you may be rate-limited. Check 'gh auth status' and try again.`
156
+
-**Empty comment body** (and no inline comments for review types): report and skip Dimension 9:
157
+
```
158
+
Note: No feedback text found in the comment at <url>.
159
+
Skipping PR Feedback Coverage (Dimension 9). Reviewing plan without PR context.
160
+
```
161
+
162
+
The response includes: `body` (comment text), `user.login` (author), `created_at`, and for inline comments: `path` (file), `line` (line number in the file — use `line`, not `position` which is the diff offset, and not `original_line` which is the base branch line), `diff_hunk` (surrounding diff context).
163
+
164
+
**Extract discrete feedback items** from the comment body:
165
+
- For AI review comments (structured markdown with P0/P1/P2/P3 or Critical/Medium/Minor sections): parse each severity section and extract individual items with their labeled severity
166
+
- For human comments with numbered/bulleted lists: each list item is one feedback item
167
+
- For human comments that are a single paragraph or conversational: the entire comment is one feedback item
168
+
- For inline review comments: each comment is one item, with `path` and `line` as its file/line reference
169
+
-**Default severity**: when a feedback item has no severity label, treat it as Medium
170
+
- Process all feedback items regardless of count
171
+
172
+
Each feedback item tracks: severity (labeled or default Medium), description, file path (if available), and line reference (if available).
173
+
69
174
### Step 3: Read Referenced Files
70
175
71
-
Identify all files the plan references (file paths, module names, class names). Then read them to validate the plan's assumptions:
176
+
Identify all files the plan references (file paths, module names, class names). When `--pr` was provided, also include files referenced in the feedback comment — inline comment `path` fields and file paths mentioned in the comment body (e.g., `path/to/file.py:L123`). Then read them to validate the plan's assumptions:
72
177
73
178
**Priority order for reading files:**
74
179
1.**Files the plan proposes to modify** — read ALL of these first
@@ -171,9 +276,25 @@ Plan-specific failure modes that wouldn't show up in a code review:
171
276
- For bug fixes: does the plan fix all pattern instances and test all of them?
172
277
- Are there missing test scenarios? (Parameter interactions, error paths, boundary conditions)
173
278
279
+
#### Dimension 9: PR Feedback Coverage (only if `--pr` provided with non-empty comment)
280
+
281
+
Only evaluate this dimension when `--pr` was provided and a non-empty comment was fetched in Step 2c. For each feedback item extracted in Step 2c, assess:
282
+
283
+
-**Addressed**: Plan explicitly mentions the issue AND proposes a concrete fix
284
+
-**Partially addressed**: Plan touches the area but doesn't fully resolve the feedback
285
+
-**Not addressed**: Plan makes no mention of this feedback item
286
+
-**Dismissed with justification**: Plan acknowledges the feedback but explains why it won't be acted on (acceptable for Low/P3; flag for Critical/P0)
287
+
288
+
Use judgment, not just substring matching — the plan may use different words to describe the same fix.
- Unaddressed P2/Medium items count as Medium issues
293
+
- Unaddressed P3/Low items count as Low issues
294
+
174
295
### Step 5: Present Structured Feedback
175
296
176
-
Present the review in the following format. Do NOT skip any section — if a section has no findings, write "None." for that section. The Delta Assessment section is only included when the `--updated` flag was provided (see Step 1b).
297
+
Present the review in the following format. Do NOT skip any section — if a section has no findings, write "None." for that section. The Delta Assessment section is only included when the `--updated` flag was provided (see Step 1b). The PR Context and PR Feedback Coverage sections are only included when `--pr` was provided with a non-empty comment.
177
298
178
299
```
179
300
## Overall Assessment
@@ -182,6 +303,17 @@ Present the review in the following format. Do NOT skip any section — if a sec
182
303
183
304
---
184
305
306
+
## PR Context (only include if `--pr` was provided with non-empty comment)
307
+
308
+
**PR**: #<number> - <title> (<owner>/<repo>)
309
+
**Branch**: <headRefName> -> <baseRefName>
310
+
**Comment**: <comment-url>
311
+
**Comment author**: <user.login>
312
+
**Feedback items extracted**: N
313
+
**Branch match**: Yes / No (warning: recommend `git checkout <headRefName>`)
314
+
315
+
---
316
+
185
317
## Issues
186
318
187
319
### CRITICAL
@@ -203,6 +335,29 @@ Cross-reference against the relevant CLAUDE.md checklists. List which checklist
203
335
204
336
---
205
337
338
+
## PR Feedback Coverage (only include if `--pr` was provided with non-empty comment)
339
+
340
+
### Addressed
341
+
- [severity] <description> -- Plan step: <reference to plan section>
[Ambiguities or missing information that should be clarified before implementation begins. Phrase as specific questions.]
@@ -220,6 +375,13 @@ Cross-reference against the relevant CLAUDE.md checklists. List which checklist
220
375
### New Issues
221
376
[List any new issues introduced by the revisions, or "None."]
222
377
378
+
### PR Feedback Coverage Delta (only include if both `--updated` and `--pr` were provided)
379
+
380
+
The `--pr` URL must be the same across the initial review and the `--updated` re-review — this compares coverage of the same feedback comment. If the prior review's PR comment URL is no longer available in conversation context (e.g., context compressed), note: "PR coverage delta unavailable — prior PR context not found."
381
+
382
+
- **Newly addressed**: [list of feedback items now covered that were previously not addressed or partially addressed]
383
+
- **Still not addressed**: [list of feedback items still missing]
384
+
223
385
---
224
386
225
387
## Summary
@@ -230,6 +392,7 @@ Cross-reference against the relevant CLAUDE.md checklists. List which checklist
230
392
| Medium | [count] |
231
393
| Low | [count] |
232
394
| Checklist gaps | [count] |
395
+
| PR feedback gaps | [count of Not Addressed + Partially Addressed] (only if `--pr`) |
233
396
| Questions | [count] |
234
397
235
398
**Verdict**: [Ready / Ready with minor fixes / Needs revision]
@@ -247,3 +410,15 @@ Cross-reference against the relevant CLAUDE.md checklists. List which checklist
247
410
- For best results, run this before implementing a plan to catch issues early
248
411
- The 8 dimensions are tuned for plan-specific failure modes, not generic code review
249
412
- Use `--updated` when re-reviewing a revised plan to get a delta assessment of what changed since the prior review
413
+
- Use `--pr <comment-url>` when the plan addresses a specific PR review comment.
414
+
This fetches the comment, extracts feedback items, and checks that the plan
415
+
covers each one. Pairs naturally with `/read-feedback-revise` which creates the plan.
416
+
- The `--pr` flag requires the `gh` CLI to be installed and authenticated.
417
+
- For best results, run this while on the PR branch so file contents and line
418
+
numbers match what reviewers commented on.
419
+
- The comment URL can be copied from the GitHub web UI by right-clicking the
420
+
timestamp on any PR comment and selecting "Copy link".
421
+
- For `pullrequestreview-` URLs, both the review body and its inline comments
422
+
are fetched (matching `/read-feedback-revise` behavior).
423
+
- Verification of these changes should be done manually before merging the PR
424
+
that adds this feature. See the Verification section of this plan.
0 commit comments