What problem does it solve?
This Skill provides a comprehensive guide to best practices for building robust and maintainable APIs, focusing on routing, service layers, error handling, and asynchronous operations.
Core Features & Use Cases
- Service Layer Ownership: Enforces business logic within services, keeping routes lean.
- Async-First Design: Promotes efficient I/O operations using
async/await and httpx.AsyncClient.
- Standardized Error Handling: Defines clear mappings between domain exceptions and HTTP responses.
- RORO Pattern: Encourages the use of Pydantic models for structured request and response handling.
- Use Case: When developing new API endpoints or refactoring existing ones, consult this Skill for guidance on structuring code, handling errors gracefully, and implementing efficient asynchronous patterns.
Quick Start
Use the courierflow-api skill to understand how to handle NotFoundError exceptions in API routes.