backend-dev-guidelines

Generate Node.js/Express/TypeScript microservice backend guidelines with layered architecture.

4|Updated Nov 1, 2025
One-click install
npx skills add https://github.com/weirdgme/claude-code-infrastructure-showcase --skill backend-dev-guidelines-weirdgme
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/weirdgme/claude-code-infrastructure-showcase/tree/main/.claude/skills/backend-dev-guidelines
Command: npx skills add https://github.com/weirdgme/claude-code-infrastructure-showcase --skill backend-dev-guidelines-weirdgme

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides standardized backend architecture and patterns (routes, controllers, services, repositories) to improve consistency, quality, and maintainability across microservices.

Core Features & Use Cases

  • Layered architecture (routes → controllers → services → repositories)
  • BaseController pattern with centralized error handling
  • Sentry integration, Zod validation, and unifiedConfig
  • Testing strategies and migration guidance from legacy patterns

Quick Start

Start by creating a new route using the recommended architecture, extend a BaseController, wire up a service with DI, and add Zod validations.

Frequently Asked Questions about backend-dev-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Node.js/Express backend with layered architecture?

Layered architecture separates routes, controllers, services, and repositories into distinct tiers. Routes handle HTTP requests, controllers manage request/response logic, services contain business logic, and repositories handle data access via Prisma. This separation improves testability and maintainability across microservices.

What's the best way to handle errors and logging in Express with Sentry?

Centralized error handling with Sentry integration captures exceptions automatically across your application. Implement a BaseController pattern that wraps route handlers to catch errors, format them consistently, and send them to Sentry. This ensures all services report issues uniformly without repetitive error management code.

How do I validate request data in TypeScript backends with Zod?

Zod provides schema validation for incoming request payloads with full TypeScript type inference. Define schemas at the controller layer, validate before passing data to services, and catch validation errors to return structured responses. This prevents invalid data from reaching business logic or the database.

Can I use dependency injection with Express and TypeScript microservices?

Yes, dependency injection decouples services from their dependencies, making code testable and flexible. Wire up services in a DI container, inject them into controllers, and swap implementations for testing. This pattern scales well across multiple microservices like blog-api, auth-service, and notifications-service.

What's the recommended way to manage configuration across Node.js microservices?

Use unifiedConfig to centralize environment variables and settings across services with type safety. Load configuration once at startup, validate schema upfront, and inject it into services. This prevents runtime configuration errors and ensures consistency between blog-api, auth-service, and notifications-service.

How do I migrate legacy Express code to follow modern backend patterns?

Incrementally refactor toward layered architecture by extracting business logic from routes into services, adding repositories for data access, and implementing centralized error handling. Move validation into dedicated schemas, introduce dependency injection, and add tests at each layer to ensure correctness during migration.