ValentinNikolaev/agent-skills / agent-plugins/skills/fastapi-development
fastapi-development
VerifiedImplement FastAPI APIs and streaming; not diff review or generic Python.
| File | Kind | Size |
|---|---|---|
| LICENSE.fastapi | other | 1.1 KB |
| SKILL.md | skill md | 5.3 KB |
| agents/openai.yaml | config | 287 B |
| references/contracts-and-versions.md | markdown | 4.7 KB |
SKILL.md
View on GitHub---
name: fastapi-development
description: Implement FastAPI APIs and streaming; not diff review or generic Python.
---
# FastAPI Development
Implement the requested FastAPI behavior using the project's supported versions, established stack and public contract. Preserve unrelated work. Return implemented changes, observed verification and remaining limits.
## Route precisely
- Use for creating or changing FastAPI endpoints, Pydantic request/response boundaries, dependencies, lifespan resources or streaming behavior.
- Use `code-review` for a read-only review of an existing diff. Do not start implementation merely because reviewed code uses FastAPI.
- Use `api-and-interface-design` for a proposed API contract, `review-spec` for a proposed specification and `verify-impl` for conformance to an accepted spec.
- Use `uv-project-workflow` when the requested result is Python environment or dependency management; the presence of a Python file does not choose uv.
- Do not activate for unrelated Python, Django, Flask, generic asyncio, or an API with no FastAPI requirement. Establish the framework if it is genuinely unresolved.
## Establish the contract and compatibility
1. Read repository instructions and working-tree state. Identify the owning app/package, affected routes and tests; preserve dirty overlapping work.
2. Read Python constraints, manifests/lockfiles, resolved FastAPI/Starlette/Pydantic versions, ASGI deployment, lifespan and test configuration. Distinguish a released installed API from upstream main.
3. State the requested inputs, outputs, status/error behavior, authorization, compatibility and resource ownership. For streams, name the protocol and whether incremental delivery or disconnect behavior is required.
4. Consult [references/contracts-and-versions.md](references/contracts-and-versions.md) only for the affected features. Verify a feature against the installed version's signatures/source or matching official docs before using it. If evidence is unavailable, use an established supported path or state the missing verification; do not invent a version floor or upgrade automatically.
## Implement the smallest coherent change
- Prefer `Annotated` parameter/dependency declarations for new compatible code. Reuse dependency aliases when useful; avoid unrelated rewrites of working signatures.
- Define validation where untrusted values enter. Keep missing values, `None`, defaults, coercion and strictness consistent with the contract. For new required Pydantic fields prefer no ellipsis default; do not treat existing `RootModel` or ellipsis as globally deprecated.
- Declare the public output schema through a supported return type or `response_model`. Keep internal secrets out of that schema. Direct `Response` objects need their own serialization/filtering guarantees.
- Keep router/app dependencies and authorization explicit. Use ordinary validation instead of dependency machinery when no external state or shared execution is needed.
- Match sync/async execution to actual calls. Keep blocking work off the event loop with a supported, bounded approach; preserve the chosen DB/HTTP libraries unless replacement is requested or demonstrably necessary.
- Own each session, client, file, task and generator until its last consumer finishes. Align `yield` cleanup with response consumption and the installed dependency-scope semantics. Do not capture request resources for detached work without a lifecycle and failure owner.
- Use the requested stream protocol. Check support before adopting native SSE, JSON Lines helpers or newer frontend APIs. Include cancellation and cleanup; do not create unbounded work behind a semaphore.
- Reuse repository tooling. uv, Ruff, ty, Asyncer, SQLModel and HTTPX are options, not mandatory migrations. Do not enable telemetry/exporters or start a production server as a side effect of editing an endpoint.
## Verify behavior
Use the configured targeted ASGI tests and local quality checks. Verify the changed public body/schema, invalid inputs, authorization, error status and resource cleanup as applicable. Exercise app lifespan when a test depends on its resources.
For streaming, distinguish producer iteration, in-process HTTP buffering and an actual incremental/disconnect test. Report which was observed; a buffered TestClient result does not prove deployed backpressure or proxy behavior. Inspect test setup before contacting services or modifying data. Do not install missing tooling merely to claim a check passed.
Use a defect/control comparison when it materially validates a regression claim; keep scratch inputs isolated. Report unrun tests, missing dependencies and unsupported version cells. Separate schema/type-check success from runtime behavior.
## Report
Return the implemented scope, version evidence, public behavior changes, files affected, actual tests/results and unverified behavior. Identify any dependency/configuration change and its side effects. Do not commit, publish, deploy or launch external services without the applicable authorization.
Adapted and substantially rewritten from the [official FastAPI skill](https://github.com/fastapi/fastapi/tree/0b919816378eaa773df7ce4204414c712c9fdbea/fastapi/.agents/skills/fastapi), MIT, copyright Sebastián Ramírez; see `LICENSE.fastapi`. Changes include version gates, precise routing, stack preservation and explicit verification limits. Attribution does not imply endorsement.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |