Idiomatic Python 3.12+ development. Use when writing Python code, CLI tools, scripts, or services. Emphasizes stdlib, type hints, uv/ruff/pyright toolchain, and minimal dependencies.
From python-devnpx claudepluginhub alexei-led/cc-thingz --plugin python-devThis skill is limited to using the following tools:
CLI.mdPATTERNS.mdTESTING.mdSearches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
Stdlib and Mature Libraries First
Type Hints Everywhere (No Any)
X | Y union syntax (3.10+), PEP 695 generics (3.12+)Protocol Over ABC
Flat Control Flow
Explicit Error Handling
except Exception)Structured Logging
structlog for structured, contextualized loggingprint() for operational outputfrom typing import Protocol
class UserStore(Protocol):
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
# NEW: type parameter syntax (no TypeVar boilerplate)
def first[T](items: list[T]) -> T | None:
return items[0] if items else None
type Vector = list[float] # type alias statement
from dataclasses import dataclass
@dataclass(frozen=True, slots=True)
class StatusUpdate:
raw_text: str
display_label: str
is_interactive: bool = False
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
import structlog
logger = structlog.get_logger()
logger.info("processing_started", user_id=user.id, count=len(items))
logger.error("operation_failed", error=str(e), context=ctx)
class NotFoundError(AppError):
def __init__(self, resource: str, id: str):
self.resource = resource
self.id = id
super().__init__(f"{resource} not found: {id}")
# Exception chaining
raise ProcessingError("failed") from original_error
def first[T](lst: list[T]) -> T (no TypeVar)from __future__ import annotations neededt"Hello {name}" returns Template (safe interpolation)except ValueError, TypeError: (PEP 758)uv sync # Install deps from pyproject.toml
uv add pkg # Add dependency
uv run python script.py # Run in project env
uv run --with pkg python script.py # Run with one-off dep
uv run --extra dev pytest -v # Run tests (dev group)
ruff check --fix . # Lint and autofix
ruff format . # Format
pyright src/ # Type check (preferred)
deptry src # Dependency check
make fmt # ruff format
make lint # ruff check
make typecheck # pyright
make deptry # dependency check
make test # unit tests only
make check # fmt + lint + typecheck + deptry + test
After generating code, always verify it passes checks:
ruff check . && ruff format --check . && pyright