python-backend-patterns

A guide for building and maintaining server-side Python services, including applications using FastAPI, Django, or Flask. Server-side code runs on a server and handles requests, data, and integrations.

In plain words
What is it for?
Use it when implementing, debugging, reviewing, or planning Python backend code and focused tests.
Why use it?
It helps developers trace how a change works through the application and account for the installed library versions.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/catwillgh/mainframe/python-backend-patterns
Any agent
npx skills add CATWILLgh/MAINFRAME --skill python-backend-patterns
Clone the repo
git clone --depth 1 https://github.com/CATWILLgh/MAINFRAME

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,260 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00042 $0.01260
Opus 5 $0.00021 $0.00630
Sonnet 5 $0.00008 $0.00252
Haiku 4.5 $0.00004 $0.00126

Measured yesterday against content hash 194cb424fe7f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

python-backend-patterns 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 yesterday.

The scan reads SKILL.md. This mod also ships 1 executable file (recon.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.

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.

adapters/claude-code/plugin/skills/python-backend-patterns/SKILL.md · 78 lines

How it starts

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

Python backend patterns

Use this skill for both new Python work and established services. Discover the active package, entrypoint, and installed versions first; dependencies alone do not prove which path owns runtime behavior.

Operating rule

  1. Run recon.py against the relevant package root, or use recon.md manually.
  2. Trace the changed behavior through entrypoint, business logic, data boundary, side effects, and callers.
  3. Read only the references matching the active path and task.
  4. Verify version-sensitive behavior against installed versions and current primary documentation through Context7 or the official project site.
  5. Apply the testing baseline below. Read testing.md when the task requires choosing test scope, changing existing tests, or separating the local and CI paths.

Multiple frameworks, validators, database libraries, or test tools are observations, not automatic blockers. Determine which one owns the changed path from imports, configuration, entrypoints, and runtime wiring. Ask the caller only when evidence cannot resolve a choice that changes product behavior or infrastructure.

Complete the assigned behavior. Do not use TODOs, placeholders, disabled checks, suppressions, or deferred in-scope work as a substitute for implementing it.

Two compatible layers

  • Established system: preserve its supported framework, package manager, architecture, validator, data layer, contracts, logging, and tests. Make the smallest coherent change; do not add a competing library or reorganize unrelated code.
  • New or isolated component: prefer a supported Python version, explicit boundaries, maintained libraries, typed public contracts, focused tests, and PostgreSQL when relational semantics are required. Choose libraries from actual requirements; this skill does not mandate FastAPI, SQLAlchemy, Pydantic, structlog, OpenTelemetry, Redis, or a universal folder structure.

Testing baseline

  • Use the project's native commands and the smallest faithful test for the changed behavior.
  • Inspect the exact command, task, configuration, and relevant fixtures before running it. Names such as lint, format, test, and check do not prove that a command is read-only, infrastructure-free, or safe for the current environment; prefer its check-only or focused form when verification must not change files or external state.
  • When practical, observe the focused test fail for the intended reason before the fix, then pass, followed by the nearest relevant fast suite.
  • Use real PostgreSQL when database semantics are the changed risk; do not add external infrastructure to tests that can prove the same behavior in process.
  • Assert observable outcomes and protected side effects. Never weaken assertions, hide failures, leave skipped tests, or claim an unobserved result.

Read the full file on GitHub · 78 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. yesterday First seen · 78 lines · 42 tokens per session scan A 194cb424fe7f

Subscribe to this mod's changes

python-backend-patterns is a skill published in the GitHub repository CATWILLgh/MAINFRAME (2 stars, last pushed 10d ago), licensed MIT. It adds 42 tokens to every session and 1,260 once invoked, about $0.0002 per session on Opus 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-08-31.

Related

Other skills, from other repositories

discord-webhook

Send trading alerts, signals, and analysis summaries to Discord via webhook. Integrates with realtime-alert-pipeline, trading-brain, and trade-journal-analytics.

mahmoud20138/Tradecraft · 37 tokens

agentforge-protocol

Use when doing non-trivial coding with Hermes, OpenClaw, Claude Code, Codex CLI, or similar autonomous coding agents. Orchestrates Karpathy-style minimal-change discipline, grill-plan intake, TDD, systematic debugging, subagent-driven implementation, spikes, and pre-commit review into one end-to-end workflow.

Yat-mo/agentforge-protocol · 71 tokens

claude-md-improver

Audit and improve CLAUDE.md files in repositories. Use when user asks to check, audit, update, improve, or fix CLAUDE.md files. Scans for all CLAUDE.md files, evaluates quality against templates, outputs quality report, then makes targeted updates. Also use when the user mentions "CLAUDE.md maintenance" or "project…

anthropics/claude-plugins-official · 82 tokens

agent-platform-model-registry

Agent Platform Model Registry Management. Use when you need to upload, list, describe, update, or delete machine learning models (and their versions) in the Agent Platform Model Registry. Don't use for model training, model deployment to endpoints, or managing non-Agent Platform models.

google/skills · 60 tokens

twitter-reader

Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…

himself65/finance-skills · 161 tokens

chenhao-limit-up

Use when evaluating A-share limit-up (涨停板) setups through Chen Hao's sentiment and momentum lens: market emotion cycles, board strength, follow-through, and short-term aggressive momentum trading.

questflowai/investorskills · 44 tokens