backend-dev-guidelines

Guide backend engineers to follow standardized patterns across Langfuse packages.

1|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/nextplus896/durra-alaseel --skill backend-dev-guidelines-nextplus896
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: backend-dev-guidelines
Source: https://github.com/nextplus896/durra-alaseel/tree/main/.github/skills/backend-dev-guidelines
Command: npx skills add https://github.com/nextplus896/durra-alaseel --skill backend-dev-guidelines-nextplus896

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Backend Development Guidelines Skill provides a centralized, opinionated set of best practices to ensure consistency across Langfuse's backend packages (web, worker, and shared), covering architecture, patterns, and testing.

Core Features & Use Cases

  • Layered architecture guidance: Entry points (tRPC procedures, Public API routes), Services, and Repositories with clear separation of concerns.
  • Dual-database patterns: PostgreSQL for transactional data and ClickHouse for analytics, with tenant isolation via projectId.
  • Observability and validation: OpenTelemetry instrumentation, env.config via env.mjs/env.ts, and Zod v4 input validation across entry points.
  • Testing strategies: Jest for web and Vitest for worker, with recommended test placements and isolation practices.

Quick Start

Spin up a new backend feature by creating a tRPC route that delegates to a service, uses a repository for data access, and is instrumented with OpenTelemetry.

Frequently Asked Questions about backend-dev-guidelines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the recommended architecture for Langfuse backend packages?

The recommended backend architecture uses a layered design with clear separation of concerns: entry points like tRPC procedures delegate to services, which interact with repositories for data access. This structure enforces consistency across web and worker packages.

How do I validate inputs in tRPC routers for Langfuse?

To validate inputs in tRPC routers, use Zod v4 input validation across all entry points. This enforces standardized schema validation before requests reach your backend services, ensuring data integrity and consistent API behavior.

When should I use PostgreSQL vs ClickHouse for backend data access?

Use PostgreSQL for transactional data and ClickHouse for analytics queries. Both database access patterns require tenant isolation via projectId, ensuring multi-tenant data security across all Langfuse backend services and workers.

Does this backend guideline require OpenTelemetry instrumentation?

Yes, OpenTelemetry instrumentation is required. Backend guidelines enforce observability integrations across all tRPC procedures, public API routes, and BullMQ workers to maintain consistent tracing and monitoring standards.

What testing frameworks are recommended for Langfuse web and worker packages?

Jest is recommended for testing web packages, while Vitest is used for worker packages. Guidelines specify recommended test placements and isolation practices to maintain reliable, standardized backend testing across the dual-database architecture.

How do I manage environment configuration in Langfuse backend services?

Manage environment configuration by using env.mjs or env.ts files. This standardized config approach ensures all backend packages, including shared modules and BullMQ workers, access environment variables consistently and safely.