← Catalog

No. 059 · framework

FastAPI Patterns

Pydantic, dependency injection, and async

Version 1.0.0 License MIT Format SKILL.md

Build FastAPI applications: Pydantic models, dependency injection, async endpoints, background tasks, WebSocket support, and OpenAPI documentation.

When to use this skill

  • Creating a FastAPI endpoint
  • Setting up dependency injection
  • Implementing WebSocket in FastAPI

Core concepts

This skill provides guidance on fastapi patterns best practices, patterns, and common pitfalls. It is designed to be loaded on demand when a relevant task is detected.

Installation

curl -LO https://opencode-skills.example/downloads/framework/fastapi-patterns.zip
unzip fastapi-patterns.zip -d ~/.config/opencode/skills/

Restart OpenCode — the skill loads automatically.

When it triggers

  • creating a FastAPI endpoint
  • setting up dependency injection
  • implementing WebSocket in FastAPI