AGENT SKILL

api-generator

Scaffolds a versioned REST route, its zod schema, and the matching test file.

适用职业开发工程师
使用场景后端与接口
License 许可
MIT
最近更新
2026-11-06
Stars
★ 28
Forks
7

01 前言 Front Matter

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

02 资源文件 2

03 SKILL.md 正文

API generator

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

Steps

  1. Read 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.
  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.

04 同仓库更多 Skills