backend-dev-guidelines

Enforce consistent backend development practices across Langfuse's Next.js 14/tRPC/Express/TypeScript monorepo.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/nksrentas/ai-stash --skill backend-dev-guidelines-nksrentas
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/nksrentas/ai-stash/tree/main/skills/backend-dev-guidelines
Command: npx skills add https://github.com/nksrentas/ai-stash --skill backend-dev-guidelines-nksrentas

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) and scripts (resource) components.

What problem does it solve?

Establishes consistent backend patterns, robust architecture, and scalable practices for Langfuse's monorepo backends.

Core Features & Use Cases

  • Layered & Telemetry-Driven Patterns: Clear separation of entry points, services, and data access with observability.
  • Database & Architecture Guidance: PostgreSQL + ClickHouse usage, multi-tenant patterns, and testing strategies.
  • Operational Maturity: Error handling, tracing, and instrumentation best practices.

Quick Start

Use the Quick Start checklist to establish a new web or worker feature with proper routing, services, and tests.

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 backend routes and services in a tRPC and Express monorepo?

Enforce layered architecture with clear separation between entry points (tRPC routers, API endpoints), services, and data access via Prisma. This pattern ensures consistent routing, testability, and observability across your Next.js 14 backend.

How do I implement multi-tenant data isolation in a backend with Prisma and PostgreSQL?

Apply projectId filtering at the service and database layers to enforce tenant isolation. This prevents cross-tenant data leakage while maintaining a shared schema and consistent query patterns across your monorepo.

What's the best way to add OpenTelemetry instrumentation and error tracing to backend services?

Use OpenTelemetry for distributed tracing and the traceException pattern for standardized error handling across tRPC procedures, Express endpoints, and BullMQ processors. This enables consistent observability and debugging across all backend components.

How do I validate inputs and configure environment variables for backend procedures and endpoints?

Use Zod v4 for input validation on tRPC routers and API endpoints, and env.mjs for centralized environment configuration. This ensures type safety and consistent validation across your entire backend.

How do I set up BullMQ queue processors with proper testing and error handling?

Create queue processors that follow the same layered architecture as synchronous services, apply traceException error handling, and include standard test scaffolds. This maintains consistency between synchronous and asynchronous backend tasks.

What testing strategies apply to backend services, database access, and queue processors?

Implement standard testing scaffolds that cover services, Prisma queries, and BullMQ processors with isolated test environments. This ensures reliable, maintainable coverage across all backend layers in your monorepo.