API Endpoint Generator
Commandby davila7 · Added 5mo ago
Claude
Install
npx claude-code-templates@latest --command=cli-tool/templates/javascript-typescript/.claude/commands --yesAdd to Claude
claude mcp add api-endpoint-generatorAbout
API Endpoint Generator
Generate a complete API endpoint for $ARGUMENTS following project conventions.
Task
I'll analyze the project structure and create a new API endpoint with:
- Route definition
- Controller/handler function
- Input validation
- Service layer logic (if applicable)
- Data access layer (if applicable)
- Unit tests
- Documentation
Process
I'll follow these steps:
- Examine the project structure to understand the architecture pattern
- Identify existing patterns for routes, controllers, and validation
- Create all necessary files following project conventions
- Implement the endpoint with proper error handling
- Add appropriate tests
- Document the new endpoint
Best Practices
I'll ensure the implementation includes:
- Strong typing with TypeScript
- Comprehensive error handling
- Input validation
- Security considerations (authentication/authorization)
- Proper logging
- Performance considerations
- Test coverage
Adaptability
I'll adapt to various API architectures:
- Express/Koa/Fastify REST APIs
- GraphQL resolvers
- Next.js/Nuxt.js API routes
- Serverless functions
- tRPC endpoints
- NestJS controllers
I'll examine your project first to determine which pattern to follow.
Tags
CodeAnalysisaitmplclaude-code-templates