api-to-fastapi-scaffold

Generates FastAPI Router, Service, and Repository scaffold code from API specification documents.

Updated Aug 15, 2026
One-click install
npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill api-to-fastapi-scaffold-jacksonlee-tw
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-to-fastapi-scaffold
Source: https://github.com/jacksonlee-tw/mystock-vue/tree/main/mystock-analysis/.github/skills/api-to-fastapi-scaffold
Command: npx skills add https://github.com/jacksonlee-tw/mystock-vue --skill api-to-fastapi-scaffold-jacksonlee-tw

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manually translating API specification documents into layered FastAPI backend code is repetitive and error-prone. This Skill automates the conversion of API specs into a consistent three-layer codebase (Router, Service, Repository) following established architectural conventions. ## Core Features & Use Cases - Spec-to-Code Generation: Parses API specification documents (endpoints, parameters, request/response bodies, validation rules) and produces Router, Service, and Repository files with correct naming conventions. - Layered Architecture Output: Generates Router endpoints with dependency injection, Service classes with TODO markers for business logic, and Repository classes extending a BaseRepository with custom query methods. - Special Endpoint Handling: Supports batch operations, export endpoints, file uploads, status-change endpoints, multi-condition search, and authenticated routes. - Use Case: Given an API spec for a weighing-records module, generate the full CRUD router, service skeleton with pagination, and repository with filter queries, then register the router in main.py. ## Quick Start Ask the AI to generate FastAPI Router, Service, and Repository scaffold code from your API specification document, for example by saying "generate the backend scaffold from this API spec".

Frequently Asked Questions about api-to-fastapi-scaffold

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

FAQPage Schema
How do I generate FastAPI code from an API specification?▼

Provide the API specification document and this Skill parses each endpoint's HTTP method, path, parameters, and response format, then generates Router, Service, and Repository files. The output follows a three-layer architecture with TODO markers where business logic must be added manually.

What code structure does FastAPI scaffold generation produce?▼

It produces three files per module: a Router with endpoint definitions and dependency injection, a Service class containing business logic skeletons with TODO markers, and a Repository class extending BaseRepository with custom query methods derived from the spec's filter conditions.

Can I generate FastAPI endpoints without a written API spec?▼

Yes. Besides spec documents, the Skill accepts verbal descriptions such as "generate a user management CRUD API" or existing router code that needs additional endpoints. It infers standard REST conventions for list, get, create, update, and delete operations.

Does the generated FastAPI code support pagination and batch operations?▼

Yes. List endpoints use PageParams and PageResponse for pagination, and special endpoint types like batch operations, export via StreamingResponse, file uploads, and status-change endpoints are handled with dedicated generation strategies.

What are the limitations of generated FastAPI scaffold code?▼

The generated Service layer contains only skeleton logic with TODO markers; business validation, delete-time relationship checks, and state machine rules must be implemented manually. You also need to register the router in main.py and write integration tests separately.