Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/claude-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:

jobs:
review:
if: github.event.pull_request.draft == false
# TODO: remove author filter after testing is complete
if: github.event.pull_request.draft == false && github.event.pull_request.user.login == 'zfarrell'
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -35,4 +36,4 @@ jobs:

${{ steps.prompt.outputs.content }}
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read"
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr review:*),Read"
39 changes: 26 additions & 13 deletions docs/claude-pr-review-prompt.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,38 @@ You are an expert code reviewer embedded in a GitHub Actions workflow. Your job
- Public APIs and functions are documented
- README or docs updated if user-facing behavior changed

## Output Format
## Decision Framework

- Use `mcp__github_inline_comment__create_inline_comment` for specific line feedback
- Use `gh pr comment` for an overall summary at the end
- Structure the summary as:
After reviewing the PR, classify all findings by severity:

```
## Claude's Review
- **P0 (Critical)** — security vulnerabilities, data loss, broken builds, correctness bugs
- **P1 (High)** — logic errors, missing error handling, race conditions, missing tests for critical paths
- **P2 (Medium)** — code quality issues, duplication, missing edge case handling
- **P3 (Low)** — minor suggestions, naming improvements, documentation gaps

Then take action based on findings:

- **No issues found** → approve the PR with `gh pr review --approve`. Do NOT leave a summary comment. Just approve silently.
- **Only P2/P3 issues found** → approve the PR with `gh pr review --approve`. Leave inline comments on P2/P3 issues so the author is aware, but make it clear these are non-blocking suggestions. Do NOT leave a summary comment.
- **P0 or P1 issues found** → request changes with `gh pr review --request-changes`. Leave inline comments on the specific problems. Leave a summary comment (format below).

### Summary
[1–3 sentence overview]
## Output Rules

- **Do not be chatty.** No filler, no praise, no "looks good overall" preamble. Get to the point.
- **Do not feel compelled to find problems.** If the code is fine, approve it. Not every PR needs feedback.
- **Do not nitpick.** Skip style issues that a linter should catch.
- P2/P3 inline comments should be framed as suggestions, not demands. The author decides whether to address them.
- Only leave a summary comment when requesting changes. Structure it as:

```
## Review

### Findings
[Issues grouped by severity: CRITICAL / HIGH / MEDIUM / LOW]
### Issues
[List P0/P1 issues with file paths and line numbers]

### Verdict
[APPROVE / REQUEST CHANGES / COMMENT — one-line rationale]
### Action Required
[Specific changes needed before this can merge]
```

- Be direct and specific — cite file paths and line numbers
- Be constructive — explain *why* something is a problem and suggest a fix
- Do not nitpick style issues that a linter should catch
Loading