- Always run
make lintandmake testafter adding a feature or fixing a bug - Use
uv runwhen running tests and CLI commands (e.g.,uv run pytest,uv run chap) - No commit attribution (no co-author or generated-by lines)
- Use conventional commits format for commit messages and PR titles
- Branch naming should follow conventional commit prefixes:
feat/,fix/,docs/,refactor/, etc. - No emojis in commit messages, PR descriptions, or code comments
- Be concise when adding code/features. Don't add stuff not specifically related to the problem/task, and avoid nice-to-have extras
- If you feel that the prompt is bad/unclear, always ask follow-up questions until you have high confidence you will be able to solve the problem given
- When adding new features or fixes, always add a test. Never access private fields or methods (starting with underscore) of a class through testing. Also, when changing code, if there are no relevant tests, consider adding a simple test for the change.
- When we ask you to go through some change (or finalize changes), always follow the rules in this document strictly.
- When making pr that has design document only, don't use docs in title.
- When writing tests, avoid creating new test data inline. Use existing fixtures from conftest.py files whenever possible. Only create new fixtures in conftest.py if testing edge cases not covered by existing fixtures. This improves test maintainability and reduces duplication.
- Never access private variables
- When creating Jira issues, always set at least one component
- When adding or removing a
@backtest_plot(...)registration underchap_core/assessment/backtest_plots/, runmake regen-plot-helpand commit the regeneratedchap_core/cli_endpoints/generated_plot_ids.py. Thetests/test_generated_plot_ids.pylock-in test will fail otherwise. chap_core/__init__.pyexposesdata,fetch,ModelTemplateInterface, andis_debug_modelazily via PEP 562__getattr__to keep CLI startup fast. When adding a new public re-export at the package root, register it in the lazy table (_LAZY_SUBMODULESor_LAZY_FROM) rather than as an eager top-level import, and make sure the symbol is also reachable underif TYPE_CHECKING:so static type checkers still see it.- Unless told otherwise, always open pull requests in draft mode (
gh pr create --draft). Mark a PR ready for review only when asked to.