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
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: mcollina-skills-fastify3description: When to use4---56## When to use78Use this skill when you need to:9- Develop backend applications using Fastify10- Implement Fastify plugins and route handlers11- Get guidance on Fastify architecture and patterns12- Use TypeScript with Fastify (strip types)13- Implement testing with Fastify's inject method14- Configure validation, serialization, and error handling1516## Quick Start1718A minimal, runnable Fastify server to get started immediately:1920```ts21import Fastify from 'fastify'2223const app = Fastify({ logger: true })2425app.get('/health', async (request, reply) => {26 return { status: 'ok' }27})2829const start = async () => {30 await app.listen({ port: 3000, host: '0.0.0.0' })31}32start()33```3435## Recommended Reading Order for Common Scenarios3637- **New to Fastify?** Start with `plugins.md` → `routes.md` → `schemas.md`38- **Adding authentication:** `plugins.md` → `hooks.md` → `authentication.md`39- **Improving performance:** `schemas.md` → `serialization.md` → `performance.md`40- **Setting up testing:** `routes.md` → `testing.md`41- **Going to production:** `logging.md` → `configuration.md` → `deployment.md`4243## How to use4445Read individual rule files for detailed explanations and code examples:4647- [rules/plugins.md](rules/plugins.md) - Plugin development and encapsulation48- [rules/routes.md](rules/routes.md) - Route organization and handlers49- [rules/schemas.md](rules/schemas.md) - JSON Schema validation50- [rules/error-handling.md](rules/error-handling.md) - Error handling patterns51- [rules/hooks.md](rules/hooks.md) - Hooks and request lifecycle52- [rules/authentication.md](rules/authentication.md) - Authentication and authorization53- [rules/testing.md](rules/testing.md) - Testing with inject()54- [rules/performance.md](rules/performance.md) - Performance optimization55- [rules/logging.md](rules/logging.md) - Logging with Pino56- [rules/typescript.md](rules/typescript.md) - TypeScript integration57- [rules/decorators.md](rules/decorators.md) - Decorators and extensions58- [rules/content-type.md](rules/content-type.md) - Content type parsing59- [rules/serialization.md](rules/serialization.md) - Response serialization60- [rules/cors-security.md](rules/cors-security.md) - CORS and security headers61- [rules/websockets.md](rules/websockets.md) - WebSocket support62- [rules/database.md](rules/database.md) - Database integration patterns63- [rules/configuration.md](rules/configuration.md) - Application configuration64- [rules/deployment.md](rules/deployment.md) - Production deployment65- [rules/http-proxy.md](rules/http-proxy.md) - HTTP proxying and reply.from()6667## Core Principles6869- **Encapsulation**: Fastify's plugin system provides automatic encapsulation70- **Schema-first**: Define schemas for validation and serialization71- **Performance**: Fastify is optimized for speed; use its features correctly72- **Async/await**: All handlers and hooks support async functions73- **Minimal dependencies**: Prefer Fastify's built-in features and official plugins7475---76> Converted and distributed by [TomeVault](https://tomevault.io/claim/mcollina) — claim your Tome and manage your conversions.77<!-- tomevault:4.0:skill_md:2026-04-11 -->
Run npx skillmds@latest add tomevault-io/mcollina-skills-fastify in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
When to use It is listed under Coding & Dev Tools on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.