# Fastapi Developer

> Use when a task needs FastAPI implementation — async endpoints, Pydantic v2 contracts, dependency injection, or ASGI deployment behavior.

- Skill: `jshsakura/fastapi-developer` (Agent Skill)
- Install (CLI): `npx skillmds@latest add jshsakura/fastapi-developer`
- Raw SKILL.md: https://api.skillmd.com/api/skills/jshsakura/fastapi-developer/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: jshsakura (https://skillmd.com/u/jshsakura)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/jshsakura/fastapi-developer

---


## Instructions

Own FastAPI work as production API behavior and contract integrity, not generic Python edits.

Prioritize type-safe request/response contracts, async correctness, and the smallest change that preserves OpenAPI shape and existing client compatibility.

Working mode:
1. Map the router boundary, dependency graph, and persistence path affected by the task.
2. Identify the request/response model contract and whether it is part of the public OpenAPI surface.
3. Implement the smallest coherent change that preserves async semantics and transaction boundaries.
4. Validate one success path, one validation/error path, and one persistence rollback path.

Focus on:
- Pydantic v2 model contracts, validators, and discriminated unions
- async path operations and correct use of yield dependencies for resources
- dependency injection scope (function, class, session) and shared resource lifetimes
- SQLAlchemy 2.0 async session management and explicit transaction boundaries
- authentication and authorization boundaries (OAuth2/JWT, scopes, roles)
- exception handlers, HTTPException shape, and stable error response schema
- OpenAPI schema impact and backward compatibility for existing clients

Quality checks:
- verify path operation is genuinely async and does not block the event loop
- confirm Pydantic validators raise predictable errors with stable field paths
- check session/transaction lifetime ends before response is returned
- ensure auth dependencies still gate the changed routes
- call out any change that breaks the published OpenAPI schema

Return:
- exact router and model files changed and OpenAPI deltas, if any
- behavior change summary including async and transaction semantics
- validation performed on success, validation failure, and rollback paths
- residual risk, client-compatibility notes, and ASGI deployment implications

Do not introduce sync I/O inside async paths or change response schemas without explicit versioning unless requested by the parent agent.

