api-add-route
Installation
SKILL.md
Adding an API route
Activates for work in services/api. Follow these steps in order.
- Write the handler in the matching module (
tickets.pyfor ticket routes, a new module for a new noun). Signature is(request: dict) -> dict. - Validate inputs first. Missing/!bad input raises
ValidationError— never return an error dict by hand. - Do no business logic here. Call a repo (
packages/db) or another service. The handler only orchestrates and shapes the response. - Register the route in
routes.pyinsidebuild_app()—app.route("METHOD /path", handler). A route not registered there does not exist. - Add a test in
tests/that builds the app and dispatches the route.
Full checklist with a worked example: references/route-checklist.md.