python-backend

python-backend is a skill for Claude Code from yonatangross/orchestkit. It costs 82 tokens per session (2,675 once invoked), scanned A, original, MIT.

Production patterns for asynchronous Python services built with asyncio, FastAPI, and SQLAlchemy. It covers concurrent tasks, web-request dependencies and middleware, database sessions, errors, cancellation, and connection pools.

In plain words
What is it for?
Use it to build FastAPI services, manage async SQLAlchemy sessions and migrations, handle cancellation and grouped errors, and tune connection pools.
Why use it?
It helps prevent common failures in async services, such as unfinished tasks, incorrect rollback handling, or poorly managed database and HTTP connections.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

Part of the ork plugin — 111 skills, 38 commands, 36 agents, 32 hooks shipped together

Good fit Use it to build FastAPI services, manage async SQLAlchemy sessions and migrations, handle cancellation and grouped errors, and tune connection pools.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yonatangross/orchestkit/python-backend
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add yonatangross/orchestkit --skill python-backend
Clone the repo
git clone --depth 1 https://github.com/yonatangross/orchestkit

Made for: Claude Code.

Or install ork, the plugin that ships this one along with the rest of its 111 skills, 38 commands, 36 agents, 32 hooks.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for python-backend

README.md
[![agentmods](https://agentmods.dev/badge/skills/yonatangross/orchestkit/python-backend/github.svg)](https://agentmods.dev/skills/yonatangross/orchestkit/python-backend)
Your own site
<a href="https://agentmods.dev/skills/yonatangross/orchestkit/python-backend"><img src="https://agentmods.dev/badge/skills/yonatangross/orchestkit/python-backend/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for python-backend

Your own site · 80×15
<a href="https://agentmods.dev/skills/yonatangross/orchestkit/python-backend"><img src="https://agentmods.dev/badge/skills/yonatangross/orchestkit/python-backend.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,675 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 1 finding, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 119
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00082 $0.02675
Opus 5.5 $0.00033 $0.01070
Sonnet 5.5 $0.00016 $0.00535
Haiku 4.5 $0.00008 $0.00267

Measured 12d ago against content hash 04fbcbed9578, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

python-backend scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (assets/fastapi-app-template.py, scripts/async-service-template.py, scripts/pool-setup-template.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# NEVER block the event loop with sync calls (time.sleep, requests.get)
plugins/ork/skills/python-backend/SKILL.md · 206 lines

How it starts

The opening of the file, as written. The whole thing — 206 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Python Backend

Patterns for building production Python backends with asyncio, FastAPI, SQLAlchemy 2.0, and connection pooling. Each category has individual rule files in rules/ loaded on-demand.

Quick Reference

Category Rules Impact When to Use
Asyncio 3 HIGH TaskGroup, structured concurrency, cancellation handling
FastAPI 3 HIGH Dependencies, middleware, background tasks
SQLAlchemy 3 HIGH Async sessions, relationships, migrations
Pooling 3 MEDIUM Database pools, HTTP sessions, tuning

Total: 12 rules across 4 categories. House decisions rescued from thinned files live in references/ork-delta.md; vendor material is linked, not restated (see Upstream coverage).

Quick Start

# FastAPI + SQLAlchemy async session
async def get_db() -> AsyncGenerator[AsyncSession, None]:
    async with async_session_factory() as session:
        try:
            yield session
            await session.commit()
        except Exception:
            await session.rollback()
            raise

# Reusable dependency alias (FastAPI's recommended Annotated form)
SessionDep = Annotated[AsyncSession, Depends(get_db)]

@router.get("/users/{user_id}")
async def get_user(user_id: UUID, db: SessionDep):
    result = await db.execute(select(User).where(User.id == user_id))
    return result.scalar_one_or_none()
# Asyncio TaskGroup with timeout
async def fetch_all(urls: list[str]) -> list[dict]:
    async with asyncio.timeout(30):
        async with asyncio.TaskGroup() as tg:
            tasks = [tg.create_task(fetch_url(url)) for url in urls]
    return [t.result() for t in tasks]

Asyncio

Modern Python asyncio patterns using structured concurrency, TaskGroup, and Python 3.11+ features.

Read the full file on GitHub · 206 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago Changed · -1 lines 04fbcbed9578
  2. 19d ago Changed 834b7de8f585
  3. 20d ago Changed · -5 lines 0ca28fa1fd3b
  4. 21d ago Changed · -1 lines 43c651f97c42
  5. 29d ago Changed 00909f818f71
  6. 1mo ago First seen · 213 lines · 82 tokens per session scan A 6377067e762a

Subscribe to this mod's changes

python-backend is a skill published in the GitHub repository yonatangross/orchestkit (297 stars, last pushed today), licensed MIT. It adds 82 tokens to every session and 2,675 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

Other skills, from other repositories

pn-python-scaffolding

Scaffolds new Python API projects (FastAPI, Flask, Django) or routes. Use when adding a new route/module; covers project layout, env/secrets, validation, error handling, and idiomatic Python patterns.

perniemann/pnCore · 51 tokens

django-6-upgrade-guide

Plan, audit, or complete an upgrade from Django 5.x to Django 6. Verify runtime and dependency compatibility, deprecations, settings, databases, migrations, tests, and deployment. Do not use for general Django work, earlier upgrades, frontend styles, or unrelated maintenance.

btfranklin/skills · 64 tokens

langgraph-docs

Fetches and references LangGraph Python documentation to build stateful agents, create multi-agent workflows, and implement human-in-the-loop patterns. Use when the user asks about LangGraph, graph agents, state machines, agent orchestration, LangGraph API, or needs LangGraph implementation guidance.

langchain-ai/deepagents · 62 tokens

azure-eventhub-py

Azure Event Hubs SDK for Python streaming. Use for high-throughput event ingestion, producers, consumers, and checkpointing. Triggers: "event hubs", "EventHubProducerClient", "EventHubConsumerClient", "streaming", "partitions".

microsoft/skills · 57 tokens

azure-mgmt-apicenter-py

Azure API Center Management SDK for Python. Use for managing API inventory, metadata, and governance across your organization. Triggers: "azure-mgmt-apicenter", "ApiCenterMgmtClient", "API Center", "API inventory", "API governance".

microsoft/skills · 59 tokens

azure-messaging-webpubsubservice-py

Azure Web PubSub Service SDK for Python. Use for real-time messaging, WebSocket connections, and pub/sub patterns. Triggers: "azure-messaging-webpubsubservice", "WebPubSubServiceClient", "real-time", "WebSocket", "pub/sub".

microsoft/skills · 64 tokens