api-generator · git:20260901.1a5254f · 2026-09-01 · sha256 26d0424f30bce2e1

api-generator git:20260901.1a5254fA

Immutable. This exact content never changes and is served at /api/v1/blob/26d0424f30bce2e1.

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_trmny5hvh3bomg6q/26d0424f30bce2e1b62f4ae6d45c0d142fcb562d76290da06de83b835e7b75b3.json

Then /plugin install api-generator@markdownregistry-trmny5hvh3bomg6q in Claude Code. It installs this exact version, the one graded A here, pinned to the commit it was graded at, and leaves it there.

---
name: api-generator
description: Scaffolds a versioned REST route, its zod schema, and the matching test file.
---

# API generator

Use this when a task asks for a new endpoint under `/v1`.

## Steps

1. Read [references/route-checklist.md](references/route-checklist.md) and confirm every box applies.
2. Run `scripts/scaffold.ts` with the resource name in kebab-case.
3. Register the router in [src/server/routes.ts](src/server/routes.ts).
4. Write the failing test first, then implement the handler.

## Conventions

- Request and response bodies are validated by zod on both ends.
- Errors return `{ error: { code, message } }`; never leak a stack trace.
- Pagination is cursor based (`?cursor=`, `?limit=`), never offset based.