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
19 changes: 19 additions & 0 deletions .claude/commands/commit-push-pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr create:*)
description: Commit, push, and open a PR
---

## Context

- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`

## Your task

Based on the above changes:
1. Create a new branch if on main
2. Create a single commit with an appropriate message
3. Push the branch to origin
4. Create a pull request using `gh pr create`
5. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
28 changes: 28 additions & 0 deletions .claude/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"permissions": {
"allow": [
"Bash(find:*)",
"Bash(make check:*)",
"Bash(make test:*)",
"Bash(make docs:*)",
"Bash(git fetch:*)",
"Bash(git commit:*)",
"Bash(git reset:*)",
"Bash(gh api:*)",
"Bash(git ls-tree:*)"
]
},
"hooks": {
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "make format"
}
]
}
]
}
}
49 changes: 27 additions & 22 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,40 @@
# Developer Guide
# Development Workflow

## Commands
**Always use `uv run`, not python**.

Use `make` for common workflows:
```sh

```bash
make format # Format and lint
make type # Format, lint, and type-check
make test-fast # Run tests excluding slow ones
make test # Run the full test suite
make docs # Build documentation
```
# 1. Make changes.

# 2. Type check.
uv run ty check # Fast
uv run pyright # More thorough, but slower

You can also run individual commands directly with `uv`:
# 3. Run tests.
uv run pytest tests/ # Single suite
uv run pytest tests/<test_file>.py # Specific file

```bash
uv run pytest tests/<test_file>.py # Run a specific test file
uv run ty check # Run the ty type checker (faster)
uv run pyright # Run the pyright type checker (slower)
# 4. Format and lint before committing.
uv run ruff format
uv run ruff check --fix
```

## General Guidelines
We've bundled common commands into a Makefile for convenience.

- Run `make check` frequently to format, lint, and type-check your code. This catches many issues before tests are executed.
- Before finalizing changes, run `make test-fast` to ensure nothing is broken.
```sh
make format # Format and lint
make type # Type-check
make check # make format && make type
make test-fast # Run tests excluding slow ones
make test # Run the full test suite
make docs # Build documentation
```

## Style Guidelines
Before creating a PR, ensure all checks pass with `make test`.

- General
- Avoid local imports unless they are strictly necessary (e.g. circular imports).
- Tests
Some style guidelines to follow:
- Avoid local imports unless they are strictly necessary (e.g. circular imports).
- Tests should follow these principles:
- Use functions and fixtures; do not use test classes.
- Favor targeted, efficient tests over exhaustive edge-case coverage.
- Prefer running individual tests rather than the full test suite to improve iteration speed.