By ofershap
FastAPI done right. Async patterns, dependency injection, Pydantic v2 models, middleware, background tasks, and project structure for production APIs.
FastAPI done right. Async/sync endpoint selection, Depends() for dependency injection, Pydantic v2
models, lifespan context managers, BackgroundTasks, APIRouter, Annotated types, and production
project structure.
AI coding assistants make every endpoint async, use global variables instead of
Depends(), generate Pydantic v1 decorators, and put all routes in a single file. This plugin enforces the patterns that make FastAPI production-ready.
npx skills add ofershap/fastapi-best-practices
Or copy skills/ into your .cursor/skills/ or .claude/skills/ directory.
| Type | Name | Description |
|---|---|---|
| Skill | fastapi-best-practices | 10 rules for async patterns, Depends(), Pydantic v2, lifespan, APIRouter, and more |
| Rule | best-practices | Always-on behavioral rule that enforces current FastAPI patterns |
| Command | /audit | Scan your codebase for FastAPI anti-patterns |
| What the agent writes | What FastAPI best practice is |
|---|---|
async def for everything | async def for I/O, def for CPU-bound |
Global db variable | Depends(get_db) dependency injection |
@validator, class Config | field_validator, ConfigDict (Pydantic v2) |
@app.on_event("startup") | lifespan context manager |
All routes in main.py | APIRouter with organized modules |
asyncio.create_task() | BackgroundTasks for fire-and-forget work |
return {"error": "not found"} | response_model + status.HTTP_404_NOT_FOUND |
If this helped your workflow, a star helps others find it.
MIT
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub ofershap/fastapi-best-practicesSvelteKit and Svelte 5 done right. Runes ($state, $derived, $effect), load functions, form actions, SSR patterns, and modern Svelte your AI agent should follow.
Modern TypeScript patterns your AI agent should use. Strict mode, discriminated unions, satisfies operator, const assertions, and type-safe patterns for TypeScript 5.x.
Query and analyze your Cursor Enterprise team's AI usage, spending, and adoption metrics. Wraps the full Cursor Admin and Analytics APIs as MCP tools with expert data interpretation skills.
Drizzle ORM done right. Schema design, relations, migrations, type-safe queries, and performance patterns for the fastest-growing TypeScript ORM.
Modern Python 3.12+ patterns your AI agent should use. Type hints, async/await, Pydantic v2, uv package manager, match statements, and project structure.
Comprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
Standalone image generation plugin using Nano Banana MCP server. Generates and edits images, icons, diagrams, patterns, and visual assets via Gemini image models. No Gemini CLI dependency required.
Multi-model consensus engine integrating OpenAI Codex CLI, Gemini CLI, and Claude CLI for collaborative code review and problem-solving.
Write feature specs, plan roadmaps, and synthesize user research faster. Keep stakeholders updated and stay ahead of the competitive landscape.