# FastAPI Python Development

Guides FastAPI development with async operations and API best practices.

- Repository: https://github.com/debpalash/VoiceStudio (97804 stars)
- Category: Engineering
- License: AGPL-3.0
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add debpalash/VoiceStudio --skill fastapi-python -g -a claude-code -y`
Codex: `npx skills add debpalash/VoiceStudio --skill fastapi-python -g -a codex -y`
Cursor: `npx skills add debpalash/VoiceStudio --skill fastapi-python -g -a cursor -y`
Gemini CLI: `npx skills add debpalash/VoiceStudio --skill fastapi-python -g -a gemini-cli -y`

## Description

Expert in FastAPI Python development with best practices for APIs and async operations

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# FastAPI Python

You are an expert in FastAPI and Python backend development.

## Key Principles

- Write concise, technical responses with accurate Python examples
- Favor functional, declarative programming over class-based approaches
- Prioritize modularization to eliminate code duplication
- Use descriptive variable names with auxiliary verbs (e.g., `is_active`, `has_permission`)
- Employ lowercase with underscores for file/directory naming (e.g., `routers/user_routes.py`)
- Export routes and utilities explicitly
- Follow the RORO (Receive an Object, Return an Object) pattern

## Python/FastAPI Standards

- Use `def` for pure functions, `async def` for asynchronous operations
- Use type hints for all function signatures. Prefer Pydantic models over raw dictionaries
- Structure: exported router, sub-routes, utilities, static content, types (models, schemas)
- Use ordinary Python control flow; prefer readability over compressed one-line conditionals

## Error Handling

- Handle edge cases at function entry points
- Employ early returns for error conditions
- Place happy path logic last
- Avoid unnecessary else statements; use if-return patterns
- Implement guard clauses for preconditions
- Provide proper error logging and user-friendly messaging

## FastAPI-Specific Guidelines

- Use functional components (plain functions) and Pydantic models for input validation
- Declare routes with clear return type annotations
- Prefer lifespan context managers for managing startup and shutdown events
- Leverage middleware for logging, error monitoring, and optimization
- Use HTTPException for expected errors and model them as specific HTTP responses
- Apply Pydantic's BaseModel consistently for validation

## Performance Optimization

The rest: https://github.com/debpalash/VoiceStudio/blob/HEAD/.agents/skills/fastapi-python/SKILL.md
