Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Comprehensive FastAPI development skill covering REST API creation, routing, request/response handling, validation, authentication, database integration, middleware, and deployment. Use when working with FastAPI projects, building APIs, implementing CRUD operations, setting up authentication/authorization, integrating databases (SQL/NoSQL), adding middleware, handling WebSockets, or deploying FastAPI applications. Triggered by requests involving .py files with FastAPI code, API endpoint creation
.claude/skills/aiskillstore-fastapi-mastery/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-19 | ✗→✓ | ▲ Improved | 98% | 0% |
| case-23 | ✗→✓ | ▲ Improved | 83% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 18% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 103% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 36% | 0% |
Build production-ready REST APIs with FastAPI using modern Python features, automatic validation, interactive documentation, and asynchronous capabilities.
Create a basic FastAPI application:
pythonfrom fastapi import FastAPI app = FastAPI() @app.get("/") async def root(): return {"message": "Hello World"}
Run with:
bashuvicorn main:app --reload
Access interactive docs: http://localhost:8000/docs
This skill is organized into three progressive levels:
Read when working with:
Read when implementing:
Read when building:
See references/01-beginner.md for basic CRUD patterns, references/02-intermediate.md for database integration.
See references/02-intermediate.md for complete authentication implementation.
See references/02-intermediate.md for database patterns.
Type hints: Always use Python type hints for automatic validation and documentation.
pythonfrom typing import Optional from pydantic import BaseModel class Item(BaseModel): name: str price: float description: Optional[str] = None
Dependency injection: Use FastAPI's dependency injection for shared logic.
pythonfrom fastapi import Depends def get_current_user(token: str = Depends(oauth2_scheme)): # Validate token and return user return user
Async when beneficial: Use async for I/O-bound operations (database, external APIs).
python@app.get("/items/{item_id}") async def read_item(item_id: int): item = await database.fetch_one(query) return item
Response models: Always define response models for API documentation and validation.
python@app.get("/items/{item_id}", response_model=ItemResponse) async def read_item(item_id: int): return item
Choose the appropriate reference based on your task:
All reference files include comprehensive examples and can be read independently.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 7,391 | 4,576 | -38% | 1 | 1 | 0% | 1,444 | 1,707 | +18% | 0 | 0 | — |
case-02 | pass→pass | 4,054 | 2,570 | -37% | 1 | 1 | 0% | 674 | 1,366 | +103% | 0 | 0 | — |
case-03 | pass→pass | 8,754 | 6,474 | -26% | 1 | 1 | 0% | 1,541 | 2,100 | +36% | 0 | 0 | — |
case-04 | pass→pass | 10,009 | 8,656 | -14% | 1 | 1 | 0% | 1,917 | 2,483 | +30% | 0 | 0 | — |
case-05 | pass→pass | 10,593 | 9,710 | -8% | 1 | 1 | 0% | 1,867 | 2,504 | +34% | 0 | 0 | — |
case-06 | pass→pass | 7,137 | 5,553 | -22% | 1 | 1 | 0% | 1,222 | 1,850 | +51% | 0 | 0 | — |
case-07 | pass→pass | 7,865 | 6,291 | -20% | 1 | 1 | 0% | 1,418 | 2,013 | +42% | 0 | 0 | — |
case-08 | pass→pass | 4,113 | 4,020 | -2% | 1 | 1 | 0% | 804 | 1,604 | +100% | 0 | 0 | — |
case-09 | pass→pass | 5,871 | 4,972 | -15% | 1 | 1 | 0% | 1,066 | 1,866 | +75% | 0 | 0 | — |
case-10 | pass→pass | 3,914 | 4,166 | +6% | 1 | 1 | 0% | 654 | 1,661 | +154% | 0 | 0 | — |
case-11 | pass→pass | 6,077 | 4,097 | -33% | 1 | 1 | 0% | 1,053 | 1,619 | +54% | 0 | 0 | — |
case-12 | pass→pass | 5,835 | 4,666 | -20% | 1 | 1 | 0% | 1,079 | 1,762 | +63% | 0 | 0 | — |
case-13 | pass→pass | 8,633 | 6,491 | -25% | 1 | 1 | 0% | 1,662 | 2,095 | +26% | 0 | 0 | — |
case-14 | pass→pass | 3,072 | 3,423 | +11% | 1 | 1 | 0% | 530 | 1,457 | +175% | 0 | 0 | — |
case-15 | pass→pass | 7,917 | 5,504 | -30% | 1 | 1 | 0% | 1,474 | 1,866 | +27% | 0 | 0 | — |
case-16 | pass→pass | 5,893 | 4,591 | -22% | 1 | 1 | 0% | 1,134 | 1,727 | +52% | 0 | 0 | — |
case-17 | pass→pass | 3,872 | 3,472 | -10% | 1 | 1 | 0% | 781 | 1,509 | +93% | 0 | 0 | — |
case-18 | pass→pass | 4,643 | 7,322 | +58% | 1 | 1 | 0% | 838 | 2,274 | +171% | 0 | 0 | — |
case-19 | fail→pass | 4,544 | 4,645 | +2% | 1 | 1 | 0% | 914 | 1,814 | +98% | 0 | 0 | — |
case-20 | pass→pass | 3,643 | 4,426 | +21% | 1 | 1 | 0% | 695 | 1,698 | +144% | 0 | 0 | — |
case-21 | pass→pass | 2,879 | 2,989 | +4% | 1 | 1 | 0% | 531 | 1,394 | +163% | 0 | 0 | — |
case-22 | pass→pass | 6,883 | 6,243 | -9% | 1 | 1 | 0% | 1,263 | 2,026 | +60% | 0 | 0 | — |
case-23 | fail→pass | 7,133 | 7,578 | +6% | 1 | 1 | 0% | 1,222 | 2,236 | +83% | 0 | 0 | — |
case-24 | pass→pass | 5,331 | 5,549 | +4% | 1 | 1 | 0% | 963 | 1,999 | +108% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +8 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.