Skip to content

Commit 2b46f7b

Browse files
Merge pull request #817 from atlanhq/fix/review-skill-improvements
fix: improve review skill
2 parents 1d1bf93 + 9cee3a0 commit 2b46f7b

2 files changed

Lines changed: 21 additions & 13 deletions

File tree

.claude/commands/review.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ Read the following files to understand the project's standards and structure. Th
1616

1717
Also use Glob to find any additional guideline files:
1818
- `.cursor/rules/*.mdc` or `.cursor/*.md` (coding standards, review checklists)
19-
- Any `CLAUDE.md` files in subdirectories relevant to the changed files
19+
- Any `CLAUDE.md` or `BUGBOT.md` files in subdirectories relevant to the changed files
2020
- `CONTRIBUTING.md` if it exists
2121

22+
**Subdirectory guidelines**: If changed files are in subdirectories with their own guideline files, read those as well for module-specific review criteria.
23+
2224
## Step 2: Gather PR data
2325

2426
Run these commands in parallel:
@@ -33,7 +35,7 @@ Run these commands in parallel:
3335
Count the number of changed files from step 2.
3436

3537
**If fewer than 100 files changed:**
36-
Review all changed files directly. Read each changed file using the Read tool to understand surrounding context beyond the diff.
38+
Review all changed files directly. Read each changed file using the Read tool to understand surrounding context beyond the diff. Cache these file contents for reuse in later validation steps.
3739

3840
**If 100 or more files changed:**
3941
This is a large PR. Deploy parallel sub-agents to gather context efficiently:
@@ -43,7 +45,7 @@ This is a large PR. Deploy parallel sub-agents to gather context efficiently:
4345

4446
## Step 4: Four review passes
4547

46-
Execute four independent review passes. For PRs with fewer than 100 files, do these sequentially. For large PRs, launch agents in parallel.
48+
Execute four independent review passes **in parallel** using separate tool calls. Each pass operates independently on the file context gathered in Step 3.
4749

4850
### Pass 1 + 2: Code standards and style compliance
4951

@@ -93,18 +95,17 @@ For each issue found across all passes, assign a confidence score from 0 to 100:
9395
- **75**: Highly confident, real and important
9496
- **100**: Absolutely certain, definitely real
9597

96-
**Validation**: For each finding scored 50 or above, verify it by:
97-
- Re-reading the relevant code in full context (not just the diff)
98+
**Filter**: Discard all findings below confidence 80.
99+
100+
**Validation**: For each finding scored **80 or above**, verify it by:
101+
- Re-reading the relevant code in full context (not just the diff) if not already cached from Step 3
98102
- Checking if the pattern is intentionally used elsewhere in the codebase
99103
- For style violations: confirming the project actually enforces this rule
100104

101-
**Filter**: Discard all findings below confidence 80.
102-
103105
**Always discard (false positives):**
104106
- Pre-existing issues not introduced in this PR
105107
- Code that appears buggy but is actually correct in context
106108
- Pedantic nitpicks a senior engineer would not flag
107-
- Issues that linters (ruff, mypy) will catch — do not run the linter to verify
108109
- General code quality concerns not explicitly required by project conventions
109110
- Issues silenced in code via lint-ignore comments
110111

@@ -141,14 +142,16 @@ sequenceDiagram
141142
<interactions showing the primary flow affected by this PR>
142143
```
143144

144-
<Generate a Mermaid sequence diagram that shows the key interaction flow introduced or modified by this PR. Rules:>
145+
<Generate a Mermaid sequence diagram **if the change affects architectural flow or component interactions**. Skip for simple bug fixes (typos, off-by-one errors, single-function changes). Rules:>
145146
<- Maximum 8 participants>
146147
<- Maximum 15 interactions>
147148
<- For refactors: show before/after with labeled boxes>
148149
<- For new features: show the end-to-end flow>
149-
<- For bug fixes: show the incorrect flow crossed out and the corrected flow>
150+
<- For bug fixes affecting flow: show the corrected flow>
150151
<- Use descriptive labels on arrows>
151152

153+
<If skipping the diagram, replace this section with a brief explanation of why it's not needed.>
154+
152155
### Findings
153156

154157
<If findings exist above threshold:>
@@ -174,7 +177,7 @@ No issues found. Checked for bugs, security, and code standards compliance.
174177
For each finding in the Findings table, post an inline comment using `mcp__github_inline_comment__create_inline_comment`.
175178
176179
Rules for inline comments:
177-
- Maximum 10 inline comments total (prioritize by severity)
180+
- Maximum 10 inline comments total (prioritize by severity), **unless there are more than 10 Critical severity findings**
178181
- Each comment includes: severity tag, issue description, why it matters, and the suggested fix
179182
- For small, self-contained fixes (< 6 lines): include a committable suggestion block
180183
- For larger fixes: describe the issue and suggested approach without a suggestion block

.github/workflows/claude.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: Claude Code
22

33
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
46
issue_comment:
57
types: [created]
68
pull_request_review_comment:
@@ -17,6 +19,7 @@ permissions:
1719
jobs:
1820
claude:
1921
if: |
22+
(github.event_name == 'pull_request' && github.event.pull_request.draft == false) ||
2023
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
2124
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
2225
(github.event_name == 'issues' && contains(github.event.issue.body, '@claude'))
@@ -47,7 +50,9 @@ jobs:
4750
- uses: anthropics/claude-code-action@v1
4851
with:
4952
anthropic_api_key: ${{ secrets.LITELLM_API_KEY }}
53+
prompt: |
54+
${{ github.event_name == 'pull_request' && format('Review PR #{0} using the /review command.', github.event.pull_request.number) || '' }}
5055
claude_args: |
51-
--model claude-opus-4-6
52-
--allowedTools "mcp__github_inline_comment__create_inline_comment"
56+
--model claude-opus-4.5
57+
--allowedTools "Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr comment:*),Bash(gh api:*),Bash(git show:*),Bash(git blame:*),mcp__github_inline_comment__create_inline_comment"
5358
--append-system-prompt "CRITICAL INSTRUCTION: When a user asks you to review a pull request (e.g. @claude review, @claude review this PR, @claude please review), you MUST execute the /review slash command. Do NOT attempt a freeform review. Always use the /review skill — no exceptions."

0 commit comments

Comments
 (0)