fastapi-service-development

FastAPI service development workflow for production-grade Python APIs. Use when FastAPI service behavior (path operations, dependency injection, request/response models, validation, async execution, OpenAPI exposure) must be implemented or revised; do not use for repository-wide architecture governance or release management policy.

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-service-development" with this command: npx skills add kentoshimizu/sw-agent-skills/kentoshimizu-sw-agent-skills-fastapi-service-development

Fastapi Service Development

Overview

Use this skill to build FastAPI services with explicit schema contracts, controlled dependency lifecycles, and predictable async runtime behavior.

Scope Boundaries

  • Use this skill when the task matches the trigger condition described in description.
  • Do not use this skill when the primary task falls outside this skill's domain.

Shared References

  • Dependency lifecycle guidance:
    • references/fastapi-dependency-lifecycle-guidance.md
  • Schema contract guidance:
    • references/fastapi-schema-contract-guidance.md

Templates And Assets

  • Router implementation starter:
    • assets/fastapi-router-template.py
  • Error response shape template:
    • assets/fastapi-error-model-template.json
  • Service verification checklist:
    • assets/fastapi-service-checklist.md

Inputs To Gather

  • Endpoint definitions and request/response schema requirements.
  • Dependency injection graph and external service dependencies.
  • Authentication, validation, and observability requirements.
  • Async I/O boundaries and expected latency constraints.
  • Internal service DTO contracts to avoid untyped dict[str, Any] propagation.

Deliverables

  • Endpoint map with typed request/response models.
  • Dependency and lifecycle management plan.
  • Error contract and exception handling policy.
  • Verification checklist and test focus areas.

Workflow

  1. Define Pydantic models and endpoint contracts first.
  2. Separate routers, service logic, and infrastructure adapters.
  3. Convert boundary payloads to explicit domain input/output models before service-layer execution.
  4. Manage shared resources using references/fastapi-dependency-lifecycle-guidance.md.
  5. Implement exception mapping with assets/fastapi-error-model-template.json.
  6. Validate behavior and docs with assets/fastapi-service-checklist.md.

Quality Standard

  • All endpoints expose explicit typed schemas.
  • Dependency scope and teardown behavior are deterministic.
  • Error responses are stable and machine-parseable.
  • OpenAPI output reflects actual runtime behavior.
  • Internal logic minimizes runtime casts by using precise models at boundaries.

Failure Conditions

  • Stop when schema contracts are ambiguous or loosely typed.
  • Stop when async request paths contain hidden blocking I/O.
  • Escalate when dependency lifecycle cannot be managed safely.

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

github-codeowners-management

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

infrastructure-as-code

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

python-style-guide

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

dynamic-programming

No summary provided by upstream source.

Repository SourceNeeds Review