Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Write idiomatic and modern (3.14+) python code. Use when writing Python code, CLI tools, scripts, or services. Emphasizes stdlib, type hints, uv/ruff toolchain, and minimal dependencies.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 140% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 43% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 115% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 88% | 0% |
Any — use concrete types or genericsdict over Dict, list over List.Union, Optinal, Generic.dataclasses over attrs and pydanticpathlib over os.pathurlib3 over requestsuv/ruff over pip/venvdataclasses over def __init__(self, ...)setattr, getattr, importlibif len(arr) == 0 over if arrTypedDict over dict if passing dictionary aroundProtocol over ABCpythonfrom typing import Protocol # Protocol at consumer (like Go interfaces) class UserStore(Protocol): uuid: str def get(self, id: str) -> User | None: ... def save(self, user: User) -> None: ... class UserService: def __init__(self, store: UserStore): self.store = store # accepts any matching impl
python# GOOD: guard clauses, early returns def process(user: User | None) -> Result: if user is None: raise ValueError("user required") if not user.email: raise ValueError("email required") if not is_valid_email(user.email): raise ValueError("invalid email") return do_work(user) # happy path at end # BAD: nested conditions def process(user: User | None) -> Result: if user is not None: if user.email: if is_valid_email(user.email): return do_work(user) raise ValueError("invalid")
python# Flatten complex conditionals with match match event: case {"type": "click", "x": x, "y": y}: handle_click(x, y) case {"type": "key", "code": code}: handle_key(code) case _: raise ValueError(f"Unknown event: {event}")
python# GOOD: concrete types def process_users(users: list[User], limit: int | None = None) -> list[Result]: ... # GOOD: generics when needed def first[T](items: list[T]) -> T | None: return items[0] if items else None # BAD: unnecessary Any def process(data: Any) -> Any: # Don't do this ...
python# except without parens (3.14) except ValueError | TypeError: handle_error() # Custom exceptions class NotFoundError(AppError): def __init__(self, resource: str, id: str): self.resource = resource self.id = id super().__init__(f"{resource} not found: {id}")
from __future__ import annotationst"Hello {name}" returns Templateexcept ValueError | TypeError:bashuv sync # Install deps ruff check --fix . # Lint and autofix ruff format . # Format pytest -v # Test mypy . # Type check
Other measured skills in the registry, with their headline benchmark lift.