@@ -3,20 +3,30 @@ name: Claude Code Review
33on :
44 pull_request :
55 types : [opened, synchronize]
6- # Optional: Only run on specific file changes
7- # paths:
8- # - "src/**/*.ts"
9- # - "src/**/*.tsx"
10- # - "src/**/*.js"
11- # - "src/**/*.jsx"
6+ # Skip reviews for non-code changes
7+ paths-ignore :
8+ - " **/*.md"
9+ - " **/package-lock.json"
10+ - " **/pnpm-lock.yaml"
11+ - " **/.gitignore"
12+ - " **/LICENSE"
13+ - " **/*.config.js"
14+ - " **/*.config.ts"
15+ - " **/tsconfig.json"
16+ - " **/.github/workflows/*.yml"
17+ - " **/docs/**"
1218
1319jobs :
1420 claude-review :
15- # Optional: Filter by PR author
16- # if: |
17- # github.event.pull_request.user.login == 'external-contributor' ||
18- # github.event.pull_request.user.login == 'new-developer' ||
19- # github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
21+ # Skip review for bot PRs and WIP/skip-review PRs
22+ # Only run if changes are significant (>10 lines)
23+ if : |
24+ (github.event.pull_request.additions > 10 || github.event.pull_request.deletions > 10) &&
25+ !contains(github.event.pull_request.title, '[skip-review]') &&
26+ !contains(github.event.pull_request.title, '[WIP]') &&
27+ !endsWith(github.event.pull_request.user.login, '[bot]') &&
28+ github.event.pull_request.user.login != 'dependabot' &&
29+ github.event.pull_request.user.login != 'renovate'
2030
2131 runs-on : ubuntu-latest
2232 permissions :
@@ -42,31 +52,46 @@ jobs:
4252
4353 # Direct prompt for automated review (no @claude mention needed)
4454 direct_prompt : |
45- Please review this pull request and provide feedback on:
46- - Code quality and best practices
47- - Potential bugs or issues
48- - Performance considerations
49- - Security concerns
50- - Test coverage
55+ IMPORTANT: Review ONLY the DIFF/CHANGESET - the actual lines that were added or modified in this PR.
56+ DO NOT review the entire file context, only analyze the specific changes being made.
5157
52- Be constructive and helpful in your feedback.
58+ Look for HIGH-PRIORITY issues in the CHANGED LINES ONLY:
59+
60+ 1. CRITICAL BUGS: Logic errors, null pointer issues, infinite loops, race conditions
61+ 2. SECURITY: SQL injection, XSS, authentication bypass, exposed secrets, unsafe operations
62+ 3. BREAKING CHANGES: API contract violations, removed exports, changed function signatures
63+ 4. DATA LOSS RISKS: Destructive operations without safeguards, missing data validation
64+
65+ DO NOT comment on:
66+ - Code that wasn't changed in this PR
67+ - Style, formatting, or documentation
68+ - Test coverage (unless tests are broken by the changes)
69+ - Minor optimizations or best practices
70+ - Existing code issues that weren't introduced by this PR
71+
72+ If you find no critical issues in the DIFF, respond with: "✅ No critical issues found in changes"
73+
74+ Keep response under 10 lines. Reference specific line numbers from the diff when reporting issues.
5375
5476 # Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
55- # use_sticky_comment: true
56-
57- # Optional: Customize review based on file types
58- # direct_prompt: |
59- # Review this PR focusing on:
60- # - For TypeScript files: Type safety and proper interface usage
61- # - For API endpoints: Security, input validation, and error handling
62- # - For React components: Performance, accessibility, and best practices
63- # - For tests: Coverage, edge cases, and test quality
77+ use_sticky_comment : true
6478
65- # Optional: Different prompts for different authors
79+ # Context-aware review based on PR characteristics
80+ # Uncomment to enable different review strategies based on context
6681 # direct_prompt: |
67- # ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
68- # 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
69- # 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
82+ # ${{
83+ # (github.event.pull_request.additions > 500) &&
84+ # 'Large PR detected. Focus only on architectural issues and breaking changes. Skip minor issues.' ||
85+ # contains(github.event.pull_request.title, 'fix') &&
86+ # 'Bug fix PR: Verify the fix addresses the root cause and check for regression risks.' ||
87+ # contains(github.event.pull_request.title, 'deps') &&
88+ # 'Dependency update: Check for breaking changes and security advisories only.' ||
89+ # contains(github.event.pull_request.title, 'refactor') &&
90+ # 'Refactor PR: Verify no behavior changes and check for performance regressions.' ||
91+ # contains(github.event.pull_request.title, 'feat') &&
92+ # 'New feature: Check for security issues, edge cases, and integration problems only.' ||
93+ # 'Standard review: Check for critical bugs, security issues, and breaking changes only.'
94+ # }}
7095
7196 # Optional: Add specific tools for running tests or linting
7297 # allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
0 commit comments