fastify-schemas-validation

fastify-schemas-validation is a skill for Claude Code from RadOrigin-LLC/RAD-Claude-Skills. It costs 87 tokens per session (2,708 once invoked), scanned A, original, Apache-2.0.

A guide to defining JSON Schema contracts for Fastify requests and responses, including validation with Ajv and response formatting with fast-json-stringify.

In plain words
What is it for?
It helps validate request bodies, query parameters, URL parameters, and headers; share schemas; and define response formats.
Why use it?
It helps reject invalid input before application logic runs and makes the expected data shape explicit.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

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

Good fit It helps validate request bodies, query parameters, URL parameters, and headers; share schemas; and define response formats.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation
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-schemas-validation
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-schemas-validation

README.md
[![agentmods](https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation/github.svg)](https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation)
Your own site
<a href="https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation"><img src="https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation/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-schemas-validation

Your own site · 80×15
<a href="https://agentmods.dev/skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation"><img src="https://agentmods.dev/badge/skills/radorigin-llc/rad-claude-skills/fastify-schemas-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 87 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,708 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.00087 $0.02708
Opus 5 $0.00044 $0.01354
Sonnet 5 $0.00017 $0.00542
Haiku 4.5 $0.00009 $0.00271

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

Security

Grade A, and why

fastify-schemas-validation 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-schemas-validation/SKILL.md · 216 lines

How it starts

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

Fastify Schemas, Validation & Serialization

Core Philosophy: Schema-First

Fastify rejects implicit behavior. You MUST define explicit JSON Schema contracts for ALL routes. Schemas are not optional documentation — they are the mechanism that unlocks pre-compiled validation via Ajv and JIT serialization via fast-json-stringify. Never execute business logic on unknown or invalid data. Fail fast: if a request does not match the contract, reject it before it reaches your handler.

Every route you write must have schemas defined for both request validation and response serialization. Treat schema omission as a bug, not a convenience tradeoff.

Request Validation with Ajv

Schema Locations

You can attach validation schemas to four locations on a route:

  • body — Use for POST, PUT, and PATCH request bodies. This is the most common validation target. Define the shape of the incoming JSON payload here.
  • querystring (or the alias query) — Use for URL query parameters. Define expected parameter names, types, and constraints. Remember that all query values arrive as strings, so rely on Ajv coercion or define types accordingly.
  • params — Use for URL path parameters (e.g., /users/:id). Always define the expected type. A common pattern is { type: 'object', properties: { id: { type: 'integer' } }, required: ['id'] }.
  • headers — Use for request headers. This is rarely needed, but useful when you must enforce a specific header value or presence (e.g., X-API-Key). Remember that header names are lowercased by Node.js.

How Validation Works Internally

Schemas are compiled into optimized JavaScript functions at startup, not at request time. This means the first request is fast — there is no cold-start penalty per route. Ajv automatically coerces types when the schema specifies a type that differs from the incoming value. For example, the string "42" becomes the number 42 when the schema declares type: "number". This coercion is enabled by default in Fastify's Ajv configuration.

Read the full file on GitHub · 216 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 · 216 lines · 87 tokens per session scan A d41eee8645ce

Subscribe to this mod's changes

fastify-schemas-validation is a skill published in the GitHub repository RadOrigin-LLC/RAD-Claude-Skills (5 stars, last pushed 24d ago), licensed Apache-2.0. It adds 87 tokens to every session and 2,708 once invoked, about $0.0004 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