/sota-skills:sota-pythonfrom SOTA Engineering Skills
State-of-the-art Python engineering for writing and auditing Python code: uv tooling, strict typing, asyncio concurrency, security, performance, and FastAPI/Django/pytest practice.
Ships in SOTA Engineering Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill encodes the 2026 state of the art for Python: modern toolchain (uv + ruff + one strict type checker), Python ≥3.12 idioms, structured async, security-by-default, and measured performance work. It serves two modes:
The detailed rules live in rules/*.md. Read SKILL.md fully; load rules files on demand per
the index table below. When in doubt between two rules files, the index's "read when" column
decides.
When creating or modifying Python code:
pyproject.toml, uv.lock, .python-version, ruff
config, and the type checker in use. Match the project's floor (e.g., no type aliases
on a 3.10 project). For a new project, scaffold per rules/01: uv init, src/ layout,
ruff with the standard select, strict checker, pre-commit.ruff check --fix + ruff format before presenting code, full annotations on everything public, pydantic v2 at
trust boundaries, frozen+slots dataclasses inside, pathlib, logging with lazy %
formatting.create_task.secrets for tokens, safe extraction, no pickle/eval on external data.ruff check, the project's type checker, and the
test suite via uv run. Code that doesn't pass these is not done.Coverage: every rules/ file's Audit checklist applies in AUDIT mode. Mark one not applicable only with its reason in the report — never skip a file because the thing it checks for is absent, since that absence may be the finding.
When reviewing existing Python code:
uvx ruff check --select F,B,S,ASYNC,DTZ,E722,BLE --statistics . for a heat map, then
uvx bandit -r src/ -ll and a pip-audit of the project's lock for security baselines —
uv export --format requirements-txt --no-emit-project | uvx pip-audit --disable-pip -r /dev/stdin
(bare uvx pip-audit audits its own tool venv and exits 0 on any project; a project with
no third-party dependencies makes this pipe exit 1 — rules/08 §1 has the counted form).pickle.loads of a file
the same process wrote with HMAC verification is not a CRITICAL). No finding ships on grep
output alone. Note mitigations that are already present.| Severity | Meaning | Examples |
|---|---|---|
| CRITICAL | Exploitable now, or data loss/corruption | SQL injection, pickle.loads/eval on untrusted input, shell=True with user data, auth bypass |
| HIGH | Exploitable with preconditions, or production-breaking bug | path traversal, unsafe extractall, random for tokens, swallowed CancelledError, blocking call in async hot path, bare except: pass around critical logic, verify=False |
| MEDIUM | Correctness/maintenance risk, degraded ops | mutable default args, fire-and-forget tasks, unbounded @cache on user input, N+1 queries, missing lockfile in an app, no type checker in CI, edited applied migrations |
| LOW | Deviation from SOTA, friction, future risk | legacy typing forms, os.path usage, f-strings in log calls, flat layout in a library, bare # type: ignore |
| INFO | Worth knowing, no action forced | tooling consolidation opportunities, 3.13/3.14 features available after floor bump |
Confidence accompanies severity: confirmed (you traced the data flow) vs suspected (pattern present, flow not fully traced — say what would confirm it).
Expands the router's canonical row (file:line | rule | severity | effort | fix, which wins on a
cross-domain roll-up); evidence block and report order: sota rules/03 §2 and §5.
[SEVERITY/confidence] short title
File: src/pkg/module.py:42 (absolute path in final report)
Issue: what is wrong, in one or two sentences, with the data-flow if security-relevant
Evidence: the offending line(s), quoted
Fix: concrete change — code snippet or exact rule reference (rules/05 §2)
Effort: trivial | small | medium | large
Group findings by severity, CRITICAL first. End with: counts per severity, the mechanical sweep commands you ran, and explicit "checked and clean" areas (so absence of findings is information, not omission).
| File | Read this when... |
|---|---|
rules/01-tooling-project-setup.md | starting/scaffolding a project; reviewing pyproject/uv/ruff/CI setup; choosing type checker; questions about uv lockfiles, pylock.toml (PEP 751) exports for non-uv tools, PEP 723 scripts, src/ layout, 3.12–3.14 features, free-threading; what 3.12/3.13 REMOVED (PEP 594, distutils, imp, lib2to3) before a floor bump; suppressions that expire (noqa/type: ignore with a rule and a reason), test-path lint exemptions, uv sync --frozen vs --locked |
rules/02-typing-correctness.md | annotating APIs; choosing TypedDict vs dataclass vs pydantic; Protocol vs ABC; generics/Self/ParamSpec; Any leaks; in-band sentinels (-1 for absent) — the defect int | None exists to prevent, invisible to the type checker; assert_never exhaustiveness; where runtime validation belongs |
rules/03-idioms-pitfalls.md | any general Python code; mutable defaults, closures, comprehensions, context managers, pathlib, EAFP, dataclass/enum patterns, itertools/functools; designing exceptions; what no except catches (C-extension crash, SIGKILL) and json.loads depth; logging setup; the public API surface (__all__, keyword-only parameters, __slots__, deprecation) |
rules/04-async.md | any async def in sight: TaskGroup vs gather, blocking-the-loop, fire-and-forget, timeouts/cancellation, async generators, anyio, sync-ORM-in-async bugs; per-request ContextVar/thread-local state reset in finally |
rules/05-security.md | auditing for vulnerabilities; handling untrusted input; subprocess/SQL/paths/archives/secrets; pickle/eval/yaml and reflection by name (import_module, getattr); SSRF/XML (dependency auditing, supply chain, adopting a new dependency and the insecure defaults of the libraries you call moved to rules/08); temp-file and permission hygiene; where crypto is owned; remote-host trust; debug consoles, debug switches and dev servers (runserver, flask run, --reload) in production; 3.14 t-string (Template) consumers that render values raw; remote debugger attach (PEP 768) and its switches; escape hatches into raw memory: ctypes/cffi and C extensions |
rules/06-performance.md | anything slow: profiling tool choice, hot-loop suspects, numpy/polars vectorization, functools caching caveats, threads vs processes vs asyncio, lazy imports/startup |
rules/07-frameworks-testing.md | FastAPI (DI, boundary models, sync-in-async), Django (N+1, select_related, migrations), cookies the app sets (set_cookie defaults: Secure/HttpOnly off), pytest (fixtures, parametrize, independence, hypothesis, CrossHair), -X dev in CI for ctypes/cffi/C-extension code. Test strategy — suite shape, TDD, doubles, test data, flake policy — lives in sota-testing; load it for any build that writes logic. This file owns Python runner mechanics only. |
rules/08-supply-chain.md | Adding or auditing dependencies: lockfiles and hashes (pip-audit on a project with no dependencies exits 1 — the counted form), typosquats and adoption checks, code that runs at install time, publishing credentials and provenance, static-analysis gates (formerly rules/05 sections 9–10, now §1–§2) |
--locked. No unlocked pip install in
pipelines or images. (rules/01)Any leaking
across module boundaries. (rules/02)extra="forbid") where data
enters; typed dataclasses within. Never pass raw parsed JSON deep into the core. (rules/02)eval/exec/pickle.loads/yaml.load on data you don't fully control.
(rules/05)shell=False, --
before user args. (rules/05)except:; no except Exception: pass; chain with raise ... from e;
except Exception only at top-level boundaries with logger.exception. (rules/03)to_thread/process pool instead); asyncio.timeout on every external await;
re-raise CancelledError. (rules/04)pathlib +
explicit encoding="utf-8". (rules/03)secrets (never random) for anything security-relevant; compare_digest for
secret comparison; no hardcoded credentials; no verify=False. (rules/05)rules/01-tooling-project-setup.md (opens in a new tab)rules/02-typing-correctness.md (opens in a new tab)rules/03-idioms-pitfalls.md (opens in a new tab)rules/04-async.md (opens in a new tab)rules/05-security.md (opens in a new tab)rules/06-performance.md (opens in a new tab)rules/07-frameworks-testing.md (opens in a new tab)rules/08-supply-chain.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
python-best-practices, code-audit, uv, strict-typing, asyncio
npx claudepluginhub martinholovsky/sota-skills --plugin sota-skills43 skills in this plugin
/sotaMaster router for the SOTA engineering skills library. Use this skill whenever the user asks to build, design, implement, refactor, harden, optimize, review, or audit an application, service, or codebase and the request spans more than one domain — or when you are unsure which specific sota-* skill applies. Also use when working on a codebase you do not own: reviewing a pull request or diff, responding to code review, evaluating someone else's patch, or preparing an upstream contribution — including mid-session, once you are already reading source, a diff, or CI config. It maps the task (build or audit mode) to the right domain and language skills (Rust, Go, C/C++, JVM, Python, JS/TS, .NET/C#, PHP, Ruby, Swift). Trigger keywords: SOTA, best practices, audit my code, security review, compliance, hardening, prod readiness, code quality, pull request, PR review, review comment, maintainer feedback, patch, diff, upstream, contribute, merge request./sota-api-designState-of-the-art API design and audit guidance (2026) covering REST/HTTP, GraphQL, gRPC, WebSockets/SSE/realtime, webhooks, versioning/evolution, and API security/operations. Use when designing or building any API surface (endpoints, schemas, protos, realtime channels, webhook senders/receivers) AND when auditing/reviewing existing APIs for correctness, evolvability, security, and operational robustness. Not for browser UI, rendering, or client-framework concerns — use sota-web-frameworks or sota-frontend-design. Trigger keywords: API, REST, GraphQL, gRPC, endpoint, websocket, SSE, realtime, WebRTC, webhook, versioning, OpenAPI, pagination, idempotency, rate limit, problem+json, protobuf, deprecation./sota-architectureState-of-the-art software and system architecture rules (2026) for both building and auditing. Use when designing, building, refactoring, or extending system architecture — boundaries, DDD, hexagonal/clean architecture, event-driven design, CQRS, sagas, messaging, caching, sharding, multi-tenancy, resilience, scalability, 12-factor/cloud-native — AND when auditing existing architecture for quality (design review, anti-patterns like distributed monolith or shared database, reliability/scalability assessment). Trigger keywords: architecture, system design, microservices, monolith, serverless, bounded context, DDD, aggregate, hexagonal, clean architecture, event-driven, Kafka, NATS, JetStream, messaging, pub/sub, stream, consumer, queue, saga, outbox, idempotency, CQRS, resilience, circuit breaker, retry, timeout, backpressure, caching, sharding, partitioning, multi-tenant, 12-factor, cloud-native, feature flag, ADR, scalability, anti-pattern, design review, architecture audit./sota-async-concurrencyState-of-the-art rules for writing and auditing asynchronous and concurrent code across runtimes (Python asyncio, JS/Node, Go, Rust, JVM). Use when building anything with async/await, threads, processes, event loops, task groups, channels, or queues — and when auditing existing code for race conditions, deadlocks, leaked tasks, blocked event loops, missing cancellation, or backpressure failures. Not for latency/throughput profiling and optimization — use sota-performance. Trigger keywords: async, await, concurrency, parallelism, threads, race condition, deadlock, event loop, channels, queues, semaphore, mutex, cancellation, timeout, backpressure, task group, goroutine, tokio, asyncio./sota-c-cppState-of-the-art C and C++ engineering rules that Claude applies when writing or auditing C/C++. Covers modern idioms (RAII, value semantics, smart pointers, C++23), memory safety (lifetimes, bounds, sanitizers, hardening flags), undefined behavior, security (SEI CERT C/C++, MISRA, integer/buffer/format-string, injection), concurrency (C/C++ memory model, atomics, data races), build/tooling/CI (CMake, clang-tidy, cppcheck, ASan/UBSan/TSan, vcpkg/Conan, supply chain), and performance. Trigger keywords - C, C++, RAII, smart pointer, unique_ptr, shared_ptr, undefined behavior, UB, buffer overflow, use-after-free, sanitizer, ASan, UBSan, TSan, valgrind, CMake, clang-tidy, cppcheck, MISRA, CERT C, memory safety, std::thread, atomics, std::move. Use for BOTH building C/C++ libraries/systems and reviewing or auditing them. Owns firmware's LANGUAGE layer; does NOT own its SYSTEMS layer — ISRs, DMA coherency, MMIO, RTOS scheduling, priority inversion, WCET, linker scripts — unowned library-wide./sota-cli-uxState-of-the-art CLI and developer-tool UX guidance (2026) covering command and flag design, output and interaction (stdout/stderr, --json, TTY detection, exit codes, prompts), runtime behavior and lifecycle (signals, dry-run, idempotency, XDG paths, completions, telemetry), and distribution (packaging, checksums, docs). Use when designing or building any command line tool, subcommand, TUI, or developer tool — in any framework (argparse, click, typer, clap, cobra, oclif, commander) — AND when auditing an existing CLI for usability, scriptability, and compatibility. Not for shell-script correctness or security — use sota-shell-scripting. Trigger keywords: CLI, command line tool, flags, subcommands, terminal output, TUI, developer tool, argparse, clap, cobra, exit code, shell completion, man page, stdin, stdout.2 plugins ship this exact skill · first indexed Oct 28, 2026
Other plugins' skills for the same job