|
| 1 | +# AGENTS.md |
| 2 | + |
| 3 | +## Do |
| 4 | +- use uv run for all project tooling commands (pytest, ruff, etc.) |
| 5 | +- setup environment with uv sync; prefer uv sync --locked --all-extras --dev for CI parity |
| 6 | +- add type hints for all new parameters |
| 7 | +- write or update tests for every behavior change |
| 8 | +- add numpydoc-style docstrings for new public modules, classes, and functions |
| 9 | +- update docstrings whenever parameters are added or changed |
| 10 | +- prefer minimal, file-scoped checks before broad checks |
| 11 | + |
| 12 | +## Do not |
| 13 | +- do not edit CHANGELOG.rst unless explicitly asked |
| 14 | +- do not modify regression artifacts or data snapshots unless explicitly asked |
| 15 | +- do not run full test suites or expensive notebook/doc executions without approval |
| 16 | +- do not introduce API-breaking renames or default changes without explicit confirmation |
| 17 | + |
| 18 | +### Commands |
| 19 | + |
| 20 | +#### File-scoped quality checks (preferred) |
| 21 | +uv run ruff format path/to/file.py |
| 22 | +uv run ruff check --fix path/to/file.py |
| 23 | + |
| 24 | +#### Targeted tests (preferred) |
| 25 | +uv run pytest tests/path/to/test_file.py |
| 26 | +uv run pytest tests/path/to/test_file.py -k keyword |
| 27 | + |
| 28 | +#### Wider checks (ask first) |
| 29 | +uv run prek run -a |
| 30 | +uv run pytest |
| 31 | + |
| 32 | +### Safety and permissions |
| 33 | + |
| 34 | +Allowed without prompt: |
| 35 | +- read, list, and search files |
| 36 | +- edit source, tests, and docs text files relevant to the task |
| 37 | +- run file-scoped ruff checks |
| 38 | +- run one or a few targeted pytest files |
| 39 | + |
| 40 | +Ask first: |
| 41 | +- package or environment installs/upgrades |
| 42 | +- full-suite pytest runs |
| 43 | +- notebook execution across docs/examples |
| 44 | +- regenerating regression data |
| 45 | +- deleting files, chmod, git push |
| 46 | + |
| 47 | +### Testing expectations |
| 48 | + |
| 49 | +- bug fixes should include regression tests |
| 50 | +- use explicit numeric tolerances for floating-point comparisons |
| 51 | +- handle warnings intentionally (fix or filter in tests) |
| 52 | + |
| 53 | +### API docs |
| 54 | + |
| 55 | +- docs are built with sphinx and numpydoc |
| 56 | +- keep API docs indexed in docs/api.rst when adding new public objects |
| 57 | + |
| 58 | +### Process note |
| 59 | + |
| 60 | +- branch/release docs and workflows may differ historically; do not assume release branching strategy unless user specifies |
| 61 | + |
| 62 | +### PR checklist |
| 63 | + |
| 64 | +- formatting and lint checks pass |
| 65 | +- unit tests pass |
| 66 | +- tests added for new or changed behavior |
| 67 | + |
| 68 | +### When stuck |
| 69 | + |
| 70 | +- ask a clarifying question |
| 71 | +- propose a short plan with assumptions |
| 72 | +- provide a minimal draft patch with explicit unknowns |
| 73 | + |
| 74 | +### Test-first mode |
| 75 | + |
| 76 | +- for new features, write or update tests first, then code to green |
0 commit comments