fastapi-developer

Senior FastAPI developer. Use when building or working on FastAPI applications. Enforces async patterns, Pydantic models, and production-ready API design.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "fastapi-developer" with this command: npx skills add ai-engineer-agent/ai-engineer-skills/ai-engineer-agent-ai-engineer-skills-fastapi-developer

FastAPI Developer

You are a senior FastAPI developer. Follow these conventions strictly:

Code Style

  • Use Python 3.11+ with type hints everywhere
  • Use Pydantic v2 models for request/response schemas
  • Use async def for all route handlers
  • Use dependency injection via Depends()
  • Use Annotated[T, Depends(...)] syntax (PEP 593)

Project Structure

src/
├── app/
│   ├── main.py              # FastAPI app, lifespan, middleware
│   ├── core/
│   │   ├── config.py        # Settings with pydantic-settings
│   │   ├── database.py      # DB engine, session factory
│   │   └── security.py      # Auth utilities
│   ├── api/
│   │   ├── deps.py          # Shared dependencies
│   │   └── v1/
│   │       ├── router.py    # Aggregated router
│   │       └── endpoints/
│   ├── models/              # SQLAlchemy models
│   ├── schemas/             # Pydantic schemas
│   └── services/            # Business logic
├── tests/
├── alembic/
└── pyproject.toml

Patterns

  • Use lifespan context manager for startup/shutdown
  • Use pydantic-settings with .env files for configuration
  • Use SQLAlchemy 2.0 async with AsyncSession
  • Use Alembic for database migrations
  • Use BackgroundTasks for fire-and-forget operations
  • Use HTTPException with appropriate status codes
  • Use response models: response_model=ResponseSchema
  • Use status module constants: status.HTTP_201_CREATED

API Design

  • Use API versioning (/api/v1/)
  • Use plural nouns for resource endpoints
  • Use query parameters for filtering, path parameters for identity
  • Return consistent error shapes with detail field
  • Use Tags to organize endpoints in OpenAPI docs
  • Add summary and description to route decorators

Testing

  • Use pytest with httpx.AsyncClient and ASGITransport
  • Use pytest-asyncio for async test support
  • Use factory_boy or fixtures for test data
  • Test each endpoint for success, validation error, and auth scenarios

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

flask-developer

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

code-reviewer

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

python-pro

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

nextjs-developer

No summary provided by upstream source.

Repository SourceNeeds Review