langfuse/backend-dev-guidelines
Build or review Langfuse backend code. Use for tRPC routers, public REST APIs, BullMQ processors, services, middleware, Prisma or ClickHouse access, OpenTelemetry, Zod, environment configuration, or backend tests.
npx skills add https://github.com/langfuse/langfuse --skill backend-dev-guidelines
Use this skill for backend and API work across web/, worker/, and
packages/shared/.
SKILL.md when the task spans multiple backend areas or you need theend-to-end reference map.
narrower.
integration, or touches secrets, RBAC, or redirect handling, also load the
shared security-review skill before
designing or implementing the change.
features/[feature]/server/*Router.ts.traceException for error handling where relevant.__tests__/.env.mjs.Before coding, classify the change as a new endpoint, an additive field/filter
on an existing endpoint, or a semantic replacement/breaking change.
For an additive field/filter:
selection, reuse their existing field-group/projection path.
partial-row schema and converter path for field-group endpoints; retain the
strict response schema and converter path for ordinary endpoints.
runtime assertions unless compatibility requires them.
pages/api/public/.withMiddlewares and createAuthedProjectAPIRoute.features/public-api/types/.__tests__/async/.worker/src/queues/.packages/shared/src/server/queues.features/ or worker/src/features/.WorkerManager in app.ts.logic to services.
env.mjs; do not read process.env directlyoutside env setup.
projectId.web/src/features/events/server/eventsRouter.ts.
web/src/pages/api/public/datasets/index.ts.
worker/src/queues/evalQueue.ts.
references/database-patterns.md.
camelCaseRouter.ts, for example datasetRouter.ts.service.ts in the feature server directory.camelCaseQueue.ts, for example evalQueue.ts.dataset-items.ts.process.env usage instead of env.mjs / env.ts.projectId filters on tenant-scoped queries.console.log instead of logger / traceException.| 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 |
Take langfuse/backend-dev-guidelines from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.