users-servicelisted
Install: claude install-skill mattbutlerengineering/mattbutlerengineering
# Users Service Development Skill
This skill provides patterns and workflows for developing the Users Service, a Fastify-based REST API at `services/users/` that handles user management with Auth0 authentication and Prisma ORM.
## Service Overview
**Location**: `services/users/`
**Framework**: Fastify v5 with TypeScript
**Database**: PostgreSQL via Prisma
**Auth**: Auth0 JWT verification with jose
**Port**: 3001 (API docs at http://localhost:3001/docs)
### Key Files
| File | Purpose |
| ---------------------- | -------------------------------------- |
| `src/app.ts` | Fastify app setup, plugin registration |
| `src/routes/users.ts` | User CRUD endpoints and auth endpoints |
| `src/services/user.ts` | Business logic (Prisma operations) |
| `src/schemas/index.ts` | OpenAPI schema definitions |
| `prisma/schema.prisma` | Database schema |
## Adding New Endpoints
### Route Structure Pattern
Follow this pattern when adding new routes to `src/routes/users.ts`:
```typescript
fastify.get<{
Params: { id: string }; // URL params
Querystring: { page?: string }; // Query params
Body: CreateUserRequest; // Request body
Reply: ApiResponse<User> | ApiError; // Response types
}>(
"/endpoint-path",
{
preHandler: requireAuth, // Add for protected routes
schema: {
summary: "Short action description",
operationId: "uniqueOperationName",
description: "D