api-generator · git:20260509.5c37a2c · 2026-05-09 · sha256 d2ca1afdbede8ac8

api-generator git:20260509.5c37a2cA

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

No tool to install first
claude plugin marketplace add https://markdownregistry.com/mp/a/art_23o3vkyxj6javc62/d2ca1afdbede8ac88aecc589d7d85c63addbfbe8679c59a7da18132bcd446fef.json

Then /plugin install api-generator@markdownregistry-23o3vkyxj6javc62 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: Generate REST API endpoints with validation and error handling
---

## Purpose

Generate well-structured REST API endpoints following the project's conventions.
Includes request validation, typed response shapes, and consistent error handling.

## Workflow

1. Analyze the endpoint requirements from the user's description
2. Review `references/checklist.md` for quality gates
3. Generate the route handler with input validation
4. Add typed request/response interfaces
5. Include error handling middleware integration
6. Write unit tests alongside the implementation

## Best Practices

- Always validate request bodies against a schema (e.g., zod)
- Return consistent error response shapes: `{ error: string; code: string }`
- Use HTTP status codes correctly (400 for validation, 404 for not found, 500 for unexpected)
- Log errors at the appropriate level (warn for expected, error for unexpected)