Agent skill

Backend Fastapi Python

by avibebuilder in avibebuilder/claude-prime

A skill your agent uses for any Python backend work in this project: building FastAPI endpoints, writing service functions, defining Pydantic/SQLModel schemas, running Alembic migrations, or…

MITAuto-check passedBackend & APIs

Install Backend Fastapi Python

skills CLI
$ npx skills add avibebuilder/claude-prime --skill backend-fastapi-python -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install avibebuilder/claude-prime backend-fastapi-python --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/avibebuilder/claude-prime.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/starter-skills/backend-fastapi-python .claude/skills/backend-fastapi-python && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
backend-fastapi-python
GitHub stars
120
Token cost
~997 tokens
SKILL.md length
362 words
Files
12 (incl. references)
Skills in repo
19
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses for any Python backend work in this project: building FastAPI endpoints, writing service functions, defining Pydantic/SQLModel schemas, running Alembic migrations, or…

  • Works in 5 steps: Services are stateless functions — Not… → Generic response wrapper — Always use… → Dependencies chain — get_current_user ->… → …
  • Any Python backend work in this project: building FastAPI endpoints
  • SKILL.md covers Architecture Decisions, Gotchas and References
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Backend Fastapi Python is an agent skill from avibebuilder/claude-prime. Use this skill for any Python backend work in this project: building FastAPI endpoints, writing service functions, defining Pydantic/SQLModel schemas, running Alembic migrations, or debugging 422 errors. Essential for authentication and authorization patterns — setting up getcurrentuser, issuperuser checks, admin-only guards, role-based access, and dependency injection chains like Depends(). Also covers middleware, background tasks, async SQLAlchemy sessions, ORM relationship loading, and request/response design…

Its SKILL.md is about 1000 tokens, which your agent loads only when the skill is triggered. The skill folder holds 12 other files, including reference files (for example `references/auth.md`, `references/configuration.md` and `references/database.md`).

It sits in Backend & APIs, covering Backend development, ORMs and data access and Authorization and RBAC. It works with FastAPI, Python, Pydantic and SQLAlchemy. The repository describes itself as: You've heard Claude Code can do amazing things. Skills, hooks, agents, memory systems — but who has time to figure all that out? Claude Prime sets it up for you in one command. The licence is MIT.

When your agent uses it

  • Any Python backend work in this project: building FastAPI endpoints
  • Writing service functions
  • Defining Pydantic/SQLModel schemas
  • Running Alembic migrations

Example prompts

  • “/backend-fastapi-python”

Requirements

  • Python 3
  • Docker

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Services are stateless functions — Not classes. First param is db: AsyncSession.
  2. Generic response wrapper — Always use ApiResponse[T] for consistency.
  3. Dependencies chain — get_current_user -> require_auth -> require_admin.
  4. Module-scoped config — Each module can have its own {module}_config.py.
  5. Error codes for frontend — AppException(status, message, error_code).

What it can do on your machine

Read from SKILL.md and the folder at commit 80bcfa4. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Backend Fastapi Python loads about 997 tokens when it runs, and up to ~13k if it reads all its reference files. Until then it costs about 178 tokens; SKILL.md has 362 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~178
When it runs · the whole SKILL.md, loaded when a task matches
~997
With references · SKILL.md plus every file in references/, read only if the agent opens them
~13k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from avibebuilder/claude-prime at commit 80bcfa4, republished under its MIT licence (© avibebuilder). 362 words, ~997 tokens.

Download SKILL.mdSave it as .claude/skills/backend-fastapi-python/SKILL.md (or your agent's skills folder). This skill also uses 11 other files; get the full folder from GitHub.
name
backend-fastapi-python
description
Use this skill for any Python backend work in this project: building FastAPI endpoints, writing service functions, defining Pydantic/SQLModel schemas, running Alembic migrations, or debugging 422 errors. Essential for authentication and authorization patterns — setting up get_current_user, is_superuser checks, admin-only guards, role-based access, and dependency injection chains like Depends(). Also covers middleware, background tasks, async SQLAlchemy sessions, ORM relationship loading, and request/response design. Activate whenever the question involves Python API code, FastAPI patterns, or backend architecture in this codebase. Not for frontend, Docker, CI/CD, or infrastructure.

Backend FastAPI Python

Project-specific conventions for FastAPI with SQLModel, pydantic-settings, and async SQLAlchemy.

Architecture Decisions

  1. Services are stateless functions — Not classes. First param is db: AsyncSession.
  2. Generic response wrapper — Always use ApiResponse[T] for consistency.
  3. Dependencies chain — get_current_user -> require_auth -> require_admin.
  4. Module-scoped config — Each module can have its own {module}_config.py.
  5. Error codes for frontend — AppException(status, message, error_code).

Gotchas

  • SQLModel Relationship() fields are NOT included in API responses by default. You must explicitly add them to model_config or use a separate response schema with those fields.
  • AsyncSession.refresh() does not load relationships. After commit, re-query with .options(selectinload(...)) if you need related objects.
  • Pydantic V2 uses model_validator not validator. The @validator decorator is V1 and will break silently or raise deprecation warnings.
  • Depends() in FastAPI creates a NEW instance per request — don't store state in dependency return values expecting it to persist.
  • Background tasks (BackgroundTasks) run AFTER the response is sent. If they fail, the client already got a 200. Use proper task queues (Celery, ARQ) for anything that must not silently fail.
  • Alembic --autogenerate misses: table renames (generates drop+create), index changes on existing columns, and Enum type modifications in PostgreSQL. Always review generated migrations.
  • async def endpoints block the event loop if you call sync I/O inside them. Use run_in_executor for sync libraries or define the endpoint as def (FastAPI runs sync endpoints in a threadpool).
  • HTTPException from FastAPI and HTTPException from Starlette are different classes. Importing the wrong one causes middleware to miss exception handlers.
  • SQLAlchemy's lazy="selectin" on relationships causes N+1 queries in async sessions. Use explicit selectinload() in queries instead.
  • Optional[str] = None in query params makes the field optional. str = None also works but loses type information — prefer the explicit Optional form.
  • When using response_model, FastAPI filters OUT any fields not in the model. If your response is missing data, check that the response model includes all fields, not just the ORM model.
Show full SKILL.md (46 more words)Show less

References

When you need...Read
Directory layoutfile-structure.md
Settings and env varsconfiguration.md
Database sessions and connectionsdatabase.md
ORM modelsmodels.md
Request/response schemasschemas.md
Router and endpoint patternsrouting.md
Service layer patternsservices.md
Dependency injectiondependencies.md
Middleware setupmiddleware.md
Error handlingerror-handling.md
Auth flow exampleauth.md

© avibebuilder, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 11 other files (references) in .claude/starter-skills/backend-fastapi-python of avibebuilder/claude-prime.

  • SKILL.md
  • references/auth.md
  • references/configuration.md
  • references/database.md
  • references/dependencies.md
  • references/error-handling.md
  • references/file-structure.md
  • references/middleware.md
  • references/models.md
  • references/routing.md
  • references/schemas.md
  • references/services.md

Open the folder on GitHubat commit 80bcfa4

Compare with similar skills

Backend Fastapi Python next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Backend Fastapi Python compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Backend Fastapi Python this skillavibebuilder/claude-prime120—~997Automated safety check: PassMIT
Fastcrudbenavlabs/fastcrud1.6k—~5kAutomated safety check: PassMIT
Python Best Practicesc0x12c/ai-toolkit106—~676Automated safety check: PassNone
PythonMadAppGang/claude-code283—~2.8kAutomated safety check: NotesMIT
Fastapi Appccplugins/awesome-claude-code-plugins967—~1.1kAutomated safety check: NotesApache-2.0
Mastering Python SkillSpillwaveSolutions/agent-brain120—~1.4kAutomated safety check: NotesMIT

Similar skills

  • Fastcrud

    benavlabs/fastcrud

    A skill your agent uses when building or modifying CRUD endpoints with FastCRUD (the fastcrud PyPI package) in a FastAPI project — covers FastCRUD, crudrouter, EndpointCreator, FilterConfig…

    1.6k GitHub stars~5k tokensUpdated 12 days ago
    Backend & APIsAuto-check passed
  • Python Best Practices

    c0x12c/ai-toolkit

    Python/FastAPI coding standards including async patterns, Pydantic v2, SQLAlchemy 2.0, and project structure.

    106 GitHub stars~676 tokensUpdated 3 mo ago
    Backend & APIsAuto-check passed
  • Python

    MadAppGang/claude-code

    A skill your agent uses when building FastAPI applications, implementing async endpoints, setting up Pydantic schemas, working with SQLAlchemy, or writing pytest tests for Python backend services.

    283 GitHub stars~2.8k tokensUpdated 6 mo ago
    Backend & APIsAuto-check: notes
  • Fastapi App

    ccplugins/awesome-claude-code-plugins

    Bootstrap a new FastAPI backend with async SQLAlchemy 2.0, asyncpg, Alembic, Pydantic v2, and no deprecated APIs.

    967 GitHub stars~1.1k tokensUpdated 1 mo ago
    Backend & APIsAuto-check: notes
  • Mastering Python Skill

    SpillwaveSolutions/agent-brain

    Modern Python coaching covering language foundations through advanced production patterns.

    120 GitHub stars~1.4k tokensUpdated 17 days ago
    DevelopmentAuto-check: notes
  • Fastapi Pro

    davila7/claude-code-templates

    Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2.

    32k GitHub starsUsed in 7 repos~1.6k tokens
    Backend & APIsAuto-check passed

More from avibebuilder/claude-prime

All 19 skills in this repo
  • Diagnose

    avibebuilder/claude-prime

    Investigate unexpected behavior and mysterious bugs. An agent skill from avibebuilder/claude-prime.

    120 GitHub starsUsed in 1 repo~1.2k tokens
    Auto-check passed
  • Frontend Design

    avibebuilder/claude-prime

    Builds distinctive, production-grade UIs that avoid generic AI aesthetics.

    120 GitHub stars~2.1k tokensUpdated 4 mo ago
    Auto-check passed
  • Media Processor

    avibebuilder/claude-prime

    Specialized visual and multimedia processing tools. An agent skill from avibebuilder/claude-prime.

    120 GitHub stars~1.2k tokensUpdated 4 mo ago
    Auto-check: notes
  • Skill Creator

    avibebuilder/claude-prime

    A skill your agent uses when the user wants to work on a Claude Code skill file (SKILL.md): writing one from scratch, testing whether an existing one works well, running evals or benchmarks…

    120 GitHub stars~8.2k tokensUpdated 4 mo ago
    Auto-check passed
  • Self Evolve

    avibebuilder/claude-prime

    The single config quality skill. An agent skill from avibebuilder/claude-prime.

    120 GitHub stars~1.9k tokensUpdated 4 mo ago
    Auto-check passed
  • Cook

    avibebuilder/claude-prime

    Implement, build, create, or add any feature, endpoint, page, component, or functionality.

    120 GitHub stars~970 tokensUpdated 4 mo ago
    Auto-check passed

Questions about Backend Fastapi Python

What does Backend Fastapi Python do?

A skill your agent uses for any Python backend work in this project: building FastAPI endpoints, writing service functions, defining Pydantic/SQLModel schemas, running Alembic migrations, or…. Backend Fastapi Python is an agent skill from avibebuilder/claude-prime. Use this skill for any Python backend work in this project: building FastAPI endpoints, writing service functions, defining Pydantic/SQLModel schemas, running Alembic migrations, or debugging 422 errors.

When should I use Backend Fastapi Python?

Backend Fastapi Python fits situations like: any Python backend work in this project: building FastAPI endpoints; writing service functions; defining Pydantic/SQLModel schemas; running Alembic migrations.

How do I install Backend Fastapi Python in Claude Code?

Run `npx skills add avibebuilder/claude-prime --skill backend-fastapi-python -a claude-code`. Or copy the skill folder (.claude/starter-skills/backend-fastapi-python in avibebuilder/claude-prime) into .claude/skills/backend-fastapi-python in your project. Claude Code loads it when a task matches its description.

How do I install Backend Fastapi Python in Codex?

Run `npx skills add avibebuilder/claude-prime --skill backend-fastapi-python -a codex`. Or copy the skill folder (.claude/starter-skills/backend-fastapi-python in avibebuilder/claude-prime) into .agents/skills/backend-fastapi-python in your project. Codex loads it when a task matches its description.

Can I use Backend Fastapi Python in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add avibebuilder/claude-prime --skill backend-fastapi-python -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/backend-fastapi-python, .gemini/skills/backend-fastapi-python, .github/skills/backend-fastapi-python and .opencode/skills/backend-fastapi-python in your project.

What does Backend Fastapi Python need to run?

SKILL.md names no scripts, command-line tools or credentials: Backend Fastapi Python is instructions for the agent only. Our summary lists: Python 3; Docker.

Does Backend Fastapi Python access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Backend Fastapi Python safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Backend Fastapi Python use?

Backend Fastapi Python is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Backend Fastapi Python use?

About 997 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 12k tokens, read only when the agent opens those files.

What are the alternatives to Backend Fastapi Python?

Skills that share tags, products or a category with Backend Fastapi Python: Fastcrud (benavlabs/fastcrud, 1.6k stars), Python Best Practices (c0x12c/ai-toolkit, 106 stars), Python (MadAppGang/claude-code, 283 stars) and Fastapi App (ccplugins/awesome-claude-code-plugins, 967 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Backend Fastapi Python?

avibebuilder (a GitHub organization) maintains it in avibebuilder/claude-prime, which has 120 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on May 16, 2026.

Source: avibebuilder/claude-prime on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.