Skip to content

Commit 20f66e5

Browse files
authored
ci: Consolidate Claude and Codex workflows into unified versions (#123)
1 parent c464af3 commit 20f66e5

File tree

3 files changed

+111
-193
lines changed

3 files changed

+111
-193
lines changed

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

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

.github/workflows/claude.yml

Lines changed: 98 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
needs.check-team-member.outputs.is-team-member == 'true' &&
3737
github.actor != 'github-actions[bot]' &&
3838
(
39-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && !contains(github.event.comment.body, '@claude /full-review')) ||
40-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && !contains(github.event.comment.body, '@claude /full-review')) ||
41-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && !contains(github.event.review.body, '@claude /full-review')) ||
39+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
40+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
41+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
4242
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
4343
)
4444
runs-on: ubuntu-latest
@@ -51,7 +51,7 @@ jobs:
5151
pull-requests: read
5252
issues: read
5353
id-token: write
54-
actions: read # Required for Claude to read CI results on PRs
54+
actions: read
5555
steps:
5656
- name: Checkout repository
5757
uses: actions/checkout@v5
@@ -65,15 +65,102 @@ jobs:
6565
with:
6666
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
6767
track_progress: true
68-
69-
# This is an optional setting that allows Claude to read CI results on PRs
7068
additional_permissions: |
7169
actions: read
70+
prompt: |
71+
You are a helpful assistant for the ZenML React Component Library. Help the user with whatever they asked.
72+
73+
If the user is asking for a code review (e.g., "@claude /full-review", "@claude review this", or similar), follow the detailed review guidelines below. Otherwise, just help them with their question or request.
74+
75+
---
76+
CODE REVIEW GUIDELINES (use when reviewing PRs):
77+
78+
Focus on ensuring the changes are sound, clean, intentional, and void of regressions.
79+
80+
REPO: ${{ github.repository }}
81+
PR NUMBER: ${{ github.event.pull_request.number }}
82+
83+
Context:
84+
- This is a frontend React component library published to npm as @zenml-io/react-component-library
85+
- Uses TypeScript, Tailwind CSS, Radix UI primitives, Vitest for testing, and Storybook for documentation
86+
- Built with tsup (ESM + CJS), uses pnpm for package management
87+
- You can fetch additional PR context via:
88+
- gh pr view ${{ github.event.pull_request.number }} --json title,body,author,headRefName,baseRefName,commits
89+
- gh pr diff ${{ github.event.pull_request.number }} --name-only
90+
- Use the repository's CLAUDE.md (if present) and existing code patterns for conventions.
91+
92+
Primary Review Goals:
93+
94+
1) Verify Change Correctness
95+
- Confirm the changes achieve their intended purpose
96+
- Check for unintended side effects or regressions in component behavior
97+
- Validate edge cases are handled properly (empty states, loading states, error states)
98+
- Ensure error paths are covered
99+
- Verify prop validation and TypeScript types are correct
100+
101+
2) Code Quality & Cleanliness
102+
- Is the code readable and self-documenting?
103+
- Are the changes minimal and focused?
104+
- Do they follow existing patterns in the codebase?
105+
- Are there any code smells or anti-patterns?
106+
- Is the component structure logical and maintainable?
107+
108+
3) Frontend-Specific Concerns
109+
- **Accessibility (a11y)**: ARIA attributes, keyboard navigation, focus management, semantic HTML
110+
- **TypeScript**: Proper typing, no `any` types, exported types are correctly defined
111+
- **Bundle Size**: Unnecessary dependencies, code bloat, tree-shaking considerations
112+
- **Performance**: Unnecessary re-renders, proper memoization, efficient event handlers
113+
- **Styling**: Tailwind classes used correctly, no inline styles, responsive design
114+
- **Browser Compatibility**: Works across target browsers
115+
116+
4) Component API Design
117+
- Are component props intuitive and consistent with existing components?
118+
- Are breaking changes to component APIs clearly justified?
119+
- Is the component composable and flexible?
120+
- Are default prop values sensible?
121+
- Is the component API backward compatible?
122+
123+
5) Potential Issues to Flag
124+
- Accessibility violations (missing labels, improper ARIA, keyboard traps)
125+
- Performance degradations (unnecessary re-renders, memory leaks)
126+
- Security vulnerabilities (XSS risks, unsafe HTML rendering)
127+
- Breaking changes to public component APIs
128+
- TypeScript type errors or unsafe type assertions
129+
- Missing error boundaries or error handling
130+
131+
6) Constructive Suggestions
132+
- Alternative approaches that might be cleaner
133+
- Opportunities to reduce complexity
134+
- Opportunities to improve accessibility
135+
136+
Testing Feedback Guidelines:
137+
- **Be concise**: Avoid verbose test suggestions or lengthy code examples.
138+
- **Stay laser-focused**: Only suggest tests that directly verify the specific changes in this PR—not tangential functionality.
139+
- **Prioritize manual testing**: Brief, actionable suggestions for what to manually verify are most useful (e.g., "Test keyboard navigation on the new dropdown").
140+
- **Limit scope**: If tests are needed, mention the scenario to cover in 1-2 sentences rather than writing full test implementations.
141+
- **Skip if unnecessary**: Not every PR needs test suggestions—if the changes are straightforward or already covered, don't force test recommendations.
142+
143+
Documentation & Storybook Review:
144+
- Determine if component behavior, props, or APIs have changed.
145+
- Heuristics (run): gh pr diff ${{ github.event.pull_request.number }} --name-only
146+
- If component changes are present in `src/` but corresponding Storybook stories are not updated, flag as "Storybook update needed".
147+
- If new components are added, ensure they have Storybook stories demonstrating usage.
148+
- If component props changed, ensure stories showcase the new prop variations.
149+
- Check that JSDoc comments are present for complex props or components.
150+
- If breaking changes are introduced to component APIs, recommend adding migration notes in the PR description or changelog.
151+
- If documentation is needed, explicitly call it out in the review with concrete file/section suggestions.
152+
153+
Review Format:
154+
- Start with a summary of what the changes accomplish.
155+
- List any critical issues that must be addressed.
156+
- Note minor improvements that would enhance quality.
157+
- Acknowledge what's done particularly well.
158+
- End with specific, actionable next steps if needed.
72159
73-
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
74-
# prompt: 'Update the pull request description to include a summary of changes.'
160+
Output Instructions:
161+
- Provide detailed feedback using inline-style code references in your comment for specific issues (quote file paths and line ranges when possible).
162+
- Use top-level comments for general observations or praise.
163+
- Use `gh pr comment` to post your review comment to the PR.
75164
76-
# Optional: Add claude_args to customize behavior and configuration
77-
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
78-
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
165+
Be constructive and helpful in your feedback.
79166
claude_args: --allowed-tools "mcp__github_inline_comment__create_inline_comment,Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"

0 commit comments

Comments
 (0)