A collection of skills for AI coding agents (Claude Code, Copilot, Cursor, etc.) to help you build production-ready Fastify applications following best practices.
Skills follow the Agent Skills format.
Apply Fastify best practices when creating servers, plugins, routes, schemas, hooks, decorators, error handling, testing, and TypeScript integration.
| Rule | Impact | Description |
|---|---|---|
| Create Server | LOW-MEDIUM | Use a buildServer() factory function for reusable, testable server setup |
| Create Plugin | LOW-MEDIUM | Encapsulate reusable functionality in plugins with fastify-plugin |
| Autoload | HIGH | Automatically load plugins and routes with @fastify/autoload |
| Route Best Practices | MEDIUM | Organize routes with plugins/prefixes, async handlers, full route options |
| Schema Validation (Zod) | HIGH | Type-safe validation with Zod + fastify-type-provider-zod |
| Encapsulation | HIGH | Proper scope isolation and when to use fastify-plugin |
| Error Handling | HIGH | Custom error handlers, @fastify/error, @fastify/sensible, 404 handling |
| Hooks & Lifecycle | MEDIUM | Full lifecycle hook coverage: request pipeline (onRequest → onResponse), application hooks (onReady, onClose), scoped hooks, and async/callback patterns |
| Logging | HIGH | Built-in Pino logger, request correlation, redaction, child loggers |
| Authentication | HIGH | JWT auth with @fastify/jwt, multi-strategy with @fastify/auth |
| Testing | HIGH | Test with inject(), buildServer pattern, vitest/node:test |
| TypeScript | MEDIUM | Type providers, module augmentation, typed decorators |
| Decorators | MEDIUM | Extend the Fastify instance, request, and reply with decorate / decorateRequest / decorateReply |
npx skills add TheCodePace/fastify-skillsSkills are automatically available once installed. The agent will use them when relevant tasks are detected.
Examples:
- "Create a new Fastify server with routes and plugins"
- "Add a users REST API with Zod validation"
- "How should I structure my Fastify app?"
- "Write tests for my Fastify routes"
Each skill contains:
SKILL.md— Instructions for the agentrules/— Best practice rules organized by topic
MIT