backend-dev-guidelines

Enforce layered Node.js/Express/TypeScript microservice architecture with Zod, Sentry, and Prisma.

11|3|Updated Oct 31, 2025
One-click install
npx skills add https://github.com/dwalleck/catalyst --skill backend-dev-guidelines-dwalleck
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/dwalleck/catalyst/tree/main/.claude/skills/backend-dev-guidelines
Command: npx skills add https://github.com/dwalleck/catalyst --skill backend-dev-guidelines-dwalleck

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Backend development in microservices can quickly become inconsistent, hard to maintain, and prone to errors without a clear architectural blueprint. This Skill provides a definitive guide for Node.js/Express/TypeScript microservices, standardizing everything from routing and data access to error handling and testing. It eliminates architectural drift and ensures every new feature is built on a solid, scalable foundation.

Core Features & Use Cases

  • Layered Architecture: Implement a clean separation of concerns (Routes → Controllers → Services → Repositories) for maximum testability and maintainability.
  • Robust API Development: Standardize input validation with Zod, manage configuration with unifiedConfig, and ensure comprehensive error tracking with Sentry.
  • Performance & Reliability: Utilize BaseController for consistent error handling and performance monitoring, and follow async/await best practices to prevent common pitfalls.
  • Use Case: When developing a new API endpoint, use this Skill to get a step-by-step checklist for defining the route, creating the controller, implementing business logic in a service, and ensuring all inputs are validated and errors are tracked.

Quick Start

To get a quick checklist for creating a new backend feature, ask: "Give me the new backend feature checklist from the backend-dev-guidelines skill."

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 API with clean layered architecture?

Layered architecture separates concerns into Routes → Controllers → Services → Repositories. Routes handle HTTP requests, controllers orchestrate business logic, services contain core logic, and repositories manage data access through Prisma. This structure improves testability, maintainability, and scalability across microservices.

What's the best way to validate API inputs in Express with TypeScript?

Use Zod for type-safe input validation. Define schemas at route entry points, validate request data before passing to controllers, and leverage TypeScript inference to automatically type validated inputs. This prevents invalid data from entering business logic and ensures runtime safety.

How do I implement consistent error handling across Node.js microservices?

Implement a BaseController that standardizes error handling and integrates Sentry for error tracking. Centralize error responses, log contextual information, and route all errors through middleware. This ensures every service reports failures consistently and enables cross-service observability.

Can I use this approach to migrate existing Express APIs from unstructured patterns?

Yes, this Skill provides migration guidance for converting legacy endpoints into the layered architecture. Refactor incrementally: extract business logic into services, create repositories for data access, and update controllers to use the new structure while maintaining backward compatibility.

What configuration management approach works best for Node.js microservices?

Use unifiedConfig for type-safe, centralized configuration across services. Store environment variables in a single validated schema, share configuration across auth-service, blog-api, and notifications-service, and prevent runtime configuration errors through TypeScript type checking.

How do I avoid common async/await pitfalls in Express controllers?

Follow explicit async patterns: always await promises in controllers and services, wrap handlers in try-catch blocks, and propagate errors to middleware. This prevents unhandled promise rejections, ensures proper error tracking in Sentry, and maintains predictable request-response flow.