fastapi

Evaluates and improves FastAPI projects for compliance with modern coding standards.

1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/cyr-ius/portalcrane --skill fastapi-cyr-ius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fastapi
Source: https://github.com/cyr-ius/portalcrane/tree/main/.agents/skills/fastapi
Command: npx skills add https://github.com/cyr-ius/portalcrane --skill fastapi-cyr-ius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps developers keep FastAPI projects aligned with best practices and current patterns, ensuring code quality and maintainability as FastAPI evolves.

Core Features & Use Cases

  • Enforces modern FastAPI conventions for CLI usage, type annotations, and return models to improve correctness and performance.
  • Provides guidance for dependency injection, async patterns, and router-level configuration to scale APIs.
  • Helps keep code up-to-date with the latest FastAPI features and recommended patterns.

Quick Start

Refactor a FastAPI project to align with the latest best practices described above.

Frequently Asked Questions about fastapi

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a FastAPI project to use modern type annotations and dependency injection?

Refactor FastAPI projects by applying annotated parameters, explicit return types, and dependency injection patterns. This ensures code correctness and maintainability by enforcing consistent async usage and router-centric configuration across small to large codebases.

What are the best practices for structuring FastAPI routers and Pydantic models?

Best practices for FastAPI routers and Pydantic models include using router-centric configuration, explicit return types, and modern type annotations. These patterns improve API correctness, performance, and maintainability as your FastAPI application scales.

Does this FastAPI refactoring approach work for large codebases with existing sync and async routes?

Yes, this approach works for large FastAPI codebases by enforcing consistent async versus sync usage. It audits and refactors existing routes and Pydantic models to align with up-to-date conventions without breaking current application logic.

How do I audit my FastAPI app for outdated patterns and code quality issues?

Audit FastAPI apps by checking for modern conventions like annotated parameters, explicit return types, and dependency injection. Identifying outdated patterns helps keep code aligned with current FastAPI features and ensures long-term maintainability.

Why should I use explicit return types and annotated parameters in FastAPI endpoints?

Explicit return types and annotated parameters in FastAPI endpoints improve correctness and performance. They enforce clear API contracts, enable better dependency injection, and keep your code aligned with up-to-date framework conventions.

What is the best way to keep FastAPI code clean and up-to-date as the framework evolves?

Keep FastAPI code clean by applying current best practices such as router-centric configuration, dependency injection, and consistent async patterns. Regularly refactoring Pydantic models and type annotations ensures your project stays maintainable.