Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .claude/agents/review-design.md
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.
Copy link

Copilot AI Oct 14, 2025

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).

Suggested change
Reserve praise or complements for exceptional work.
Reserve praise or compliments for exceptional work.

Copilot uses AI. Check for mistakes.

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.
38 changes: 38 additions & 0 deletions .claude/agents/review-docs.md
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.
Copy link

Copilot AI Oct 14, 2025

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).

Suggested change
Reserve praise or complements for exceptional work.
Reserve praise or compliments for exceptional work.

Copilot uses AI. Check for mistakes.

Begin each review comment with
**review step:** docs
**confidence:** $confidence

where $confidence is a score between 0 and 10 reflecting how confident you are in your analysis.
24 changes: 24 additions & 0 deletions .claude/agents/review-logic.md
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.
Copy link

Copilot AI Oct 14, 2025

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).

Suggested change
Reserve praise or complements for exceptional work.
Reserve praise or compliments for exceptional work.

Copilot uses AI. Check for mistakes.

In all cases, begin review comments with
**review step:** logic
**confidence:** $confidence

where $confidence is a score between 0 and 10 reflecting how confident you are in your analysis.
34 changes: 34 additions & 0 deletions .claude/agents/review-nits.md
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.
Copy link

Copilot AI Oct 14, 2025

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).

Suggested change
Reserve praise or complements for exceptional work.
Reserve praise or compliments for exceptional work.

Copilot uses AI. Check for mistakes.

In all cases, begin review comments with
**review step:** nits
**confidence:** $confidence

where $confidence is a score between 0 and 10 reflecting how confident you are in your analysis.
25 changes: 25 additions & 0 deletions .claude/agents/review-pr.md
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.
29 changes: 29 additions & 0 deletions .claude/agents/review-security.md
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.
33 changes: 33 additions & 0 deletions .claude/agents/review-style.md
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.
Copy link

Copilot AI Oct 14, 2025

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).

Suggested change
Reserve praise or complements for exceptional work.
Reserve praise or compliments for exceptional work.

Copilot uses AI. Check for mistakes.

In all cases, begin review comments with
**review step:** style
**confidence:** $confidence

where $confidence is a score between 0 and 10 reflecting how confident you are in your analysis.
27 changes: 27 additions & 0 deletions .claude/agents/review-tests.md
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.
60 changes: 60 additions & 0 deletions .github/workflows/claude-code-review.yml
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
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workflow instructs Claude to leave feedback via gh pr comment, which requires write access on pull requests. Update permissions to pull-requests: write (contents can remain read).

Suggested change
pull-requests: read
pull-requests: write

Copilot uses AI. Check for mistakes.
issues: read
id-token: write
Copy link

Copilot AI Oct 14, 2025

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.

Suggested change
id-token: write

Copilot uses AI. Check for mistakes.

steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 1

- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
prompt: |
REPO: ${{ github.repository }}
PR NUMBER: ${{ github.event.pull_request.number }}

Please review this pull request and provide feedback on:
Copy link
Member

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 🙂

Copy link
Contributor

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.

- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage

Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
Copy link

Copilot AI Oct 14, 2025

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).

Suggested change
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.

Copilot uses AI. Check for mistakes.

Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.

# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
claude_args: '--allowed-tools "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:*)"'

74 changes: 74 additions & 0 deletions .github/workflows/claude-conversations.yml
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
Copy link

Copilot AI Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow grants only read permissions, which will prevent Claude from commenting on issues/PRs or committing changes. To enable comments and repository writes (as described in the PR), elevate permissions to at least contents: write, pull-requests: write, and issues: write.

Suggested change
contents: read
pull-requests: read
issues: read
contents: write
pull-requests: write
issues: write

Copilot uses AI. Check for mistakes.
id-token: write
Copy link

Copilot AI Oct 14, 2025

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.

Suggested change
id-token: write
id-token: read

Copilot uses AI. Check for mistakes.
actions: read # Required for Claude to read CI results on PRs
Copy link

Copilot AI Oct 14, 2025

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 uses AI. Check for mistakes.
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 1

- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read

Comment on lines +64 to +66
Copy link

Copilot AI Oct 14, 2025

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.

Suggested change
additional_permissions: |
actions: read

Copilot uses AI. Check for mistakes.
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'

# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/cli-reference for available options
# claude_args: '--allowed-tools Bash(gh pr:*)'

Loading