Home/AI Backend Engineering/fastify-best-practices
F

fastify-best-practices

by @mcollinav
4.6(55)

Provides best practices for developing backend applications with Fastify, covering plugin implementation, route handling, and architectural guidance, helping you build high-performance services.

fastifynodejsweb-frameworksapi-developmentbackend-performanceGitHub
Installation
npx skills add https://github.com/mcollina/skills --skill fastify-best-practices
compare_arrows

Before / After Comparison

1
Before

Without clear best practice guidance, developers using Fastify for backend applications may face issues such as chaotic plugin management, unreasonable routing design, and insufficient performance optimization. This leads to applications that are difficult to scale, have high maintenance costs, and fail to fully leverage Fastify's high-performance advantages, impacting user experience.

After

By following Fastify best practices, developers can systematically learn how to efficiently implement plugins, optimize route handling, and build scalable architectures. This not only ensures code quality and maintainability but also fully unleashes Fastify's performance potential, helping teams quickly build responsive, stable, reliable, and easily scalable high-performance backend services.

SKILL.md

fastify-best-practices

When to use

Use this skill when you need to:

  • Develop backend applications using Fastify

  • Implement Fastify plugins and route handlers

  • Get guidance on Fastify architecture and patterns

  • Use TypeScript with Fastify (strip types)

  • Implement testing with Fastify's inject method

  • Configure validation, serialization, and error handling

Quick Start

A minimal, runnable Fastify server to get started immediately:

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.mdroutes.mdschemas.md

  • Adding authentication: plugins.mdhooks.mdauthentication.md

  • Improving performance: schemas.mdserialization.mdperformance.md

  • Setting up testing: routes.mdtesting.md

  • Going to production: logging.mdconfiguration.mddeployment.md

How to use

Read individual rule files for detailed explanations and code examples:

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

Weekly Installs737Repositorymcollina/skillsGitHub Stars1.5KFirst SeenJan 31, 2026Security AuditsGen Agent Trust HubPassSocketPassSnykPassInstalled onopencode677codex673github-copilot670gemini-cli669cursor621kimi-cli619

User Reviews (0)

Write a Review

Effect
Usability
Docs
Compatibility

No reviews yet

Statistics

Installs21.8K
Rating4.6 / 5.0
Version
Updated2026年7月9日
Comparisons1

User Rating

4.6(55)
5
24%
4
51%
3
24%
2
2%
1
0%

Rate this Skill

0.0

Compatible Platforms

🔧Claude Code
🔧OpenClaw
🔧OpenCode
🔧Codex
🔧Gemini CLI
🔧GitHub Copilot
🔧Amp
🔧Kimi CLI

Timeline

Created2026年3月17日
Last Updated2026年7月9日
🎁 Agent Knowledge Cards
Survey