Kipt

Fastify skill for Claude Code: fastify-best-practices

The Fastify skill, fastify-best-practices, is Matteo Collina's Agent Skill for Fastify APIs: plugins, schemas, hooks, testing. What it does and how to install.

By the Kipt team · Updated 24 October 2026

Source: mcollina/skills · Maintainer: community: Matteo Collina · License: MIT · Checked: 24 October 2026

What is the Fastify skill?

The Fastify skill is fastify-best-practices, an Agent Skill that teaches Claude Code, Codex and other agents how to build Fastify servers and REST APIs the way Fastify is designed to be used: encapsulated plugins, schema-first validation and serialization, async hooks, and testing with inject(). It is for Node.js backend developers who want agent-written Fastify code that follows the framework's conventions instead of Express habits.

It comes from mcollina/skills, described as "My own collection of skills for modern Node.js development." Matteo Collina is listed as a lead maintainer in Fastify's README, so the skill reflects a core maintainer's view, though it is not published by the Fastify organization.

As of 24 October 2026, its skills.sh page listed 81.0K installs (snapshot, 24 October 2026).

What does it do?

The skill's description says it "Guides development of Fastify Node.js backend servers and REST APIs using TypeScript or JavaScript," and lists the cases it covers: routes, plugins, JSON Schema validation, error handling, performance, authentication, CORS and security headers, databases, WebSockets and deployment. It ends with trigger terms such as "Fastify, Node.js server, REST API" and file names like server.ts and app.ts.

The SKILL.md itself is short. It gives a minimal runnable server, a reading order for common scenarios, an index of rule files, and five core principles:

  • Encapsulation: "Fastify's plugin system provides automatic encapsulation."
  • Schema-first: "Define schemas for validation and serialization."
  • Performance: use Fastify's features correctly.
  • Async/await: "All handlers and hooks support async functions."
  • Minimal dependencies: "Prefer Fastify's built-in features and official plugins."

The reading order it suggests:

Scenario Rule files, in order
New to Fastify plugins, routes, schemas
Adding authentication plugins, hooks, authentication
Improving performance schemas, serialization, performance
Setting up testing routes, testing
Going to production logging, configuration, deployment

What's in the 19 rule files (each in rules/):

  • plugins.md: encapsulation, when to break it with fastify-plugin, registration order, autoloading. Fastify's encapsulation docs explain the same model.
  • schemas.md: JSON Schema with TypeBox, shared schemas with $id, coercion, OpenAPI integration.
  • typescript.md: Node.js type stripping, type providers, typing decorators, plugins and hooks.
  • testing.md: inject() with node:test, plugins in isolation, database tests with transactions.
  • authentication.md: @fastify/jwt, refresh tokens, role and permission checks, API keys, sessions, password hashing, rate limiting.
  • performance.md: @fastify/under-pressure for load shedding, always defining response schemas, avoiding event loop blocking, request coalescing.
  • database.md: official adapters such as @fastify/postgres, @fastify/mysql, @fastify/mongodb and @fastify/redis, plus a repository pattern.
  • deployment.md: graceful shutdown with close-with-grace, health checks, Docker and Kubernetes examples, trust proxy settings.
  • Plus routes, hooks, error handling, logging with Pino, decorators, content-type parsing, serialization, CORS and security headers, WebSockets, configuration and HTTP proxying with reply.from().

How do you install the Fastify skill?

The repo README lists the skills but gives no install command, so use the one from skills.sh:

npx skills add https://github.com/mcollina/skills --skill fastify-best-practices

Add -g to install for all projects, or -a claude-code to target Claude Code. Note the name mismatch: the folder in the repo is skills/fastify, while the skill name in the frontmatter, and the name the CLI matches, is fastify-best-practices.

Claude Code reads skills from .claude/skills/ in a project or ~/.claude/skills/ for your user, as its skills docs explain. Codex and Cursor read the same SKILL.md format; see Codex skills and Cursor skills.

The same repo has a companion node skill for general Node.js practice and an oauth skill with Fastify integration patterns, which you can add with more --skill flags.

How do you use it?

Mention Fastify, or a file such as server.ts or app.ts, and the skill can load on its own. You can also call it by name, as /fastify-best-practices in Claude Code.

Example prompts (suggestions, not quotes from the repo):

  • Scaffold a Fastify API for a todo app in TypeScript, with TypeBox schemas for every route.
  • Move our auth decorator into a plugin and make it available to all routes under /api.
  • Write node:test tests for the /users routes using inject(), including validation errors.
  • Our Fastify service slows down under load. Review it against the performance rules.
  • Get this Fastify app production ready: graceful shutdown, health checks and a Dockerfile.

Tips and limits

  • All three audits pass. On skills.sh, Gen Agent Trust Hub, Socket and Snyk all showed Pass on 24 October 2026.
  • Type stripping depends on your Node.js version. The skill says type stripping works from Node.js 22.6 with --experimental-strip-types, and with plain node app.ts in Node.js 23 and later. Node's TypeScript docs add that type stripping is enabled by default from v22.18.0 and v23.6.0, and that only erasable TypeScript syntax runs this way; for full TypeScript syntax the docs point to a third-party tool such as tsx.
  • Opinionated on tooling. Tests use node:test, schemas use TypeBox, logging uses Pino. If your project uses Vitest or Zod, say so in your prompt or CLAUDE.md.
  • Rule files load on demand. The SKILL.md is an index; the agent reads only the rule files a task needs, so expect it to open several files on a broad request.
  • No scripts. The skill is plain Markdown and runs nothing on its own.
  • Broad triggers. The description includes generic trigger terms such as "REST API" and "backend framework", so the skill could load for generic Node.js API work too. If you use another framework in the same environment, install it per project rather than with -g.

Under the MIT License you can copy and change it as long as you keep the copyright notice.

Save it in your Kipt library

In Kipt, open Skills and paste the skill's GitHub folder link into the import box. Kipt reads the SKILL.md and the rules/ files. Paste the repo link instead and Kipt shows a list of Collina's skills, so you can take node or oauth as well. Your skills live in your own private GitHub repo and install into Claude Code or Codex with one command:

npx skills add https://github.com/<you>/<repo>.git --all -g

Kipt is not affiliated with Matteo Collina or the Fastify project.

Similar skills

Questions

What is the fastify-best-practices skill?

fastify-best-practices is an Agent Skill in Matteo Collina's mcollina/skills repo, released under the MIT license. It guides a coding agent through building Fastify servers and REST APIs in TypeScript or JavaScript, with 19 rule files covering plugins, routes, JSON Schema, hooks, auth, testing, performance and deployment. Collina is listed as a lead maintainer of Fastify.

How do I install the Fastify skill?

Run npx skills add https://github.com/mcollina/skills --skill fastify-best-practices, the command on its skills.sh page. Add -g to install it for every project. The folder in the repo is named fastify, but the skill name in SKILL.md is fastify-best-practices.

Does the Fastify skill work with TypeScript?

Yes. The skill recommends running TypeScript directly with Node.js type stripping instead of a build step, plus a tsconfig with noEmit and erasableSyntaxOnly. Its typescript rule file also covers type providers, typing decorators, plugins and hooks.

How does the skill test Fastify apps?

It uses Fastify's inject() method with the built-in node:test runner. The skill notes that inject() simulates HTTP requests without network overhead. The testing rule file covers headers, validation errors, file uploads, plugins in isolation and database transactions.

Is the Fastify skill official?

It is not published by the Fastify organization. It comes from Matteo Collina's personal repo, and Fastify's README lists him as a lead maintainer, so it reflects a core maintainer's recommendations rather than official project docs.

More in Skill directory

All guides

Keep your prompts and skills in one place, in your own GitHub. Install every skill with one command.

Get started

Kipt is an independent product, not affiliated with or endorsed by Anthropic, OpenAI, Cursor or GitHub. Claude, ChatGPT, Codex, Cursor and GitHub are trademarks of their owners.