Skip to content
Back to skills

Add Api Route

ASecurity

Adds a Fastify route to the Saltmarsh Booking API with its schema, auth level, repository call, and registration. Use when asked to "add an endpoint", "add a route", or "expose this over the API".

  • 198 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 12, 2026
ai-agentsgoapi

Works with

  • api

Security analysis

A100/100

Scanned November 12, 2026

npx -y skills add mblode/agent-skills --skill add-api-route --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Add Api Route?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Add Api Route
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/mblode-add-api-route/badge)](https://www.skillsdirectory.com/skills/mblode-add-api-route)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: add-api-route
description: Adds a Fastify route to the Saltmarsh Booking API with its schema, auth level, repository call, and registration. Use when asked to "add an endpoint", "add a route", or "expose this over the API".
---

# Add an API Route

1. Add the request and response schemas to `packages/shared/src/schemas/<resource>.ts`.
2. Create or extend `packages/api/src/routes/<resource>.ts`. Export a Fastify plugin.
3. Set `config.auth` to `"guest"`, `"owner"`, or `"public"`, and `config.rateLimit` if 60 a minute is wrong for this route.
4. Call a repository in `packages/api/src/repos`. Add the query there if it does not exist.
5. Register the plugin in `packages/api/src/app.ts`.
6. Add a typed call for it to `packages/web/src/lib/api.ts` if the web app will use it.

## Gotchas

- An owner route checks that the campsite in the path belongs to `request.owner.id`. The auth level alone does not do that.
- Return errors with `problem()`. A thrown error becomes a 500 with no detail.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.