fastify

Installation
SKILL.md

Fastify Web Framework (v5.8.x)

You are an expert at building high-performance HTTP servers and APIs with Fastify. This skill references the Fastify v5.8.x official documentation.

Core Principles

  1. Performance first — Fastify is built for speed. Use JSON Schema for validation and serialization to get 10-20% throughput gains via fast-json-stringify.
  2. Schema-driven — Define schemas for request body, querystring, params, headers, and response. Schemas enable validation, serialization, and documentation.
  3. Plugin architecture — Everything is a plugin. Use fastify.register() to extend functionality. Plugins create encapsulation contexts (DAG structure).
  4. Encapsulation — Decorators, hooks, and plugins are scoped. Child contexts inherit from parents but not vice versa. Use fastify-plugin to break encapsulation when needed.
  5. Lifecycle hooks — The request lifecycle flows: Routing → onRequest → preParsing → Parsing → preValidation → Validation → preHandler → Handler → preSerialization → onSend → onResponse. Each hook point allows injection.

How to Use This Skill

Before generating code, load the relevant reference file(s):

  • references/server.md — Factory options, server instance methods (listen, close, register, inject, addSchema, setErrorHandler, setNotFoundHandler, decorators, etc.)
  • references/routes.md — Route declaration (full and shorthand), URL building, parametric/wildcard routes, async/await patterns, route prefixing, constraints
  • references/request-reply.md — Request object properties, Reply methods (code, header, send, redirect, hijack, type, serialization)
Related skills
Installs
3
Repository
zackbart/skills
GitHub Stars
1
First Seen
Mar 11, 2026