python-engineeringlisted
Install: claude install-skill grimaldost/craft-collection
# Modern Python Engineering Standards
Apply these standards whenever scaffolding, advising on, or generating Python code
and configuration.
---
## Core Philosophy
1. **Ecosystem-First**: Before writing custom logic, evaluate standardized
solutions. Custom scripts are liabilities; community tools are assets.
2. **Fail Fast**: Catch errors at startup (typed config) and at commit time
(pre-commit hooks), not in production.
3. **src layout is mandatory** — never flat layout for production projects.
4. **Single quotes** for code literals; **double quotes** for docstrings.
5. **Never suggest `pip`, `poetry`, or `virtualenv`** — always `uv`.
6. **Astral-first toolchain**: prefer `uv` + `ruff` + `ty` for the unified,
high-performance developer experience.
7. **Protocol-first typing**: prefer `typing.Protocol` (structural subtyping)
over ABCs for interfaces. Reserve ABCs for shared implementation only.
8. **Async for I/O-bound services**: reach for `async`/`await` on web services and
I/O-bound code — not CPU-bound work or one-shot scripts. Use `asyncio.TaskGroup`
over `asyncio.gather()`.
9. **Observable when it runs as a service**: for anything long-running, logging
alone is insufficient — instrument with OpenTelemetry traces, metrics, and
correlated structured logs. Right-size it; a CLI or one-off script doesn't need
distributed tracing.
10. **Secure the supply chain**: pin dependencies with hashes, audit for CVEs
in CI, use Trusted Publishers for P