Agent skill

Fastify API Design

by johnku2011 in johnku2011/boilerplates-with-ai-skills

A skill your agent uses when adding or changing routes, schemas, or plugins in this Fastify API — keep endpoints validated, typed, and testable.

MITAuto-check passedBackend & APIs

Install Fastify API Design

skills CLI
$ npx skills add johnku2011/boilerplates-with-ai-skills --skill fastify-api-design -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install johnku2011/boilerplates-with-ai-skills fastify-api-design --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/johnku2011/boilerplates-with-ai-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/boilerplates/fastify-api/skills/fastify-api-design .claude/skills/fastify-api-design && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fastify-api-design
GitHub stars
240
Token cost
~420 tokens
SKILL.md length
194 words
Files
1
Skills in repo
18
Repo updated
First seen
Licence
MIT

At a glance

A skill your agent uses when adding or changing routes, schemas, or plugins in this Fastify API — keep endpoints validated, typed, and testable.

  • Works in 5 steps: Register routes on the app returned by… → Define JSON schemas for request/response… → Return correct status codes (200/201… → …
  • Changing routes
  • SKILL.md covers Overview, Process, Plugin Order and Testing, plus 2 more sections
  • Calls npm

What it does

Fastify API Design is an agent skill from johnku2011/boilerplates-with-ai-skills. Use when adding or changing routes, schemas, or plugins in this Fastify API — keep endpoints validated, typed, and testable.

Its SKILL.md is about 420 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts. Compatibility notes: Fastify ESM API in this boilerplate

It sits in Backend & APIs, covering API design. It works with Fastify. The licence is MIT.

When your agent uses it

  • Changing routes
  • Plugins in this Fastify API — keep endpoints validated

Example prompts

  • “/fastify-api-design”

Requirements

  • Compatibility (from SKILL.md): Fastify ESM API in this boilerplate
  • Pre-approved tools (allowed-tools): Read

Workflow steps

5 steps, taken from the first numbered list in SKILL.md.

  1. Register routes on the app returned by createApp() in src/app.js.
  2. Define JSON schemas for request/response when the payload shape matters.
  3. Return correct status codes (200/201 success, 400 client error, 404 not found).
  4. Use Fastify's built-in error handler; do not leak stack traces in production.
  5. Add a test/ case that starts the app on port 0 and asserts responses.

What it can do on your machine

Read from SKILL.md and the folder at commit 475dc6a. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • npm

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use npm, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Fastify ESM API in this boilerplate

    From compatibility in the SKILL.md frontmatter.

Context cost

Fastify API Design loads about 420 tokens when it runs. Until then it costs about 36 tokens; SKILL.md has 194 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~36
When it runs · the whole SKILL.md, loaded when a task matches
~420

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from johnku2011/boilerplates-with-ai-skills at commit 475dc6a, republished under its MIT licence (© johnku2011). 194 words, ~420 tokens.

Download SKILL.mdSave it as .claude/skills/fastify-api-design/SKILL.md (or your agent's skills folder).
name
fastify-api-design
description
Use when adding or changing routes, schemas, or plugins in this Fastify API — keep endpoints validated, typed, and testable.
allowed-tools
Read
compatibility
Fastify ESM API in this boilerplate
license
MIT
metadata.stack
fastify

Fastify API Design

Overview

Keep the Fastify app small, testable, and schema-first. Build on the exported createApp() factory so tests can inject the server without binding a fixed port.

Process

  1. Register routes on the app returned by createApp() in src/app.js.
  2. Define JSON schemas for request/response when the payload shape matters.
  3. Return correct status codes (200/201 success, 400 client error, 404 not found).
  4. Use Fastify's built-in error handler; do not leak stack traces in production.
  5. Add a test/ case that starts the app on port 0 and asserts responses.

Plugin Order

  1. Core plugins (cors, sensible) if needed
  2. Route registration
  3. Global error handler

Testing

  • Integration tests: app.listen({ port: 0 }), fetch against 127.0.0.1.
  • Extract pure helpers for unit tests when logic grows beyond route handlers.
  • Run npm test before every commit.

Guidelines

  • Prefer route-level schemas over ad-hoc validation in handlers.
  • Keep handlers thin; move business logic to testable functions.
  • Read secrets from environment variables at startup, not from requests.
  • Prefer explicit routes over catch-all handlers.

Anti-patterns

  • Bypassing Fastify validation with unvalidated request.body access.
  • Starting the server inside createApp() — keep listen in server.js only.
  • Global mutable state shared across requests.

© johnku2011, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in boilerplates/fastify-api/skills/fastify-api-design of johnku2011/boilerplates-with-ai-skills.

Open the folder on GitHubat commit 475dc6a

Compare with similar skills

Fastify API Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fastify API Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fastify API Design this skilljohnku2011/boilerplates-with-ai-skills240—~420Automated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15818 repos~4kAutomated safety check: PassAGPL-3.0
Nestjsericrisco/rsc-harness167—~2.9kAutomated safety check: PassMIT
API ExtractorEmeaAppGbb/spec2cloud100—~2.4kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Pangolin CRUD Endpointsfosrl/pangolin23k—~461Automated safety check: PassCustom licence

Similar skills

  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 18 repos~4k tokens
    Backend & APIsAuto-check passed
  • Nestjs

    ericrisco/rsc-harness

    A skill your agent uses when building or structuring a NestJS backend — feature modules, providers and DI wiring, provider scopes and request-lifecycle order, where to bind…

    167 GitHub stars~2.9k tokensUpdated today
    Backend & APIsAuto-check passed
  • API Extractor

    EmeaAppGbb/spec2cloud

    Extract API contracts from existing code — routes, endpoints, request/response schemas, authentication patterns.

    100 GitHub stars~2.4k tokensUpdated 5 mo ago
    Backend & APIsAuto-check passed
  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Use whenever asked to add, create, or scaffold a CRUD endpoint, router, or entity in this repo's server (create/list/get/update/delete handlers, new…

    23k GitHub stars~461 tokensUpdated today
    Backend & APIsAuto-check passed
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 20 repos~3.4k tokens
    Backend & APIsAuto-check passed

More from johnku2011/boilerplates-with-ai-skills

All 18 skills in this repo
  • Project Security

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when reviewing security-sensitive code paths — check auth, secrets, input validation, dependency risk, and data exposure before shipping.

    240 GitHub stars~650 tokensUpdated 1 mo ago
    Auto-check passed
  • Code Review

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when reviewing a diff or pull request — check correctness, tests, readability, security, and server/client boundaries before approving.

    240 GitHub stars~708 tokensUpdated 1 mo ago
    Auto-check passed
  • Python API Design

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when adding or changing FastAPI routes, dependencies, or tests in this Python service — keep endpoints typed, validated, and covered by pytest.

    240 GitHub stars~449 tokensUpdated 1 mo ago
    Auto-check passed
  • Bwai Advisor

    johnku2011/boilerplates-with-ai-skills

    Use before scaffolding a bwai project — runs the full startup-goal workflow then recommends the right boilerplate and outputs the exact bwai new command to run.

    240 GitHub stars~1.2k tokensUpdated 1 mo ago
    Auto-check passed
  • Deploy Vercel

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when deploying or configuring this project on Vercel — env vars, build settings, serverless limits, and production checks for Next.js or Express.

    240 GitHub stars~660 tokensUpdated 1 mo ago
    Auto-check: notes
  • Express API Design

    johnku2011/boilerplates-with-ai-skills

    A skill your agent uses when adding or changing routes, middleware, or error handling in this Express.js API, to keep endpoints consistent, validated, and testable.

    240 GitHub stars~575 tokensUpdated 1 mo ago
    Auto-check passed

Works with

Categories

Questions about Fastify API Design

What does Fastify API Design do?

A skill your agent uses when adding or changing routes, schemas, or plugins in this Fastify API — keep endpoints validated, typed, and testable. Fastify API Design is an agent skill from johnku2011/boilerplates-with-ai-skills. Use when adding or changing routes, schemas, or plugins in this Fastify API — keep endpoints validated, typed, and testable.

When should I use Fastify API Design?

Fastify API Design fits situations like: changing routes; plugins in this Fastify API — keep endpoints validated.

How do I install Fastify API Design in Claude Code?

Run `npx skills add johnku2011/boilerplates-with-ai-skills --skill fastify-api-design -a claude-code`. Or copy the skill folder (boilerplates/fastify-api/skills/fastify-api-design in johnku2011/boilerplates-with-ai-skills) into .claude/skills/fastify-api-design in your project. Claude Code loads it when a task matches its description.

How do I install Fastify API Design in Codex?

Run `npx skills add johnku2011/boilerplates-with-ai-skills --skill fastify-api-design -a codex`. Or copy the skill folder (boilerplates/fastify-api/skills/fastify-api-design in johnku2011/boilerplates-with-ai-skills) into .agents/skills/fastify-api-design in your project. Codex loads it when a task matches its description.

Can I use Fastify API Design in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add johnku2011/boilerplates-with-ai-skills --skill fastify-api-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fastify-api-design, .gemini/skills/fastify-api-design, .github/skills/fastify-api-design and .opencode/skills/fastify-api-design in your project.

What does Fastify API Design need to run?

Going by SKILL.md and its folder, Fastify API Design needs the command-line tools its instructions call (npm). Its frontmatter pre-approves these tools: Read. Compatibility (from SKILL.md): Fastify ESM API in this boilerplate.

Does Fastify API Design access the network?

SKILL.md contains no URLs. Its commands use npm, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Fastify API Design safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fastify API Design use?

Fastify API Design is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fastify API Design use?

About 420 tokens (SKILL.md is roughly 1.7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fastify API Design?

Skills that share tags, products or a category with Fastify API Design: Nodejs Backend Patterns (ever-works/ever-works, 158 stars), Nestjs (ericrisco/rsc-harness, 167 stars), API Extractor (EmeaAppGbb/spec2cloud, 100 stars) and API Designer (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fastify API Design?

johnku2011 (a GitHub user) maintains it in johnku2011/boilerplates-with-ai-skills, which has 240 GitHub stars. The repository holds 18 skills in this directory. The repository was last updated on August 24, 2026.

Source: johnku2011/boilerplates-with-ai-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.