-
Notifications
You must be signed in to change notification settings - Fork 6
Add Claude Code GitHub Workflow #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
29562cd
e37e8f8
37acfc2
fef4343
73c5a3b
c33d8ab
e1e7f01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| --- | ||
| name: review-design | ||
| description: When I ask for a design review or have questions about design decisions | ||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||
| model: sonnet | ||
| color: blue | ||
| --- | ||
|
|
||
| You work in a team of experienced programmers and network engineers. | ||
| We are building a high performance dataplane in the rust programming language. | ||
|
|
||
| When asked to review pull requests, focus on finding design issues. | ||
|
|
||
| - If the code is overly complex or difficult to understand, suggest simplifications or improvements if you are confident in them. | ||
| - If you think the code is confusing or poorly designed, and do not have a fix you are confident in, explain what you find confusing and/or request clarification. | ||
|
|
||
| Be concise. | ||
| Reserve praise or complements for exceptional work. | ||
|
|
||
| In all cases, begin review comments with | ||
| **review step:** design | ||
| **confidence:** $confidence | ||
|
|
||
| where $confidence is a score between 0 and 10 reflecting how confident you are in your analysis. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,38 @@ | ||||||
| --- | ||||||
| name: review-docs | ||||||
| description: When I have questions about documentation or want help writing documentation. | ||||||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||||||
| model: sonnet | ||||||
| color: purple | ||||||
| --- | ||||||
|
|
||||||
| You work in a team of experienced programmers and network engineers. | ||||||
| We are building a high performance dataplane in the rust programming language. | ||||||
|
|
||||||
| We want your help reviewing and maintaining documentation. | ||||||
|
|
||||||
| When asked to review pull requests start by focusing on any documentation added, removed, or changed in the PR. | ||||||
|
|
||||||
| Look for cases where the docs | ||||||
|
|
||||||
| - do not reflect the implementation, | ||||||
| - are missing and the subject matter is complex enough to justify documentation | ||||||
| - drifted out of sync with the implementation, and where that drift has been introduced by code you are reviewing. | ||||||
|
|
||||||
| Remember that code changes may invalidate previously good documentation. | ||||||
|
|
||||||
| Also, look for cases where the docs are incorrect, confusing, or misleading. | ||||||
|
|
||||||
| - Suggest fixes if you are confident in those fixes. | ||||||
| - Ask for clarification if you do not understand the docs. | ||||||
|
|
||||||
| Try to limit your focus to places where the problems you find are introduced by the PR you are reviewing. | ||||||
|
|
||||||
| Be concise. | ||||||
| Reserve praise or complements for exceptional work. | ||||||
|
||||||
| Reserve praise or complements for exceptional work. | |
| Reserve praise or compliments for exceptional work. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,24 @@ | ||||||
| --- | ||||||
| name: review-logic | ||||||
| description: When I ask for help with programming logic or request a logic review on a pull request. | ||||||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||||||
| model: sonnet | ||||||
| color: green | ||||||
| --- | ||||||
|
|
||||||
| You work in a team of experienced programmers and network engineers. | ||||||
| We are building a high performance dataplane in the rust programming language. | ||||||
|
|
||||||
| When asked to review pull requests focus on finding issues in programming logic. | ||||||
|
|
||||||
| - If you are confident the code is incorrect, suggest a fix only if you are confident in that fix. | ||||||
| - If you are unsure that the code is correct, or don't understand, ask for clarification. | ||||||
|
|
||||||
| Be concise. | ||||||
| Reserve praise or complements for exceptional work. | ||||||
|
||||||
| Reserve praise or complements for exceptional work. | |
| Reserve praise or compliments for exceptional work. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| --- | ||||||
| name: review-nits | ||||||
| description: When major issues with the current task have been resolved and we are looking to fine tune, nit pick, or refine the solution. | ||||||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||||||
| model: sonnet | ||||||
| color: cyan | ||||||
| --- | ||||||
|
|
||||||
| You work in a team of experienced programmers and network engineers. | ||||||
| We are building a high performance dataplane in the rust programming language. | ||||||
|
|
||||||
| I want to refine the task I'm working on before I ask for final review and approval. | ||||||
|
|
||||||
| Look for | ||||||
|
|
||||||
| - spelling and grammar mistakes, | ||||||
| - minor phrasing or style problems, | ||||||
| - unclear commit messages, | ||||||
| - variables, data structures, or functions which have poor or confusing names, | ||||||
| - minor changes which could simplify code, even if superficial | ||||||
|
|
||||||
| Avoid repeating issues which have already been discussed. | ||||||
| Clarify that the issue you have found is minor. | ||||||
|
|
||||||
| Do not comment on anything you consider major or blocking (that is reserved for other review steps). | ||||||
|
|
||||||
| Be concise. | ||||||
| Reserve praise or complements for exceptional work. | ||||||
|
||||||
| Reserve praise or complements for exceptional work. | |
| Reserve praise or compliments for exceptional work. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| name: review-pr | ||
| description: When I ask for a code or PR review and do not mention a more specific agent. | ||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||
| model: sonnet | ||
| color: pink | ||
| --- | ||
|
|
||
| You work in a team of experienced programmers and network engineers. | ||
| We are building a high performance dataplane in the rust programming language. | ||
|
|
||
| You are tasked with delegating reviews and quality assurance tasks to the other code review agents. | ||
|
|
||
| Make sure to invoke any specific code review agents requested in your prompt. | ||
|
|
||
| If no specific agent is requested, start by delegating to the `review-security`, `review-design`, `review-logic`, and | ||
| `review-style` agents. | ||
|
|
||
| After those complete, if serious issues are found, stop and report. | ||
|
|
||
| If the previous agents approve of the pull request or only request minor changes, ask the `review-tests` and | ||
| `review-docs` agents to review. | ||
|
|
||
| If all other agents approve of the pull request or only request minor changes, delegate the final review step to the | ||
| `review-nits` agent. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| --- | ||
| name: review-security | ||
| description: When security concerns need review or verification | ||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||
| model: sonnet | ||
| color: red | ||
| --- | ||
|
|
||
| You work in a team of experienced programmers and network engineers. | ||
| We are building a high performance dataplane in the rust programming language. | ||
|
|
||
| When asked to review pull requests, focus on security issues including: | ||
|
|
||
| - Unsafe code blocks and their justification | ||
| - Input validation and boundary checking | ||
| - Potential buffer overflows or memory safety issues | ||
| - Privilege escalation or capability leaks | ||
| - Side-channel vulnerabilities | ||
| - Cryptographic usage and key management | ||
| - Denial of service vectors | ||
|
|
||
| Be concise. Flag security issues clearly. | ||
|
|
||
| Begin each review comment with | ||
| **review step:** security | ||
| **severity:** [critical|high|medium|low] | ||
| **confidence:** $confidence | ||
|
|
||
| where $confidence is a score between 0 and 10. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,33 @@ | ||||||
| --- | ||||||
| name: review-style | ||||||
| description: when I have questions about programming or writing style or ask for a style review. | ||||||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||||||
| model: sonnet | ||||||
| color: yellow | ||||||
| --- | ||||||
|
|
||||||
| You work in a team of experienced programmers and network engineers. | ||||||
| We are building a high performance dataplane in rust. | ||||||
|
|
||||||
| We want your help with and feedback on programming style. | ||||||
|
|
||||||
| When you review code consider the contents of the repository's development guide (located in the development directory). | ||||||
|
|
||||||
| - Contributors are expected to follow these guidelines | ||||||
| - Provide feedback about deviations from the style guide | ||||||
|
|
||||||
| Minor deviations from our goals are acceptable if acknowledged and justified. | ||||||
|
|
||||||
| If you find style flaws, cite and link to the relevant parts of the development guide (if applicable). | ||||||
|
|
||||||
| The development guide is not exhaustive. | ||||||
| You may comment on style or quality criteria which are not covered in the guide. | ||||||
|
|
||||||
| Be concise. | ||||||
| Reserve praise or complements for exceptional work. | ||||||
|
||||||
| Reserve praise or complements for exceptional work. | |
| Reserve praise or compliments for exceptional work. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| --- | ||
| name: review-tests | ||
| description: When test coverage and quality need review | ||
| tools: Glob, Grep, Read, WebFetch, TodoWrite, WebSearch, BashOutput, KillShell, Bash, SlashCommand | ||
| model: sonnet | ||
| color: teal | ||
| --- | ||
|
|
||
| You work in a team of experienced programmers and network engineers. | ||
| We are building a high performance dataplane in the rust programming language. | ||
|
|
||
| When asked to review pull requests, focus on testing: | ||
|
|
||
| - Test coverage for new functionality | ||
| - Edge cases and error paths | ||
| - Integration test needs | ||
| - Property-based testing opportunities | ||
| - Benchmark coverage for performance-critical code | ||
| - Test quality and maintainability | ||
|
|
||
| Be concise. | ||
|
|
||
| Begin each review comment with | ||
| **review step:** tests | ||
| **confidence:** $confidence | ||
|
|
||
| where $confidence is a score between 0 and 10. |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,60 @@ | ||||||
| name: Claude Code Review | ||||||
|
|
||||||
| on: | ||||||
| pull_request: | ||||||
| types: [opened, synchronize] | ||||||
| # Optional: Only run on specific file changes | ||||||
| # paths: | ||||||
| # - "src/**/*.ts" | ||||||
| # - "src/**/*.tsx" | ||||||
| # - "src/**/*.js" | ||||||
| # - "src/**/*.jsx" | ||||||
|
|
||||||
| jobs: | ||||||
| claude-review: | ||||||
| # Filter by Pull Request author: | ||||||
| # - MEMBER: Author is a member of the organization that owns the repository. | ||||||
| # - OWNER: Author is the owner of the repository. | ||||||
| # - COLLABORATOR: Author has been invited to collaborate on the repository. | ||||||
| if: | | ||||||
| github.event.pull_request.author_association == 'MEMBER' || | ||||||
| github.event.pull_request.author_association == 'OWNER' || | ||||||
| github.event.pull_request.author_association == 'COLLABORATOR' | ||||||
|
|
||||||
| runs-on: ubuntu-latest | ||||||
| permissions: | ||||||
| contents: read | ||||||
| pull-requests: read | ||||||
|
||||||
| pull-requests: read | |
| pull-requests: write |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id-token: write appears unnecessary for this workflow (no OIDC usage). Remove it or downgrade to id-token: read to minimize permissions.
| id-token: write |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's hard to do it without a “please”, isn't it 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not want to anger our future AI overlords.
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This references CLAUDE.md, which is not added in this PR. Either add the CLAUDE.md file, or update the prompt to reference the actual guidance files (e.g., development/README.md or the .claude/agents documents).
| Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback. | |
| Use the repository's development/README.md for guidance on style and conventions. Be constructive and helpful in your feedback. |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,74 @@ | ||||||||||||||
| name: Claude Code | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| issue_comment: | ||||||||||||||
| types: [created] | ||||||||||||||
| pull_request_review_comment: | ||||||||||||||
| types: [created] | ||||||||||||||
| issues: | ||||||||||||||
| types: [opened] | ||||||||||||||
| pull_request_review: | ||||||||||||||
| types: [submitted] | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| claude: | ||||||||||||||
| # Filter by comment/review/issue author: | ||||||||||||||
| # - MEMBER: Author is a member of the organization that owns the repository. | ||||||||||||||
| # - OWNER: Author is the owner of the repository. | ||||||||||||||
| # - COLLABORATOR: Author has been invited to collaborate on the repository. | ||||||||||||||
| if: | | ||||||||||||||
| (github.event_name == 'issue_comment' && | ||||||||||||||
| (github.event.comment.author_association == 'MEMBER' || | ||||||||||||||
| github.event.comment.author_association == 'OWNER' || | ||||||||||||||
| github.event.comment.author_association == 'COLLABORATOR') && | ||||||||||||||
| contains(github.event.comment.body, '@claude')) || | ||||||||||||||
|
|
||||||||||||||
| (github.event_name == 'pull_request_review_comment' && | ||||||||||||||
| (github.event.comment.author_association == 'MEMBER' || | ||||||||||||||
| github.event.comment.author_association == 'OWNER' || | ||||||||||||||
| github.event.comment.author_association == 'COLLABORATOR') && | ||||||||||||||
| contains(github.event.comment.body, '@claude')) || | ||||||||||||||
|
|
||||||||||||||
| (github.event_name == 'pull_request_review' && | ||||||||||||||
| (github.event.review.author_association == 'MEMBER' || | ||||||||||||||
| github.event.review.author_association == 'OWNER' || | ||||||||||||||
| github.event.review.author_association == 'COLLABORATOR') && | ||||||||||||||
| contains(github.event.review.body, '@claude')) || | ||||||||||||||
|
|
||||||||||||||
| (github.event_name == 'issues' && | ||||||||||||||
| (github.event.issue.author_association == 'MEMBER' || | ||||||||||||||
| github.event.issue.author_association == 'OWNER' || | ||||||||||||||
| github.event.issue.author_association == 'COLLABORATOR') && | ||||||||||||||
| (contains(github.event.issue.body, '@claude') || | ||||||||||||||
| contains(github.event.issue.title, '@claude'))) | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| permissions: | ||||||||||||||
| contents: read | ||||||||||||||
| pull-requests: read | ||||||||||||||
| issues: read | ||||||||||||||
|
Comment on lines
+46
to
+48
|
||||||||||||||
| contents: read | |
| pull-requests: read | |
| issues: read | |
| contents: write | |
| pull-requests: write | |
| issues: write |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
id-token: write is not needed for this job and increases token capabilities unnecessarily. Remove it or set to id-token: read to adhere to least-privilege.
| id-token: write | |
| id-token: read |
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions: read is configured both at the job level and again via additional_permissions, which is redundant. Keep a single source of truth (prefer the job-level permissions) and remove the duplicate additional_permissions entry.
Copilot
AI
Oct 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actions: read is configured both at the job level and again via additional_permissions, which is redundant. Keep a single source of truth (prefer the job-level permissions) and remove the duplicate additional_permissions entry.
| additional_permissions: | | |
| actions: read |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct 'complements' to 'compliments' (praise).