askill
fastify-best-practices

fastify-best-practicesSafety 95Repository

Comprehensive best practices for Fastify development

3 stars
1.2k downloads
Updated 3/14/2026

Package Files

Loading files...
SKILL.md

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

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

58/100Analyzed 2/24/2026

This is an index/overview document for Fastify best practices that references 19 separate rule files (not included in this content). It has good structure with clear When to use and How to use sections, includes relevant tags, and follows a dedicated skills folder pattern. However, the actual content is minimal - it provides core principles but lacks the detailed guidance that would make it fully actionable. The references to separate .md files suggest a larger documentation structure, but without that content, this skill feels incomplete. High reusability as a reference but limited immediate actionability due to missing detailed content."

95
75
80
35
40

Metadata

Licenseunknown
Version-
Updated3/14/2026
Publisherfellipeutaka

Tags

apibackendfastifyhttpnodejsservertypescript