Back to Skills

fastify-best-practices

Guides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript. Use when building, configuring, or debugging a Fastify application — including defining routes, implementing plugins, setting up JSON Schema validation, handling errors, optimising performance, managing authentication, configuring CORS and security headers, integrating databases, working with WebSockets, and deploying to production. Covers the full Fastify request lifecycle (hooks, serialization,

1,813stars140forksUpdated 5/26/2026

Security Assessment

Medium Risk(50/100)

Detected risks:

Secret Exposure([rules/deployment.md] SECRET=, [rules/deployment.md] PASSWORD=, [rules/decorators.md] token =)
Sensitive File Access([rules/deployment.md] .env, [rules/decorators.md] .env, [rules/authentication.md] .env)
Security Score50/100

About fastify-best-practices

The fastify-best-practices skill provides structured guidance for building and maintaining Fastify-based backend applications and REST APIs using JavaScript or TypeScript. It helps developers follow established Fastify patterns when creating Node.js servers, organizing application architecture, configuring APIs, and troubleshooting backend issues. The skill addresses common backend development challenges by consolidating recommendations around server setup, request handling, validation, performance optimization, and production readiness into a consistent workflow.

Its capabilities span the complete Fastify development lifecycle. It includes guidance for implementing route handlers and plugins, configuring JSON Schema validation and response serialization, handling errors, using hooks across the request lifecycle, and integrating authentication and authorization flows. It also covers logging with Pino, TypeScript integration, testing using Fastify's inject method, content-type handling, decorators, WebSocket support, database integration patterns, application configuration, deployment practices, HTTP proxying, and security-related setup such as CORS and security headers. The skill emphasizes core Fastify principles including encapsulation, schema-first design, async/await usage, performance-conscious development, and preference for built-in capabilities and official plugins.

This skill is designed for backend developers, API engineers, and teams building Fastify applications ranging from simple services to production deployments. It is useful for developers new to Fastify who need onboarding guidance, as well as experienced users looking for implementation patterns and architectural recommendations. Typical use cases include creating REST APIs, adding authentication flows, improving server performance, introducing testing strategies, and preparing Fastify applications for deployment.

FAQ

When should I use the fastify-best-practices skill?

Use it when developing, configuring, debugging, or optimizing Fastify backend applications and REST APIs, including work related to routes, plugins, schemas, testing, and deployment.

Does this skill support TypeScript projects?

Yes. The skill includes guidance for using TypeScript with Fastify and references TypeScript integration practices.

Can this skill help with testing Fastify applications?

Yes. It includes testing guidance using Fastify's inject method for application testing workflows.

Does the skill cover production and deployment topics?

Yes. It includes guidance related to logging, configuration, deployment practices, and production-oriented application setup.

Are external libraries required for most implementations?

The documented principles recommend preferring Fastify's built-in capabilities and official plugins where possible, minimizing unnecessary dependencies.

All Files

21 files
rules/deployment.md8.8 KB
View
SKILL.md3.7 KB
View
rules/decorators.md9.5 KB
View
rules/websockets.md8.8 KB
View
rules/authentication.md12.7 KB
View
rules/cors-security.md8.8 KB
View
rules/logging.md7.8 KB
View
rules/error-handling.md9.7 KB
View
rules/performance.md9.0 KB
View
rules/configuration.md5.0 KB
View
rules/database.md7.1 KB
View
rules/schemas.md11.7 KB
View
rules/typescript.md9.1 KB
View
rules/content-type.md8.1 KB
View
rules/serialization.md9.5 KB
View
rules/hooks.md9.8 KB
View
rules/http-proxy.md5.3 KB
View
tile.json0.8 KB
View
rules/plugins.md7.6 KB
View
rules/routes.md9.7 KB
View
rules/testing.md10.8 KB
View

Install fastify-best-practices

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

mcollina/skills