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