This document provides general guidance for agents committing to this repository.
Before committing any changes, please ensure that you run the following checks:
- Ruff: Run
ruffto lint and format the code. - Mypy: Run
mypyto check for type errors. - Pytest: Run
pytestto ensure all tests pass.
Please adhere to the following code style guidelines:
- Follow PEP 8 for all Python code.
- Use modern Python type hints (e.g.,
listanddictinstead ofListandDict). - Never use quotes around type hints (e.g.,
def foo() -> "MyClass": ...). You can always addfrom __future__ import annotationsto the top of the file if you need to delay the evaluation of type hints. - Use type hints for all function signatures.
- Write clear and concise docstrings for all modules, classes, and functions.
- Keep lines under 88 characters long.
- When creating Pydantic
BaseModels, usemodel_post_initfor any post-initialization logic instead of overriding the__init__method. - Always put imports at the top of the file, organized into sections (standard library, third-party, and first-party).
- Use
ConfigDictwhen working with Pydantic types to specify model-specific configuration, likearbitrary_types_allowed=True.
- The default model for this project is
gpt-5. - Write clear and descriptive commit messages.
- Break down large changes into smaller, logical commits.
- Ensure that all new code is covered by tests.
- Update the documentation as needed.
scripts/run_checks.sh: Run ruff, mypy, and pytest.