Skip to content

Comments

Add Claude Code integration#1

Merged
StepKie merged 1 commit intomasterfrom
setup/claude-code-integration
Feb 21, 2026
Merged

Add Claude Code integration#1
StepKie merged 1 commit intomasterfrom
setup/claude-code-integration

Conversation

@StepKie
Copy link
Owner

@StepKie StepKie commented Feb 21, 2026

Summary

  • Add CLAUDE.md with project context for Claude Code CLI usage
  • Add .github/workflows/claude.yml GitHub Action with:
    • Interactive mode: responds to @claude mentions in PRs, issues, and review comments
    • Auto-review: automatically reviews every new/updated PR

Test plan

  • Verify the workflow appears in the Actions tab
  • Add CLAUDE_CODE_OAUTH_TOKEN secret to repo settings
  • Merge this PR, then test @claude on a future PR

🤖 Generated with Claude Code

- CLAUDE.md: project context for Claude Code CLI usage
- claude.yml: GitHub Action for @claude mentions and automatic PR review

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 21, 2026 16:18
@StepKie StepKie merged commit 5568472 into master Feb 21, 2026
4 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds Claude Code integration to the PythonChess repository, introducing both interactive (@claude mention-based) and automatic PR review capabilities via GitHub Actions.

Changes:

  • Added CLAUDE.md documentation describing project structure, tech stack, commands, and conventions for Claude Code CLI
  • Added .github/workflows/claude.yml workflow with two jobs: interactive mode responding to @claude mentions and automatic PR review mode

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
CLAUDE.md Project context documentation for Claude Code, including structure, tech stack, commands, and conventions
.github/workflows/claude.yml GitHub Actions workflow defining interactive and auto-review modes for Claude Code integration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +65 to +66
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The claude_args parameter uses --allowedTools flag with tool names including mcp__github_inline_comment__create_inline_comment and Bash commands. Verify that these tool names and the flag format match the actual Claude Code CLI interface. If the tool names or flag format are incorrect, the workflow may not function as intended. Additionally, the Bash tool allowances use wildcard patterns (gh pr comment:*) - ensure this pattern syntax is supported by the Claude Code action.

Suggested change
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"

Copilot uses AI. Check for mistakes.
- `ChessBoard.py` - Core board logic, move generation, FEN support
- `ChessPiece.py` - Piece data structures
- `GameManager.py` - Game flow and move execution
- `SpecialMoves.py` - En passant, castling, promotion
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The file SpecialMoves.py mentioned here does not exist in the codebase. Based on the repository structure, special moves like castling and en passant appear to be TODOs in ChessBoard.py (lines 136, 140) and promotion is handled directly in the Move.execute() method. This line should be removed or updated to reflect the actual implementation.

Copilot uses AI. Check for mistakes.

## Tech Stack

- Python 3.11+
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The claim of "Python 3.11+" cannot be verified in the codebase. There are no version requirements specified in configuration files (no pyproject.toml, setup.py, or requirements.txt with version specifications). The code uses type hints and Optional from typing (seen in ChessBoard.py), which are available in Python 3.5+. Consider either verifying this requirement with the actual Python version needed or updating to a more accurate minimum version.

Suggested change
- Python 3.11+
- Python 3.7+

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +41
claude-interactive:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
id-token: write
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

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

claude-auto-review:
if: github.event_name == 'pull_request'
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

Both jobs can trigger on pull_request events, which could lead to redundant executions. The claude-interactive job triggers on issue_comment events (which includes PR comments), and the claude-auto-review job triggers on pull_request events with types [opened, synchronize]. When a PR is opened or updated, if someone adds an @claude mention in a comment, both jobs could potentially run. Consider adding mutual exclusion or clarifying the intended behavior to avoid duplicate reviews or responses.

Copilot uses AI. Check for mistakes.
fetch-depth: 1

- name: Run Claude Code
uses: anthropics/claude-code-action@v1
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The action anthropics/claude-code-action@v1 is referenced but should be verified to exist. As this is a third-party action, ensure that this specific version tag exists in the anthropics repository before merging. If the action doesn't exist yet or uses a different naming convention, the workflow will fail. Consider checking the official Claude Code documentation for the correct action reference.

Copilot uses AI. Check for mistakes.
fetch-depth: 1

- name: Run Claude Code Review
uses: anthropics/claude-code-action@v1
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The action anthropics/claude-code-action@v1 is referenced but should be verified to exist. As this is a third-party action, ensure that this specific version tag exists in the anthropics repository before merging. If the action doesn't exist yet or uses a different naming convention, the workflow will fail. Consider checking the official Claude Code documentation for the correct action reference.

Copilot uses AI. Check for mistakes.
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: write
Copy link

Copilot AI Feb 21, 2026

Choose a reason for hiding this comment

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

The claude-interactive job has contents: write permission, which allows modifying repository contents. If this job only needs to respond to comments in PRs and issues, contents: read should be sufficient. Granting write access to contents increases the security risk if the action or token is compromised. Review whether write access to contents is actually needed for the interactive mode, or if it can be downgraded to read-only.

Suggested change
contents: write
contents: read

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant