REST API Endpoint
Defines every route, validation rule, and response format so Bolt builds a complete CRUD API. The 'do not modify' boundary prevents unintended side effects.
Add a RESTful API endpoint for {{resource_name}}.\n\nRoutes:\n- GET /api/{{resource_name}} — list all with pagination (page, limit query params)\n- GET /api/{{resource_name}}/:id — get single by ID\n- POST /api/{{resource_name}} — create new (validate required fields: {{required_fields}})\n- PUT /api/{{resource_name}}/:id — update existing\n- DELETE /api/{{resource_name}}/:id — soft delete (set deleted_at timestamp)\n\nInclude:\n- Input validation with descriptive error messages\n- Try/catch with proper HTTP status codes (400, 404, 500)\n- Response format: { success: boolean, data: T, error?: string }\n\nDo not modify any existing routes or the frontend.
Variables to customize
Why this prompt works
Defines every route, validation rule, and response format so Bolt builds a complete CRUD API. The 'do not modify' boundary prevents unintended side effects.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Forcing the agent to plan before acting prevents premature execution and wasted steps. Explicit dependency mapping enables parallel execution and catches logical gaps early.
Tool Selection AgentThe ReAct pattern (Reason + Act) creates an explicit reasoning trace that improves tool selection accuracy. The error-handling rule prevents infinite retry loops.
Prompt CompressorExplicitly requiring all functional requirements to be preserved prevents the model from over-compressing and losing critical instructions.
Memory Management AgentExplicit memory read/write instructions create agents that improve over time. Categorization keeps memories organized, and the deduplication rule prevents context bloat.