| name | python-quality-and-cli |
| description | Use when writing or reviewing Python (scripts, services, tests): stdlib CLI patterns, logging, typing, Ruff/Mypy alignment, and safe defaults. Use for cross-org guidance; Engineering owns product code patterns in [PRODUCT_CODE_ROOT]/. |
Python quality & CLI (HQ + cross-org)
When to use
- HQ agents reference Engineering deliverables or Python examples in
[YOUR_PLANS_DIR]/.
- Any agent is asked to author, refactor, or critique Python snippets, CLIs, or small tools.
- Code review language for handoffs to Engineering (“please align with…”).
Canonical references
[PRODUCT_CODE_ROOT]/docs/engineering/PYTHON_LAW_v1.md (product repo) — locked layers, contracts, scripts, tooling, learn-as-you-go.
shared_context/python_agent_coding_hygiene_v1.md — supplementary habits + external link map.
Engineering: [PRODUCT_CODE_ROOT]/pyproject.toml (Ruff, Mypy) and .cursor/rules/method-python-law.mdc when editing Python in Cursor.
Minimum checklist (before saying “done”)
- CLI:
argparse (or repo-standard Typer/Click) — working --help, sensible exit codes, early validation.
- No secrets in source; use env/config patterns consistent with repo.
pathlib + encoding="utf-8" for text files when applicable.
logging in library/service code; avoid debug print in shared modules.
- Tests for new behavior (pytest) when touching
[PRODUCT_CODE_ROOT]/ — Engineering executes.
- Ruff / Mypy clean per
pyproject.toml when changes land in product repo.
Founder links — how to cite them
- dl-books → DL book literacy, not coding standard.
- GitHub python-ai topic → discover projects; verify against official docs before adopting.
- TensorFlow.org → only if TensorFlow is in scope for that task.
Handoff phrase (HQ → Engineering)
Python changes must comply with [PRODUCT_CODE_ROOT]/docs/engineering/PYTHON_LAW_v1.md, [PRODUCT_CODE_ROOT]/pyproject.toml, and shared_context/python_agent_coding_hygiene_v1.md as supplementary.