What problem does it solve?
This Skill enforces a clean separation between API routes and business logic by implementing routers and schemas for endpoints, without embedding business rules or LLM prompts.
Core Features & Use Cases
- Router-Only Endpoints: Endpoints map requests to service methods with no business logic.
- Separate Schemas: Request and response models live under
api/schemas/ for clarity and consistency.
- Type-Safe Endpoints: Endpoints specify
response_model= to ensure predictable outputs and easier maintenance.
- Use Case: Scaffold a new resource with standard CRUD routes and corresponding schemas, ready for service integration.
Quick Start
Create a new router for a resource (e.g., items) under src/synth_lab/api/routers/, add ItemCreate, ItemDetail, and ItemSummary schemas under src/synth_lab/api/schemas/, then wire the router into src/synth_lab/api/main.py with an appropriate prefix and tags.