fastapi-developer · voltagent/awesome-codex-subagents — Codex subagent for FastAPI
fastapi-developer — a Codex subagent for FastAPI development — async operations, Pydantic v2 type-safe contracts, dependency injection, and ASGI deployment. Use when you need production API code with correct semantics.
MIT ★ 6,505 updated 2026-10-05
.codex/agents/fastapi-developer.tomlWhat fastapi-developer does
fastapi-developer maps router boundaries, dependency graphs, and transaction paths affected by your task. It builds request and response models with type safety, verifies async path operations without event loop blocking, manages session lifetimes, and validates changes across three scenarios: happy path, validation failure, and transaction rollback.
Focus areas include Pydantic v2 models with validators and discriminated unions, async/await without blocking I/O, SQLAlchemy 2.0 async session handling, OAuth2/JWT authorization boundaries, and stable error schemas. Every change is checked for compatibility with the published OpenAPI surface — reports include schema deltas and client-compatibility notes.
Returns a list of modified router and model files, behavior summaries with async and transaction details, validation across success and error paths, rollback checks, and residual deployment risks.
What it helps with
- build async endpoints without event loop blocking
- define and validate Pydantic v2 contracts with discriminated types
- manage SQLAlchemy 2.0 session lifetime and transaction boundaries
- preserve OpenAPI compatibility when changing request and response shapes
- implement OAuth2/JWT with correct scopes and role-based access control
Example prompts for the agent
- Add a POST
/usersendpoint with Pydantic validation and rollback on uniqueness conflict - Refactor the
/orders/{id}handler to be async and use a yield dependency for connection pooling - Check if changing
created_atfrom ISO string to Unix timestamp breaks the published OpenAPI schema
How to install fastapi-developer
Manually: put the files in place
.codex/agents/fastapi-developer.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.claude/agents/fastapi-developer.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.cursor/agents/fastapi-developer.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about fastapi-developer
How do I install fastapi-developer in Codex?
Place the subagent config at .codex/agents/fastapi-developer.toml in your project root, then reload Codex. The subagent will appear in your agent list for task assignment.
When should I use fastapi-developer?
Use it when building or modifying FastAPI endpoints — async operations, type-safe contracts, dependency injection, or ASGI deployment. The subagent verifies async correctness, validates contracts, and tracks schema compatibility.
What does fastapi-developer validate?
It validates the happy path (async correctness, session handling), validation failures (predictable Pydantic error shapes), and rollback scenarios (transaction abort on failure). It also ensures auth boundaries still work and OpenAPI schema remains client-compatible.
Source text
fastapi-developer.toml · MIT
# fastapi-developer Use when a task needs FastAPI implementation — async endpoints, Pydantic v2 contracts, dependency injection, or ASGI deployment behavior. 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.
© VoltAgent · MIT · VoltAgent/awesome-codex-subagents
Similar subagents
All subagents for Backend and APIs →fastapi-developer by other authors comes first.