← ClaudeAtlas

new-service-routelisted

Scaffold a new Fastify route in services/{reservations,users,agent} matching the house pattern — schema validation, auth, error envelope per ADR-002, SSE broadcast (if reservations), tests
mattbutlerengineering/mattbutlerengineering · ★ 0 · API & Backend · score 69
Install: claude install-skill mattbutlerengineering/mattbutlerengineering
# /new-service-route — add a Fastify route to a service Generates a new route handler in one of the monorepo's Fastify services that matches the conventions of existing routes. ## Gather context Ask the user (or accept as args) if not obvious from the task: 1. **Which service?** One of `reservations`, `users`, `agent`. 2. **HTTP method + path.** e.g., `POST /api/v1/floor-plans/:id/clone`. 3. **What it does.** One sentence — becomes the OpenAPI `summary`. 4. **Request body / params / querystring** — the shapes that need validation. 5. **Response shape** — what gets returned on success. 6. **Auth?** Nearly always yes. `preHandler: [fastify.requireAuth]`. 7. **Should it emit an SSE event?** reservations service only — e.g., `floor-plan:created`. ## Route shape (example — adapt to the specific service) ```typescript fastify.post<{ Params: { id: string }; Body: CloneFloorPlanRequest; Reply: ApiResponse<FloorPlan> | ApiError; }>( "/:id/clone", { preHandler: requireAuth, schema: { summary: "Clone a floor plan", operationId: "cloneFloorPlan", description: "Duplicates a floor plan and all its tables.", tags: ["Floor Plans"], params: { type: "object", required: ["id"], properties: { id: { type: "string" } }, }, body: { type: "object", properties: { name: { type: "string" } }, }, response: { 201: { /* FloorPlan */ }, 404: { /*