coding-guidelines-python
Installation
SKILL.md
Python Coding Guidelines
Typing
Every function has parameter types and a return type. Use from __future__ import annotations
at the top of every file. Prefer X | None over Optional[X]. Use generics
where appropriate (list[str], dict[str, int]).
from __future__ import annotations
def transform(items: list[str], limit: int) -> list[str]:
return items[:limit]
Type checking — ty
Run ty before every commit. Zero errors is the bar — never suppress
a check to make a deadline. Fix the root cause.