scaffold-python-api

scaffold-python-api is a command for Claude Code from kumaran-is/claude-code-onboarding. It costs 24 tokens per session (435 once invoked), scanned A, original, MIT.

A command that creates a new Python FastAPI service with Pydantic data models, asynchronous SQLAlchemy database access, a health endpoint, tests, and development tooling.

In plain words
What is it for?
Use it to start an API with sample request and response models, service and repository layers, async tests, linting, type checking, and a production Dockerfile.
Why use it?
It removes the repetitive setup needed for a structured backend service and provides a starting point for configuration, routing, persistence, validation, and type checking.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Good fit Use it to start an API with sample request and response models, service and repository layers, async tests, linting, type checking, and a production Dockerfile.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kumaran-is/claude-code-onboarding/scaffold-python-api
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.

Clone the repo
git clone --depth 1 https://github.com/kumaran-is/claude-code-onboarding

Made for: Claude Code.

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 scaffold-python-api

README.md
[![agentmods](https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-python-api.svg)](https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-python-api)
Your own site
<a href="https://agentmods.dev/commands/kumaran-is/claude-code-onboarding/scaffold-python-api"><img src="https://agentmods.dev/badge/commands/kumaran-is/claude-code-onboarding/scaffold-python-api.svg" alt="Measured on agentmods" height="20"></a>
Per session 24 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 435 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.
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.00024 $0.00435
Opus 5 $0.00012 $0.00217
Sonnet 5 $0.00005 $0.00087
Haiku 4.5 $0.00002 $0.00044

Measured 4d ago against content hash 50ac1a4fdb08, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

scaffold-python-api 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 4d 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.

.claude/commands/scaffold-python-api.md · 33 lines

What it actually says

Scaffold Python FastAPI Service

Create a new Python 3.14 / FastAPI project with the following:

Project name: $ARGUMENTS (default to "my-python-api" if not provided)

Steps

  1. Create .gitignore first — before any other file. Include: __pycache__/, .env, *.pem, *.key, .venv/, dist/, *.egg-info/, .DS_Store, .mypy_cache/, .ruff_cache/
  2. Initialize project with pyproject.toml (dependencies + dev dependencies, include pip-audit in dev deps)
  3. Set up virtual environment with uv init or python -m venv
  4. Create folder structure: src/<package>/api/routes/, models/, services/, repositories/, core/, utils/
  5. Create main.py with FastAPI app, lifespan handler, and router includes
  6. Create core/config.py with pydantic-settings
  7. Create a sample Pydantic model (request + response)
  8. Create a sample route handler, service, and repository
  9. Add a health check endpoint at GET /api/v1/health
  10. Create tests/conftest.py with async test client fixture
  11. Add a pytest test for the sample endpoint
  12. Configure ruff (linting) and mypy (type checking) in pyproject.toml
  13. Create a Dockerfile for production
  14. Add a .env.example file
  15. Run pip audit — fix or document any critical/high CVEs before proceeding
  16. Print summary of created files and next steps

Use the python-dev skill for patterns and templates.

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. 4d ago First seen · 33 lines · 24 tokens per session scan A 50ac1a4fdb08

Subscribe to this mod's changes

scaffold-python-api is a command published in the GitHub repository kumaran-is/claude-code-onboarding (35 stars, last pushed 2mo ago), licensed MIT. It adds 24 tokens to every session and 435 once invoked, about $0.0001 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-09-03.