backend-dev-guidelines

Centralize backend engineering practices for a Next.js 14 monorepo.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Langfuse backend teams often struggle with inconsistent patterns across web, worker, and shared codebases, hindering maintainability and scalability.

Core Features & Use Cases

  • Standardizes entry points (tRPC procedures and Public API routes) and the service layer.
  • Guides data access with Prisma and ClickHouse, tenant isolation via projectId, and OpenTelemetry instrumentation.
  • Provides testing strategies, environment management, and a clear separation of concerns.

Quick Start

Begin by aligning a new backend feature with the guidelines: implement the entry point to delegate to a service, use a repository for complex queries, validate inputs with Zod, and apply projectId tenant filtering.

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 tRPC router with Prisma in a Next.js monorepo?

Standardize tRPC router setup by delegating entry points to a service layer and using repositories for complex Prisma queries. Validate inputs with Zod and enforce projectId tenant filtering for strict data isolation.

What is the best way to enforce multi-tenant data isolation in a tRPC backend?

The best way to enforce multi-tenant isolation is by applying projectId filtering across all data access layers. This ensures queries in Prisma and ClickHouse are scoped to the correct tenant throughout the service layer.

How do I validate environment variables and inputs for Next.js 14 backend services?

Validate backend environment variables and inputs by using env.mjs for configuration and Zod for schema validation. This enforces type safety and prevents invalid data from entering tRPC procedures or public API endpoints.

Can I use ClickHouse alongside Prisma for queue processors in a monorepo?

Yes, you can use ClickHouse alongside Prisma for queue processors. The guidelines standardize data access patterns for both tools within BullMQ workers, ensuring proper OpenTelemetry instrumentation and separation of data layers.

How does OpenTelemetry instrumentation work with BullMQ queue processors?

OpenTelemetry instrumentation for BullMQ queue processors works by tracing background jobs across the service layer. It standardizes observability for queue processing, linking telemetry spans to specific tasks and multi-tenant data access operations.

What testing strategies should I use for tRPC procedures and public API routes?

Testing strategies for tRPC procedures and public API routes should cover entry, service, and data layers. The guidelines provide robust testing patterns that validate Zod schemas, projectId tenant filtering, and ClickHouse query logic.