From 62f674befa02ae8777c72c2d4d7410a6216e1994 Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Sat, 3 Jan 2026 03:50:21 -0800 Subject: [PATCH 1/4] Tweak CLAUDE.md --- CLAUDE.md | 49 +++++++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 563d178c3..f46f63876 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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/.py # Specific file -```bash -uv run pytest tests/.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. From fdb0e9f3a04e24a8cf07b2869ee31f02d0733545 Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Sat, 3 Jan 2026 03:51:24 -0800 Subject: [PATCH 2/4] Add formatting posttooluse --- .claude/settings.json | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .claude/settings.json diff --git a/.claude/settings.json b/.claude/settings.json new file mode 100644 index 000000000..adaa56da6 --- /dev/null +++ b/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "hooks": { + "PostToolUse": [ + { + "matcher": "Write|Edit", + "hooks": [ + { + "type": "command", + "command": "make format" + } + ] + } + ] + } +} From 358e527dd341f7437227d9c4402664c00494759e Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Sat, 3 Jan 2026 03:51:31 -0800 Subject: [PATCH 3/4] Add commit-push-pr slash command --- .claude/commands/commit-push-pr.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .claude/commands/commit-push-pr.md diff --git a/.claude/commands/commit-push-pr.md b/.claude/commands/commit-push-pr.md new file mode 100644 index 000000000..0a624d60a --- /dev/null +++ b/.claude/commands/commit-push-pr.md @@ -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. From a4a151bfcad26e1b3d3966efabff0b2e5d87a85b Mon Sep 17 00:00:00 2001 From: Kevin Zakka Date: Sat, 3 Jan 2026 14:01:07 +0200 Subject: [PATCH 4/4] Tweak permissions. --- .claude/settings.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.claude/settings.json b/.claude/settings.json index adaa56da6..43d45b334 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -1,4 +1,17 @@ { + "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": [ {