Shared backend guide for Langfuse's Next.js 14, tRPC, BullMQ, and TypeScript monorepo. Use when creating or reviewing tRPC routers, public REST endpoints, BullMQ queue processors, backend services, middleware, Prisma or ClickHouse data access, OpenTelemetry instrumentation, Zod validation, env configuration, or backend tests across web, worker, or packages/shared.
Use this skill for backend and API work across web/, worker/, and
packages/shared/.
| Topic | Read this when | File |
|---|---|---|
| Architecture and package boundaries | You need the web/worker/shared split, request flow, or queue lifecycle | references/architecture-overview.md |
| Routing and controllers | You are writing tRPC procedures, public API routes, or queue entrypoints | references/routing-and-controllers.md |
| Middleware and auth | You are changing request auth, permissions, or middleware composition | references/middleware-guide.md |
| Services and repositories | You are placing business logic, repository code, or DI patterns | references/services-and-repositories.md |
| Database access | You are touching Prisma, ClickHouse, tenant filters, or query patterns | references/database-patterns.md |
| Configuration | You are adding env vars, startup config, or runtime toggles | references/configuration.md |
| Testing | You are adding or updating backend tests | references/testing-guide.md |
Read AGENTS.md for the complete backend guide with checklists, directory conventions, imports, architecture, and cross-cutting practices.