Express API Builder
VerifiedBuild production-ready Express.js REST APIs with middleware stacks, JWT auth, input validation, error handling, and OpenAPI documentation.
Install
Claude Code
Copy the SKILL.md file to .claude/skills/express-api.md About This Skill
Express API Builder generates well-structured Express.js applications following the router-controller-service pattern. It produces maintainable, testable code with a complete middleware stack ready for production.
Architecture Pattern
The skill enforces a clean separation: Routes define endpoints and apply middleware, Controllers handle HTTP request/response, Services contain business logic, and Repositories abstract data access. This makes testing each layer in isolation straightforward.
Middleware Stack
Generated apps include: helmet for security headers, cors with configurable origins, express-rate-limit for API throttling, morgan for request logging, and a global error handler that normalizes errors into consistent JSON responses.
Authentication
JWT auth middleware with access + refresh token pattern. Refresh tokens are stored with expiry and rotation on use. Supports both Bearer token and cookie-based token delivery.
Validation
Request validation using Zod schemas co-located with routes. Schema inference generates TypeScript types automatically. Validation errors return RFC 7807 Problem Details responses.
Documentation
JSDoc annotations on routes feed swagger-jsdoc to auto-generate OpenAPI 3.1 specs. Swagger UI is mounted at /api-docs in development mode.
Use Cases
- Generating Express router files with full CRUD operations
- Adding JWT authentication middleware with refresh token rotation
- Creating Zod or Joi validation schemas for request bodies
- Auto-generating OpenAPI 3.1 specs from route definitions
Pros & Cons
Pros
- + Clean router-controller-service separation makes testing easy
- + Includes complete security middleware stack out of the box
- + Auto-generates OpenAPI documentation from route annotations
- + Supports TypeScript with full type inference from Zod schemas
Cons
- - Opinionated structure may not suit existing Express projects
- - Refresh token rotation requires a persistent store (Redis or DB)
Related AI Tools
Claude Code
Paid
Anthropic's agentic CLI for autonomous terminal-native coding workflows
- Terminal-native autonomous coding agent
- Full file system and shell access for multi-step tasks
- Deep codebase understanding via repository indexing
GitHub Copilot
Freemium
AI pair programmer that suggests code in real time across your IDE
- Real-time code completions across 30+ languages
- Copilot Chat for natural language code Q&A
- Pull request description and summary generation
Replit
Freemium
Browser-based IDE with AI agent for building and deploying apps from prompts
- Replit Agent for autonomous app building from prompts
- Complete browser-based IDE with terminal and database
- Instant deployment to live URLs
Related Skills
API Builder
CautionScaffold REST and GraphQL APIs with route generation, validation, authentication middleware, and OpenAPI documentation.
JWT Validator
VerifiedImplements secure JWT creation, validation, and rotation with proper algorithm selection, claim validation, and key management.
Stay Updated on Agent Skills
Get weekly curated skills + safety alerts
每周精选 Skills + 安全预警