# Backend Dev Guidelines

Guides Node.js, Express and TypeScript backend work across routes and services.

- Repository: https://github.com/diet103/claude-code-infrastructure-showcase (10043 stars)
- Category: Engineering
- License: MIT
- Last updated: 2026-07-13
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add diet103/claude-code-infrastructure-showcase --skill backend-dev-guidelines -g -a claude-code -y`
Codex: `npx skills add diet103/claude-code-infrastructure-showcase --skill backend-dev-guidelines -g -a codex -y`
Cursor: `npx skills add diet103/claude-code-infrastructure-showcase --skill backend-dev-guidelines -g -a cursor -y`
Gemini CLI: `npx skills add diet103/claude-code-infrastructure-showcase --skill backend-dev-guidelines -g -a gemini-cli -y`

## Description

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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Backend Development Guidelines

## Purpose

Establish consistency and best practices across backend services using modern Node.js/Express/TypeScript patterns.

Written for Node.js/Express/TypeScript with Prisma and Sentry. Different stack? Adapt the architectural principles - see CLAUDE_INTEGRATION_GUIDE.md in the repo root.

## 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](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](architecture-overview.md) for complete details.

---

## Directory Structure

The rest: https://github.com/diet103/claude-code-infrastructure-showcase/blob/HEAD/.agents/skills/backend-dev-guidelines/SKILL.md
