scaffold

A command that creates API route handlers from an API description or specification. API routes are the parts of an application that receive web requests, validate them, and return responses.

In plain words
What is it for?
Use it to scaffold endpoints for resources such as users, posts, or orders, choosing the HTTP methods and whether authentication is required.
Why use it?
It reduces the repeated work of setting up endpoints, request validation, data types, and optional login checks.

Command

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 commands/iwritec0de/app-dev/scaffold
Clone the repo
git clone --depth 1 https://github.com/iwritec0de/app-dev
Per session 12 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 691 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.00012 $0.00691
Opus 5 $0.00006 $0.00345
Sonnet 5 $0.00002 $0.00138
Haiku 4.5 $0.00001 $0.00069

Measured yesterday against content hash 3ade4dbfa80e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

scaffold 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 yesterday.

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.

commands/scaffold.md · 87 lines

How it starts

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

API Scaffold

Generate route handlers, validation, and types for API endpoints.

Load the nextjs-typescript-engineer and api-design skills for conventions and API patterns.

Usage

/scaffold <resource> [--methods GET,POST,PUT,DELETE] [--auth]

Arguments

Parse $ARGUMENTS to extract:

  • resource (required) — Resource name (e.g., users, posts, orders)
  • --methods (optional, default: GET,POST,PUT,DELETE) — HTTP methods to generate
  • --auth — Add authentication middleware/guards to all endpoints

Instructions

1. Detect Framework

Search the project for:

grep -l "express\|fastify\|koa\|hono" package.json 2>/dev/null       # Node.js
ls app/api/ 2>/dev/null                                                # Next.js App Router
ls pages/api/ 2>/dev/null                                              # Next.js Pages Router
grep -l "flask\|fastapi\|django" requirements.txt 2>/dev/null          # Python
grep -l "gin\|echo\|fiber\|chi" go.mod 2>/dev/null                     # Go
grep -l "laravel\|slim" composer.json 2>/dev/null                      # PHP

2. Detect Existing Patterns

Read 1-2 existing route files to understand:

  • File organization (routes/, controllers/, handlers/)
  • Naming conventions
  • Error handling pattern
  • Validation approach (zod, joi, class-validator, etc.)
  • Response format (envelope pattern, direct, etc.)
  • Database layer (ORM, raw SQL, repository pattern)

3. Generate Route Handlers

For each method, generate appropriate handlers following the project's existing patterns.

Standard REST endpoints:

Method Route Handler Description
GET /<resource> list List all with pagination
GET /<resource>/:id get Get single by ID
POST /<resource> create Create new
PUT /<resource>/:id update Update existing
DELETE /<resource>/:id delete Delete by ID

Each handler should include:

  • Input validation (request body, query params, path params)
  • Error handling (404, 400, 500)
  • Response typing
  • Authentication check (if --auth)

Read the full file on GitHub · 87 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. yesterday First seen · 87 lines · 12 tokens per session scan A 3ade4dbfa80e

Subscribe to this mod's changes

scaffold is a command published in the GitHub repository iwritec0de/app-dev (3 stars, last pushed 4mo ago), licensed MIT. It adds 12 tokens to every session and 691 once invoked, about $0.0001 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.