backend-dev-guidelines
What it does
This skill gives your AI agent backend rules for Node.js, Express and TypeScript services. It is for developers who want routes, services and data access kept organized.
When to use it
- βWhen you add new routes, controllers or services to an Express API.
- βWhen you set up a new microservice with error tracking and configuration.
- βWhen you add database access with Prisma or input validation with Zod.
Skill link
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/backend-dev-guidelines/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agentβs skills folder.
Example of what to ask your AI
βAdd a new endpoint for creating invoices in my Express API, following our layered structure.β
5 new skills a week. 1 minute to read.
How it works
The skill shows the agent a layered approach where routes only route, controllers handle requests, services hold business logic and repositories access data. The agent follows it when writing or changing code.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Backend Development Guidelines
Purpose
Establish consistency and best practices across backend microservices (blog-api, auth-service, notifications-service) using modern Node.js/Express/TypeScript patterns.
When to Use This Skill
Automatically activates when working on:
- Creating or modifying routes, endpoints, APIs
- Building controllers, services, repositories
- Implementing middleware (auth, validation, error handling)
- Database operations with Prisma
- Error tracking with Sentry
- Input validation with Zod
- Configuration management
- Backend testing and refactoring
Quick Start
New Backend Feature Checklist
- Route: Clean definition, delegate to controller
- Controller: Extend BaseController
- Service: Business logic with DI
- Repository: Database access (if complex)
- Validation: Zod schema
- Sentry: Error tracking
- Tests: Unit + integration tests
- Config: Use unifiedConfig
New Microservice Checklist
- Directory structure (see architecture-overview.md)
- instrument.ts for Sentry
- unifiedConfig setup
- BaseController class
- Middleware stack
- Error boundary
- Testing framework
Architecture Overview
Layered Architecture
HTTP Request
β
Routes (routing only)
β
Controllers (request handling)
β
Services (business logic)
β
Repositories (data access)
β
Database (Prisma)
Key Principle: Each layer has ONE responsibility.
See architecture-overview.md for complete details.
Directory Structure
service/src/
βββ config/ # UnifiedConfig
βββ controllers/ # Request handlers
βββ services/ # Business logic
βββ repositories/ # Data access
βββ routes/ # Route definitions
βββ middleware/ # Express middleware
βββ types/ # TypeScript types
βββ validators/ # Zod schemas
βββ utils/ # Utilities
βββ tests/ # Tests
βββ instrument.ts # Sentry (FIRST IMPORT)
βββ app.ts # Express setup
βββ server.ts # HTTP server
Naming Conventions:
- Controllers:
PascalCase-UserController.ts - Services:
camelCase-userService.ts - Routes:
camelCase + Routes-userRoutes.ts - Repositories:
PascalCase + Repository-UserRepository.ts
Core Principles (7 Key Rules)
1. Routes Only Route, Controllers Control
// β NEVER: Business logic in routes
router.post('/submit', async (req, res) => {
// 200 lines of logic
});
// β
ALWAYS: Delegate to controller
router.post('/submit', (req, res) => controller.submit(req, res));
2. All Controllers Extend BaseController
export class UserController extends BaseController {
async getUser(req: Request, res: Response): Promise<void> {
try {
const user = await this.userService.findById(req.params.id);
this.handleSuccess(res, user);
} catch (error) {
this.handleError(error, res, 'getUser');
}
}
}
3. All Errors to Sentry
try {
await operation();
} catch (error) {
Sentry.captureException(error);
throw error;
}
4. Use unifiedConfig, NEVER process.env
// β NEVER
const timeout = process.env.TIMEOUT_MS;
// β
ALWAYS
import { config } from './config/unifiedConfig';
const timeout = config.timeouts.default;
5. Validate All Input with Zod
const schema = z.object({ email: z.string().email() });
const validated = schema.parse(req.body);
6. Use Repository Pattern for Data Access
// Service β Repository β Database
const users = await userRepository.findActive();
7. Comprehensive Testing Required
describe('UserService', () => {
it('should create user', async () => {
expect(user).toBeDefined();
});
});
Common Imports
// Express
import express, { Request, Response, NextFunction, Router } from 'express';
// Validation
import { z } from 'zod';
// Database
import { PrismaClient } from '@prisma/client';
import type { Prisma } from '@prisma/client';
// Sentry
import * as Sentry from '@sentry/node';
// Config
import { config } from './config/unifiedConfig';
// Middleware
import { SSOMiddlewareClient } from './middleware/SSOMiddleware';
import {
FAQ
What is the layered structure?
It separates routes, controllers, services and repositories, so each layer has one job.
What tools does it cover?
It covers Prisma, Zod, Sentry, unified configuration and dependency injection.
Does it include testing?
Yes, the checklist includes unit and integration tests.
Details
Original description by the author
Comprehensive backend development guide for Node.js/Express/TypeScript microservices. Use when creating routes, controllers, services, repositories, middleware, or working with Express APIs, Prisma database access, Sentry error tracking, Zod validation, unifiedConfig, dependency injection, or async patterns. Covers layered architecture (routes β controllers β services β repositories), BaseController pattern, error handling, performance monitoring, testing strategies, and migration from legacy patterns.
Popularity
- GitHub stars
- 33k
- Ranking position
- #8726
- License
- MIT
- Updated
- 11/2/2026
Comments
- β¦
More skills from this repository
owasp-security
33kTeaches your agent OWASP security guidance for web apps, APIs, mobile, containers and AI agents, so it can spot common weaknesses and suggest fixes.
agent-management
33kLets your agent create, list, hibernate, wake, rename and delete AI agents using the AI Maestro command line, managing each agent's lifecycle.
agent-messaging
33kLets your agent send, receive and reply to signed messages between AI agents, using the Agent Messaging Protocol, mostly on your own machine.
docs-search
33kLets your agent search auto-generated code documentation for function signatures, class definitions and comments, so it checks the real API before changing code.
Similar skills
api-connector-builder
280kHas your agent build new API connections following the existing pattern. Use when you need to add one more integration without creating a new way of doing things.
api-design
280kHelps your agent design REST APIs following best practices. It's useful for defining how APIs communicate, how errors are shown, and how to organize data.
backend-patterns
280kHelps your agent with server-side architecture patterns and database optimization. It's useful for building or reviewing code that runs on the server.