|
| 1 | +# Agent Guidelines |
| 2 | + |
| 3 | +## Developer commands |
| 4 | + |
| 5 | +- `devbox run -- uv run -- pytest` – run all tests |
| 6 | +- `devbox run -- uv run -- pre-commit run -a` – run all code quality checks |
| 7 | + |
| 8 | +## Code conventions |
| 9 | + |
| 10 | +- ALWAYS write code compatible with Python 3.10+ |
| 11 | +- ALWAYS use `snake_case` for Python functions/methods and variables, `PascalCase` for |
| 12 | + classes, and `UPPER_SNAKE_CASE` for constants |
| 13 | +- ALWAYS use full type annotations except for `self` and `cls` parameters |
| 14 | +- ALWAYS prefix internal Python modules, packages, and symbols with `_` |
| 15 | +- ALWAYS export public Python API symbols via `__all__` in public modules |
| 16 | +- ALWAYS use Google-style docstrings with all relevant sections (e.g., `Args`, |
| 17 | + `Returns`, `Raises`) |
| 18 | +- ALWAYS use single-backticks for inline code in comments and docstrings; NEVER use |
| 19 | + double-backticks |
| 20 | +- NEVER use comments to describe what the code is doing; ONLY use comments to clarify |
| 21 | + invariants and the reasoning behind any unusual/complex implementation decisions |
| 22 | +- ALWAYS keep docstrings and comments short and concise |
| 23 | + |
| 24 | +## Test conventions |
| 25 | + |
| 26 | +- ALWAYS attempt to add a test case for changed behavior |
| 27 | +- ALWAYS read and copy the style of similar tests when adding new cases |
| 28 | +- PREFER running specific tests over running the entire test suite |
| 29 | +- PREFER parametrized tests using the `@pytest.mark.parametrize` decorator over |
| 30 | + multiple separate test functions when testing the same logic with different inputs |
| 31 | +- PREFER tests that assert one clearly defined behavior; split tests that validate |
| 32 | + multiple unrelated things into separate focused test functions |
| 33 | +- ALWAYS test observable behavior (inputs → outputs, raised exceptions, side effects); |
| 34 | + NEVER assert on internal implementation details such as private attributes, call |
| 35 | + counts, execution order, etc. |
| 36 | +- PREFER tests that create a minimal test template using `build_file_tree` and call |
| 37 | + `run_copy`/`run_recopy`/`run_update` to generate/update a test project over using |
| 38 | + internal API in isolation |
0 commit comments