Skip to content
Merged
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
66 changes: 66 additions & 0 deletions .github/workflows/claude.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Claude Code

on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
pull_request:
types: [opened, synchronize]

jobs:
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
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.
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
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.
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}

claude-auto-review:
if: github.event_name == 'pull_request'
Comment on lines +16 to +41
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.
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
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.
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
prompt: |
Please review this pull request for:
- Code quality and Python best practices
- Potential bugs or issues
- Test coverage
- Type hint correctness

Use inline comments for specific issues and a summary comment for overall feedback.
claude_args: |
--allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"
Comment on lines +65 to +66
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.
42 changes: 42 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# PythonChess

Minimal chess program with a pygame GUI. Originally a ninth-grade school assignment, extended with additional features.

## Project Structure

- `PythonChess.py` - Main entry point (pygame GUI app)
- `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.
- `BoardRenderer.py` - Pygame-based visual rendering
- `Tests/` - pytest test suite
- `Figuren/` - Chess piece PNG images

## 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.
- pygame for GUI
- pytest for tests
- Type hints and dataclasses throughout

## Commands

```bash
# Run the app
python PythonChess.py

# Run tests
pytest Tests/

# Run tests with verbose output
pytest Tests/ -v
```

## Conventions

- Standard Python naming: snake_case for functions/variables, PascalCase for classes
- Type hints used throughout
- One module per logical concern (board, pieces, rendering, game management, special moves)
- Tests in `Tests/` directory using pytest fixtures
- Default branch is `master`
Loading