| name | python-conventions |
| description | Code style and structure conventions for this Python project. Use this skill whenever writing, editing, or reviewing any Python code in the coach repo — new modules, bug fixes, refactors, anything. Do not write code without consulting these conventions first. |
Python conventions (coach project)
Toolchain
- Python 3.13+, strict mypy, ruff (line length 200)
- Single-quote strings enforced by ruff (
Q001)
- Imports: force-single-line (one import per line, no grouped imports)
Type annotations
- All functions must be fully typed — no untyped parameters or return values
- Use
Optional[X] not X | None
- Use
ABC + @abstractmethod for interfaces — not Protocol (explicit inheritance and runtime enforcement preferred over structural subtyping)
Code style
After any change
Review the affected code for simplification opportunities, duplication, and violations of the above before considering the task done.