Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Python Backend Skill

ASecurity

Scaffold Python backend projects — FastAPI/Django/Flask layout, dependency injection, config, virtual environments, pyproject.toml.

6 stars
0 votes
0 copies
0 views
Added 9/20/2026
developmentpythongosqlnextjsnodefastapidjangoflaskgitapi

Works with

api

Security Analysis

A100/100

Scanned 9/20/2026

Install to Claude Code

$npx -y skills add darellchua2/opencode-config-template --skill python-backend-skill --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Backend Skill?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Python Backend Skill
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/darellchua2-python-backend-skill/badge)](https://www.skillsdirectory.com/skills/darellchua2-python-backend-skill)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: python-backend-skill
description: >-
  Scaffold Python backend projects — FastAPI/Django/Flask layout, dependency
  injection, config, virtual environments, pyproject.toml.
license: Apache-2.0
compatibility: opencode
category: Language-Specific
---

## 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`.

## House Learnings

### Learning: `inline-http-header-parsing-in-handlers`
Same 3-line `Location`-header resource-ID extraction repeated across 2+ handlers drifts (each variant handles missing headers differently) — extract one module-level `extract_resource_id(headers)` helper.
Detection: `rg 'headers\.get\(["\']Location' --type py -c | rg '[2-9]|[1-9][0-9]+'`

### Learning: `duplicated-response-parsing-in-llm-nodes`
Identical LLM response-parsing (JSON-in-text + regex fallback + error wrappers) copied across LangChain/LangGraph nodes: a fix lands in one node and misses the rest. Extract a mixin/base parser when 2+ nodes need it.
Detection: `rg 'json\.loads.*result|re\.search.*text' --type py -c | rg '[2-9]|[1-9][0-9]+'`

### Learning: `duplicate-service-account-check`
Any method crossing a process boundary (network/DB/file/subprocess) is called at most ONCE per function — bind to a local on first call, reuse thereafter.
Detection: `rg '(\w+\.\w+\([^)]*\))' --type py | sort | uniq -c | sort -rn | head -20`

> Removed 2026-09: full FastAPI/Django/Flask directory trees, scaffolding step-by-steps, venv management walkthroughs, DI/factory code examples, extended SSE code listings — framework conventions the model knows; kept the pinned pyproject standard, the LSP wiring, the four incident rules, and the three codified learnings.

Attribution

darellchua2darellchua2
View sourceMore from darellchua2 →
SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Your tool, in front of Claude Code builders.

3 founder slots · $299/mo · GSC-verified traffic · sponsors can never buy grades.

See placements

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

281612 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2132 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →