backend-dev-guidelines

Guide backend development for a Next.js 14/tRPC/Express/TypeScript monorepo.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This guide provides a centralized, standardized set of backend development practices for Langfuse's Next.js 14/tRPC/Express/TypeScript monorepo.

Core Features & Use Cases

  • Layered architecture guidance for entry points (tRPC procedures/Public API) → services → repositories → databases, including Web and Worker patterns.
  • Tenant isolation and data access best practices, with projectId filtering across PostgreSQL and ClickHouse integrations.
  • Observability, error handling, input validation, and testing conventions (OpenTelemetry, traceException, Zod v4, Jest for web, vitest for worker).

Quick Start

Consult this guide when starting a new backend feature to align with Langfuse's architectural patterns.

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 new tRPC router and service layer in a Next.js monorepo?

Structure a new tRPC router by routing entry points through a service layer to repositories and databases. This enforces layered architecture across web and worker packages, standardizing backend patterns for Next.js and Express.

What is the best way to isolate tenant data across PostgreSQL and ClickHouse?

Isolate tenant data by applying projectId filtering across all database integrations. This dual PostgreSQL and ClickHouse strategy ensures strict tenant isolation and secure data access for backend services.

How do I handle backend errors and observability in a TypeScript tRPC application?

Handle backend errors and observability by implementing traceException error handling and OpenTelemetry instrumentation. This centralized approach standardizes error tracking across tRPC procedures and BullMQ workers.

Does this backend guide include input validation and testing conventions for BullMQ workers?

The guide includes input validation and testing conventions for BullMQ workers. It enforces Zod validation and specifies vitest for worker testing, while utilizing Jest for web package testing.

Can I use this guide for creating public API routes alongside tRPC procedures?

You can use this guide for creating public API routes alongside tRPC procedures. It provides standardized architectural patterns for both entry points, ensuring consistent env configuration and observability.