Production-ready FastAPI patterns with Pydantic v2, SQLAlchemy 2.0 async, and JWT authentication.
Works with
Domain-based project structure, async database setup with SQLAlchemy 2.0, and dependency injection patterns for maintainable APIs
Comprehensive JWT authentication with password hashing, token generation, and protected routes using OAuth2
Prevents 7 documented issues including form data validation bugs, background task overwrites, Pydantic v2 migration breaking changes, and async event lo
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versionfastapiExecute the skills CLI command in your project's root directory to begin installation:
Fetches fastapi from jezweb/claude-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate fastapi. Access via /fastapi in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
697
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
697
stars
Production-tested patterns for FastAPI with Pydantic v2, SQLAlchemy 2.0 async, and JWT authentication.
Latest Versions (verified January 2026):
Requirements:
# Create project
uv init my-api
cd my-api
# Add dependencies
uv add fastapi[standard] sqlalchemy[asyncio] aiosqlite python-jose[cryptography] passlib[bcrypt]
# Run development server
uv run fastapi dev src/main.py
# src/main.py
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI(title="My API")
class Item(BaseModel):
name: str
price: float
@app.get("/")
async def root():
return {"message": "Hello World"}
@app.post("/items")
async def create_item(item: Item):
return item
Run: uv run fastapi dev src/main.py
Docs available at: http://127.0.0.1:8000/docs
For maintainable projects, organize by domain not file type:
my-api/
├── pyproject.toml
├── src/
│ ├── __init__.py
│ ├── main.py # FastAPI app initialization
│ ├── config.py # Global settings
│ ├── database.py # Database connection
│ │
│ ├── auth/ # Auth domain
│ │ ├── __init__.py
│ │ ├── router.py # Auth endpoints
│ │ ├── schemas.py # Pydantic models
│ │ ├── models.py # SQLAlchemy models
│ │ ├── service.py # Business logic
│ │ └── dependencies.py # Auth dependencies
│ │
│ ├── items/ # Items domain
│ │ ├── __init__.py
│ │ ├── router.py
│ │ ├── schemas.py
│ │ ├── models.py
│ │ └── service.py
│ │
│ └── shared/ # Shared utilities
│ ├── __init__.py
│ └── exceptions.py
└── tests/
└── test_main.py
# src/items/schemas.py
from pydantic import BaseModel, Field, ConfigDict
from datetime import datetime
from enum import Enum
class ItemStatus(str, Enum):
DRAFT = "draft"
PUBLISHED = "published"
ARCHIVED = "archived"
class ItemBase(BaseModel):
name: str = Field(..., min_length=1, max_length=100)
description: str | None = Field(None, max_length=500)
price: float = Field(..., gt=0, description="Price must be positive")
status: ItemStatus = ItemStatus.DRAFT
class ItemCreate(ItemBase):
pass
class ItemUpdate(BaseModel):
name: str | None = Field(None, min_length=1, max_length=100)
description: str | None = None
price: float | None = Field(None, gt=0)
status: ItemStatus | None = None
class ItemResponse(ItemBase):
id: int
created_at: datetime
model_config = ConfigDict(from_attributes=True)
Key Points:
Field() for validation constraintsfrom_attributes=True enables SQLAlchemy model conversionstr | None (Python 3.10+) not Optional[str]# src/items/models.py
from sqlalchemy import String, Float, DateTime, Enum as SQLEnum
from sqlalchemy.orm import Mapped, mapped_column
from datetime import datetime
from src.database import Base
from src.items.schemas import ItemStatus
class Item(Base):
__tablename__ = "items"
id: Mapped[int] = mapped_column(primary_key=True)
name: Mapped[str] = mapped_column(String(100))
description: Mapped[str | None] = mapped_column(String(500), nullable=True)
price: Mapped[float] = mapped_column(Float)
status: Mapped[ItemStatus] = mapped_column(
SQLEnum(ItemStatus), default=ItemStatus.DRAFT
)
created_at: Mapped[datetime] = mapped_column(
DateTime, default=datetime.utcnow
)
# src/database.py
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker
from sqlalchemy.orm import DeclarativeBase
DATABASE_URL = "sqlite+aiosqlite:///./database.db"
engine = create_async_engine(DATABASE_URL, echo=True)
async_session = async_sessionmaker(engine, expire_on_commit=False)
class Base(DeclarativeBase):
pass
async def get_db():
async with async_session() as session:
try:
yield session
await session.commit()
except Exception:
await session.rollback()
raise
# src/items/router.py
from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from src.database import get_db
from src.items import schemas, models
router = APIRouter(prefix="/items", tags=["items"])
@router.get("", response_model=list[schemas.ItemResponseImplementation Guide
Prerequisites
- ›Claude Desktop or compatible AI client with skill support
- ›Clear understanding of task or problem to solve
- ›Willingness to iterate and refine outputs
Time Estimate
15-45 minutes depending on use case complexity
Steps
- 1Install skill using provided installation command
- 2Test with simple use case relevant to your work
- 3Evaluate output quality and relevance
- 4Iterate on prompts to improve results
- 5Integrate into regular workflow if valuable
Common Pitfalls
- ⚠Expecting perfect results without iteration
- ⚠Not providing enough context in prompts
- ⚠Using skill for tasks outside its intended scope
- ⚠Accepting outputs without review and validation
Best Practices
✓ Do
- +Start with clear, specific prompts
- +Provide relevant context and constraints
- +Review and refine all outputs before using
- +Iterate to improve output quality
- +Document successful prompt patterns
✗ Don't
- −Don't use without understanding skill limitations
- −Don't skip validation of outputs
- −Don't share sensitive information in prompts
- −Don't expect skill to replace human judgment
💡 Pro Tips
- ★Be specific about desired format and style
- ★Ask for multiple options to choose from
- ★Request explanations to understand reasoning
- ★Combine AI efficiency with human expertise
When to Use This
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
Learning Path
- 1Familiarize yourself with skill capabilities and limitations
- 2Start with low-risk, non-critical tasks
- 3Progress to more complex and valuable use cases
- 4Build expertise through regular use and experimentation
Related Skills
wordpress-elementor
111jezweb/claude-skills
Productivitysame reporeact-native
21jezweb/claude-skills
Frontendsame repofastapi-python
55mindrally/skills
Backendtag: fastapifastapi-expert
19jeffallan/claude-skills
Backendtag: fastapitypescript-best-practices
127jwynia/agent-skills
Backendsame categorygoogle-search-console
47kostja94/marketing-skills
Backendsame categoryReviews
4.6★★★★★60 reviews- MMateo Liu★★★★★Dec 28, 2024
We added fastapi from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- AAnika Singh★★★★★Dec 24, 2024
Useful defaults in fastapi — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- SSakura Jain★★★★★Dec 12, 2024
We added fastapi from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- HHenry Jackson★★★★★Dec 12, 2024
fastapi reduced setup friction for our internal harness; good balance of opinion and flexibility.
- SShikha Mishra★★★★★Dec 4, 2024
fastapi fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- YYash Thakker★★★★★Nov 23, 2024
fastapi is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- AAnika Yang★★★★★Nov 23, 2024
Solid pick for teams standardizing on skills: fastapi is focused, and the summary matches what you get after install.
- LLuis Chen★★★★★Nov 19, 2024
Keeps context tight: fastapi is the kind of skill you can hand to a new teammate without a long onboarding doc.
- SSakura Iyer★★★★★Nov 15, 2024
Registry listing for fastapi matched our evaluation — installs cleanly and behaves as described in the markdown.
- AAnika Sharma★★★★★Nov 3, 2024
Keeps context tight: fastapi is the kind of skill you can hand to a new teammate without a long onboarding doc.
showing 1-10 of 60
1 / 6Discussion
Comments — not star reviews- No comments yet — start the thread.