Skip to content

Commit 426daab

Browse files
authored
[ci] claude in ci. (#13297)
* claude in ci. * review feedback.
1 parent 762ae05 commit 426daab

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.ai/review-rules.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# PR Review Rules
2+
3+
Review-specific rules for Claude. Focus on correctness — style is handled by ruff.
4+
5+
Before reviewing, read and apply the guidelines in:
6+
- [AGENTS.md](AGENTS.md) — coding style, dependencies, copied code, model conventions
7+
- [skills/model-integration/SKILL.md](skills/model-integration/SKILL.md) — attention pattern, pipeline rules, implementation checklist, gotchas
8+
- [skills/parity-testing/SKILL.md](skills/parity-testing/SKILL.md) — testing rules, comparison utilities
9+
- [skills/parity-testing/pitfalls.md](skills/parity-testing/pitfalls.md) — known pitfalls (dtype mismatches, config assumptions, etc.)
10+
11+
## Common mistakes (add new rules below this line)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Claude PR Review
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
pull_request_review_comment:
7+
types: [created]
8+
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
issues: read
13+
14+
jobs:
15+
claude-review:
16+
if: |
17+
(
18+
github.event_name == 'issue_comment' &&
19+
github.event.issue.pull_request &&
20+
github.event.issue.state == 'open' &&
21+
contains(github.event.comment.body, '@claude') &&
22+
(github.event.comment.author_association == 'MEMBER' ||
23+
github.event.comment.author_association == 'OWNER' ||
24+
github.event.comment.author_association == 'COLLABORATOR')
25+
) || (
26+
github.event_name == 'pull_request_review_comment' &&
27+
contains(github.event.comment.body, '@claude') &&
28+
(github.event.comment.author_association == 'MEMBER' ||
29+
github.event.comment.author_association == 'OWNER' ||
30+
github.event.comment.author_association == 'COLLABORATOR')
31+
)
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: anthropics/claude-code-action@v1
35+
with:
36+
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
37+
claude_args: |
38+
--append-system-prompt "Review this PR against the rules in .ai/review-rules.md. Focus on correctness, not style (ruff handles style). Only review changes under src/diffusers/. Do NOT commit changes unless the comment explicitly asks you to using the phrase 'commit this'."

0 commit comments

Comments
 (0)