Automated enforcement
| Rule set | What it covers |
|---|---|
| E | pycodestyle errors |
| F | pyflakes (unused imports, undefined names) |
| I | isort (import ordering) |
| W | pycodestyle warnings |
E501 (line length) and E402 (module-level import position). The full configuration is in pyproject.toml under [tool.ruff].
Import ordering
Organize imports into four groups, separated by blank lines:TYPE_CHECKING block goes last and contains imports used only in type annotations.
Type annotations
Use modern Python 3.12+ syntax throughout:TYPE_CHECKING guards for forward references that cause circular imports:
Naming conventions
| Element | Convention | Example |
|---|---|---|
| Classes | PascalCase | TaskPolicy, AgentFuture |
| Functions / methods | snake_case | register_hook, _deep_unwrap |
| Constants | UPPER_SNAKE_CASE | DEFAULT_POLICY, MODEL_CALL |
| Private internals | _ prefix | _prerequisites, _scan_deps |
| Type aliases | PascalCase | HookCallback, TaskType |
Docstrings
Use Google style. Required for all public classes and functions._) or test functions.
Comments
Add comments only where the logic is not self-evident from the code. Do not add comments to code you did not change. Prefer renaming variables or extracting functions over writing explanatory comments.String formatting
Use f-strings for interpolation. Use explicitstr.format() only when the template is defined separately from its arguments.

