claudegoodies
Command

route

From davila7

Create API routes for $ARGUMENTS following project conventions.

Install

/route

Facts

Status
Actively maintained
Last commit

Source preview

The instructions Claude Code reads when this command runs.

# Route Creator

Create API routes for $ARGUMENTS following project conventions.

## Task

Create or optimize API routes based on the requirements:

1. **Analyze project structure**: Check existing route patterns, folder organization, and framework setup
2. **Examine framework**: Identify if using Express, Fastify, NestJS, or other Node.js framework
3. **Review existing routes**: Understand current routing patterns, validation, and error handling
4. **Check authentication**: Review existing auth middleware and protection patterns
5. **Define route structure**: Determine HTTP methods, path parameters, and request/response schemas
6. **Implement routes**: Create route handlers with proper validation and error handling
7. **Add middleware**: Include authentication, validation, and logging middleware as needed
8. **Create tests**: Write route tests following project testing patterns
9. **Update route registration**: Integrate new routes into main router configuration

## Implementation Requirements

- Follow project's routing architecture and naming conventions
- Use existing validation libraries (Joi, Zod, class-validator, etc.)
- Include proper TypeScript types for request/response objects
- Add comprehensive error handling with appropriate HTTP status codes
- Implement proper authentication/authorization if required
- Follow RESTful conventions unless project uses different patt
View full source on GitHub →

Other slash commands