Generate robust Next.js API routes with Zod validation, error handling, rate limiting, and TypeScript types.
Create a Next.js App Router API route at app/api/[endpoint]/route.ts. Requirements:
- Export async GET/POST/PUT/DELETE handler functions
- Use Zod schemas for request body and query parameter validation
- Implement proper error handling with try/catch and typed error responses
- Return consistent JSON response shape: { data, error, message }
- Add proper HTTP status codes (200, 201, 400, 401, 403, 404, 500)
- Include request body type inference from Zod schema
- Add rate limiting check if this is a public endpoint
- Use NextRequest and NextResponse from next/server
- Log errors to console with context (route, method, timestamp)
- Handle edge cases: empty body, malformed JSON, missing fields
- Follow existing API patterns in this project's codebaseReplace [endpoint] with your route path. Works best when you provide example request/response payloads. Use with @-mention of existing API routes for pattern matching.
Agent Library is a centralized collection of reusable AI agent skills, workflows, prompts, and specialized knowledge modules. Built for Claude Code, Codex, Cursor, and other AI coding agents with an efficient on-demand loading architecture.
An open-source collection of production-ready AI skills, prompts, templates, and workflows for Claude, ChatGPT, Gemini, Cursor, and other AI tools.
A collection of Skills (system prompts) for autonomous AI Agents and LLMs (Google Antigravity, Claude Code, GitHub Copilot, Codex, Cursor, AutoGPT, ChatGPT, Gemini).
许惟的 AI 工具合集 · A growing collection of practical AI tools & skills. First up: diagram-generator (one sentence → clean diagrams).
A curated collection of high-quality AI prompts for ChatGPT, Claude, Gemini, Cursor, and other AI assistants
A curated collection of ready-to-run automation prompts for real-world workflows.
Workflows from the Neura Market marketplace related to this Cursor resource