create-backend-service
Use this skill when adding new backend functionality (API endpoints + business logic).
When & Why to Use This Skill
This Claude skill automates the creation of backend services and API endpoints by enforcing a structured 'route-service' architectural pattern. It streamlines the development workflow by generating boilerplate code for controllers and business logic modules, ensuring consistency in naming conventions and project structure. By utilizing predefined templates, it helps developers quickly implement scalable and testable backend functionality while maintaining a clean separation of concerns.
Use Cases
- Scenario 1: Rapidly scaffolding new RESTful API endpoints, including the necessary route handlers and business logic services.
- Scenario 2: Implementing complex business logic into modular service files to ensure the codebase remains easy to test and maintain.
- Scenario 3: Standardizing backend development across a team by following specific naming patterns and directory structures (e.g., server/src/services and server/src/routes).
- Scenario 4: Automating the registration and mounting of new API routes within the main application entry point to reduce manual configuration errors.
| name | Create Backend Service |
|---|---|
| description | Use this skill when adding new backend functionality (API endpoints + business logic). |
Create Backend Service
Use this skill to follow the route (controller) + service split used in server/src/.
Steps
- Create the service module
- Location:
server/src/services/{serviceName}.js - Use
template_service.jsfrom this folder. - Prefer small exported functions (keep them easy to test).
- Create the route module
- Location:
server/src/routes/{routeName}.js - Use
template_route.jsfrom this folder. - Validate inputs near the route (or use
server/src/contracts/httpSchemas.jswhen applicable).
- Mount the route
- Register it in
server/src/index.js:app.use('/api/your-scope', yourRouter);
Naming notes
- Prefer existing naming patterns:
- Routes:
dataRoutes.js,runRoutes.js,indicatorExecutionRoutes.js - Services:
marketWindowService.js,leanService.js,runStore.js
- Routes: