Skip to content

Commit 0c12730

Browse files
ashwin-antclaude
andauthored
feat: improve PR review examples with context and tools (anthropics#504)
- Add PR repository and number to review prompts - Note that PR branch is already checked out - Update allowed tools to use inline comments and gh CLI - Remove experimental review mode example in favor of standardized approach 🤖 Generated with [Claude Code](https://claude.ai/code) Co-authored-by: Claude <noreply@anthropic.com>
1 parent 8a20581 commit 0c12730

File tree

4 files changed

+28
-48
lines changed

4 files changed

+28
-48
lines changed

examples/claude-auto-review.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ jobs:
2222
with:
2323
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
2424
prompt: |
25-
Please review this pull request and provide comprehensive feedback.
25+
REPO: ${{ github.repository }}
26+
PR NUMBER: ${{ github.event.pull_request.number }}
27+
28+
Please review this pull request.
29+
30+
Note: The PR branch is already checked out in the current working directory.
2631
2732
Focus on:
2833
- Code quality and best practices
@@ -34,7 +39,10 @@ jobs:
3439
- Verify that README.md and docs are updated for any new features or config changes
3540
3641
Provide constructive feedback with specific suggestions for improvement.
37-
Use inline comments to highlight specific areas of concern.
42+
Use `gh pr comment:*` for top-level comments.
43+
Use `mcp__github_inline_comment__create_inline_comment` to highlight specific areas of concern.
44+
Only your GitHub comments that you post will be seen, so don't submit your review as a normal message, just as comments.
45+
If the PR has already been reviewed, or there are no noteworthy changes, don't post anything.
3846
3947
claude_args: |
40-
--allowedTools "mcp__github__create_pending_pull_request_review,mcp__github__add_comment_to_pending_review,mcp__github__submit_pending_pull_request_review,mcp__github__get_pull_request_diff"
48+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*)"

examples/claude-experimental-review-mode.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

examples/claude-pr-path-specific.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,13 @@ jobs:
2828
with:
2929
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
3030
prompt: |
31+
REPO: ${{ github.repository }}
32+
PR NUMBER: ${{ github.event.pull_request.number }}
33+
3134
Please review this pull request focusing on the changed files.
35+
36+
Note: The PR branch is already checked out in the current working directory.
37+
3238
Provide feedback on:
3339
- Code quality and adherence to best practices
3440
- Potential bugs or edge cases
@@ -38,3 +44,6 @@ jobs:
3844
3945
Since this PR touches critical source code paths, please be thorough
4046
in your review and provide inline comments where appropriate.
47+
48+
claude_args: |
49+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*)"

examples/claude-review-from-author.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,13 @@ jobs:
2727
with:
2828
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
2929
prompt: |
30+
REPO: ${{ github.repository }}
31+
PR NUMBER: ${{ github.event.pull_request.number }}
32+
3033
Please provide a thorough review of this pull request.
3134
35+
Note: The PR branch is already checked out in the current working directory.
36+
3237
Since this is from a specific author that requires careful review,
3338
please pay extra attention to:
3439
- Adherence to project coding standards
@@ -38,3 +43,6 @@ jobs:
3843
- Documentation
3944
4045
Provide detailed feedback and suggestions for improvement.
46+
47+
claude_args: |
48+
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*), Bash(gh pr diff:*), Bash(gh pr view:*)"

0 commit comments

Comments
 (0)