backend-dev-guidelines

Guide Node.js/Express/TypeScript backend implementation with layered architecture and Prisma.

1|Updated May 24, 2026
One-click install
npx skills add https://github.com/gavin100305/traffic --skill backend-dev-guidelines-gavin100305
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/gavin100305/traffic/tree/main/agents/.agents/skills/backend-dev-guidelines
Command: npx skills add https://github.com/gavin100305/traffic --skill backend-dev-guidelines-gavin100305

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents fragile backend code by enforcing a production-grade architecture, consistent error handling, strong input validation, and first-class observability across Node.js/Express/TypeScript services.

Core Features & Use Cases

  • Layered backend architecture enforcement: Routes → Controllers → Services → Repositories, with no business logic leakage across layers.
  • Reliability-first error handling: Captures errors in Sentry and blocks silent failures and console logging patterns.
  • Secure and predictable input validation: Requires Zod validation for all external input (body, query, params, webhooks).
  • Operational guardrails & test discipline: Introduces a Backend Feasibility & Risk Index (BFRI) to decide how risky a change is, and mandates unit/integration tests.

Use it when you are implementing or modifying backend routes/controllers/services/repositories, adding Express middleware (including async handlers), or working with Prisma database access, especially in production-grade microservices.

Quick Start

Use this skill when you are about to implement a new Express route and want to confirm it follows the required layered architecture, validation, Sentry error capture, configuration rules, and test expectations for a production backend.

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 Express and TypeScript backend services to prevent business logic leakage?

Structure Express and TypeScript backend services using a layered architecture of routes, controllers, services, and repositories. This separation enforces production-grade guardrails and ensures business logic does not leak into HTTP routing or data access layers.

What is the best way to validate external input in Node.js backend routes?

The best way to validate external input in Node.js backend routes is using Zod validation. Applying Zod schemas to all external inputs like request bodies, queries, parameters, and webhooks ensures secure and predictable data handling before reaching controllers.

How does Sentry observability work with async error handling in Express?

Sentry observability works with async error handling in Express by capturing errors through async wrappers and blocking silent failures. This reliability-first approach prevents fragile code patterns by ensuring all operational errors are caught and logged without using console logging.

Can I use Prisma repositories for database access in a layered backend architecture?

Yes, you can use Prisma repositories for database access in a layered backend architecture. Prisma acts as the repository layer, isolating data access logic from services and controllers to maintain strict separation of concerns and production-grade reliability.

Why should I avoid process.env and console logging in production backend services?

You should avoid process.env and console logging in production backend services because they bypass unified configuration management and observability tools. Strict anti-pattern avoidance mandates using unifiedConfig and Sentry to capture errors reliably and prevent silent failures.

When do I need a Backend Feasibility and Risk Index assessment for feature work?

You need a Backend Feasibility and Risk Index (BFRI) assessment when implementing or modifying backend routes, controllers, or middleware. The BFRI evaluates how risky a change is and mandates unit and integration tests to align with strict reliability constraints.