backend-feature-fastapi

Scaffolds FastAPI backends with feature-based routers, Pydantic schemas, and service layers.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/jason23452/my-skill --skill backend-feature-fastapi-jason23452
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: backend-feature-fastapi
Source: https://github.com/jason23452/my-skill/tree/main/backend/backend-feature-fastapi
Command: npx skills add https://github.com/jason23452/my-skill --skill backend-feature-fastapi-jason23452

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires fastapi, uvicorn, pydantic, and includes scripts (resource) and references (resource) components.

What problem does it solve? Setting up a FastAPI backend from scratch involves repetitive decisions about project layout, router registration, and where business logic belongs. This Skill provides a consistent feature-based architecture with an app factory, core config/middleware, and per-feature router/schema/service separation, so every endpoint follows the same maintainable pattern. ## Core Features & Use Cases - Greenfield Scaffolding: Bootstraps a complete FastAPI project via uv with app/main.py, app/core/config.py, app/core/middleware.py, a feature router aggregator, and a working health endpoint. - Feature Module Pattern: Guides creation of new features (e.g., users, projects) with dedicated router.py, schemas.py, service.py, and __init__.py, registered centrally in app/features/router.py. - Runtime Smoke Testing: Ships a sandboxed smoke-test script that copies the project to a temp directory, runs uv sync, and launches uvicorn against a /health liveness endpoint. - Use Case: Ask the agent to add a projects API with list and create endpoints; it produces the feature directory, Pydantic DTOs, service logic, and router registration without touching app construction code. ## Quick Start Ask the agent to create a new FastAPI greenfield backend with a health endpoint and feature-based project structure.

Frequently Asked Questions about backend-feature-fastapi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a FastAPI project with feature-based folders?▼

Create an app directory with main.py defining create_app(), a core package for config and middleware, and a features package where each feature has router.py, schemas.py, service.py, and __init__.py. Register all feature routers in app/features/router.py and include only that aggregator in main.py.

How do I add a new endpoint to an existing FastAPI feature?▼

Add the business logic as a method in the feature's service.py, define request/response models in schemas.py, then wire the HTTP method, path, status code, and response_model in router.py. Keep validation and HTTP concerns in the router and business rules in the service.

Does this FastAPI scaffold include database or ORM setup?▼

No. Database connections, ORM models, and migrations are intentionally excluded and handled by separate skills such as backend-orm-migrations and pgdb-docker-orm. This scaffold covers only the HTTP application structure.

Why should runtime smoke tests run in a sandbox instead of the workspace?▼

Docker bind mounts on paths like /workspace can make uvicorn startup and readiness unreliable. The smoke script copies the project to a temp sandbox, runs uv sync there, and launches uvicorn against the /health endpoint for consistent results.

What package manager does the FastAPI scaffold use?▼

The scaffold uses uv. It runs uv init to create the project, uv add to install fastapi[standard] and uvicorn[standard], and uv sync to install dependencies before verification with python -m compileall.