Skip to content

Commit bb8483e

Browse files
committed
chore(claude): reformat code review command
1 parent 0e59ad4 commit bb8483e

1 file changed

Lines changed: 19 additions & 15 deletions

File tree

.claude/commands/code-review.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,12 @@ allowed-tools: Bash(gh issue view:*), Bash(gh search:*), Bash(gh issue list:*),
33
description: Code review a pull request
44
---
55

6+
# Code Review Command
7+
68
Provide a code review for the given pull request.
79

810
**Agent assumptions (applies to all agents and subagents):**
11+
912
- All tools are functional and will work without error. Do not test tools or make exploratory calls. Make sure this is clear to every subagent that is launched.
1013
- Only call a tool if it is required to complete the task. Every tool call should have a clear purpose.
1114

@@ -19,18 +22,19 @@ To do this, follow these steps precisely:
1922

2023
If any condition is true, stop and do not proceed.
2124

22-
Note: Still review Claude generated PR's.
25+
> [!NOTE]
26+
> Review Claude-generated PR's, too.
2327
24-
2. Launch a haiku agent to return a list of file paths (not their contents) for all relevant CLAUDE.md files including:
25-
- The root CLAUDE.md file, if it exists
26-
- Any CLAUDE.md files in directories containing files modified by the pull request
28+
2. Launch a haiku agent to return a list of file paths (not their contents) for all relevant `CLAUDE.md`/`AGENTS.md` files including:
29+
- The root `CLAUDE.md`/`AGENTS.md` file, if it exists
30+
- Any `CLAUDE.md`/`AGENTS.md` files in directories containing files modified by the pull request
2731

2832
3. Launch a sonnet agent to view the pull request and return a summary of the changes
2933

30-
4. Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "CLAUDE.md adherence", "bug"). The agents should do the following:
34+
4. Launch 4 agents in parallel to independently review the changes. Each agent should return the list of issues, where each issue includes a description and the reason it was flagged (e.g. "`CLAUDE.md`/`AGENTS.md` adherence", "bug"). The agents should do the following:
3135

32-
Agents 1 + 2: CLAUDE.md compliance sonnet agents
33-
Audit changes for CLAUDE.md compliance in parallel. Note: When evaluating CLAUDE.md compliance for a file, you should only consider CLAUDE.md files that share a file path with the file or parents.
36+
Agents 1 + 2: `CLAUDE.md`/`AGENTS.md` compliance sonnet agents
37+
Audit changes for `CLAUDE.md`/`AGENTS.md` compliance in parallel. Note: When evaluating `CLAUDE.md`/`AGENTS.md` compliance for a file, you should only consider `CLAUDE.md`/`AGENTS.md` files that share a file path with the file or parents.
3438

3539
Agent 3: Opus bug agent (parallel subagent with agent 4)
3640
Scan for obvious bugs. Focus only on the diff itself without reading extra context. Flag only significant bugs; ignore nitpicks and likely false positives. Do not flag issues that you cannot validate without looking at context outside of the git diff.
@@ -41,7 +45,7 @@ Note: Still review Claude generated PR's.
4145
**CRITICAL: We only want HIGH SIGNAL issues.** Flag issues where:
4246
- The code will fail to compile or parse (syntax errors, type errors, missing imports, unresolved references)
4347
- The code will definitely produce wrong results regardless of inputs (clear logic errors)
44-
- Clear, unambiguous CLAUDE.md violations where you can quote the exact rule being broken
48+
- Clear, unambiguous `CLAUDE.md`/`AGENTS.md` violations where you can quote the exact rule being broken
4549

4650
Do NOT flag:
4751
- Code style or quality concerns
@@ -52,13 +56,13 @@ Note: Still review Claude generated PR's.
5256

5357
In addition to the above, each subagent should be told the PR title and description. This will help provide context regarding the author's intent.
5458

55-
5. For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. These subagents should get the PR title and description along with a description of the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be CLAUDE.md issues. The agent should validate that the CLAUDE.md rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for CLAUDE.md violations.
59+
5. For each issue found in the previous step by agents 3 and 4, launch parallel subagents to validate the issue. These subagents should get the PR title and description along with a description of the issue. The agent's job is to review the issue to validate that the stated issue is truly an issue with high confidence. For example, if an issue such as "variable is not defined" was flagged, the subagent's job would be to validate that is actually true in the code. Another example would be `CLAUDE.md`/`AGENTS.md` issues. The agent should validate that the `CLAUDE.md`/`AGENTS.md` rule that was violated is scoped for this file and is actually violated. Use Opus subagents for bugs and logic issues, and sonnet agents for `CLAUDE.md`/`AGENTS.md` violations.
5660

5761
6. Filter out any issues that were not validated in step 5. This step will give us our list of high signal issues for our review.
5862

5963
7. Output a summary of the review findings to the terminal:
6064
- If issues were found, list each issue with a brief description.
61-
- If no issues were found, state: "No issues found. Checked for bugs and CLAUDE.md compliance."
65+
- If no issues were found, state: "No issues found. Checked for bugs and `CLAUDE.md`/`AGENTS.md` compliance."
6266

6367
If `--comment` argument was NOT provided, stop here. Do not post any GitHub comments.
6468

@@ -82,28 +86,28 @@ Use this list when evaluating issues in Steps 4 and 5 (these are false positives
8286
- Something that appears to be a bug but is actually correct
8387
- Pedantic nitpicks that a senior engineer would not flag
8488
- Issues that a linter will catch (do not run the linter to verify)
85-
- General code quality concerns (e.g., lack of test coverage, general security issues) unless explicitly required in CLAUDE.md
86-
- Issues mentioned in CLAUDE.md but explicitly silenced in the code (e.g., via a lint ignore comment)
89+
- General code quality concerns (e.g., lack of test coverage, general security issues) unless explicitly required in `CLAUDE.md`/`AGENTS.md`
90+
- Issues mentioned in `CLAUDE.md`/`AGENTS.md` but explicitly silenced in the code (e.g., via a lint ignore comment)
8791

8892
Notes:
8993

9094
- Use gh CLI to interact with GitHub (e.g., fetch pull requests, create comments). Do not use web fetch.
9195
- Create a todo list before starting.
92-
- You must cite and link each issue in inline comments (e.g., if referring to a CLAUDE.md, include a link to it).
96+
- You must cite and link each issue in inline comments (e.g., if referring to a `CLAUDE.md`/`AGENTS.md`, include a link to it).
9397
- If no issues are found and `--comment` argument is provided, post a comment with the following format:
9498

9599
---
96100

97101
## Code review
98102

99-
No issues found. Checked for bugs and CLAUDE.md compliance.
103+
No issues found. Checked for bugs and `CLAUDE.md`/`AGENTS.md` compliance.
100104

101105
---
102106

103107
- When linking to code in inline comments, follow the following format precisely, otherwise the Markdown preview won't render correctly: https://github.com/anthropics/claude-code/blob/c21d3c10bc8e898b7ac1a2d745bdc9bc4e423afe/package.json#L10-L15
104108
- Requires full git sha
105109
- You must provide the full sha. Commands like `https://github.com/owner/repo/blob/$(git rev-parse HEAD)/foo/bar` will not work, since your comment will be directly rendered in Markdown.
106110
- Repo name must match the repo you're code reviewing
107-
- # sign after the file name
111+
- `#` symbol after the file name
108112
- Line range format is L[start]-L[end]
109113
- Provide at least 1 line of context before and after, centered on the line you are commenting about (eg. if you are commenting about lines 5-6, you should link to `L4-7`)

0 commit comments

Comments
 (0)