Backend Dev Elite
Powerful skill for comprehensive, backend, development, guide. Includes structured workflows, validation checks, and reusable patterns for development.
Backend Development Elite
A Claude Code skill establishing consistency and best practices across backend services. Covers project structure, API design, error handling, database patterns, authentication, testing, logging, and deployment for modern Node.js/Express/TypeScript backend development.
When to Use This Skill
Choose Backend Dev Elite when:
- You're setting up a new backend service with Node.js/TypeScript
- You want consistent patterns across multiple microservices
- You need production-ready error handling, logging, and monitoring
- You want to establish coding standards for your backend team
- You need guidance on authentication, authorization, and security patterns
Consider alternatives when:
- You need serverless-specific patterns (use an AWS/Azure serverless skill)
- You want frontend development guidance (use a frontend skill)
- You need database-specific optimization (use a database skill)
Quick Start
# Install the skill claude install backend-dev-elite # Set up a new service claude "Set up a Node.js/Express/TypeScript backend with: project structure, error handling middleware, logging, and health checks" # Add authentication claude "Add JWT authentication with refresh tokens to my Express API. Include middleware, route protection, and token rotation" # Implement a feature claude "Implement a CRUD API for a products service with validation, pagination, and proper error responses"
Core Concepts
Project Structure
src/
āāā controllers/ # Request handling, response formatting
āāā services/ # Business logic, orchestration
āāā repositories/ # Data access layer
āāā middleware/ # Auth, error handling, logging, validation
āāā routes/ # Route definitions
āāā types/ # TypeScript types and interfaces
āāā utils/ # Shared utilities
āāā config/ # Environment config, constants
āāā validators/ # Request validation schemas
āāā index.ts # App entry point
tests/
āāā unit/ # Unit tests (services, utils)
āāā integration/ # API endpoint tests
āāā fixtures/ # Test data and factories
Layer Responsibilities
| Layer | Responsibility | Dependencies |
|---|---|---|
| Controller | Parse request, call service, format response | Service layer |
| Service | Business logic, validation, orchestration | Repository layer |
| Repository | Data access, queries, transactions | Database |
| Middleware | Cross-cutting: auth, logging, errors | Config |
Error Handling Pattern
// Custom error classes class AppError extends Error { constructor( public statusCode: number, public code: string, message: string, ) { super(message); } } class NotFoundError extends AppError { constructor(resource: string) { super(404, 'NOT_FOUND', `${resource} not found`); } } // Error middleware app.use((err, req, res, next) => { const status = err.statusCode || 500; res.status(status).json({ error: { code: err.code, message: err.message }, }); });
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
framework | string | "express" | Framework: express, fastify, nestjs, hono |
database | string | "postgresql" | Database: postgresql, mongodb, mysql |
orm | string | "prisma" | ORM: prisma, drizzle, typeorm, knex |
auth | string | "jwt" | Auth: jwt, session, oauth2, api_key |
testing | string | "vitest" | Testing: vitest, jest, mocha |
Best Practices
-
Separate controllers from business logic ā Controllers handle HTTP concerns (parsing request, formatting response). Services contain business logic. Repositories handle data access. This separation makes each layer testable and replaceable.
-
Use typed error classes ā Create a hierarchy of error classes with status codes and machine-readable codes.
throw new NotFoundError('User')is clearer thanthrow new Error('not found')and automatically maps to the right HTTP response. -
Validate all input at the boundary ā Use Zod or Joi to validate request bodies, query parameters, and path parameters in middleware. Reject invalid input early with clear error messages before it reaches your business logic.
-
Log structured JSON ā Use a logger like Pino that outputs structured JSON. Include request ID, user ID, and operation context in every log line. Structured logs are searchable and parseable by log aggregation tools.
-
Write integration tests for API endpoints ā Unit tests for services are good, but integration tests that make real HTTP requests to your API catch more bugs. Use Supertest with an in-memory database for fast, reliable API tests.
Common Issues
Unhandled promise rejections crash the server ā Express doesn't catch async errors by default. Use express-async-errors or wrap every async handler with a try-catch. In Express 5, async error handling is built-in.
Circular dependencies between modules ā Usually a sign that your module boundaries are wrong. Extract shared logic into a separate module, or restructure so dependencies flow in one direction (controller ā service ā repository).
Environment configuration is inconsistent ā Use a single config module that validates all environment variables at startup. If a required variable is missing, fail fast with a clear error message rather than crashing later with a cryptic error.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.