add-resource

add-resource is a skill for Claude Code, Codex from dvd90/chassis. It costs 59 tokens per session (938 once invoked), scanned A, original, MIT.

A guide for adding a complete REST resource to a Chassis backend, an Express and TypeScript framework that uses decorators to define routes. It covers the controller, input checks, error handling, and tests.

In plain words
What is it for?
Use it when adding a model, route, endpoint, or CRUD resource to a Chassis project.
Why use it?
It removes the guesswork of fitting a new endpoint or CRUD feature into the project's existing conventions. It also helps keep validation and tests consistent.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/dvd90/chassis/add-resource
Any agent
npx skills add dvd90/chassis --skill add-resource
Clone the repo
git clone --depth 1 https://github.com/dvd90/chassis

Made for: Claude Code, Codex.

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-resource

README.md
[![agentmods](https://agentmods.dev/badge/skills/dvd90/chassis/add-resource.svg)](https://agentmods.dev/skills/dvd90/chassis/add-resource)
Your own site
<a href="https://agentmods.dev/skills/dvd90/chassis/add-resource"><img src="https://agentmods.dev/badge/skills/dvd90/chassis/add-resource.svg" alt="Measured on agentmods" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 938 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 $0.00059 $0.00938
Opus 5 $0.00030 $0.00469
Sonnet 5 $0.00012 $0.00188
Haiku 4.5 $0.00006 $0.00094

Measured 4d ago against content hash d6359eefff91, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

add-resource 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 4d 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.

.claude/skills/add-resource/SKILL.md · 103 lines

How it starts

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

Add a resource to Chassis

Scaffold and implement a REST resource so it matches Chassis conventions exactly. Follow these steps in order. Read AGENTS.md first if you haven't — it defines the conventions this skill applies.

Step 1 — Scaffold

Run the generator (converts the name to a controller class + base path):

npm run gen <Name>      # e.g. npm run gen book  ->  BookController at /books

This creates src/controllers/<Name>.controller.ts, a smoke test in src/__tests__/, and adds the export to src/controllers/index.ts. If the generator isn't available, create those three by hand modeled on an existing *.controller.ts, and add the export * from './<Name>.controller'; line yourself.

Step 2 — Define the input schema(s)

For every route that accepts input, write a zod schema. Put it at the top of the controller file or in src/schemas/<name>.schema.ts:

const createBookSchema = z.object({
  title: z.string().min(1),
  author: z.string().min(1),
  year: z.coerce.number().int().min(0).optional()
});

Step 3 — Implement the routes

Fill in the controller. Rules that keep it idiomatic:

  • Decorate each method with @route(method, path, [middlewares]) (or @protectedRoute when it requires auth).
  • Attach validation via validate({ body|query|params: schema }) in the middleware array.
  • Return through req.resHandler — pick the helper that matches the outcome (ok, created, noContent, …).
  • Signal failures by throwing AppError with the right ERROR_CODES entry. No try/catch.
@route('get', '/:id')
async show(req: Request): Promise<Response> {
  const book = await BookModel.findById(req.params.id);
  if (!book) throw new AppError(ERROR_CODES.NOT_FOUND, 'Book not found');
  return req.resHandler.ok(book);
}

@route('post', '/', [validate({ body: createBookSchema })])
async create(req: Request): Promise<Response> {
  return req.resHandler.created(await BookModel.create(req.body));
}

Read the full file on GitHub · 103 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. 4d ago First seen · 103 lines · 59 tokens per session scan A d6359eefff91

Subscribe to this mod's changes

add-resource is a skill published in the GitHub repository dvd90/chassis (6 stars, last pushed 27d ago), licensed MIT. It adds 59 tokens to every session and 938 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-31.

Related

Other skills, from other repositories

merge-seed

Merge upstream React Starter Kit updates (the seed remote) into main, preserving this project's identity, scope, and behavior. Use when asked to sync, pull, or merge the seed / starter kit / upstream template.

kriasoft/react-starter-kit · 49 tokens

ocli-api

Turn any OpenAPI/Swagger API into CLI commands and call them. Search endpoints with BM25, check parameters, execute — no MCP server needed.

EvilFreelancer/openapi-to-cli · 34 tokens

ultracite

Ultracite is a zero-config linting and formatting preset for JavaScript/TypeScript projects. Use when: (1) Setting up or initializing Ultracite in a project (ultracite init), (2) Running linting or formatting commands (check, fix, doctor), (3) Writing or reviewing JS/TS code in a project that uses Ultracite — to…

agustinusnathaniel/nextarter-tailwind · 142 tokens

next-upgrade

Upgrade Next.js to the latest version following official migration guides and codemods.

agustinusnathaniel/nextarter-tailwind · 19 tokens

procedure

Vovk.ts procedures — atomic unit of server-side logic in Vovk project. Use whenever user asks to build ANYTHING producing or consuming data on server — page loading data ("users page", "dashboard", "product list"), endpoint, API handler, server action, form submission, controller, validation with Zod / Valibot /…

finom/vovk · 342 tokens

rpc

Vovk.ts RPC client — how vovk generate turns controllers into type-safe client modules, composed vovk-client vs segmented clients, call shape (apiRoot, params, body, query, meta, init, disableClientValidation, validateOnClient, interpretAs, transform, fetcher), customizing generation via outputConfig.imports.fetcher +…

finom/vovk · 354 tokens