csp-api-codegenlisted
Install: claude install-skill maythyai/code-skills-package
# API Codegen
Generate application code from API specifications. Two source formats:
| Source | Use for |
|------------------|----------------------------------------------------------|
| OpenAPI / Swagger | Existing REST contract → client SDK, server stubs, schemas |
| TypeSpec | Design-first API definition with rich type system |
## Workflow
1. **Ingest the spec.**
- URL, file path, or pasted content.
- Validate completeness: endpoints, schemas, auth, servers, examples.
2. **Confirm target.** Ask (or infer from repo):
- Language + framework + version.
- Client SDK, server stubs, or both?
- ORM / database? In-memory / mock?
- Auth method (JWT / OAuth2 / API key / basic)?
3. **Generate.** Follow the relevant reference:
- OpenAPI → `reference/openapi-codegen.md`
- TypeSpec → `reference/typespec-patterns.md`
4. **Verify.**
- Build / compile the generated project.
- Run the generated tests.
- Show one example request/response round-trip.
5. **Document.** Produce a README with setup, env vars, run commands, and a link back to the spec.
## Generation Principles
- **Spec is truth.** Do not invent endpoints, fields, or status codes.
- **Separate concerns.** Controllers / handlers, services, models, config.
- **Validate early.** Request validation at the boundary; typed models inside.
- **Error semantics.** Map spec error responses to typed exceptions / result types.
- *