What problem does it solve?
The users-service skill helps you safely extend the Users Service by adding Fastify routes, wiring authentication, implementing Prisma-backed business logic, and covering changes with tests and API docs.
Core Features & Use Cases
- Route scaffolding for Fastify: Create new REST endpoints in
services/users/src/routes/users.ts with consistent request/response typing and OpenAPI schema metadata.
- Auth0-protected endpoints: Add
preHandler: requireAuth and declare security: [{ bearerAuth: [] }] so endpoints correctly require JWTs and follow the repo’s error behavior.
- Service-layer implementation with Prisma: Add business logic in
services/users/src/services/user.ts, using mapPrismaUser() for consistent domain mapping and types.
- Testing patterns for routes: Follow Vitest patterns that mock the service layer and validate responses via
app.inject, including 401 cases for missing/invalid auth.
Quick Start
Ask the skill to add a protected endpoint in the Users Service that returns the current authenticated user profile, including the route code, the corresponding service method, the OpenAPI schema update, and the Vitest coverage for the happy path and the 401 case.