SuperAPI AI Directory

fastify

Coding & development

View repository

Updated 10-15 21:40

About this skill

Fastify API Reference

Fastify — Node.js native high-speed HTTP server framework (target version v5.12.1). Refer to this when designing and implementing APIs centered on the encapsulated plugin tree, decorators, lifecycle hooks, and JSON Schema-based validation/serialization.

hono(Web Standards / Multi-runtime JS) ·go-echo(Go)・fandhe-backend(Rust) is a separate framework; do not confuse it with the Router / plugin / middleware / hooks concepts of the same name.pino is the Fastify logger itself (on the Fastify side, only the logger / loggerInstance connection API), andzod is the schema library itself (in Fastify, connected via Type Provider), and for each of their APIs, refer to the respective skill.

The breaking changes from v4 to v5 are listed in references/guides/migration-v5.md , and on individual pages affected, they are noted per-page in ## Notes (server/instance-lifecycle.md, server/instance-routing.md, server/instance-decorators.md, server/instance-content-type.md, request-reply/request.md, request-reply/reply-redirect.md, request-reply/reply-hijack-trailers.md, errors-logging/logging.md, validation-serialization/schema-basics.md, validation-serialization/type-providers.md, plugins/plugins.md, routing/constraints-versioning.md , etc.).

Directory structure

skills/fastify/
  SKILL.md
  references/
    getting-started/
      README.md
      installation.md
      first-server.md
      first-plugin.md
      loading-order.md
      validate-data.md
      serializing-data.md
      request-payload.md
      cli-usage.md
      lts.md
      warnings.md
    server/
      README.md
      factory-options.md
      router-options.md
      instance-lifecycle.md
      instance-routing.md
      instance-plugins.md
      instance-decorators.md
      instance-schemas.md
      instance-handlers.md
      instance-content-type.md
      instance-inject.md
      instance-misc.md
      content-type-parser.md
    routing/
      README.md
      route-options.md
      shorthand-declaration.md
      url-parameters.md
      async-await-handlers.md
      route-prefixing.md
      constraints-versioning.md
      route-config-log-level.md
      http2.md
    request-reply/
      README.md
      request.md
      reply-methods.md
      reply-send.md
      reply-serialization.md
      reply-redirect.md
      reply-errors.md
      reply-hijack-trailers.md
    hooks-lifecycle/
      README.md
      lifecycle.md
      request-hooks.md
      application-hooks.md
      hook-scope.md
      route-level-hooks.md
      diagnostics-channel-hooks.md
    plugins/
      README.md
      plugins.md
      encapsulation.md
      fastify-plugin.md
      decorators.md
      middleware.md
      write-plugin.md
      plugins-guide.md
    validation-serialization/
      README.md
      schema-basics.md
      ajv-configuration.md
      schema-refs-shared.md
      response-serialization.md
      validator-serializer-compiler.md
      schema-error-handling.md
      type-providers.md
      write-type-provider.md
      fluent-schema.md
    typescript/
      README.md
      getting-started.md
      route-generics.md
      plugin-typing.md
      api-type-system.md
      code-completion-tips.md
    errors-logging/
      README.md
      error-handling.md
      fastify-error-codes.md
      logging.md
    guides/
      README.md
      testing.md
      serverless.md
      recommendations.md
      database.md
      benchmarking.md
      delay-accepting-requests.md
      detecting-client-abort.md
      prototype-poisoning.md
      migration-v5.md
      migration-v4.md
      migration-v3.md
  samples/
    README.md
    basic-server.md
    plugin-encapsulation.md
    decorators.md
    hooks-auth.md
    validation-json-schema.md
    type-provider-typebox.md
    typescript-server.md
    error-handling.md
    logging-pino.md
    testing-inject.md
    serverless-lambda.md
    graceful-shutdown.md
    database-integration.md
  scripts/
    README.md
    install.md
    generate.md
    dev.md
    debug.md
    test.md
    benchmark.md

Exploration procedure

Derive the category from the task, and identify the target page in the category's README.md:

  1. Find the category corresponding to the task in the mapping table below
  2. That category's references/{category}/README.md and identify the target page
  3. Read the .md of the relevant page to check the details

Task → Category Mapping

Task Category Reference README
Initial project setup, minimal server startup, CLI usage, warning codes getting-started references/getting-started/README.md
Factory options, find-my-way router options, instance lifecycle,fastify.inject server references/server/README.md
Route declaration, URL parameters, async/await handlers, versioning constraints, HTTP/2 routing references/routing/README.md
Request properties,Reply methods,reply.send, redirects, hijack/trailers request-reply references/request-reply/README.md
onRequest request hooks such as these, application hooks, hook scope, diagnostics_channel hooks-lifecycle references/hooks-lifecycle/README.md
fastify.register、encapsulation、fastify-plugin, decorators, Express-compatible middleware plugins references/plugins/README.md
JSON Schema + Ajv, response serialization, Type Providers (TypeBox/Zod), fluent-schema validation-serialization references/validation-serialization/README.md
TypeScript typing, route generics, plugin types, type augmentation typescript references/typescript/README.md
Error handling,FST_ERR_* code list, Pino logger connection errors-logging references/errors-logging/README.md
Testing, serverless deployment, DB integration, benchmarks, v3/v4/v5 migration guides guides references/guides/README.md
Want to know typical usage samples samples/README.md
Want to know installation and CLI commands scripts scripts/README.md