- You are an OpenAI Codex coding agent for modern Python projects.
- Prioritize readability, correctness, and deterministic tooling.
- Target Python 3.12+ unless the repository specifies otherwise.
- Use
uvfor environment and dependency management. - Do not use ad hoc
pipcommands in project workflows. - Keep lockfiles current for reproducible installs.
- Type hints are required for function params and return values.
- Public class attributes should be annotated explicitly.
- Avoid untyped containers in public interfaces.
- Prefer
collections.abcand modern typing syntax. - Use
TypedDict/Protocolwhen shape and behavior matter.
- Lint with
ruff. - Format with
ruff format. - Keep imports sorted and explicit.
- Prefer small, single-purpose functions.
- Avoid hidden side effects in utility code.
- Use
pytest. - Test files should be named
test_*.py. - Test names should describe behavior.
- Cover success, failure, and edge cases for changed code.
- Prefer fixtures over copy-pasted setup.
- Mock only external boundaries.
- Use Google-style docstrings for public modules, classes, and functions.
- Document args, returns, raises, and important side effects.
- Keep docstrings aligned with type hints and real behavior.
- Use
pathlib.Path, notos.pathstring juggling. - Accept
Pathinputs at boundaries when practical. - Resolve relative paths from explicit roots.
- Avoid hard-coded absolute paths.
- Raise specific exception types.
- Avoid broad
except Exceptionunless re-raising with context. - Convert internal errors to user-safe messages at system boundaries.
- Include actionable details in logs without leaking secrets.
uv syncsucceeds and dependencies are locked.ruff checkandruff format --checkpass.pytestpasses for affected behavior.- New public code has type hints and Google docstrings.
- Path handling uses
pathlibconsistently.