api-design

Standardize REST API design for FastAPI routers with URL, status code, and authentication conventions.

4|Updated Dec 5, 2025
One-click install
npx skills add https://github.com/aaaa47080/stock_agent --skill api-design-aaaa47080
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/aaaa47080/stock_agent/tree/main/.opencode/skills/api-design
Command: npx skills add https://github.com/aaaa47080/stock_agent --skill api-design-aaaa47080

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

REST API design in FastAPI projects is often ad-hoc, leading to inconsistent endpoints, unclear error handling, and difficult maintenance.

Core Features & Use Cases

  • URL structure conventions for resources, collections, and sub-resources
  • Standard HTTP methods, status codes, responses, and error handling patterns
  • Consistent authentication and authorization expectations across routers
  • Use Case: Designing a new set of endpoints for a microservice with clear resource naming and predictable responses

Quick Start

Apply these conventions when scaffolding new FastAPI routers to ensure consistent, maintainable APIs.

Frequently Asked Questions about api-design

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

FAQPage Schema
How do I standardize REST API URL structures in FastAPI?

Standardize REST API URL structures in FastAPI by applying explicit conventions for resources, collections, and sub-resources to ensure consistent endpoint naming and maintainable router scaffolding.

What conventions should I use for FastAPI HTTP status codes and error handling?

Use standard HTTP methods, status codes, and error handling patterns to enforce predictable REST API responses, ensuring clear communication of routing outcomes and exceptions across FastAPI endpoints.

How do I implement consistent authentication and rate limiting in FastAPI endpoints?

Implement consistent authentication and rate limiting in FastAPI endpoints by applying explicit conventions and examples that define authorization expectations and pagination controls across all routers.

Can I use these REST API design conventions for both microservices and monoliths?

Yes, you can use these REST API design conventions for both microservices and monoliths, as the rules standardize HTTP endpoint structures, responses, and authentication regardless of architectural scale.

What is the best way to scaffold maintainable FastAPI routers for a new microservice?

Scaffold maintainable FastAPI routers by applying standardized REST API design conventions for URL naming, pagination, and authentication, preventing ad-hoc endpoint creation and maintenance difficulties.