Shared backend guide for Langfuse's Next.js, 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.
Seed local Langfuse test data with one command: large/branching observation trees (v3 and v4 events), long sessions, bulk traces for list performance. Use whenever a task needs ClickHouse/Postgres test data โ e.g. "seed a complex trace", "make a tough session", "fill the trace list", "test v4 events UI", or when debugging trace/session/list rendering or performance. Never write ad-hoc seed scripts or raw ClickHouse inserts.
Prepare Langfuse weekly production reviews that explain what broke, what was fixed, what remains open, and where alerting or tracking needs cleanup. Use when asked for a production review, "what broke last week", fixed/open bugs, Datadog alerted monitors/pages, status-page incidents, incident.io incidents, or an engineering-team overview that combines Linear, Datadog, and customer incident signals.
Shared code review workflow for Langfuse. Use when reviewing a PR, branch, diff, or local changes for correctness, regressions, risk, and missing tests. Start with references/review-checklist.md for repo-specific review rules and use package AGENTS.md files plus any matching shared skills when the change touches those areas.
Use when building, changing, or refactoring large Langfuse frontend features, virtualized lists, large tables, controller components, local feature state, Zustand stores, row selection, high-frequency UI state, or rendering-performance issues.
Use when writing or reviewing Storybook stories (`.stories.tsx`) for React components.
Use when editing worker/src/constants/default-model-prices.json, packages/shared/src/server/llm/types.ts, pricing tiers, tokenizer IDs, or matchPattern regexes for OpenAI, Anthropic, Bedrock, Vertex, Azure, or Gemini model pricing.
MUST USE when reviewing ClickHouse schemas, queries, or configurations. Contains 28 rules that MUST be checked before providing recommendations. Always read relevant rule files and cite specific rules in responses.