首页/AI 后端工程/fastify-best-practices
F

fastify-best-practices

by @mcollinav
4.6(55)

提供使用Fastify开发后端应用的最佳实践,涵盖插件实现、路由处理和架构指导,助您构建高性能服务。

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

Before / After 效果对比

1
使用前

在没有明确的最佳实践指导下,使用Fastify开发后端应用时,开发者可能面临插件管理混乱、路由设计不合理、性能优化不足等问题。这导致应用难以扩展,维护成本高,且无法充分发挥Fastify的高性能优势,影响用户体验。

使用后

遵循Fastify最佳实践,开发者能够系统地学习如何高效实现插件、优化路由处理和构建可扩展的架构。这不仅能确保代码质量和可维护性,更能充分释放Fastify的性能潜力,帮助团队快速构建出响应迅速、稳定可靠且易于扩展的高性能后端服务。

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

用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价

统计数据

安装量21.8K
评分4.6 / 5.0
版本
更新日期2026年7月9日
对比案例1 组

用户评分

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

为此 Skill 评分

0.0

兼容平台

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

时间线

创建2026年3月17日
最后更新2026年7月9日
🎁 Agent 知识卡片
调研问卷