python-backend-skill

python-backend-skill is a skill for Claude Code, Codex from darellchua2/opencode-config-template. It costs 34 tokens per session (1,001 once invoked), scanned A, original, Apache-2.0.

A guide to structuring Python backend applications built with FastAPI, Django, or Flask, including configuration, dependencies, and testing setup.

In plain words
What is it for?
Use it to start or reorganize a Python API or web backend, configure environment-based settings, add dependency injection, set up project checks, or investigate SQLAlchemy session errors.
Why use it?
It gives a new or disorganized backend a consistent structure and helps keep settings, dependencies, and application startup manageable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions OpenCode.

Good fit Use it to start or reorganize a Python API or web backend, configure environment-based settings, add dependency injection, set up project checks, or investigate SQLAlchemy session errors.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/darellchua2/opencode-config-template/python-backend-skill
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 darellchua2/opencode-config-template --skill python-backend-skill
Clone the repo
git clone --depth 1 https://github.com/darellchua2/opencode-config-template

Made for: Claude Code, Codex.

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-skill

README.md
[![agentmods](https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/python-backend-skill/github.svg)](https://agentmods.dev/skills/darellchua2/opencode-config-template/python-backend-skill)
Your own site
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/python-backend-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/python-backend-skill/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-skill

Your own site · 80×15
<a href="https://agentmods.dev/skills/darellchua2/opencode-config-template/python-backend-skill"><img src="https://agentmods.dev/badge/skills/darellchua2/opencode-config-template/python-backend-skill.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 34 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,001 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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: 6 findings, 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 142
    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.
  • high Privilege Escalation · line 187
    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.
  • medium Rogue Agent · line 464
    Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
    Fix: Remove any persistence mechanisms (cron jobs, startup scripts, state files). Skills should not maintain state across sessions without explicit user consent.
  • medium Data Exfiltration · line 744
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 748
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
  • medium Data Exfiltration · line 752
    Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
    Fix: Verify the destination URL is trusted and necessary. Remove or replace with documented APIs. Ensure no secrets, tokens, or PII are transmitted.
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.00034 $0.01001
Opus 5.5 $0.00014 $0.00400
Sonnet 5.5 $0.00007 $0.00200
Haiku 4.5 $0.00003 $0.00100

Measured 2mo ago against content hash 13e5c5627a14, 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-skill scanned grade A with 0 findings 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 2mo ago.

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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/python-backend-skill/SKILL.md · 48 lines

How it starts

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

What I do

Scaffold Python backends: framework choice (FastAPI/Django/Flask), project layout, pyproject.toml standard, env-based config (pydantic-settings), DI, SQLAlchemy session discipline, migration gotchas, SSE durability, OpenCode LSP wiring.

When to use me

New/restructured Python backend; production patterns for FastAPI/Django/Flask; detached-instance or SSE bugs.

Related: python-pytest-creator-skill (tests) · python-ruff-linter-skill (lint) · database-migration-skill (full migration workflows — this file keeps only gotchas) · nextjs-standard-setup-skill (JS equivalent).

House standards

pyproject.toml (FastAPI baseline): requires-python = ">=3.12"; deps fastapi>=0.110.0, uvicorn[standard]>=0.27.0, sqlalchemy[asyncio]>=2.0.0, asyncpg>=0.29.0, pydantic-settings>=2.1.0, alembic>=1.13.0; dev extras pytest>=8, pytest-asyncio>=0.23, pytest-cov, httpx, ruff>=0.2, mypy>=1.8. Ruff: target-version py312, line-length 120, select E,F,I,N,UP,B,SIM,C4; pytest asyncio_mode = "auto"; mypy strict = true + pydantic.mypy plugin.

OpenCode LSP (project-level): root opencode.json with "lsp": {"pyright": {}} — ambient cross-module type diagnostics during edits (pyright in dev deps, >=1.1.350); ruff/mypy remain the CI gate, pyright is the ambient feed. Project-level only for code repos; check into git.

Hard rules (each was a production incident):

  • Detached ORM across sessions — never fetch in one session and commit in another; one session per read-modify-write (async with session.begin()). Mocks mask this bug.
  • Pydantic on JSONB — never assign a BaseModel to a JSONB column; model_dump() first (a miss here took out all 47 node registrations).
  • Alembic bulk_insert + asyncpg JSONB — pass native dicts, never json.dumps() strings.
  • asyncio.Queue as sole SSE event store — events vanish on reconnect/multi-worker; DB (or Redis) is the store, queue is delivery, replay via Last-Event-ID.

Read the full file on GitHub · 48 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. 2mo ago Changed · -924 lines 13e5c5627a14
  2. 3mo ago First seen · 972 lines · 34 tokens per session scan A 9eb43aa93f77

Subscribe to this mod's changes

python-backend-skill is a skill published in the GitHub repository darellchua2/opencode-config-template (6 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 34 tokens to every session and 1,001 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

python-backend-skill compared with skills from other repositories

python-backend-skill next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
python-backend-skilldarellchua2/opencode-config-templateSkill62mo agoApache-2.0A34Claude Code, Codex
fastapi-patternsaffaan-m/ECCSkill317k4d agoMITA35Claude Code, Kiro
stripe-projectse2b-dev/E2BSkill15kyesterdayApache-2.0A51Claude Code, Codex
azure-mgmt-botservice-pymicrosoft/skillsSkill3.3kyesterdayMITA59Claude Code
azure-messaging-webpubsubservice-pymicrosoft/skillsSkill3.3kyesterdayMITA64Claude Code
azure-appconfiguration-pybenjaminasterA/antigravity-awesome-skillsSkill528yesterdayMITA0Claude Code, Codex
azure-messaging-webpubsubservice-pybenjaminasterA/antigravity-awesome-skillsSkill528yesterdayMITA0Claude Code, Codex