Claude Code Plugins

Community-maintained marketplace

Feedback

python-fastapi-conventions

@nera0875/agi
0
0

FastAPI routing structure, Pydantic models, error handling, project layout patterns for backend implementations

Install Skill

1Download skill
2Enable skills in Claude

Open claude.ai/settings/capabilities and find the "Skills" section

3Upload to Claude

Click "Upload skill" and select the downloaded ZIP file

Note: Please verify skill by going through its instructions before using it.

SKILL.md

name python-fastapi-conventions
description FastAPI routing structure, Pydantic models, error handling, project layout patterns for backend implementations

Pattern: FastAPI backend standard structure following async/await patterns.

Usage: Implementing FastAPI routes, models, validation, project initialization.

Instructions:

  • Use FastAPI() instance in main.py
  • Organize routes in routers/ directory with APIRouter
  • Define Pydantic models in models/ with validation
  • Use schemas/ for request/response DTOs
  • Implement error handling with HTTPException(status_code, detail)
  • Use async def for all endpoints (async-first)
  • Add type hints on all functions

Structure:

backend/
├── main.py
├── routers/
│   ├── users.py
│   └── items.py
├── models/
│   └── user.py
└── schemas/
    └── user_schema.py

Example Error Handling:

from fastapi import HTTPException

@app.get("/items/{id}")
async def get_item(id: int):
    if not found:
        raise HTTPException(status_code=404, detail="Not found")
    return item