backend-dev-guidelines

Enforces layered architecture patterns for Node.js Express TypeScript microservices.

2|Updated Jan 10, 2026
One-click install
npx skills add https://github.com/Shubh2310-developer/ENGUNITYCORE --skill backend-dev-guidelines-shubh2310-developer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/Shubh2310-developer/ENGUNITYCORE/tree/main/.claude/skills/backend-dev-guidelines
Command: npx skills add https://github.com/Shubh2310-developer/ENGUNITYCORE --skill backend-dev-guidelines-shubh2310-developer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Backend microservices often accumulate inconsistent patterns: business logic leaking into routes, scattered process.env usage, missing error tracking, and untested code. This Skill provides a single authoritative guide that standardizes how routes, controllers, services, repositories, and middleware are built across Node.js/Express/TypeScript services. ## Core Features & Use Cases - Layered Architecture Enforcement: Defines the routes → controllers → services → repositories pattern with a BaseController class, dependency injection, and repository-based Prisma data access. - Operational Standards: Covers Sentry error tracking and performance monitoring, Zod input validation, unifiedConfig configuration management, AsyncLocalStorage audit middleware, and async error handling. - Refactoring Guidance: Provides before/after examples showing how to convert 200-line route handlers into clean controller/service layers, plus testing strategies. - Use Case: When asked to add a new REST endpoint to an Express microservice, the Skill ensures the route delegates to a BaseController subclass, input is validated with Zod, errors flow to Sentry, and database access goes through a repository. ## Quick Start Ask the assistant to create a new Express endpoint for managing users following the backend development guidelines, including the route, controller, service, repository, and Zod validation schema.

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 routes and controllers in an Express TypeScript microservice?

Routes should only register paths, middleware, and delegate to controllers with no business logic. Controllers extend a BaseController class that provides handleError, handleSuccess, and Sentry-integrated performance tracking methods.

What is the repository pattern with Prisma and when should I use it?

The repository pattern wraps all Prisma queries in dedicated classes like UserRepository, separating data access from business logic. Use it for complex queries, reused queries, or when you need caching and easy test mocking.

Why should I avoid using process.env directly in Node.js services?

Direct process.env usage lacks type safety, validation, and defaults, causing runtime errors from typos. A unifiedConfig module centralizes configuration, validates at startup, and provides typed access with fallbacks.

How do I integrate Sentry error tracking in Express middleware?

Initialize Sentry in an instrument.ts file imported first, register Sentry request handlers before routes, and register error handlers after all routes. Capture exceptions with tags, user context, and breadcrumbs in controllers and services.

How do I validate request input with Zod in Express controllers?

Define a Zod schema for the request body and call schema.parse(req.body) inside the controller method. Catch ZodError instances and return a 400 status with the validation details.

What are common async error handling mistakes in Node.js services?

Common mistakes include fire-and-forget promises without catch handlers, unhandled rejections, and swallowed errors in empty catch blocks. Always await async calls, wrap handlers in an asyncErrorWrapper, and capture all errors to Sentry before rethrowing.