AGENT SKILL
api-generator
Generate REST API endpoints with validation and error handling
适用职业开发工程师
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 29
- Forks
- 7
01 前言 Front Matter
- name
- api-generator
- description
- Generate REST API endpoints with validation and error handling
02 资源文件 1
- 参考文档references/checklist.md569 B
03 SKILL.md 正文
Purpose
Generate well-structured REST API endpoints following the project's conventions. Includes request validation, typed response shapes, and consistent error handling.
Workflow
- Analyze the endpoint requirements from the user's description
- Review
references/checklist.mdfor quality gates - Generate the route handler with input validation
- Add typed request/response interfaces
- Include error handling middleware integration
- 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)
04 同仓库更多 Skills
research
Research docs and summarize decisions
★ 29
debugging
Systematic debugging workflow for production failures and test regressions.
★ 29
api-generator
Generate REST API endpoints with validation and tests
★ 29
debugging
Systematic debugging workflow for production failures and test regressions.
★ 29
typescript-pro
Apply advanced TypeScript patterns including conditional types, template literal types, and mapped types
★ 29
debugging
Systematic debugging workflow for Replit projects
★ 29