fastify-best-practices

fastify-best-practices is a skill for Claude Code from RadOrigin-LLC/RAD-Claude-Skills. It costs 110 tokens per session (3,704 once invoked), scanned A, original, Apache-2.0.

A guide to structuring applications built with Fastify, a Node.js framework for web servers and APIs. It explains how Fastify plugins form an ordered tree of isolated application contexts.

In plain words
What is it for?
Use it when creating Fastify applications or plugins, registering routes, adding decorators, and organizing automatic plugin loading.
Why use it?
It helps prevent setup-order errors and incorrect plugin patterns, such as mixing asynchronous and callback-based initialization.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: positional $N argument.

Part of the rad-fastify plugin — 8 skills, 1 agent shipped together

Good fit Use it when creating Fastify applications or plugins, registering routes, adding decorators, and organizing automatic plugin loading.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/radorigin-llc/rad-claude-skills/fastify-best-practices
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add RadOrigin-LLC/RAD-Claude-Skills --skill fastify-best-practices
Clone the repo
git clone --depth 1 https://github.com/RadOrigin-LLC/RAD-Claude-Skills

Made for: Claude Code.

Or install rad-fastify, the plugin that ships this one along with the rest of its 8 skills, 1 agent.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for fastify-best-practices

README.md
[![agentmods](https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/fastify-best-practices/github.svg)](https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/fastify-best-practices)
Your own site
<a href="https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/fastify-best-practices"><img src="https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/fastify-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for fastify-best-practices

Your own site · 80×15
<a href="https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/fastify-best-practices"><img src="https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/fastify-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 110 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,704 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00110 $0.03704
Opus 5 $0.00055 $0.01852
Sonnet 5 $0.00022 $0.00741
Haiku 4.5 $0.00011 $0.00370

Measured 11d ago against content hash 011c9a388d83, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

fastify-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

archive/plugins/rad-fastify/skills/fastify-best-practices/SKILL.md · 347 lines

How it starts

The opening of the file, as written. The whole thing — 347 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fastify: Core Architecture & Best Practices

Core Mental Model — The Plugin Tree

Understand that a Fastify application is a directed acyclic graph (DAG) of encapsulated contexts, not a flat middleware chain. Every call to fastify.register() creates a new child node in this tree. The root Fastify instance is the only context that is not itself a plugin.

The DAG is managed internally by the avvio library. Avvio guarantees deterministic, async loading in the exact order plugins are registered. Never rely on timing assumptions — rely on registration order.

Plugins signal readiness in exactly one of two ways: by returning a Promise, or by calling the done callback. Never mix both in the same plugin. If the plugin function is async, never accept or call done — Fastify will await the returned Promise. If the function is synchronous, call done() when setup is complete.

// CORRECT: async plugin — no done parameter
module.exports = async function myPlugin(fastify, opts) {
  // setup logic
}

// CORRECT: callback plugin — call done explicitly
module.exports = function myPlugin(fastify, opts, done) {
  // setup logic
  done()
}

// WRONG: mixing async and done — causes hangs or double-resolution
module.exports = async function myPlugin(fastify, opts, done) {
  await someSetup()
  done() // BUG: never do this in an async function
}

Encapsulation Rules — Hard Invariants

These five rules are non-negotiable. Every architectural decision in Fastify flows from them:

  1. Child inherits everything from parent and ancestors. A plugin registered inside another plugin sees all decorators, hooks, and parsers from its parent chain up to root.

  2. Siblings are completely isolated. Two plugins registered at the same level share nothing with each other. Plugin A cannot see Plugin B's decorators, routes, or hooks, even if they are registered on the same parent.

  3. Parents cannot access child entities. A parent context never sees decorators, hooks, or routes added by its children. Data flows downward only.

Read the full file on GitHub · 347 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 347 lines · 110 tokens per session scan A 011c9a388d83

Subscribe to this mod's changes

fastify-best-practices is a skill published in the GitHub repository RadOrigin-LLC/RAD-Claude-Skills (5 stars, last pushed 25d ago), licensed Apache-2.0. It adds 110 tokens to every session and 3,704 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

draper-decorators

This skill should be used when the user asks to "create a decorator", "write a decorator", "move logic into decorator", "clean logic out of the view", "isn't it decorator logic", "test a decorator", or mentions Draper, keeping views clean, or representation logic in decorators. Should also be used when editing…

hoblin/claude-ruby-marketplace · 131 tokens

rudder-mcp-workflow

Connects AI agents to RudderStack via MCP tool calls for catalog, sources, destinations, transformations, and live events. Use when connecting an AI agent to RudderStack's MCP server, driving RudderStack via MCP, or mentions of mcp.rudderstack.com.

rudderlabs/rudder-agent-skills · 63 tokens

helius

Skill "helius" from helius-labs/core-ai, covering helius — build on solana, prerequisites, 1. helius mcp server, 2. mcp router surface and 3. api key.

helius-labs/core-ai · 0 tokens

api-contracts

API design and contract engineering — REST resource modelling, error envelopes, pagination, filtering, idempotency, versioning and deprecation, rate limiting, webhooks, OpenAPI, GraphQL schema and N+1 defence, and contract testing. Use when designing, reviewing or documenting an endpoint or integration; when the user…

Kin9Zeus/senior-engineer-skills · 148 tokens

performance-engineering

Performance engineering across the stack — Core Web Vitals (LCP, INP, CLS), bundle size and rendering strategy, image and font optimisation, backend latency budgets, caching layers, database query cost, profiling, and load testing. Use when the user says "slow", "performance", "optimize", "Core Web Vitals", "LCP"…

Kin9Zeus/senior-engineer-skills · 146 tokens

bug-reporting

Load this skill whenever you are filing, reviewing, or generating accessibility bug reports — whether from automated tool output, manual testing, user reports, or testing with disabled people. The purpose of this skill is to make accessibility findings easier to report accurately, connect them to real people and…

mgifford/accessibility-skills · 122 tokens