|
| 1 | +name: Claude Code Review |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, ready_for_review] |
| 6 | + issue_comment: |
| 7 | + types: [created] |
| 8 | + |
| 9 | +jobs: |
| 10 | + claude-review: |
| 11 | + if: | |
| 12 | + (github.event_name == 'pull_request' && |
| 13 | + github.event.pull_request.head.repo.full_name == github.repository) || |
| 14 | + (github.event_name == 'issue_comment' && |
| 15 | + github.event.issue.pull_request && |
| 16 | + contains(github.event.comment.body, '/claude') && |
| 17 | + contains(fromJson('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) |
| 18 | + uses: yetanotherco/actions/.github/workflows/pr_review_claude.yml@v1.0.1 |
| 19 | + with: |
| 20 | + custom_prompt: | |
| 21 | + 1. **Security vulnerabilities** - Label by criticality (Critical/High/Medium/Low) |
| 22 | + - Solidity: e.g. reentrancy, access control, integer issues, etc. |
| 23 | + - Rust: e.g. unsafe blocks, error handling, panics, etc. |
| 24 | + - Web/API: e.g. SQL injection, auth bypass, input validation, sensitive data exposure, CORS/CSRF, etc. |
| 25 | +
|
| 26 | + 2. **Potential bugs** - Logic errors, edge cases, incorrect behavior, race conditions |
| 27 | +
|
| 28 | + 3. **Performance issues** - Only significant: e.g. O(n²) on unbounded input, N+1 queries, unbounded memory growth |
| 29 | +
|
| 30 | + 4. **Simplicity** - Prefer simple, readable code over clever abstractions |
| 31 | +
|
| 32 | + Guidelines: |
| 33 | + - Be concise and to the point |
| 34 | + - Do NOT suggest micro-optimizations or premature abstractions |
| 35 | + - Always prefer simplicity over complexity when performance gains are marginal |
| 36 | + - Focus on real issues, not hypothetical improvements |
| 37 | + - Be concise and actionable |
| 38 | + secrets: |
| 39 | + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} |
0 commit comments