Skip to content

Commit e97edb3

Browse files
authored
Merge pull request #1 from hotdata-dev/feat/review-approval-behavior
feat: add approval capability and severity-based review behavior
2 parents 88f6782 + b6e1528 commit e97edb3

File tree

2 files changed

+29
-15
lines changed

2 files changed

+29
-15
lines changed

.github/workflows/claude-pr-review.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ on:
66

77
jobs:
88
review:
9-
if: github.event.pull_request.draft == false
9+
# TODO: remove author filter after testing is complete
10+
if: github.event.pull_request.draft == false && github.event.pull_request.user.login == 'zfarrell'
1011
runs-on: ubuntu-latest
1112
permissions:
1213
contents: read
@@ -35,4 +36,4 @@ jobs:
3536
3637
${{ steps.prompt.outputs.content }}
3738
claude_args: |
38-
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Read"
39+
--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"

docs/claude-pr-review-prompt.md

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,38 @@ You are an expert code reviewer embedded in a GitHub Actions workflow. Your job
4040
- Public APIs and functions are documented
4141
- README or docs updated if user-facing behavior changed
4242

43-
## Output Format
43+
## Decision Framework
4444

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

49-
```
50-
## Claude's Review
47+
- **P0 (Critical)** — security vulnerabilities, data loss, broken builds, correctness bugs
48+
- **P1 (High)** — logic errors, missing error handling, race conditions, missing tests for critical paths
49+
- **P2 (Medium)** — code quality issues, duplication, missing edge case handling
50+
- **P3 (Low)** — minor suggestions, naming improvements, documentation gaps
51+
52+
Then take action based on findings:
53+
54+
- **No issues found** → approve the PR with `gh pr review --approve`. Do NOT leave a summary comment. Just approve silently.
55+
- **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.
56+
- **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).
5157

52-
### Summary
53-
[1–3 sentence overview]
58+
## Output Rules
59+
60+
- **Do not be chatty.** No filler, no praise, no "looks good overall" preamble. Get to the point.
61+
- **Do not feel compelled to find problems.** If the code is fine, approve it. Not every PR needs feedback.
62+
- **Do not nitpick.** Skip style issues that a linter should catch.
63+
- P2/P3 inline comments should be framed as suggestions, not demands. The author decides whether to address them.
64+
- Only leave a summary comment when requesting changes. Structure it as:
65+
66+
```
67+
## Review
5468
55-
### Findings
56-
[Issues grouped by severity: CRITICAL / HIGH / MEDIUM / LOW]
69+
### Issues
70+
[List P0/P1 issues with file paths and line numbers]
5771
58-
### Verdict
59-
[APPROVE / REQUEST CHANGES / COMMENT — one-line rationale]
72+
### Action Required
73+
[Specific changes needed before this can merge]
6074
```
6175

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

0 commit comments

Comments
 (0)