Back to skills
SKILL.md
Fastify Best Practices
ASecurityDevelop, configure, and debug Fastify (Node.js/TypeScript) servers and REST APIs — routes, plugins, JSON Schema validation, hooks, auth, serialization, performance, deployment. Triggers: Fastify, server.ts, app.ts, fastify.config.
- 4 stars
- 0 votes
- 0 copies
- 8 views
- Added September 19, 2026
Works with
Security analysis
100/100Pro scans all 20 files and shows the line behind each finding
npx -y skills add jgamaraalv/delivery-loop --skill fastify-best-practices --agent claude-codeAre you the author of Fastify Best Practices?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/jgamaraalv-fastify-best-practices)---
name: fastify-best-practices
description: Develop, configure, and debug Fastify (Node.js/TypeScript) servers and REST APIs — routes, plugins, JSON Schema validation, hooks, auth, serialization, performance, deployment. Triggers: Fastify, server.ts, app.ts, fastify.config.
---
## Quick Start
A minimal, runnable Fastify server to get started immediately:
```ts
import Fastify from 'fastify'
const app = Fastify({ logger: true })
app.get('/health', async (request, reply) => {
return { status: 'ok' }
})
const start = async () => {
await app.listen({ port: 3000, host: '0.0.0.0' })
}
start()
```
## Recommended Reading Order for Common Scenarios
- **New to Fastify?** Start with `plugins.md` → `routes.md` → `schemas.md`
- **Adding authentication:** `plugins.md` → `hooks.md` → `authentication.md`
- **Improving performance:** `schemas.md` → `serialization.md` → `performance.md`
- **Setting up testing:** `routes.md` → `testing.md`
- **Going to production:** `logging.md` → `configuration.md` → `deployment.md`
## How to use
Read individual rule files for detailed explanations and code examples:
- [rules/plugins.md](rules/plugins.md) - Plugin development and encapsulation
- [rules/routes.md](rules/routes.md) - Route organization and handlers
- [rules/schemas.md](rules/schemas.md) - JSON Schema validation
- [rules/error-handling.md](rules/error-handling.md) - Error handling patterns
- [rules/hooks.md](rules/hooks.md) - Hooks and request lifecycle
- [rules/authentication.md](rules/authentication.md) - Authentication and authorization
- [rules/testing.md](rules/testing.md) - Testing with inject()
- [rules/performance.md](rules/performance.md) - Performance optimization
- [rules/logging.md](rules/logging.md) - Logging with Pino
- [rules/typescript.md](rules/typescript.md) - TypeScript integration
- [rules/decorators.md](rules/decorators.md) - Decorators and extensions
- [rules/content-type.md](rules/content-type.md) - Content type parsing
- [rules/serialization.md](rules/serialization.md) - Response serialization
- [rules/cors-security.md](rules/cors-security.md) - CORS and security headers
- [rules/websockets.md](rules/websockets.md) - WebSocket support
- [rules/database.md](rules/database.md) - Database integration patterns
- [rules/configuration.md](rules/configuration.md) - Application configuration
- [rules/deployment.md](rules/deployment.md) - Production deployment
- [rules/http-proxy.md](rules/http-proxy.md) - HTTP proxying and reply.from()
## Core Principles
- **Encapsulation**: Fastify's plugin system provides automatic encapsulation
- **Schema-first**: Define schemas for validation and serialization
- **Performance**: Fastify is optimized for speed; use its features correctly
- **Async/await**: All handlers and hooks support async functions
- **Minimal dependencies**: Prefer Fastify's built-in features and official plugins
Files in this skill
- SKILL.md
- rules/authentication.md
- rules/configuration.md
- rules/content-type.md
- rules/cors-security.md
- rules/database.md
- rules/decorators.md
- rules/deployment.md
- rules/error-handling.md
- rules/hooks.md
- rules/http-proxy.md
- rules/logging.md
- rules/performance.md
- rules/plugins.md
- rules/routes.md
- rules/schemas.md
- rules/serialization.md
- rules/testing.md
- rules/typescript.md
- rules/websockets.md
Attribution
Related skills
View all in development →Comments
Loading comments…
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.