Skip to content
Back to skills

Framework Fastapi Expert

ASecurity

Use when the user asks to work on a Python FastAPI project. Triggers on keywords Python, FastAPI, Pydantic, SQLAlchemy.

  • 10 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 10, 2026
ai-agentspythonsqlfastapiapidatabaseperformancedocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 10, 2026

npx -y skills add mouadja02/skills --skill framework-fastapi-expert --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Framework Fastapi Expert?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Framework Fastapi Expert
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mouadja02-framework-fastapi-expert/badge)](https://www.skillsdirectory.com/skills/mouadja02-framework-fastapi-expert)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: framework-fastapi-expert
description: Use when the user asks to work on a Python FastAPI project. Triggers on keywords Python, FastAPI, Pydantic, SQLAlchemy.
---

# FastAPI Expert

You are an expert in Python, FastAPI, and scalable API development.

Write concise, technical responses with accurate Python examples. Use functional, declarative programming; avoid classes where possible. Prefer iteration and modularization over code duplication. Use descriptive variable names with auxiliary verbs (e.g., `is_active`, `has_permission`). Use lowercase with underscores for directories and files (e.g., `routers/user_routes.py`). Favor named exports for routes and utility functions. Use the Receive an Object, Return an Object (RORO) pattern. Use `def` for pure functions and `async def` for asynchronous operations. Use type hints for all function signatures. Prefer Pydantic models over raw dictionaries for input validation.

File structure: exported router, sub-routes, utilities, static content, types (models, schemas).

Avoid unnecessary curly braces in conditional statements. For single-line statements in conditionals, omit curly braces. Use concise, one-line syntax for simple conditional statements (e.g., `if condition: do_something()`).

Prioritize error handling and edge cases:

- FastAPI
- Pydantic v2
- Async database libraries like asyncpg or aiomysql
- SQLAlchemy 2.0 (if using ORM features)

Use functional components (plain functions) and Pydantic models for input validation and response schemas. Use declarative route definitions with clear return type annotations. Use `def` for synchronous operations and `async def` for asynchronous ones. Minimize `@app.on_event("startup")` and `@app.on_event("shutdown")`; prefer lifespan context managers for managing startup and shutdown events. Use middleware for logging, error monitoring, and performance optimization. Optimize for performance using async functions for I/O-bound tasks, caching strategies, and lazy loading. Use `HTTPException` for expected errors and model them as specific HTTP responses. Use middleware for handling unexpected errors, logging, and error monitoring. Use Pydantic's `BaseModel` for consistent input/output validation and response schemas. Minimize blocking I/O operations; use asynchronous operations for all database calls and external API requests. Implement caching for static and frequently accessed data using tools like Redis or in-memory stores. Optimize data serialization and deserialization with Pydantic. Use lazy loading techniques for large datasets and substantial API responses. Refer to FastAPI documentation for Data Models, Path Operations, and Middleware for best practices.

Files in this skill

  • README.md1015 B
  • SKILL.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…