Community程式設計與開發github.com

mcollina/fastify-best-practices

指導使用 TypeScript 或 JavaScript 開發 Fastify Node.js 後端伺服器與 REST API。用於建置、設定或除錯 Fastify 應用程式,涵蓋路由定義、外掛實作、JSON Schema 驗證、錯誤處理、效能最佳化、驗證管理、CORS 與安全標頭設定、資料庫整合、WebSockets 操作及生產環境部署。

fastify-best-practices 是什麼?

這個技能提供了一套全面的指南,用於開發基於 Fastify 的 Node.js 後端伺服器和 REST API,支援 TypeScript 和 JavaScript。其主要目的是協助開發者在建置、設定或除錯 Fastify 應用程式時,遵循業界最佳實踐。技能涵蓋了完整的 Fastify 請求生命週期,包括鉤子函數、序列化以及使用 Pino 進行日誌記錄。此外,它還深入探討了 TypeScript 整合、JSON Schema 驗證、錯誤處理、效能最佳化、驗證管理、CORS 與安全標頭設定,以及資料庫和 WebSockets 的整合。對於需要開發高生產力、可維護且高效能的 Fastify 應用程式的開發團隊,此技能極為有用。觸發關鍵詞包括 Fastify、Node.js 伺服器、REST API、API 路由、後端框架、fastify.config、server.ts 和 app.ts。

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/mcollina/skills/tree/main/skills/fastify-best-practices

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

fastify-best-practices 是做什麼的?

指導使用 TypeScript 或 JavaScript 開發 Fastify Node.js 後端伺服器與 REST API。用於建置、設定或除錯 Fastify 應用程式 — 包括定義路由、實作外掛、設定 JSON Schema 驗證、處理錯誤、最佳化效能、管理驗證、設定 CORS 與安全標頭、整合資料庫、操作 WebSockets,以及部署至生產環境。涵蓋完整的 Fastify 請求生命週期(鉤子函數、序列化、使用 Pino 進行日誌記錄)以及透過 strip types 進行的 TypeScript 整合。觸發關鍵詞:Fastify、Node.js 伺服器、REST API、API 路由、後端框架、fastify.config、server.ts、app.ts。

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

mcollina/documentation

Creates, structures, and reviews technical documentation following the Diátaxis framework (tutorials, how-to guides, reference, and explanation pages). Use when a user needs to write or reorganize docs, structure a tutorial vs. a how-to guide, build reference docs or API documentation, create explanation pages, choose between Diátaxis documentation types, or improve existing documentation structure. Trigger terms include: documentation structure, Diátaxis, tutorials vs how-to guides, organize docs, user guide, reference docs, technical writing.

mcollina/node

Provides domain-specific best practices for Node.js development with TypeScript, covering type stripping, async patterns, error handling, streams, modules, testing, performance, caching, logging, and more. Use when setting up Node.js projects with native TypeScript support, configuring type stripping (--experimental-strip-types), writing Node 22+ TypeScript without a build step, or when the user mentions 'native TypeScript in Node', 'strip types', 'Node 22 TypeScript', '.ts files without compilation', 'ts-node alternative', or needs guidance on error handling, graceful shutdown, flaky tests, profiling, or environment configuration in Node.js. Helps configure tsconfig.json for type stripping, set up package.json scripts, handle module resolution and import extensions, and apply robust patterns across the full Node.js stack.

mcollina/nodejs-core

Debugs native module crashes, optimizes V8 performance, configures node-gyp builds, writes N-API/node-addon-api bindings, and diagnoses libuv event loop issues in Node.js. Use when working with C++ addons, native modules, binding.gyp, node-gyp errors, segfaults, memory leaks in native code, V8 optimization/deoptimization, libuv thread pool tuning, N-API or NAN bindings, build system failures, or any Node.js internals below the JavaScript layer.

mcollina/typescript-magician

Designs complex generic types, refactors `any` types to strict alternatives, creates type guards and utility types, and resolves TypeScript compiler errors. Use when the user asks about TypeScript (TS) types, generics, type inference, type guards, removing `any` types, strict typing, type errors, `infer`, `extends`, conditional types, mapped types, template literal types, branded/opaque types, or utility types like `Partial`, `Record`, `ReturnType`, and `Awaited`.

相關技能