원클릭으로
write-code
Write or review code in this repo. Use when writing new code, reviewing existing code, or editing code.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Write or review code in this repo. Use when writing new code, reviewing existing code, or editing code.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | write-code |
| description | Write or review code in this repo. Use when writing new code, reviewing existing code, or editing code. |
| argument-hint | [source code] |
Use this skill when writing, reviewing, or editing code.
The goal of this document is to provide guidance when coding in this repository. All code should be pythonic and easy to read.
Python version: >=3.13
prek -aSee skill write-docstrings
typing only when necessary (prefer built-ins)list[str], dict[str, int] (not List[str], Dict[str, int])dict, always annotate the type of the dict (e.g. dict[str, float])Any in dict annotations only if absolutely necessary| for union types: str | Nonefrom __future__ import annotationstype Matrix[T: np.generic] = np.ndarray[tuple[int, int], np.dtype[T]]Via ruff
from module import *) except in __init__.pySpamTypeError(ValueError), SpamEatingError(RuntimeError))except: clausespathlib.Path for file operations instead of os.pathslots=True and frozen=True..0 to indicate floatsstrict=True in zip and itertools.batchedmatch/case statements (i.e. case _:)Code quality tools (ruff, ty, pytest) are configured per-package in pyproject.toml.
# Setup
prek install # Install git hooks
# Code quality
ruff format . # Format code
ruff check . # Lint code
ty check # Type check
prek -a # Run all prek hooks
prek run <hook-id> # Run specific hook
# Testing
pytest # Run tests
pytest --cov # Run tests with coverage
# Package management
uv sync # Install dependencies
uv add <package> # Add dependency
uv add --dev <package> # Add dev dependency
Direnv auto-activates virtual environments when entering package directories.
Run direnv allow . if you see permission errors.
tests/; doctests are auto-discovered in sourceapprox or assert_almost_equal (imported as aae), prefer default thresholdsSee the skill write-tests for more detail, but only if actively writing tests
CI runs ruff format, ruff check, ty check, and pytest per-package via GitHub Actions.
When working on a new feature, bugfix, etc. If Claude is already working in this directory, offer to start a new worktree. Create a new branch for all new work (avoid developing on master)
e.g.
git worktree add ../{package_name}-{feature_name} && cd ../{package_name}-{feature_name} # optional
git switch -c feat/jalapeno_spam
Break up work into manageable commits, keeping track of what changed in each commit. When the work is complete, create a descriptive PR, breaking down what was added, changed, and removed.
e.g.
gh pr create --title "Adds Jalapeno Spam" --body "Spam is a tasty processed meat ..."
If a worktree was created, offer to clean it up.
Format: conventional commits recommended
feat: - new featuresfix: - bug fixesdocs: - documentation changestest: - test changesrefactor: - code refactoringchore: - maintenance tasksNever include Claude as a co-author on commits.
git commit -m "feat: add Jalapeno Spam
- Adds Jalapeno Spam
- Tests that it is spicy"
Use skill write-docstrings
Formatting issues:
git add .Lint issues:
# noqa: <rule> if absolutely necessary, ask before addingType issues:
ty check to verify locallyTest failures:
pytest -v for detailed outputpytest tests/test_file.py::test_nameDo not add new packages without explicitly asking first. Never add ignores to the pyproject.toml formatting, linting, or type checking without explicitly asking