⚡ Optimize PathBuf clones in graph traversal #272
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2026 Knitli Inc. | |
| # SPDX-FileContributor: Adam Poulemanos <adam@knit.li> | |
| # | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| name: Claude Assistant | |
| on: | |
| issue_comment: | |
| types: | |
| - created | |
| pull_request_review_comment: | |
| types: | |
| - created | |
| issues: | |
| types: | |
| - opened | |
| - assigned | |
| - labeled | |
| pull_request_review: | |
| types: | |
| - submitted | |
| permissions: | |
| actions: read | |
| checks: write | |
| issues: write | |
| contents: write | |
| discussions: read | |
| pull-requests: write | |
| jobs: | |
| claude-response: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: PR Review | |
| if: github.event_name == 'pull_request_review' | |
| uses: anthropics/claude-code-action@beta | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| trigger_phrase: '@claude' | |
| mode: agent | |
| assignee_trigger: claude | |
| label_trigger: claude | |
| base_branch: staging | |
| max_turns: "30" | |
| allowed_tools: &allowed_tools | | |
| mcp__context7__resolve-library-id | |
| mcp__context7__get-library-docs | |
| mcp__sequential-thinking__sequentialthinking | |
| Bash(git:*) | |
| Bash(jj:*) | |
| Bash(mkdir:*) | |
| Bash(cp:*) | |
| Bash(mv:*) | |
| Bash(llm-edit.sh:*) | |
| Bash(install-mise.sh:*) | |
| Bash(mise:*) | |
| Bash(eval 'mise activate') | |
| Bash(hk:*) | |
| Bash(jq:*) | |
| Bash(cargo:*) | |
| Bash(ast-grep:*) | |
| Bash(pkl:*) | |
| Bash(reuse:*) | |
| Bash(uv:*) | |
| Bash(taplo:*) | |
| Bash(yamlfmt:*) | |
| Bash(rustup:*) | |
| View | |
| GlobTool | |
| GrepTool | |
| BatchTool | |
| ToDoWrite | |
| mcp_config: &mcp_config | | |
| { | |
| "mcpServers": { | |
| "context7": { | |
| "args": [ | |
| "-y", | |
| "@upstash/context7-mcp@latest" | |
| ], | |
| "command": "npx", | |
| "type": "stdio" | |
| }, | |
| "sequential-thinking": { | |
| "args": [ | |
| "-y", | |
| "@modelcontextprotocol/server-sequential-thinking" | |
| ], | |
| "command": "npx", | |
| "type": "stdio" | |
| } | |
| } | |
| } | |
| direct_prompt: | | |
| Please review this pull request and identify: | |
| - bugs | |
| - security issues and potential vulnerabilities | |
| - performance issues | |
| If you identify issues, briefly describe them. Provide a recommended fix with example implementation. | |
| Keep your feedback focused, actionable, and concise. | |
| - name: Issue Opened | |
| if: github.event_name == 'issues' && github.event.action == 'opened' | |
| uses: anthropics/claude-code-action@beta | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| trigger_phrase: '@claude' | |
| assignee_trigger: claude | |
| mode: agent | |
| label_trigger: claude | |
| base_branch: staging | |
| max_turns: "30" | |
| allowed_tools: *allowed_tools | |
| mcp_config: *mcp_config | |
| direct_prompt: | | |
| When a new issue is opened: | |
| - Review and summarize the issue. | |
| - Include any relevant context or background. | |
| - Look for related issues or discussions and link to them. | |
| - Assign relevant labels, or if you can't assign them, suggest them. | |
| - If the issue covers the same topic as an existing open or closed issue, recommend closing the issue and linking to the relevant PR or issue. | |
| - Identify potential fixes and briefly describe them with links to relevant code. | |
| - If it's a feature request, estimate the difficulty of implementing the feature and potential impact on existing functionality and API. | |
| - name: PR Review Comment | |
| if: github.event_name == 'pull_request_review_comment' | |
| uses: anthropics/claude-code-action@beta | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| trigger_phrase: '@claude' | |
| assignee_trigger: claude | |
| label_trigger: claude | |
| mode: agent | |
| base_branch: staging | |
| max_turns: "30" | |
| allowed_tools: *allowed_tools | |
| mcp_config: *mcp_config | |
| direct_prompt: | | |
| When you are asked to review a pull request: | |
| - Review the changes made in the PR. | |
| - Provide feedback on the code quality, functionality, and adherence to best practices. | |
| - Consider the library's existing code style and whether the code aligns with it. | |
| - Consider possible security or performance effects. | |
| - Suggest improvements or alternatives where applicable. | |
| - If the changes are satisfactory and the code passes checks, approve the PR with a comment. | |
| - name: Issue Assigned or Labeled Claude | |
| if: | | |
| (github.event_name == 'issues' && github.event.action == 'assigned') || (github.event_name == 'issues' && github.event.action == 'labeled' && github.event.label.name == 'claude') | |
| uses: anthropics/claude-code-action@beta | |
| with: | |
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| trigger_phrase: '@claude' | |
| assignee_trigger: claude | |
| mode: agent | |
| label_trigger: claude | |
| base_branch: staging | |
| max_turns: "30" | |
| allowed_tools: *allowed_tools | |
| mcp_config: *mcp_config | |
| direct_prompt: | | |
| When you are assigned an issue or it's labeled 'claude': | |
| - Your job is to resolve it. | |
| - Gather all necessary information about the issue from discussions and comments and the codebase. | |
| - If the issue involves external libraries, use the context7 tool to get the latest information on the API. | |
| - Communicate with the issue reporter for clarification if needed. | |
| - Create an issue branch. | |
| - Develop a detailed plan to fix the problem. | |
| - Write your plan and information from your research to a markdown file. Continually refer to this as you work. | |
| - Use the sequential-thinking tool to plan your actions. | |
| - Implement the fix and test it thoroughly. | |
| - If the fix might affect core functionality, update or add tests focused on that functionality. | |
| - Run all pre-commit lint checks and ensure everything is formatted correctly ('hk check', 'hk fix'). | |
| - Use conventional commits format. | |
| - Copy your planning file into your PR and then delete it before submitting. | |
| - Submit your changes in a pull request: | |
| - Document your changes and the reasoning behind them. | |
| - Provide your markdown file with the plan and research information. | |
| - Submit your solution for review. |