Skip to content

Commit 0fed947

Browse files
author
Steven Murray
committed
maint: add agents
1 parent bb882bc commit 0fed947

3 files changed

Lines changed: 98 additions & 87 deletions

File tree

agents.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ tests = [
7373
dev = [
7474
{include-group = "docs"},
7575
{include-group = "tests"},
76-
"pre-commit>=4.5.1",
76+
"prek>=0.3.8",
7777
"ruff>=0.15.6",
7878
]
7979

uv.lock

Lines changed: 21 additions & 86 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)