fastapi-template/skills/fastapi-template/SKILL.md
# FastAPI Template Skill Generate production-ready FastAPI CRUD modules following a proven single-session-per-request architecture. ## When to Use This Skill Use this skill when asked to: - Create a new FastAPI entity/module (router, service, repository, schemas) - Add CRUD endpoints to an existing FastAPI application - Generate data access layers following the repository pattern - Build REST APIs with SQLAlchemy and Pydantic ## Architecture Overview ``` ┌───────────────────────────────────
npx skillsauth add adelabdelgawad/claude-fullstack-plugins fastapi-template/skills/fastapi-templateInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate production-ready FastAPI CRUD modules following a proven single-session-per-request architecture.
Use this skill when asked to:
┌─────────────────────────────────────────────────────────────┐
│ HTTP Request │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Router (api/v1/{entity}.py) │
│ • Endpoint definitions │
│ • Request/Response validation │
│ • session: AsyncSession = Depends(get_session) │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Service (api/services/{entity}_service.py) │
│ • Business logic │
│ • Validation rules │
│ • Orchestrates repositories │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Repository (api/repositories/{entity}_repository.py) │
│ • Data access │
│ • SQLAlchemy queries │
│ • No business logic │
└──────────────────────────┬──────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ Model (db/models.py) + Schema (api/schemas/{entity}.py) │
│ • SQLAlchemy ORM models │
│ • Pydantic DTOs with CamelModel │
└─────────────────────────────────────────────────────────────┘
api/
├── v1/
│ └── {entity}.py # Router with endpoints
├── services/
│ └── {entity}_service.py # Business logic
├── repositories/
│ └── {entity}_repository.py # Data access layer
└── schemas/
├── _base.py # CamelModel base class
└── {entity}_schemas.py # Pydantic DTOs
db/
└── models.py # SQLAlchemy models
core/
├── exceptions.py # Domain exceptions
└── pagination.py # Pagination utilities
Every request uses exactly ONE database session:
@router.post("/items")
async def create_item(
item_create: ItemCreate,
session: AsyncSession = Depends(get_session), # Session injected here
):
service = ItemService()
return await service.create_item(session, item_create) # Passed to service
Endpoint (session created)
→ Service (receives session as param)
→ Repository (receives session as param)
→ Database operations
All schemas inherit from CamelModel for automatic snake_case → camelCase conversion:
class ItemResponse(CamelModel):
item_id: int # Python: snake_case
created_at: datetime
# JSON output: {"itemId": 1, "createdAt": "..."}
Use typed exceptions that map to HTTP status codes:
| Exception | HTTP Status | |-----------|-------------| | NotFoundError | 404 | | ConflictError | 409 | | ValidationError | 422 | | AuthenticationError | 401 | | AuthorizationError | 403 | | DatabaseError | 500 |
When creating a new entity, generate files in this order:
__init__ takes no parameterssession as first parametersession.flush() to persist, session.refresh() to reload__init__ creates repository instancessession as first parametersession: AsyncSession = Depends(get_session)service = EntityService()See the references/ directory for detailed patterns:
schema-pattern.md - Pydantic DTO patternsrepository-pattern.md - Data access layerservice-pattern.md - Business logic layerrouter-pattern.md - API endpointsmodel-pattern.md - SQLAlchemy modelstools
# Tasks Management Skill Background task management system using APScheduler for scheduling and Celery for distributed execution. ## When to Use This Skill Use this skill when asked to: - Set up background task processing - Create scheduled jobs with APScheduler - Implement Celery workers for task execution - Add job management endpoints - Configure task queues and retries ## Architecture Overview ``` ┌─────────────────────────────────────────────────────────────┐ │ FastA
tools
# Next.js Template Skill Generate production-ready Next.js pages with SSR initial load, SWR client-side data management, and server-response-based cache updates. ## When to Use This Skill Use this skill when asked to: - Create a new Next.js page with data table - Add CRUD functionality to a Next.js application - Generate pages with server-side rendering and client-side updates - Build admin/settings pages with filtering, pagination, and bulk actions ## Architecture Overview ``` ┌───────────
development
Create Next.js data table pages with SSR initial load, SWR caching, and server-response-based UI updates. Use when asked to create a new data table page, entity management page, CRUD table, or admin list view. Generates page.tsx (SSR), table components, columns, context, actions, and API routes following a proven architecture with centralized reusable data-table component.
tools
# Fetch Architecture Skill Client and server-side fetch utilities for Next.js applications with API route proxying to FastAPI backends. ## When to Use This Skill Use this skill when asked to: - Set up fetch utilities for Next.js - Configure client-side API calls with auth refresh - Implement server-side data fetching - Create API route proxies to backend services - Handle authentication tokens across layers ## Architecture Overview ``` ┌──────────────────────────────────────────────────────