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.
.claude/skills/gali-leilei-write-python/SKILL.md| 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
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | fail→fail | 10,295 | 11,240 | +9% | 1 | 1 | 0% | 1,989 | 3,555 | +79% | 0 | 0 | — |
case-01 | fail→pass | 18,077 | 17,273 | -4% | 1 | 1 | 0% | 4,236 | 5,295 | +25% | 0 | 0 | — |
case-02 | fail→pass | 14,470 | 25,630 | +77% | 1 | 1 | 0% | 3,018 | 7,244 | +140% | 0 | 0 | — |
case-03 | fail→pass | 16,688 | 19,003 | +14% | 1 | 1 | 0% | 3,645 | 5,213 | +43% | 0 | 0 | — |
case-04 | pass→pass | 9,580 | 7,078 | -26% | 1 | 1 | 0% | 1,926 | 2,621 | +36% | 0 | 0 | — |
case-05 | pass→pass | 5,537 | 4,014 | -28% | 1 | 1 | 0% | 1,113 | 2,028 | +82% | 0 | 0 | — |
case-06 | pass→pass | 14,340 | 14,301 | -0% | 1 | 1 | 0% | 3,055 | 3,848 | +26% | 0 | 0 | — |
case-07 | fail→pass | 6,865 | 8,444 | +23% | 1 | 1 | 0% | 1,329 | 2,863 | +115% | 0 | 0 | — |
case-09 | fail→pass | 5,242 | 4,294 | -18% | 1 | 1 | 0% | 1,059 | 1,992 | +88% | 0 | 0 | — |
case-10 | pass→pass | 5,935 | 5,266 | -11% | 1 | 1 | 0% | 1,206 | 2,234 | +85% | 0 | 0 | — |
case-11 | fail→pass | 11,195 | 7,896 | -29% | 1 | 1 | 0% | 2,250 | 2,855 | +27% | 0 | 0 | — |
case-12 | pass→pass | 5,540 | 9,534 | +72% | 1 | 1 | 0% | 1,154 | 3,174 | +175% | 0 | 0 | — |
case-13 | fail→pass | 9,302 | 8,519 | -8% | 1 | 1 | 0% | 1,884 | 2,990 | +59% | 0 | 0 | — |
case-14 | fail→pass | 11,297 | 7,748 | -31% | 1 | 1 | 0% | 2,283 | 2,873 | +26% | 0 | 0 | — |
case-15 | fail→pass | 8,267 | 5,369 | -35% | 1 | 1 | 0% | 1,749 | 2,208 | +26% | 0 | 0 | — |
case-16 | fail→pass | 9,041 | 8,661 | -4% | 1 | 1 | 0% | 1,888 | 2,949 | +56% | 0 | 0 | — |
case-17 | pass→pass | 7,854 | 1,775 | -77% | 1 | 1 | 0% | 1,535 | 1,447 | -6% | 0 | 0 | — |
case-18 | fail→pass | 15,560 | 13,336 | -14% | 1 | 1 | 0% | 3,102 | 3,532 | +14% | 0 | 0 | — |
case-19 | fail→pass | 11,524 | 6,945 | -40% | 1 | 1 | 0% | 2,240 | 2,575 | +15% | 0 | 0 | — |
case-20 | pass→pass | 12,168 | 11,500 | -5% | 1 | 1 | 0% | 2,338 | 2,996 | +28% | 0 | 0 | — |
case-21 | fail→pass | 7,427 | 7,491 | +1% | 1 | 1 | 0% | 1,442 | 2,679 | +86% | 0 | 0 | — |
case-22 | pass→pass | 10,380 | 16,159 | +56% | 1 | 1 | 0% | 2,212 | 4,760 | +115% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +59 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.