In short.
Fastify Best Practices is a reference skill for developers using coding assistants to build backends with Fastify, a Node.js web framework, but its broad example collection needs adaptation and security review. Version 0.1.0 organizes guidance around plugins, schemas and the request lifecycle, with examples extending through authentication, database access and deployment. Concrete concerns include SQL column names assembled without an explicit allowlist, incomplete evidence of database test isolation and authentication tokens placed in a redirect URL. No code was executed, and the evidence supplies no measured improvement in performance or assistant output.
Researched and written by an AI model and checked by a second AI model. How it works
The selected scope comprises skills/fastify/SKILL.md, all 19 skills/fastify/rules/*.md files and skills/fastify/tile.json at revision c75d70dbfbe991d8cec42aeda0b64ff14fbb9ac7. The repository-level LICENSE is included as a related notice. External linked pages, dependency implementations and other repository folders are excluded. No code or commands were executed. Runtime correctness, compatibility, deployed security, performance and effects on assistant output remain unassessed.
The overview
Identity
The package identifies itself as mcollina/fastify-best-practices, version 0.1.0. It contains text instructions and code examples that a coding assistant or developer can consult when building Fastify applications in JavaScript or TypeScript. SKILL.md is the entry point and links to 19 topic guides.
Its original location is [https://github.com/mcollina/skills/tree/main/skills/fastify]. Fastify and the plugins used in its examples are separate dependencies; the selected files provide guidance rather than a complete backend application.
Assessment
The skill is useful as a structured starting reference for Fastify development. It connects route organization, plugin boundaries, validation, response serialization and testing, giving developers concrete conventions to discuss with an assistant. Several examples depend on application-specific helpers, database objects or configuration that the reader must supply.
Its performance advice includes response schemas, load shedding, caching, worker threads and profiling. The serialization guide claims a two- to threefold serialization speedup, but supplies no benchmark method or results supporting that figure. Application speedups and improvements in generated code remain unknown.
Users
The intended audience includes developers starting a Fastify API, adding features to an existing backend or investigating configuration and request-handling problems. Beginners receive suggested reading paths, including plugins, routes and schemas for an introduction. Familiarity with JavaScript or TypeScript and HTTP is helpful because the guides quickly move into implementation examples.
Experienced developers can consult the material on encapsulation, typed decorators, schema reuse, authenticated request tests and application shutdown. No particular coding assistant, model or supported skill host is named.
Capabilities
The guides cover routes, plugins, decorators, request hooks, validation, serialization and error handling. Integration examples include PostgreSQL, MySQL, MongoDB, Redis, multipart uploads, XML and protobuf parsing, WebSockets, reverse proxies and API gateways.
Security topics include JWTs, refresh tokens, sessions, permissions, resource ownership, password hashing, CORS, security headers and rate limiting. Operational examples cover Pino logging, health endpoints, graceful shutdown, Docker, Kubernetes and Prometheus metrics. These are documented implementation patterns; their working behavior is not demonstrated by execution results.
Using it
Requirements
Using the examples requires Node.js, Fastify and the dependencies relevant to the chosen feature. These include TypeBox for typed schemas, env-schema for configuration validation and individual Fastify plugins. Database and Redis examples also require the corresponding services and connection settings. Reading the skill does not require provisioning every illustrated service.
The TypeScript guide describes native type stripping and a separate tsc --noEmit check. It names Node.js 22.6+ with an experimental flag and presents unflagged execution for Node.js 23+. A sample plugin metadata block mentions Fastify 5.x, but the files provide no validated package-wide compatibility matrix or pinned dependency set. Supported assistant hosts and model requirements are unknown.
Mechanism
SKILL.md describes relevant tasks and directs the reader to individual rule files. Its frontmatter names the skill fastify-best-practices and declares that it should be used when building, configuring or debugging a Fastify application. It lists the trigger terms Fastify, Node.js server, REST API, API routes, backend framework, fastify.config, server.ts and app.ts. It also suggests reading sequences for authentication, performance, testing and production work. The mechanism is task-specific written guidance with examples; the selected files contain no model or autonomous execution engine.
The technical approach centers on Fastify's structure. Plugins determine where helpers and hooks are available, decorators add application-specific properties, hooks place work at particular stages of a request, and schemas describe accepted inputs and response fields. For example, the lifecycle guide places onRequest before body parsing and onResponse after the response has been sent.
Setup
Keep the complete skills/fastify directory together, including SKILL.md, rules and tile.json. The entry point uses relative links to the detailed guides, so copying it alone omits most of the material. Retain the MIT notice when copying or redistributing the package. Installation commands, and how a particular assistant host acts on the declared triggers and loads the relative rule files, are not documented and remain unknown.
For a new application, the suggested introductory path is plugins, routes and schemas. Application configuration examples validate environment variables with env-schema and expose the result through a Fastify decorator. Secrets, database connections and other application-specific values must be supplied separately.
Example
For a user-creation endpoint, the route guide separates schema definitions, handler functions and route registration into different files. Its body schema requires a name and email, the handler delegates storage to an application-specific database helper, and the response uses status 201 with a defined user schema.
The schema guides show how TypeBox can supply both JSON Schema and TypeScript types. The testing guide illustrates app.inject() requests that submit a user payload and assert the intended status and response fields without opening a network listener. These are example assertions, not recorded passing tests; the assembled application was not run.
Assessment & evidence
Limitations
The database repository update helper inserts Object.keys(data) directly into SQL column positions. Values use placeholders, but column names have no explicit allowlist. This creates a potential injection path if untrusted keys reach the helper; the TypeScript type alone does not demonstrate a runtime boundary.
The database guide's (rules/database.md) testing example starts a transaction on one acquired client, then sends requests through app.inject(), without showing that route queries use that same client. Its rollback therefore does not establish test isolation. The testing guide (rules/testing.md) shows a different pattern using app.db.setTransaction(transaction) to route application queries through the transaction, but this application-specific helper is not defined in the files. Separately, the hook guide's transaction example commits in onResponse, after the response is sent, so a commit failure could not change that response.
The authentication examples store refresh tokens in a process-local Map; the guide itself marks this in-memory storage as unsuitable for production and points to Redis. The refresh example deletes the old refresh token and issues a new one on each refresh, but has no shared store and no reuse detection. The OAuth example redirects a login to a URL containing a JWT, which creates an exposure risk through URL handling. No execution results establish the security or correctness of these examples.
Reasoning
The strongest practical benefit is connected coverage: plugin boundaries explain where behavior applies, hooks explain when it runs, and schemas define input and output shapes. This can give a team concrete conventions for requesting and reviewing assistant-generated changes. An improvement in consistency is plausible from the format, but has not been measured.
Its preferences also need reconciliation. The configuration guide rejects environment-specific branching, while the logging guide branches on NODE_ENV. The database guide insists on official adapters, while the performance guide illustrates the postgres client directly. These differences make explicit project conventions important when applying the material.
Alternatives
Within the material, plain JSON Schema is an explicit alternative to TypeBox. Developers can also use explicit route generics instead of relying on a schema type provider. These options accommodate projects with different typing conventions.
The files can be read manually as a topic reference. No competing instruction skill or assistant is described in enough detail to support a comparative recommendation, and relative quality is unknown.
Evidence
The evidence consists of the resource's SKILL.md, all 19 topic guides, tile.json and the repository MIT notice. These primary documents establish the package's declared identity, written guidance and example code.
The fixed source snapshot is [https://github.com/mcollina/skills/tree/c75d70dbfbe991d8cec42aeda0b64ff14fbb9ac7/skills/fastify]. No executed test logs, benchmark outputs or assistant evaluations are supplied. Findings about SQL construction, transaction boundaries and token handling are static observations and implications of the shown code.
Access & freshness
Costs
The MIT notice grants its permissions free of charge. The supplied files state no purchase price, subscription plan, assistant usage price or total operating cost.
Applications following the database, Redis, hosting and monitoring examples may incur costs determined by the services and infrastructure chosen. Any coding assistant charges are also separate. Actual amounts are unknown.
Rights
The repository LICENSE is the MIT License, copyright 2026 Matteo Collina. It permits use, modification, distribution, sublicensing and sale of the software and associated documentation, subject to retaining the copyright and permission notices in copies or substantial portions. It disclaims warranties and liability.
This supports redistribution of the selected skill files with the notice included. The notice does not establish the licenses of separately installed dependencies. The original license is available at [https://raw.githubusercontent.com/mcollina/skills/c75d70dbfbe991d8cec42aeda0b64ff14fbb9ac7/LICENSE].
Freshness
The supplied snapshot was captured on 13 November 2026 at 20:21:40.512 UTC from revision c75d70dbfbe991d8cec42aeda0b64ff14fbb9ac7. Its descriptor declares version 0.1.0. The capture time does not establish a release or last-update date; later changes are unknown.
Version-sensitive examples deserve attention. The deployment guide uses node:22-alpine with an unflagged TypeScript entry point, while the TypeScript guide discusses different flagged and unflagged execution paths. Exact Node.js minor-version behavior, import resolution and plugin compatibility were not assessed.
Actions
Begin with the complete source directory and its license, then follow the reading path matching the task. Establish the project's Node.js, Fastify and plugin versions before adopting examples. Installation commands, and how a particular assistant host acts on the declared triggers and loads the relative rule files, are not documented and remain unknown.
Before production use, allowlist updateable database columns, ensure requests in the database guide's (rules/database.md) testing example use the client holding the transaction, define transaction completion before a successful response, and review refresh-token storage and OAuth token delivery. The testing guide (rules/testing.md) shows a different pattern using app.db.setTransaction(transaction) to route application queries through the transaction; this application-specific helper is not defined in the files. Add tests for these specific boundaries. The included inject() examples and separate TypeScript check provide starting patterns; no passing results are supplied.
