python-backend

python-backend is a skill for Claude Code from yonatangross/orchestkit. It costs 47 tokens per session (2,641 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 — 83 skills, 39 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 83 skills, 39 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 47 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,641 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.00047 $0.02641
Opus 5.5 $0.00019 $0.01056
Sonnet 5.5 $0.00009 $0.00528
Haiku 4.5 $0.00005 $0.00264

Measured 1mo ago against content hash a799c12d30d7, 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 1mo 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. 1mo ago Changed · -35 tokens per session a799c12d30d7
  2. 1mo ago Changed · -1 lines 04fbcbed9578
  3. 2mo ago Changed 834b7de8f585
  4. 2mo ago Changed · -5 lines 0ca28fa1fd3b
  5. 2mo ago Changed · -1 lines 43c651f97c42
  6. 2mo ago Changed 00909f818f71
  7. 3mo 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 (313 stars, last pushed yesterday), licensed MIT. It adds 47 tokens to every session and 2,641 once invoked, about $0.0002 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

python-backend compared with skills from other repositories

python-backend next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
python-backendyonatangross/orchestkitSkill313yesterdayMITA47Claude Code
django-6-upgrade-guidebtfranklin/skillsSkill62d agoMITA49Codex
pn-python-scaffoldingperniemann/pnCoreSkill03d agoMITA51Cursor
langgraph-docslangchain-ai/deepagentsSkill32ktodayMITA62Claude Code, Codex
azure-messaging-webpubsubservice-pymicrosoft/skillsSkill3.3kyesterdayMITA64Claude Code
azure-mgmt-apicenter-pymicrosoft/skillsSkill3.3kyesterdayMITA59Claude Code
python-engineering-guidelinesanywhere-labs/Agents-AnywhereSkill3.9kyesterdayApache-2.0A75Codex