python-stylelisted
Install: claude install-skill wntic/pyhouse
# Python Style
Project-wide rules that are stricter than CPython's defaults and hold **whatever the architecture is** —
a hexagonal app, a flat-layered worker, or a standalone script. Two subjects: what the types look like,
and where a comment is warranted.
## When to use vs. neighbours
- Writing or changing any annotation, or any comment → this skill.
- Any log call, event name or logging configuration → `python-logging`.
- One class per module, `__all__`, the `__init__.py` re-export contract, import forms →
`python-packaging`.
- Deriving a concrete class or module name → `naming`; deriving a concrete artifact *path* in a
hexagonal project → `hex-conventions`, in the `pyhouse-hex` plugin.
- The exception classes themselves → `exception-catalog`.
- Where a module lives and what may import it → `hex-architecture` (in the `pyhouse-hex` plugin) or
`flat-layered` (in `pyhouse-flat`), whichever style the project uses.
- The shape of a specific artifact → its own skill. This skill is consulted **alongside** them.
## Typing
### `X | None`, not `Optional[X]`
```python
# yes
name: str | None = None
def find(id: UUID) -> Foo | None: ...
# no
from typing import Optional
name: Optional[str] = None
```
PEP 604 union syntax is the default. `Union[A, B]` is equally banned — write `A | B`. This holds
everywhere, validation models included.
### Never `from __future__ import annotations`
Do not add this import to any module. Projects in this style rely on **runtime annotati