Scaffold a REST API endpoint with route, controller, validation, and tests. Use when creating new API endpoints, adding resources, or when asked to build a new backend route.
Create a new REST API endpoint following project conventions.
comment)body:string, author_id:number)true)post)Create the route file
src/routes/{entity}.routes.ts
GET /, GET /:id, POST /, PUT /:id, DELETE /:idGET /{parent}s/:parentId/{entity}sCreate the controller
src/controllers/{entity}.controller.ts
{ data, error, meta } shapeCreate the validation schema
src/validators/{entity}.validator.ts
Create the test file
tests/api/{entity}.test.ts
Register the route
src/routes/index.ts
app.use('/{entity}s', {entity}Routes)/comments, not /comment)comment.routes.ts){ data, error, meta }meta includes pagination for list endpointsmulter middleware, accept multipart/form-dataDELETE sets deleted_at timestamp, doesn't remove the rowSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer