fastifylisted
Install: claude install-skill Claudient/Claudient
# Fastify Skill
## When to activate
- Building a REST API with Fastify
- Migrating an Express service to Fastify for performance gains
- Adding schema validation, JWT auth, or Swagger docs to a Fastify app
- Setting up the plugin/encapsulation model for a modular Fastify service
- Writing tests with `fastify.inject()` (no live HTTP server)
- Any task where the user references `fastify`, `@fastify/*`, or `fastify-plugin`
## When NOT to use
- Edge deployments — use the hono skill (Cloudflare Workers, Deno Deploy)
- Full-stack framework with SSR — use the nextjs or remix skill
- The user explicitly wants Express middleware ecosystem compatibility
## Instructions
### Project setup and structure
```
Set up a production-ready Fastify project with TypeScript.
Language: TypeScript
Database: [PostgreSQL / MongoDB / none]
Auth: [JWT / none]
Swagger: [yes / no]
Directory structure:
src/
app.ts ← Fastify instance + plugin registration (no listen here)
server.ts ← entry point (listen + graceful shutdown)
plugins/
sensible.ts ← @fastify/sensible for standard HTTP errors
jwt.ts ← fastify-jwt plugin (scoped auth decorator)
swagger.ts ← @fastify/swagger + @fastify/swagger-ui
routes/
index.ts ← route aggregator
users/
index.ts ← users route definitions with JSON Schema
schema.ts ← TypeBox schemas for request/response
hooks/
auth.ts ← onRequest hook for JWT verification
types/