From Python Programming Expert
Expert Python: Pythonic code, typing, async, the standard library, and performance. Trigger keywords: Python, PEP 8, type hints, mypy, asyncio, generator, decorator, context manager, dataclass, pytest, pandas, numpy, packaging, uv, GIL, profiling. Use for writing/refactoring Python, fixing bugs, performance, or library/tooling guidance.
How this skill is triggered — by the user, by Claude, or both
Slash command
/python-expert:python-expertThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Write code that reads like the problem. Lean on the stdlib, type the boundaries, handle specific exceptions, and measure before optimizing. There's usually one obvious, Pythonic way — find it.
Write code that reads like the problem. Lean on the stdlib, type the boundaries, handle specific exceptions, and measure before optimizing. There's usually one obvious, Pythonic way — find it.
competitive-programming-expert.software-architect.deep-learning-expert.ruff format/black) + linter (ruff). Comprehensions, generators, enumerate/zip, pathlib, f-strings.mypy/pyright strict for libraries. Use dataclasses/pydantic for structured data; enum/Literal for fixed sets.except:. Re-raise with context (raise X from e). EAFP (try/except) over LBYL where it reads cleaner.with); don't hand-close files/locks. Prefer pure functions and immutability where practical.collections (Counter, defaultdict, deque), itertools, functools (lru_cache, cached_property), contextlib, pathlib, datetime/zoneinfo. Reach for a dependency only when the stdlib falls short.uv (or Poetry) for envs/deps, pytest for tests, ruff for lint/format.timeit, cProfile, py-spy). Use set/dict for O(1) membership; pick the right container.asyncio for high-concurrency I/O, threads for blocking I/O calls, multiprocessing (or vectorized numpy) for CPU-bound work. (Free-threaded 3.13+ is changing this — know your runtime.)def f(x=[])) → shared across calls; use None + assign inside.except: → swallows KeyboardInterrupt/bugs; catch specific types.== vs is → is only for None/singletons, not value equality.functools.partial.join/generators.from module import * and deep relative imports → explicit imports.Idiomatic, typed, safe
from __future__ import annotations
from collections import Counter
from collections.abc import Iterable
def top_words(words: Iterable[str], n: int = 3) -> list[tuple[str, int]]:
"""Return the n most common non-empty words, case-insensitively."""
return Counter(w.casefold() for w in words if w).most_common(n)
Async I/O with bounded concurrency
import asyncio, httpx
async def fetch_all(urls: list[str], limit: int = 10) -> list[str]:
sem = asyncio.Semaphore(limit)
async with httpx.AsyncClient(timeout=10) as client:
async def one(u: str) -> str:
async with sem:
r = await client.get(u); r.raise_for_status()
return r.text
return await asyncio.gather(*(one(u) for u in urls))
competitive-programming-expert — algorithmic Python + fast I/O.deep-learning-expert — PyTorch/NumPy on Python fundamentals.testing-expert — pytest, fixtures, fakes. performance-expert — profiling.rules/python-style-guide.md — enforceable style rules.Provides UI/UX resources: 50+ styles, color palettes, font pairings, guidelines, charts for web/mobile across React, Next.js, Vue, Svelte, Tailwind, React Native, Flutter. Aids planning, building, reviewing interfaces.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
npx claudepluginhub miaoge-ge/coding-agent-skills --plugin python-expert