VaultysClaw: Skill for Claude Code

.github/skills/add-api-route/SKILL.md

add-api-route is a skill for Claude Code from vaultys/VaultysClaw. It costs 69 tokens per session (1,108 once invoked), scanned A, original, MIT.

A prescribed process for adding REST API routes, which are web endpoints that let software read and change data over HTTP.

In plain words
What is it for?
Creating list, detail, create, update, and delete endpoints in the control plane, including nested resources and registered API types.
Why use it?
It prevents common endpoint mistakes by standardizing authentication, permissions, database queries, errors, pagination, response formats, and tests.

Skill for Claude Code

Written for Claude Code: argument-hint in frontmatter.

This is vaultys/VaultysClaw's own configuration. It tells Claude Code how to work on VaultysClaw itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything VaultysClaw configures →

Reuse

Borrowing it

Nothing to install: this file belongs to vaultys/VaultysClaw. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/vaultys/VaultysClaw/main/.github/skills/add-api-route/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/vaultys/VaultysClaw

Made for: Claude Code.

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 add-api-route

README.md
[![agentmods](https://agentmods.dev/badge/skills/vaultys/vaultysclaw/add-api-route.svg)](https://agentmods.dev/skills/vaultys/vaultysclaw/add-api-route)
Your own site
<a href="https://agentmods.dev/skills/vaultys/vaultysclaw/add-api-route"><img src="https://agentmods.dev/badge/skills/vaultys/vaultysclaw/add-api-route.svg" alt="Measured on agentmods" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,108 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00069 $0.01108
Opus 5 $0.00034 $0.00554
Sonnet 5 $0.00014 $0.00222
Haiku 4.5 $0.00007 $0.00111

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

Security

Grade A, and why

add-api-route 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 6d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (assets/route-template.ts, assets/test-template.ts), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

.github/skills/add-api-route/SKILL.md · 105 lines

How it starts

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

Add API Route — Control Plane

When to Use

  • Creating a new resource endpoint under packages/control-plane/app/api/
  • Adding handlers to an existing route file
  • Ensuring consistent auth, error handling, pagination, and response shapes

Procedure

1. Determine Route Path & Handlers

From the argument (e.g. invitations):

  • Collection: app/api/invitations/route.tsGET (list) + POST (create)
  • Item: app/api/invitations/[id]/route.tsGET (detail) + PUT/PATCH (update) + DELETE

If sub-resource (e.g. workspaces/members): app/api/workspaces/[id]/members/route.ts.

2. Create the Route File

Use ./assets/route-template.ts as starting point. Key rules:

  • Always call getAuthContext(request) first (pass request for API key auth); return unauthorized() if null
  • Use forbidden() for permission failures (e.g. !auth.isGlobalAdmin, !auth.canAccessWorkspace(id))
  • Wrap all handlers in try/catch; log with console.error("METHOD /api/<resource> error:", err)
  • For list endpoints, apply pagination — see template for the pattern
  • Parse [id] from dynamic segments with const { id } = await params

3. Add DB Query Functions (if needed)

Add helper functions to packages/control-plane/lib/db.ts:

  • Use getDb() singleton and raw better-sqlite3 prepared statements
  • Name convention: getXxx(id), listXxx(filters), createXxx(data), updateXxx(id, data), deleteXxx(id)
  • Add indexes with CREATE INDEX IF NOT EXISTS idx_<table>_<col> inside createTables()

4. Register Response Types (if new resource)

Add to packages/control-plane/lib/api-types.ts:

  • Summary type for list items (e.g. InvitationSummary)
  • Full type for detail response if different from summary

5. Register in Route Registry

Add an entry to packages/control-plane/lib/route-registry.ts (ROUTE_REGISTRY):

{ path: "/api/my-resource",     methods: ["GET", "POST"], group: "MyGroup", description: "List / create my resources" },
{ path: "/api/my-resource/[id]", methods: ["GET", "PUT", "DELETE"], group: "MyGroup", description: "Get / update / delete a my resource" },

Read the full file on GitHub · 105 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago First seen · 105 lines · 69 tokens per session scan A 1f0ac717d5da

Subscribe to this mod's changes

add-api-route is a skill published in the GitHub repository vaultys/VaultysClaw (77 stars, last pushed 4d ago), licensed MIT. It adds 69 tokens to every session and 1,108 once invoked, about $0.0003 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-30.

Related

Other skills, from other repositories