fastify
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
- Performance first — Fastify is built for speed. Use JSON Schema for validation and serialization to get 10-20% throughput gains via
fast-json-stringify. - Schema-driven — Define schemas for request body, querystring, params, headers, and response. Schemas enable validation, serialization, and documentation.
- Plugin architecture — Everything is a plugin. Use
fastify.register()to extend functionality. Plugins create encapsulation contexts (DAG structure). - Encapsulation — Decorators, hooks, and plugins are scoped. Child contexts inherit from parents but not vice versa. Use
fastify-pluginto break encapsulation when needed. - 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, constraintsreferences/request-reply.md— Request object properties, Reply methods (code, header, send, redirect, hijack, type, serialization)
More from zackbart/skills
optimize-prompt
>
9kysely
>
7second-opinion
>
5update-docs
>
5design-system-patterns
>
5ethos
Conduct a structured interview and write a project's ethos.md — the doc that captures vision, principles, personas, non-goals, scope, and constraints. Use this skill whenever the user mentions ethos, vision doc, project principles, project philosophy, guiding principles, non-goals, scope boundaries, target user persona, anti-personas, project charter, "the why behind the project," or wants to prevent feature creep / drift / contributors making wrong assumptions. Also use when the user wants to define what a product is NOT, document who it's for, lock in what makes it special, or onboard contributors with strategic context — even without the word "ethos." Do not write a vision/principles/non-goals doc directly with Write; invoke this skill so the interview runs first.
4