quiver-cli 1.3.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +197 -239
- package/dist/cli.js +3163 -2040
- package/package.json +10 -11
- package/template/.agents/AGENTS.md +0 -26
- package/template/.agents/commands/cp.md +0 -108
- package/template/.agents/commands/next-setup.md +0 -1064
- package/template/.agents/commands/review.md +0 -68
- package/template/.agents/commands/terraform-readme.md +0 -38
- package/template/.agents/config.json +0 -80
- package/template/.agents/plugins/opencode/rtk.ts +0 -34
- package/template/.agents/skills/agent-browser/SKILL.md +0 -51
- package/template/.agents/skills/apps/skybridge/SKILL.md +0 -50
- package/template/.agents/skills/code/cleanup/SKILL.md +0 -26
- package/template/.agents/skills/code/improve/SKILL.md +0 -122
- package/template/.agents/skills/code/improve/references/audit-playbook.md +0 -130
- package/template/.agents/skills/code/improve/references/closing-the-loop.md +0 -96
- package/template/.agents/skills/code/improve/references/plan-template.md +0 -197
- package/template/.agents/skills/code/vercel-react-best-practices/AGENTS.md +0 -3810
- package/template/.agents/skills/code/vercel-react-best-practices/README.md +0 -123
- package/template/.agents/skills/code/vercel-react-best-practices/SKILL.md +0 -149
- package/template/.agents/skills/code/vercel-react-best-practices/metadata.json +0 -15
- package/template/.agents/skills/code/vercel-react-best-practices/rules/_sections.md +0 -46
- package/template/.agents/skills/code/vercel-react-best-practices/rules/_template.md +0 -28
- package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-effect-event-deps.md +0 -56
- package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-event-handler-refs.md +0 -55
- package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-init-once.md +0 -42
- package/template/.agents/skills/code/vercel-react-best-practices/rules/advanced-use-latest.md +0 -39
- package/template/.agents/skills/code/vercel-react-best-practices/rules/async-api-routes.md +0 -38
- package/template/.agents/skills/code/vercel-react-best-practices/rules/async-cheap-condition-before-await.md +0 -37
- package/template/.agents/skills/code/vercel-react-best-practices/rules/async-defer-await.md +0 -82
- package/template/.agents/skills/code/vercel-react-best-practices/rules/async-dependencies.md +0 -51
- package/template/.agents/skills/code/vercel-react-best-practices/rules/async-parallel.md +0 -28
- package/template/.agents/skills/code/vercel-react-best-practices/rules/async-suspense-boundaries.md +0 -99
- package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-analyzable-paths.md +0 -63
- package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-barrel-imports.md +0 -60
- package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-conditional.md +0 -31
- package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-defer-third-party.md +0 -49
- package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-dynamic-imports.md +0 -35
- package/template/.agents/skills/code/vercel-react-best-practices/rules/bundle-preload.md +0 -50
- package/template/.agents/skills/code/vercel-react-best-practices/rules/client-event-listeners.md +0 -74
- package/template/.agents/skills/code/vercel-react-best-practices/rules/client-localstorage-schema.md +0 -71
- package/template/.agents/skills/code/vercel-react-best-practices/rules/client-passive-event-listeners.md +0 -48
- package/template/.agents/skills/code/vercel-react-best-practices/rules/client-swr-dedup.md +0 -56
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-batch-dom-css.md +0 -107
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-cache-function-results.md +0 -80
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-cache-property-access.md +0 -28
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-cache-storage.md +0 -70
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-combine-iterations.md +0 -32
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-early-exit.md +0 -50
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-flatmap-filter.md +0 -60
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-hoist-regexp.md +0 -45
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-index-maps.md +0 -37
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-length-check-first.md +0 -49
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-min-max-loop.md +0 -82
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-request-idle-callback.md +0 -105
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-set-map-lookups.md +0 -24
- package/template/.agents/skills/code/vercel-react-best-practices/rules/js-tosorted-immutable.md +0 -57
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-activity.md +0 -26
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-animate-svg-wrapper.md +0 -47
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-conditional-render.md +0 -40
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-content-visibility.md +0 -38
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-hoist-jsx.md +0 -46
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-hydration-no-flicker.md +0 -82
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-hydration-suppress-warning.md +0 -30
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-resource-hints.md +0 -85
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-script-defer-async.md +0 -68
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-svg-precision.md +0 -28
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rendering-usetransition-loading.md +0 -75
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-defer-reads.md +0 -39
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-dependencies.md +0 -45
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-derived-state-no-effect.md +0 -40
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-derived-state.md +0 -29
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-functional-setstate.md +0 -74
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-lazy-state-init.md +0 -58
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-memo-with-default-value.md +0 -38
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-memo.md +0 -44
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-move-effect-to-event.md +0 -45
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-no-inline-components.md +0 -82
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-simple-expression-in-memo.md +0 -35
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-split-combined-hooks.md +0 -64
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-transitions.md +0 -40
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-use-deferred-value.md +0 -59
- package/template/.agents/skills/code/vercel-react-best-practices/rules/rerender-use-ref-transient-values.md +0 -73
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-after-nonblocking.md +0 -73
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-auth-actions.md +0 -96
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-cache-lru.md +0 -41
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-cache-react.md +0 -76
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-dedup-props.md +0 -65
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-hoist-static-io.md +0 -149
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-no-shared-module-state.md +0 -50
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-parallel-fetching.md +0 -83
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-parallel-nested-fetching.md +0 -34
- package/template/.agents/skills/code/vercel-react-best-practices/rules/server-serialization.md +0 -38
- package/template/.agents/skills/data/prisma-cli/SKILL.md +0 -247
- package/template/.agents/skills/data/prisma-cli/references/db-execute.md +0 -78
- package/template/.agents/skills/data/prisma-cli/references/db-pull.md +0 -185
- package/template/.agents/skills/data/prisma-cli/references/db-push.md +0 -148
- package/template/.agents/skills/data/prisma-cli/references/db-seed.md +0 -188
- package/template/.agents/skills/data/prisma-cli/references/debug.md +0 -46
- package/template/.agents/skills/data/prisma-cli/references/dev.md +0 -157
- package/template/.agents/skills/data/prisma-cli/references/format.md +0 -48
- package/template/.agents/skills/data/prisma-cli/references/generate.md +0 -173
- package/template/.agents/skills/data/prisma-cli/references/init.md +0 -136
- package/template/.agents/skills/data/prisma-cli/references/mcp.md +0 -38
- package/template/.agents/skills/data/prisma-cli/references/migrate-deploy.md +0 -127
- package/template/.agents/skills/data/prisma-cli/references/migrate-dev.md +0 -145
- package/template/.agents/skills/data/prisma-cli/references/migrate-diff.md +0 -89
- package/template/.agents/skills/data/prisma-cli/references/migrate-reset.md +0 -78
- package/template/.agents/skills/data/prisma-cli/references/migrate-resolve.md +0 -57
- package/template/.agents/skills/data/prisma-cli/references/migrate-status.md +0 -65
- package/template/.agents/skills/data/prisma-cli/references/studio.md +0 -137
- package/template/.agents/skills/data/prisma-cli/references/validate.md +0 -53
- package/template/.agents/skills/data/prisma-client-api/SKILL.md +0 -216
- package/template/.agents/skills/data/prisma-client-api/references/client-methods.md +0 -223
- package/template/.agents/skills/data/prisma-client-api/references/constructor.md +0 -208
- package/template/.agents/skills/data/prisma-client-api/references/filters.md +0 -256
- package/template/.agents/skills/data/prisma-client-api/references/model-queries.md +0 -281
- package/template/.agents/skills/data/prisma-client-api/references/query-options.md +0 -276
- package/template/.agents/skills/data/prisma-client-api/references/raw-queries.md +0 -194
- package/template/.agents/skills/data/prisma-client-api/references/relations.md +0 -308
- package/template/.agents/skills/data/prisma-client-api/references/transactions.md +0 -184
- package/template/.agents/skills/design/impeccable/SKILL.md +0 -84
- package/template/.agents/skills/design/impeccable/reference/adapt.md +0 -312
- package/template/.agents/skills/design/impeccable/reference/adapt.native.md +0 -58
- package/template/.agents/skills/design/impeccable/reference/android.md +0 -40
- package/template/.agents/skills/design/impeccable/reference/animate.md +0 -86
- package/template/.agents/skills/design/impeccable/reference/audit.md +0 -136
- package/template/.agents/skills/design/impeccable/reference/audit.native.md +0 -139
- package/template/.agents/skills/design/impeccable/reference/bolder.md +0 -31
- package/template/.agents/skills/design/impeccable/reference/clarify.md +0 -94
- package/template/.agents/skills/design/impeccable/reference/colorize.md +0 -86
- package/template/.agents/skills/design/impeccable/reference/craft-floor.md +0 -42
- package/template/.agents/skills/design/impeccable/reference/craft.md +0 -5
- package/template/.agents/skills/design/impeccable/reference/critique.md +0 -788
- package/template/.agents/skills/design/impeccable/reference/degraded/asset-producer.md +0 -90
- package/template/.agents/skills/design/impeccable/reference/degraded/documenter.md +0 -24
- package/template/.agents/skills/design/impeccable/reference/degraded/finish-reviewer.md +0 -37
- package/template/.agents/skills/design/impeccable/reference/degraded/manual-edit-applier.md +0 -92
- package/template/.agents/skills/design/impeccable/reference/delight.md +0 -70
- package/template/.agents/skills/design/impeccable/reference/distill.md +0 -111
- package/template/.agents/skills/design/impeccable/reference/doctor.md +0 -53
- package/template/.agents/skills/design/impeccable/reference/document.md +0 -416
- package/template/.agents/skills/design/impeccable/reference/extract.md +0 -69
- package/template/.agents/skills/design/impeccable/reference/harden.md +0 -336
- package/template/.agents/skills/design/impeccable/reference/hooks.md +0 -105
- package/template/.agents/skills/design/impeccable/reference/init.md +0 -125
- package/template/.agents/skills/design/impeccable/reference/ios.md +0 -45
- package/template/.agents/skills/design/impeccable/reference/layout.md +0 -84
- package/template/.agents/skills/design/impeccable/reference/live-setup.md +0 -102
- package/template/.agents/skills/design/impeccable/reference/live.md +0 -323
- package/template/.agents/skills/design/impeccable/reference/new-work.md +0 -105
- package/template/.agents/skills/design/impeccable/reference/onboard.md +0 -234
- package/template/.agents/skills/design/impeccable/reference/operate.md +0 -61
- package/template/.agents/skills/design/impeccable/reference/optimize.md +0 -258
- package/template/.agents/skills/design/impeccable/reference/overdrive.md +0 -127
- package/template/.agents/skills/design/impeccable/reference/polish.md +0 -97
- package/template/.agents/skills/design/impeccable/reference/quieter.md +0 -99
- package/template/.agents/skills/design/impeccable/reference/routing.md +0 -18
- package/template/.agents/skills/design/impeccable/reference/shape.md +0 -59
- package/template/.agents/skills/design/impeccable/reference/typeset.md +0 -80
- package/template/.agents/skills/design/impeccable/reference/visualize.md +0 -47
- package/template/.agents/skills/design/impeccable/scripts/command-metadata.json +0 -94
- package/template/.agents/skills/design/impeccable/scripts/concept-seed.mjs +0 -558
- package/template/.agents/skills/design/impeccable/scripts/context-signals.mjs +0 -334
- package/template/.agents/skills/design/impeccable/scripts/context.mjs +0 -1450
- package/template/.agents/skills/design/impeccable/scripts/critique-storage.mjs +0 -213
- package/template/.agents/skills/design/impeccable/scripts/detect-csp.mjs +0 -198
- package/template/.agents/skills/design/impeccable/scripts/detect.mjs +0 -21
- package/template/.agents/skills/design/impeccable/scripts/detector/browser/injected/index.mjs +0 -2023
- package/template/.agents/skills/design/impeccable/scripts/detector/cli/main.mjs +0 -438
- package/template/.agents/skills/design/impeccable/scripts/detector/design-system.mjs +0 -983
- package/template/.agents/skills/design/impeccable/scripts/detector/detect-antipatterns-browser.js +0 -8283
- package/template/.agents/skills/design/impeccable/scripts/detector/detect-antipatterns.mjs +0 -50
- package/template/.agents/skills/design/impeccable/scripts/detector/engines/browser/detect-url.mjs +0 -372
- package/template/.agents/skills/design/impeccable/scripts/detector/engines/regex/detect-text.mjs +0 -768
- package/template/.agents/skills/design/impeccable/scripts/detector/engines/static-html/css-cascade.mjs +0 -1186
- package/template/.agents/skills/design/impeccable/scripts/detector/engines/static-html/detect-html.mjs +0 -264
- package/template/.agents/skills/design/impeccable/scripts/detector/engines/visual/screenshot-contrast.mjs +0 -189
- package/template/.agents/skills/design/impeccable/scripts/detector/findings.mjs +0 -18
- package/template/.agents/skills/design/impeccable/scripts/detector/node/file-system.mjs +0 -212
- package/template/.agents/skills/design/impeccable/scripts/detector/profile/profiler.mjs +0 -166
- package/template/.agents/skills/design/impeccable/scripts/detector/registry/antipatterns.mjs +0 -617
- package/template/.agents/skills/design/impeccable/scripts/detector/rules/checks.mjs +0 -5580
- package/template/.agents/skills/design/impeccable/scripts/detector/shared/color.mjs +0 -124
- package/template/.agents/skills/design/impeccable/scripts/detector/shared/constants.mjs +0 -112
- package/template/.agents/skills/design/impeccable/scripts/detector/shared/fonts.mjs +0 -30
- package/template/.agents/skills/design/impeccable/scripts/detector/shared/inline-ignores.mjs +0 -148
- package/template/.agents/skills/design/impeccable/scripts/detector/shared/page.mjs +0 -7
- package/template/.agents/skills/design/impeccable/scripts/doctor.mjs +0 -336
- package/template/.agents/skills/design/impeccable/scripts/embed-prompt.mjs +0 -133
- package/template/.agents/skills/design/impeccable/scripts/generate-image.mjs +0 -240
- package/template/.agents/skills/design/impeccable/scripts/hook-admin.mjs +0 -741
- package/template/.agents/skills/design/impeccable/scripts/hook-before-edit.mjs +0 -516
- package/template/.agents/skills/design/impeccable/scripts/hook-lib.mjs +0 -2100
- package/template/.agents/skills/design/impeccable/scripts/hook.mjs +0 -78
- package/template/.agents/skills/design/impeccable/scripts/lib/artifact-schema.mjs +0 -93
- package/template/.agents/skills/design/impeccable/scripts/lib/composition-catalog.mjs +0 -200
- package/template/.agents/skills/design/impeccable/scripts/lib/concept-catalog.mjs +0 -357
- package/template/.agents/skills/design/impeccable/scripts/lib/design-parser.mjs +0 -842
- package/template/.agents/skills/design/impeccable/scripts/lib/impeccable-config.mjs +0 -658
- package/template/.agents/skills/design/impeccable/scripts/lib/impeccable-paths.mjs +0 -137
- package/template/.agents/skills/design/impeccable/scripts/lib/is-generated.mjs +0 -69
- package/template/.agents/skills/design/impeccable/scripts/lib/provider.mjs +0 -5
- package/template/.agents/skills/design/impeccable/scripts/lib/roll-selection.mjs +0 -362
- package/template/.agents/skills/design/impeccable/scripts/lib/staleness-deep.mjs +0 -457
- package/template/.agents/skills/design/impeccable/scripts/lib/staleness-notice.mjs +0 -169
- package/template/.agents/skills/design/impeccable/scripts/lib/staleness.mjs +0 -457
- package/template/.agents/skills/design/impeccable/scripts/lib/surface-briefs.mjs +0 -151
- package/template/.agents/skills/design/impeccable/scripts/lib/target-args.mjs +0 -42
- package/template/.agents/skills/design/impeccable/scripts/lib/target-slug.mjs +0 -33
- package/template/.agents/skills/design/impeccable/scripts/lib/template-extensions.mjs +0 -146
- package/template/.agents/skills/design/impeccable/scripts/live/accept-css.mjs +0 -617
- package/template/.agents/skills/design/impeccable/scripts/live/accept-verify.mjs +0 -60
- package/template/.agents/skills/design/impeccable/scripts/live/browser-script-parts.mjs +0 -55
- package/template/.agents/skills/design/impeccable/scripts/live/completion.mjs +0 -28
- package/template/.agents/skills/design/impeccable/scripts/live/event-validation.mjs +0 -199
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/astro.mjs +0 -47
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/detect-utils.mjs +0 -73
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/index.mjs +0 -143
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/journal.mjs +0 -197
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/nextjs.mjs +0 -49
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/nuxt.mjs +0 -161
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/script-src.mjs +0 -17
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/static-html.mjs +0 -26
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/sveltekit.mjs +0 -71
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/tag-strategy.mjs +0 -247
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/tanstack-start.mjs +0 -70
- package/template/.agents/skills/design/impeccable/scripts/live/frameworks/vite-generic.mjs +0 -42
- package/template/.agents/skills/design/impeccable/scripts/live/generation-preflight.mjs +0 -149
- package/template/.agents/skills/design/impeccable/scripts/live/insert-ui.mjs +0 -458
- package/template/.agents/skills/design/impeccable/scripts/live/instructions.mjs +0 -142
- package/template/.agents/skills/design/impeccable/scripts/live/manual-apply.mjs +0 -939
- package/template/.agents/skills/design/impeccable/scripts/live/manual-edit-routes.mjs +0 -357
- package/template/.agents/skills/design/impeccable/scripts/live/manual-edits-buffer.mjs +0 -152
- package/template/.agents/skills/design/impeccable/scripts/live/poll-lanes.mjs +0 -14
- package/template/.agents/skills/design/impeccable/scripts/live/roots.mjs +0 -508
- package/template/.agents/skills/design/impeccable/scripts/live/session-store.mjs +0 -563
- package/template/.agents/skills/design/impeccable/scripts/live/source-lock.mjs +0 -105
- package/template/.agents/skills/design/impeccable/scripts/live/source-search.mjs +0 -105
- package/template/.agents/skills/design/impeccable/scripts/live/svelte-ast.mjs +0 -961
- package/template/.agents/skills/design/impeccable/scripts/live/svelte-component.mjs +0 -1342
- package/template/.agents/skills/design/impeccable/scripts/live/sveltekit-adapter.mjs +0 -316
- package/template/.agents/skills/design/impeccable/scripts/live/tanstack-adapter.mjs +0 -280
- package/template/.agents/skills/design/impeccable/scripts/live/ui-core.mjs +0 -180
- package/template/.agents/skills/design/impeccable/scripts/live/vocabulary.mjs +0 -171
- package/template/.agents/skills/design/impeccable/scripts/live-accept.mjs +0 -954
- package/template/.agents/skills/design/impeccable/scripts/live-browser-dom.js +0 -146
- package/template/.agents/skills/design/impeccable/scripts/live-browser-session.js +0 -123
- package/template/.agents/skills/design/impeccable/scripts/live-browser.js +0 -12512
- package/template/.agents/skills/design/impeccable/scripts/live-commit-manual-edits.mjs +0 -1244
- package/template/.agents/skills/design/impeccable/scripts/live-complete.mjs +0 -107
- package/template/.agents/skills/design/impeccable/scripts/live-copy-edit-agent.mjs +0 -683
- package/template/.agents/skills/design/impeccable/scripts/live-discard-manual-edits.mjs +0 -51
- package/template/.agents/skills/design/impeccable/scripts/live-inject.mjs +0 -503
- package/template/.agents/skills/design/impeccable/scripts/live-insert.mjs +0 -292
- package/template/.agents/skills/design/impeccable/scripts/live-manual-edit-evidence.mjs +0 -368
- package/template/.agents/skills/design/impeccable/scripts/live-poll.mjs +0 -429
- package/template/.agents/skills/design/impeccable/scripts/live-resume.mjs +0 -123
- package/template/.agents/skills/design/impeccable/scripts/live-server.mjs +0 -1661
- package/template/.agents/skills/design/impeccable/scripts/live-status.mjs +0 -71
- package/template/.agents/skills/design/impeccable/scripts/live-target.mjs +0 -30
- package/template/.agents/skills/design/impeccable/scripts/live-wrap.mjs +0 -927
- package/template/.agents/skills/design/impeccable/scripts/live.mjs +0 -359
- package/template/.agents/skills/design/impeccable/scripts/modern-screenshot.umd.js +0 -14
- package/template/.agents/skills/design/impeccable/scripts/palette.mjs +0 -628
- package/template/.agents/skills/design/impeccable/scripts/pin.mjs +0 -221
- package/template/.agents/skills/design/impeccable/scripts/serve-question.mjs +0 -932
- package/template/.agents/skills/design/impeccable/scripts/surface-brief.mjs +0 -74
- package/template/.agents/skills/design/shadcn/SKILL.md +0 -277
- package/template/.agents/skills/design/shadcn/agents/openai.yml +0 -5
- package/template/.agents/skills/design/shadcn/assets/shadcn-small.png +0 -0
- package/template/.agents/skills/design/shadcn/assets/shadcn.png +0 -0
- package/template/.agents/skills/design/shadcn/cli.md +0 -290
- package/template/.agents/skills/design/shadcn/customization.md +0 -209
- package/template/.agents/skills/design/shadcn/evals/evals.json +0 -77
- package/template/.agents/skills/design/shadcn/mcp.md +0 -105
- package/template/.agents/skills/design/shadcn/registry.md +0 -277
- package/template/.agents/skills/design/shadcn/rules/base-vs-radix.md +0 -306
- package/template/.agents/skills/design/shadcn/rules/chat.md +0 -224
- package/template/.agents/skills/design/shadcn/rules/composition.md +0 -213
- package/template/.agents/skills/design/shadcn/rules/forms.md +0 -192
- package/template/.agents/skills/design/shadcn/rules/icons.md +0 -101
- package/template/.agents/skills/design/shadcn/rules/styling.md +0 -185
- package/template/.agents/skills/find-skills/SKILL.md +0 -141
- package/template/.agents/skills/hono/SKILL.md +0 -579
- package/template/.agents/skills/integrations/langfuse/SKILL.md +0 -146
- package/template/.agents/skills/integrations/langfuse/references/ci-cd.md +0 -41
- package/template/.agents/skills/integrations/langfuse/references/cli.md +0 -60
- package/template/.agents/skills/integrations/langfuse/references/error-analysis.md +0 -88
- package/template/.agents/skills/integrations/langfuse/references/instrumentation.md +0 -121
- package/template/.agents/skills/integrations/langfuse/references/judge-calibration.md +0 -291
- package/template/.agents/skills/integrations/langfuse/references/prompt-engineering.md +0 -35
- package/template/.agents/skills/integrations/langfuse/references/prompt-migration.md +0 -79
- package/template/.agents/skills/integrations/langfuse/references/skill-feedback.md +0 -55
- package/template/.agents/skills/integrations/langfuse/references/trace-evaluator-upgrade.md +0 -76
- package/template/.agents/skills/integrations/langfuse/references/user-feedback.md +0 -92
- package/template/.agents/skills/integrations/langfuse/references/v4-project-migration.md +0 -73
- package/template/.agents/skills/integrations/posthog/SKILL.md +0 -102
- package/template/.agents/skills/integrations/posthog/references/error-tracking-alerts.md +0 -63
- package/template/.agents/skills/integrations/posthog/references/error-tracking-assigning-issues.md +0 -77
- package/template/.agents/skills/integrations/posthog/references/error-tracking-fingerprints.md +0 -57
- package/template/.agents/skills/integrations/posthog/references/error-tracking-monitoring.md +0 -140
- package/template/.agents/skills/integrations/posthog/references/error-tracking-nextjs.md +0 -490
- package/template/.agents/skills/integrations/posthog/references/error-tracking-source-maps.md +0 -45
- package/template/.agents/skills/integrations/posthog/references/feature-flags-best-practices.md +0 -139
- package/template/.agents/skills/integrations/posthog/references/feature-flags-react.md +0 -302
- package/template/.agents/skills/integrations/posthog/references/identify-users.md +0 -202
- package/template/.agents/skills/integrations/posthog/references/integration-example.md +0 -706
- package/template/.agents/skills/integrations/posthog/references/integration-nextjs.md +0 -385
- package/template/.agents/skills/integrations/posthog/references/integration-step-1-begin.md +0 -43
- package/template/.agents/skills/integrations/posthog/references/integration-step-2-edit.md +0 -37
- package/template/.agents/skills/integrations/posthog/references/integration-step-3-revise.md +0 -22
- package/template/.agents/skills/integrations/posthog/references/integration-step-4-conclude.md +0 -38
- package/template/.agents/skills/integrations/posthog/references/llm-analytics-anthropic.md +0 -200
- package/template/.agents/skills/integrations/posthog/references/llm-analytics-basics.md +0 -62
- package/template/.agents/skills/integrations/posthog/references/llm-analytics-costs.md +0 -197
- package/template/.agents/skills/integrations/posthog/references/llm-analytics-manual-capture.md +0 -397
- package/template/.agents/skills/integrations/posthog/references/llm-analytics-traces.md +0 -98
- package/template/.agents/skills/integrations/posthog/references/llm-analytics-vercel-ai.md +0 -120
- package/template/.agents/skills/repo/repo-ci/SKILL.md +0 -265
- package/template/.agents/skills/repo/repo-init-next-js/SKILL.md +0 -129
- package/template/.agents/skills/repo/repo-init-next-js/references/file-contents.md +0 -800
- package/template/.agents/skills/repo/repo-init-next-js/scripts/setup.sh +0 -47
- package/template/.agents/skills/repo/repo-init-node/SKILL.md +0 -196
- package/template/.agents/skills/skill-creator/LICENSE.txt +0 -202
- package/template/.agents/skills/skill-creator/SKILL.md +0 -485
- package/template/.agents/skills/skill-creator/agents/analyzer.md +0 -274
- package/template/.agents/skills/skill-creator/agents/comparator.md +0 -202
- package/template/.agents/skills/skill-creator/agents/grader.md +0 -223
- package/template/.agents/skills/skill-creator/assets/eval_review.html +0 -146
- package/template/.agents/skills/skill-creator/eval-viewer/generate_review.py +0 -471
- package/template/.agents/skills/skill-creator/eval-viewer/viewer.html +0 -1325
- package/template/.agents/skills/skill-creator/references/schemas.md +0 -430
- package/template/.agents/skills/skill-creator/scripts/__init__.py +0 -0
- package/template/.agents/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
- package/template/.agents/skills/skill-creator/scripts/generate_report.py +0 -326
- package/template/.agents/skills/skill-creator/scripts/improve_description.py +0 -247
- package/template/.agents/skills/skill-creator/scripts/package_skill.py +0 -136
- package/template/.agents/skills/skill-creator/scripts/quick_validate.py +0 -103
- package/template/.agents/skills/skill-creator/scripts/run_eval.py +0 -310
- package/template/.agents/skills/skill-creator/scripts/run_loop.py +0 -328
- package/template/.agents/skills/skill-creator/scripts/utils.py +0 -47
- package/template/.agents/skills/supabase/CHANGELOG.md +0 -71
- package/template/.agents/skills/supabase/SKILL.md +0 -145
- package/template/.agents/skills/supabase/assets/feedback-issue-template.md +0 -17
- package/template/.agents/skills/supabase/references/skill-feedback.md +0 -17
- package/template/.agents/skills/supabase-postgres-best-practices/CHANGELOG.md +0 -73
- package/template/.agents/skills/supabase-postgres-best-practices/SKILL.md +0 -64
- package/template/.agents/skills/supabase-postgres-best-practices/references/_contributing.md +0 -170
- package/template/.agents/skills/supabase-postgres-best-practices/references/_sections.md +0 -39
- package/template/.agents/skills/supabase-postgres-best-practices/references/_template.md +0 -34
- package/template/.agents/skills/supabase-postgres-best-practices/references/advanced-full-text-search.md +0 -55
- package/template/.agents/skills/supabase-postgres-best-practices/references/advanced-jsonb-indexing.md +0 -49
- package/template/.agents/skills/supabase-postgres-best-practices/references/conn-idle-timeout.md +0 -46
- package/template/.agents/skills/supabase-postgres-best-practices/references/conn-limits.md +0 -44
- package/template/.agents/skills/supabase-postgres-best-practices/references/conn-pooling.md +0 -41
- package/template/.agents/skills/supabase-postgres-best-practices/references/conn-prepared-statements.md +0 -46
- package/template/.agents/skills/supabase-postgres-best-practices/references/data-batch-inserts.md +0 -54
- package/template/.agents/skills/supabase-postgres-best-practices/references/data-n-plus-one.md +0 -53
- package/template/.agents/skills/supabase-postgres-best-practices/references/data-pagination.md +0 -50
- package/template/.agents/skills/supabase-postgres-best-practices/references/data-upsert.md +0 -50
- package/template/.agents/skills/supabase-postgres-best-practices/references/lock-advisory.md +0 -56
- package/template/.agents/skills/supabase-postgres-best-practices/references/lock-deadlock-prevention.md +0 -68
- package/template/.agents/skills/supabase-postgres-best-practices/references/lock-short-transactions.md +0 -50
- package/template/.agents/skills/supabase-postgres-best-practices/references/lock-skip-locked.md +0 -54
- package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-explain-analyze.md +0 -45
- package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-pg-stat-statements.md +0 -55
- package/template/.agents/skills/supabase-postgres-best-practices/references/monitor-vacuum-analyze.md +0 -55
- package/template/.agents/skills/supabase-postgres-best-practices/references/query-composite-indexes.md +0 -44
- package/template/.agents/skills/supabase-postgres-best-practices/references/query-covering-indexes.md +0 -40
- package/template/.agents/skills/supabase-postgres-best-practices/references/query-index-types.md +0 -48
- package/template/.agents/skills/supabase-postgres-best-practices/references/query-missing-indexes.md +0 -43
- package/template/.agents/skills/supabase-postgres-best-practices/references/query-partial-indexes.md +0 -45
- package/template/.agents/skills/supabase-postgres-best-practices/references/schema-constraints.md +0 -80
- package/template/.agents/skills/supabase-postgres-best-practices/references/schema-data-types.md +0 -46
- package/template/.agents/skills/supabase-postgres-best-practices/references/schema-foreign-key-indexes.md +0 -59
- package/template/.agents/skills/supabase-postgres-best-practices/references/schema-lowercase-identifiers.md +0 -55
- package/template/.agents/skills/supabase-postgres-best-practices/references/schema-partitioning.md +0 -55
- package/template/.agents/skills/supabase-postgres-best-practices/references/schema-primary-keys.md +0 -61
- package/template/.agents/skills/supabase-postgres-best-practices/references/security-privileges.md +0 -54
- package/template/.agents/skills/supabase-postgres-best-practices/references/security-rls-basics.md +0 -50
- package/template/.agents/skills/supabase-postgres-best-practices/references/security-rls-performance.md +0 -63
- package/template/.agents/skills/writing/humanizer/SKILL.md +0 -621
- package/template/.agents/upstreams.json +0 -116
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: langfuse-judge-calibration
|
|
3
|
-
description: Calibrate and validate LLM-as-a-Judge evaluators against dataset ground truth. Runs the judge prompt as a Langfuse dataset experiment, compares judge outputs with dataset item expected outputs, and reports simple accuracy or advanced confusion-matrix metrics. Use this guide whenever a user asks if their LLM judge is actually useful, aligned with human judgment, or safe to trust for monitoring decisions.
|
|
4
|
-
metadata:
|
|
5
|
-
required_access:
|
|
6
|
-
- CODEBASE
|
|
7
|
-
- LANGFUSE_PROJECT_SCRIPT
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Judge Calibration (LLM-as-a-Judge)
|
|
11
|
-
|
|
12
|
-
## Goal
|
|
13
|
-
|
|
14
|
-
Validate judge outputs against human labels using the smallest reliable workflow
|
|
15
|
-
for the user's goal.
|
|
16
|
-
|
|
17
|
-
Default to a **Langfuse dataset experiment** when the user has a Langfuse
|
|
18
|
-
dataset or wants results in the Langfuse Experiments UI.
|
|
19
|
-
|
|
20
|
-
Default to **simple calibration** unless the user asks for deeper metrics,
|
|
21
|
-
split-based validation, thresholding, or production automation.
|
|
22
|
-
|
|
23
|
-
## 1) Choose the calibration mode
|
|
24
|
-
|
|
25
|
-
### Simple calibration
|
|
26
|
-
|
|
27
|
-
Use this when the user wants a quick answer like "does this judge basically
|
|
28
|
-
match human labels?" or explicitly asks for accuracy only.
|
|
29
|
-
|
|
30
|
-
- No train/dev/test split is required.
|
|
31
|
-
- Compute `exact_match` for each valid row.
|
|
32
|
-
- Report valid sample size, invalid-label count, accuracy, and a short
|
|
33
|
-
recommendation.
|
|
34
|
-
- Do not include Precision/Recall/F1, TPR/TNR, denominator notes, or top failure
|
|
35
|
-
direction unless the user asks for advanced metrics.
|
|
36
|
-
|
|
37
|
-
### Advanced calibration
|
|
38
|
-
|
|
39
|
-
Use this when the user asks for confusion matrix metrics, thresholds,
|
|
40
|
-
production monitoring, high-stakes automation, or train/test-style validation.
|
|
41
|
-
|
|
42
|
-
- If split labels exist, keep train/dev/test separate.
|
|
43
|
-
- If no split exists, compute metrics on the provided rows and state that this is
|
|
44
|
-
not a held-out final quality claim.
|
|
45
|
-
- Compute TP/FP/FN/TN and derived metrics.
|
|
46
|
-
- Use `references/error-analysis.md` for qualitative diagnosis of disagreements.
|
|
47
|
-
|
|
48
|
-
## 2) Primary workflow
|
|
49
|
-
|
|
50
|
-
1. Confirm the dataset name, ground-truth label location in `expectedOutput`,
|
|
51
|
-
judge prompt name/version, judge model, and label vocabulary.
|
|
52
|
-
2. Choose simple or advanced mode. If ambiguous, use simple mode.
|
|
53
|
-
3. Run the judge prompt against each dataset item input as a Langfuse experiment.
|
|
54
|
-
4. Compare the judge output to `item.expected_output` in evaluator functions.
|
|
55
|
-
5. Return the matching report format from section 7.
|
|
56
|
-
|
|
57
|
-
## 3) Langfuse experiment workflow
|
|
58
|
-
|
|
59
|
-
Use the SDK experiment runner as the default implementation. A Langfuse-hosted
|
|
60
|
-
dataset automatically creates a dataset run that can be inspected and compared
|
|
61
|
-
in the Langfuse UI.
|
|
62
|
-
|
|
63
|
-
Before implementing, you **must** retrieve the current experiment SDK
|
|
64
|
-
documentation from the Langfuse docs — do not rely on memory, the SDK changes
|
|
65
|
-
frequently. Fetch these pages (see SKILL.md section 2 for retrieval methods):
|
|
66
|
-
|
|
67
|
-
- [Experiments via SDK](https://langfuse.com/docs/evaluation/experiments/experiments-via-sdk) — primary reference for `dataset.run_experiment`, task/evaluator signatures, and `Evaluation` return shape
|
|
68
|
-
- [Datasets](https://langfuse.com/docs/evaluation/experiments/datasets) — dataset item structure (`input`, `expectedOutput`) and how to load a hosted dataset
|
|
69
|
-
- [Experiments data model](https://langfuse.com/docs/evaluation/experiments/data-model) — how runs, items, and scores relate in the UI
|
|
70
|
-
|
|
71
|
-
High-level shape of a simple-mode calibration experiment:
|
|
72
|
-
|
|
73
|
-
```
|
|
74
|
-
load dataset and judge prompt from Langfuse
|
|
75
|
-
define POSITIVE / NEGATIVE label set
|
|
76
|
-
|
|
77
|
-
task(item):
|
|
78
|
-
compile judge prompt with item.input
|
|
79
|
-
call judge model
|
|
80
|
-
return normalized label
|
|
81
|
-
# never read item.expected_output here — that would leak the answer
|
|
82
|
-
|
|
83
|
-
item_evaluator(output, expected_output):
|
|
84
|
-
if either label is outside the allowed set:
|
|
85
|
-
return invalid (excluded from accuracy denominator)
|
|
86
|
-
return exact_match score (0 or 1)
|
|
87
|
-
|
|
88
|
-
run_evaluator(item_results):
|
|
89
|
-
accuracy = matches / valid_rows
|
|
90
|
-
return aggregate score + invalid_label count
|
|
91
|
-
|
|
92
|
-
dataset.run_experiment(task, [item_evaluator], [run_evaluator],
|
|
93
|
-
metadata={calibration_mode, judge_prompt, labels})
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
For advanced calibration, the item evaluator emits one score per confusion-matrix
|
|
97
|
-
cell (`judge-is-tp`, `judge-is-fp`, `judge-is-fn`, `judge-is-tn`), and the run
|
|
98
|
-
evaluator aggregates them into Precision / Recall / F1 / TPR / TNR. See section
|
|
99
|
-
6 for the metric definitions and zero-denominator guardrails.
|
|
100
|
-
|
|
101
|
-
Rules:
|
|
102
|
-
- Use a Langfuse-hosted dataset when the user wants a real Langfuse experiment.
|
|
103
|
-
Local SDK datasets create traces and scores, but not Langfuse dataset runs.
|
|
104
|
-
- The dataset item `input` must contain everything needed to run the judge
|
|
105
|
-
prompt. The dataset item `expectedOutput` must contain the ground-truth label.
|
|
106
|
-
- Never pass `expectedOutput` into the judge prompt or task. That would leak the
|
|
107
|
-
answer and invalidate calibration.
|
|
108
|
-
- Return `Evaluation(...)` objects from item and run evaluators for stable SDK
|
|
109
|
-
formatting and score ingestion.
|
|
110
|
-
- Store prompt name/version, judge model, label vocabulary, dataset version, and
|
|
111
|
-
calibration mode in run metadata.
|
|
112
|
-
- Use a unique run name so the experiment appears as a separate dataset run.
|
|
113
|
-
|
|
114
|
-
## 4) Label validation
|
|
115
|
-
|
|
116
|
-
Never silently treat unknown labels as negative.
|
|
117
|
-
|
|
118
|
-
- For binary judges, define the positive and negative labels before computing
|
|
119
|
-
confusion-matrix metrics.
|
|
120
|
-
- Normalize only deterministic differences such as surrounding whitespace or
|
|
121
|
-
casing, and mention that normalization was applied.
|
|
122
|
-
- Rows where `expected` or `actual` is outside the allowed label set are invalid.
|
|
123
|
-
Exclude them from metric denominators and report the invalid count.
|
|
124
|
-
- For multi-class judges, use simple `exact_match` / accuracy unless the user
|
|
125
|
-
defines one positive class for binary metrics.
|
|
126
|
-
|
|
127
|
-
Example binary labels:
|
|
128
|
-
- Positive: `ESCALATE`
|
|
129
|
-
- Negative: `RESOLVE`
|
|
130
|
-
|
|
131
|
-
## 5) Simple metrics
|
|
132
|
-
|
|
133
|
-
For each valid row:
|
|
134
|
-
|
|
135
|
-
- `exact_match = 1 if actual == expected else 0`
|
|
136
|
-
|
|
137
|
-
Aggregate:
|
|
138
|
-
|
|
139
|
-
- `accuracy = sum(exact_match) / valid_rows`
|
|
140
|
-
|
|
141
|
-
If `valid_rows == 0`, report that accuracy is undefined and ask for valid
|
|
142
|
-
expected/actual labels.
|
|
143
|
-
|
|
144
|
-
## 6) Advanced metrics
|
|
145
|
-
|
|
146
|
-
### Dataset and split discipline
|
|
147
|
-
|
|
148
|
-
Use split discipline only when the user asks for advanced validation or final
|
|
149
|
-
quality claims.
|
|
150
|
-
|
|
151
|
-
- **Train**: optional few-shot examples for the judge prompt
|
|
152
|
-
- **Dev**: iterative prompt/model refinement
|
|
153
|
-
- **Test**: single final calibration pass
|
|
154
|
-
|
|
155
|
-
Do not tune on the same rows used to claim final quality. Use balanced classes
|
|
156
|
-
in dev/test when possible so both error directions are measurable.
|
|
157
|
-
|
|
158
|
-
### Per-row classification mapping
|
|
159
|
-
|
|
160
|
-
For each row with `expected` and `actual` labels:
|
|
161
|
-
|
|
162
|
-
- **TP**: expected = positive and actual = positive
|
|
163
|
-
- **FP**: expected = negative and actual = positive
|
|
164
|
-
- **FN**: expected = positive and actual = negative
|
|
165
|
-
- **TN**: expected = negative and actual = negative
|
|
166
|
-
|
|
167
|
-
Also compute:
|
|
168
|
-
- `exact_match = 1 if actual == expected else 0`
|
|
169
|
-
|
|
170
|
-
### Aggregate metrics
|
|
171
|
-
|
|
172
|
-
From aggregate counts:
|
|
173
|
-
- `accuracy = (TP + TN) / valid_rows`
|
|
174
|
-
- `precision = TP / (TP + FP)`
|
|
175
|
-
- `recall = TP / (TP + FN)`
|
|
176
|
-
- `f1 = 2 * precision * recall / (precision + recall)`
|
|
177
|
-
- `TPR = TP / (TP + FN)`
|
|
178
|
-
- `TNR = TN / (TN + FP)`
|
|
179
|
-
|
|
180
|
-
Guardrails:
|
|
181
|
-
- if `TP + FP == 0`, precision is undefined (report null + note)
|
|
182
|
-
- if `TP + FN == 0`, recall and TPR are undefined (report null + note)
|
|
183
|
-
- if `TN + FP == 0`, TNR is undefined (report null + note)
|
|
184
|
-
- if `precision + recall == 0`, set `f1 = 0`
|
|
185
|
-
|
|
186
|
-
### Advanced quality gates
|
|
187
|
-
|
|
188
|
-
Before trusting the judge on production traffic:
|
|
189
|
-
|
|
190
|
-
1. **Split integrity**: no leakage from held-out rows into prompt examples.
|
|
191
|
-
2. **Confusion matrix sanity**: `TP + FP + FN + TN == valid_rows`.
|
|
192
|
-
3. **Metric recomputation check**: recompute aggregate stats from row-level
|
|
193
|
-
flags and compare.
|
|
194
|
-
4. **TPR/TNR review**: inspect both directions for class-direction bias.
|
|
195
|
-
5. **Threshold**: target `TPR > 0.90` and `TNR > 0.90` before high-stakes
|
|
196
|
-
automation.
|
|
197
|
-
|
|
198
|
-
## 7) Report format
|
|
199
|
-
|
|
200
|
-
### Simple report
|
|
201
|
-
|
|
202
|
-
Return only:
|
|
203
|
-
- dataset name and dataset run URL when available
|
|
204
|
-
- valid rows / total rows
|
|
205
|
-
- invalid-label count
|
|
206
|
-
- accuracy
|
|
207
|
-
- one-sentence recommendation
|
|
208
|
-
|
|
209
|
-
### Advanced report
|
|
210
|
-
|
|
211
|
-
Add:
|
|
212
|
-
- confusion matrix: TP, FP, FN, TN
|
|
213
|
-
- accuracy, precision, recall, F1, TPR, TNR
|
|
214
|
-
- denominator notes for undefined metrics
|
|
215
|
-
- top failure direction: false positives or false negatives
|
|
216
|
-
- recommendation: ship, iterate, collect more labels, or do not automate
|
|
217
|
-
|
|
218
|
-
## 8) Langfuse implementation notes
|
|
219
|
-
|
|
220
|
-
Prefer SDK experiment evaluators for score creation. They attach item-level
|
|
221
|
-
scores to the experiment traces and run-level scores to the dataset run.
|
|
222
|
-
|
|
223
|
-
Use manual REST score creation only as a fallback when not using the SDK
|
|
224
|
-
experiment runner, or for local smoke tests. See
|
|
225
|
-
[Scores via SDK](https://langfuse.com/docs/evaluation/evaluation-methods/scores-via-sdk)
|
|
226
|
-
and the [Scores API reference](https://langfuse.com/docs/api) (`POST /api/public/scores`)
|
|
227
|
-
for the current payload shape. Do not use the current `langfuse-cli` score-create
|
|
228
|
-
wrapper unless `--help` shows a usable `value` argument; `langfuse-cli@0.0.10`
|
|
229
|
-
exposes `legacy-score-v1s create` but cannot pass the required score `value`.
|
|
230
|
-
|
|
231
|
-
Score names to emit:
|
|
232
|
-
|
|
233
|
-
Simple mode:
|
|
234
|
-
- `judge-exact-match`
|
|
235
|
-
- `judge-accuracy`
|
|
236
|
-
|
|
237
|
-
Advanced mode:
|
|
238
|
-
- `judge-exact-match`
|
|
239
|
-
- `judge-is-tp`
|
|
240
|
-
- `judge-is-fp`
|
|
241
|
-
- `judge-is-fn`
|
|
242
|
-
- `judge-is-tn`
|
|
243
|
-
|
|
244
|
-
Recommended metadata:
|
|
245
|
-
- `expected_label`, `actual_label`
|
|
246
|
-
- calibration mode: `simple` or `advanced`
|
|
247
|
-
- positive/negative labels when binary metrics are used
|
|
248
|
-
- evaluator prompt name+version
|
|
249
|
-
- dataset/split version when used
|
|
250
|
-
- run identifier
|
|
251
|
-
|
|
252
|
-
## 9) Classification logic (pseudo-code)
|
|
253
|
-
|
|
254
|
-
The per-row classification each evaluator must perform:
|
|
255
|
-
|
|
256
|
-
```
|
|
257
|
-
normalize(label) = strip whitespace, uppercase
|
|
258
|
-
ALLOWED = {POSITIVE, NEGATIVE}
|
|
259
|
-
|
|
260
|
-
classify(expected, actual):
|
|
261
|
-
expected, actual = normalize(expected), normalize(actual)
|
|
262
|
-
|
|
263
|
-
if expected ∉ ALLOWED or actual ∉ ALLOWED:
|
|
264
|
-
mark row invalid → exclude from denominators
|
|
265
|
-
|
|
266
|
-
exact_match = (expected == actual)
|
|
267
|
-
is_tp = (expected == POSITIVE and actual == POSITIVE)
|
|
268
|
-
is_fp = (expected == NEGATIVE and actual == POSITIVE)
|
|
269
|
-
is_fn = (expected == POSITIVE and actual == NEGATIVE)
|
|
270
|
-
is_tn = (expected == NEGATIVE and actual == NEGATIVE)
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
## 10) Common failure modes
|
|
274
|
-
|
|
275
|
-
- label vocabulary not constrained (judge outputs free text instead of strict
|
|
276
|
-
labels)
|
|
277
|
-
- positive/negative label inversion between annotators and evaluator code
|
|
278
|
-
- leaking `expectedOutput` into the judge task instead of only the evaluator
|
|
279
|
-
- using local SDK data when the user expects a Langfuse dataset run in the UI
|
|
280
|
-
- reporting only accuracy when classes are imbalanced and error direction matters
|
|
281
|
-
- calculating F1 without explicit zero-denominator handling
|
|
282
|
-
- using advanced validation claims without a held-out split
|
|
283
|
-
|
|
284
|
-
## 11) What to do after calibration
|
|
285
|
-
|
|
286
|
-
- If simple accuracy is enough: report it and stop.
|
|
287
|
-
- If metrics are weak and advanced validation is needed: iterate prompt and
|
|
288
|
-
few-shots on dev data only.
|
|
289
|
-
- If metrics pass: freeze the baseline and monitor drift over time.
|
|
290
|
-
- For qualitative diagnosis of disagreements, switch to
|
|
291
|
-
`references/error-analysis.md`.
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: langfuse-prompt-engineering
|
|
3
|
-
description: Write or change prompts in Langfuse or code. Use whenever the user asks to create, edit, rewrite, debug, tune, or otherwise modify a prompt, including a small wording or instruction change. Distinct from prompt-migration and judge-calibration.
|
|
4
|
-
metadata:
|
|
5
|
-
required_access: []
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Prompt Engineering
|
|
9
|
-
|
|
10
|
-
## Universal principles
|
|
11
|
-
|
|
12
|
-
1. **Be specific.** State the required output format, constraints, and, when order matters, numbered steps. Write for someone with minimal context.
|
|
13
|
-
2. **Use labeled sections** for the role, instructions, examples, and context. Use XML tags when they help distinguish rules, data, and variables.
|
|
14
|
-
3. **Give the model a role.** A focused system-prompt sentence can steer tone and behavior.
|
|
15
|
-
4. **Explain why important rules exist** so the model can apply them to adjacent cases.
|
|
16
|
-
|
|
17
|
-
## Adjusting an existing prompt
|
|
18
|
-
|
|
19
|
-
1. **Pin down the failure first.** Use concrete misbehaving outputs and name the exact failure mode: wrong format, ignored instruction, wrong tone, hallucination, or another observable error. The task and data show what could fail, not what did fail; do not write a fix before observing the failure.
|
|
20
|
-
2. **Trace the failure to the prompt.** Look for a missing, ambiguous, or conflicting instruction.
|
|
21
|
-
3. **Fix the failure class, not the example.** Generalize the observed mistake into an error class and write the instruction at that level, in your own words. Cover adjacent cases, but do not add definitions, rules, or examples for unobserved problems or encode the failing example itself. If a generalized instruction does not work, report the failure instead of narrowing the rule to that case.
|
|
22
|
-
4. **Preserve existing behavior.** Before changing text, identify what behavior it protects. Avoid contradicting other rules or breaking cases that already work.
|
|
23
|
-
5. **Make the smallest testable edit.** Change one cause per attempt so you can attribute the result. Avoid extra length, emphasis, or all-caps. In Langfuse, save each attempt as a new version or label so you can compare and roll back.
|
|
24
|
-
|
|
25
|
-
## Model-specific tuning
|
|
26
|
-
|
|
27
|
-
Identify the target model if you can — tuning differs by model, so when you know which model the prompt runs on, follow that model's own prompting guidance.
|
|
28
|
-
|
|
29
|
-
| Technique | Standard (GPT) | Reasoning (Claude latest) |
|
|
30
|
-
|-----------|----------------|---------------------------|
|
|
31
|
-
| Instruction density | High, prescriptive | Goal-level; don't micro-manage steps |
|
|
32
|
-
| Reasoning | Add explicit chain-of-thought | Native thinking; "think thoroughly" + tune `effort` |
|
|
33
|
-
| Emphasis language | Strong directives fine | Dial back `MUST`/`CRITICAL` |
|
|
34
|
-
| Output format | Prefilling/scaffolds | Prefill removed (4.6+); structured outputs + "no preamble" |
|
|
35
|
-
| Roles | `developer` > `user` > `assistant` | `system` role + `user`/`assistant` |
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: langfuse-prompt-migration
|
|
3
|
-
description: Migrate hardcoded prompts to Langfuse for version control and deployment-free iteration. Use when user wants to externalize prompts, move prompts to Langfuse, or set up prompt management.
|
|
4
|
-
metadata:
|
|
5
|
-
required_access:
|
|
6
|
-
- CODEBASE
|
|
7
|
-
- LANGFUSE_PROJECT_SCRIPT
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Langfuse Prompt Migration
|
|
11
|
-
|
|
12
|
-
Migrate hardcoded prompts into Langfuse-managed prompts. The API mechanics (`create_prompt`, `get_prompt`, `.compile()`, linking to traces) are in the docs — fetch them at execution time.
|
|
13
|
-
|
|
14
|
-
## Prerequisites
|
|
15
|
-
|
|
16
|
-
Verify credentials exist — check presence only, never print the secret key (its value would land in the agent's context and transcripts):
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
[ -n "$LANGFUSE_PUBLIC_KEY" ] && echo "public key: set" || echo "public key: missing"
|
|
20
|
-
[ -n "$LANGFUSE_SECRET_KEY" ] && echo "secret key: set" || echo "secret key: missing"
|
|
21
|
-
[ -n "${LANGFUSE_BASE_URL:-${LANGFUSE_HOST:-}}" ] && echo "base url: set" || echo "base url: missing"
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
Use `LANGFUSE_BASE_URL` for current SDKs. If only `LANGFUSE_HOST` is set, export `LANGFUSE_BASE_URL="$LANGFUSE_HOST"`. If a CLI expects `LANGFUSE_HOST` and only `LANGFUSE_BASE_URL` is set, export `LANGFUSE_HOST="$LANGFUSE_BASE_URL"`.
|
|
25
|
-
|
|
26
|
-
If credentials or the base URL are missing, ask the user to set them in their shell or a `.env` file. Do not ask them to paste secret keys into chat.
|
|
27
|
-
|
|
28
|
-
## 1. Inventory every prompt (before writing any code)
|
|
29
|
-
|
|
30
|
-
For each prompt, record:
|
|
31
|
-
|
|
32
|
-
- **Name**: lowercase, hyphenated (e.g. `chat-assistant`)
|
|
33
|
-
- **Source file**: where the prompt text lives
|
|
34
|
-
- **Code file to refactor**: the file that USES the prompt. For asset files (`.txt`/`.yaml`/`.md`), this is the file that loads the asset, not the asset itself
|
|
35
|
-
- **Type**: `chat` (message array) or `text` (plain string)
|
|
36
|
-
- **Variables**: values interpolated in, converted to `{{var}}`
|
|
37
|
-
- **Content**: the actual text to upload
|
|
38
|
-
|
|
39
|
-
Before choosing `text` or `chat`, fetch and follow [Chat vs Text Prompts](https://langfuse.com/docs/prompt-management/data-model#text-vs-chat-prompts). Do not default unrelated prompt flows to one prompt type.
|
|
40
|
-
|
|
41
|
-
Prompts typically live in OpenAI message arrays, Anthropic system arguments, LangChain prompt templates, Vercel AI system/prompt fields, and raw multi-line strings near LLM calls.
|
|
42
|
-
|
|
43
|
-
## 2. Convert templating and decide structure
|
|
44
|
-
|
|
45
|
-
**Variable syntax:** Langfuse substitutes only double-brace `{{var}}`. Convert every single-brace form during upload — `{var}`, `${var}`, f-string `{var}`, `.format(var=...)`, and string concatenation all become `{{var}}`. Uploading `{var}` will silently fail to substitute.
|
|
46
|
-
|
|
47
|
-
**Complex templates:** Langfuse has no conditionals, loops, or filters. If the code uses them (e.g. Jinja `{% if %}`/`{% for %}`), either pre-compute the value in code and pass a plain `{{variable}}` (recommended), or store the raw template and compile client-side — which loses Playground preview and UI experiments. See https://langfuse.com/docs/prompt-management/features/variables and the [external templating FAQ](https://langfuse.com/faq/all/using-external-templating-libraries).
|
|
48
|
-
|
|
49
|
-
**What to make a variable vs. keep hardcoded:**
|
|
50
|
-
|
|
51
|
-
| Make variable | Keep hardcoded |
|
|
52
|
-
|---------------|----------------|
|
|
53
|
-
| User-specific (`{{user_name}}`) | Output format instructions |
|
|
54
|
-
| Dynamic content (`{{context}}`) | Safety guardrails |
|
|
55
|
-
| Per-request (`{{query}}`) | Persona / personality |
|
|
56
|
-
| Environment-specific (`{{company_name}}`) | Static examples |
|
|
57
|
-
|
|
58
|
-
**Naming:** lowercase-hyphenated, feature-based (`document-summarizer`), hierarchical for related prompts (`support/triage`), prefix subprompts with `_` (`_base-personality`).
|
|
59
|
-
|
|
60
|
-
Before extracting subprompts, fetch and follow [Prompt Composability](https://langfuse.com/docs/prompt-management/features/composability). Use composition for the reuse and shared-maintenance cases described there, not merely to decompose one coherent prompt flow.
|
|
61
|
-
|
|
62
|
-
## 3. Present the plan, then create and refactor
|
|
63
|
-
|
|
64
|
-
When the user explicitly requests a migration and credentials work, treat that request as authorization to create prompts and refactor the call sites. Present the inventory and plan as a progress update, then continue.
|
|
65
|
-
|
|
66
|
-
Ask only when a materially different design choice would change behavior, required credentials are unavailable, or destructive cleanup needs approval. Do not stop merely to confirm names, prompt types, or optional tracing.
|
|
67
|
-
|
|
68
|
-
Then:
|
|
69
|
-
|
|
70
|
-
- Create the prompts (label migrated prompts `production` — they're already live) and refactor call sites to fetch each prompt from Langfuse and compile its variables in. The SDK calls differ across Python and JS/TS — fetch the current docs: https://langfuse.com/docs/prompt-management/get-started
|
|
71
|
-
- Fetch by the `production` label
|
|
72
|
-
- If the codebase already has Langfuse tracing (decorators, an instrumented client, or manual spans), link prompts so you can see which version produced each response. See https://langfuse.com/docs/prompt-management/features/link-to-traces
|
|
73
|
-
|
|
74
|
-
## 4. Verify
|
|
75
|
-
|
|
76
|
-
- All prompts created with the `production` label; code fetches with `label="production"`
|
|
77
|
-
- Variables and subprompts compile without errors
|
|
78
|
-
- Application behavior is unchanged
|
|
79
|
-
- Generations show the linked prompt in the UI (if tracing enabled)
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: langfuse-skill-feedback
|
|
3
|
-
description: Submit feedback about the Langfuse skill to its maintainers via GitHub Discussions. Use when the user indicates the skill gave incorrect guidance, is missing information, or could be improved.
|
|
4
|
-
metadata:
|
|
5
|
-
required_access:
|
|
6
|
-
- GITHUB
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
# Skill Feedback
|
|
10
|
-
|
|
11
|
-
Follow these steps exactly:
|
|
12
|
-
|
|
13
|
-
1. **Ask permission**: Ask the user if they'd like you to submit feedback to the skill maintainers. Make it clear this is about the skill (the agent instructions), not about Langfuse the product. If they decline, move on.
|
|
14
|
-
2. **Draft feedback**: Write the feedback using the form structure below. Present the draft to the user and ask if they'd like to change anything before submitting.
|
|
15
|
-
3. **Submit**: Once approved, submit via `gh` CLI as described below. Share the resulting discussion URL with the user.
|
|
16
|
-
|
|
17
|
-
## Feedback Form Structure
|
|
18
|
-
|
|
19
|
-
Draft the feedback using these two fields:
|
|
20
|
-
|
|
21
|
-
**Describe your idea or feedback** (required)
|
|
22
|
-
A clear description of what went wrong or what could be improved. Include:
|
|
23
|
-
- What the user was trying to do
|
|
24
|
-
- What the skill did vs what was expected
|
|
25
|
-
- Any specific instructions that were incorrect or missing
|
|
26
|
-
|
|
27
|
-
**What would the ideal outcome look like?** (optional)
|
|
28
|
-
What the correct behavior or guidance should be.
|
|
29
|
-
|
|
30
|
-
Format the body as markdown with the two field labels as headings.
|
|
31
|
-
|
|
32
|
-
## Submitting
|
|
33
|
-
|
|
34
|
-
Create a GitHub Discussion on the `langfuse/skills` repository using the GraphQL API:
|
|
35
|
-
|
|
36
|
-
```bash
|
|
37
|
-
gh api graphql -f query='
|
|
38
|
-
mutation($repoId: ID!, $categoryId: ID!, $title: String!, $body: String!) {
|
|
39
|
-
createDiscussion(input: {repositoryId: $repoId, categoryId: $categoryId, title: $title, body: $body}) {
|
|
40
|
-
discussion { url }
|
|
41
|
-
}
|
|
42
|
-
}' \
|
|
43
|
-
-f repoId="$(gh api graphql -f query='{ repository(owner: "langfuse", name: "skills") { id } }' --jq '.data.repository.id')" \
|
|
44
|
-
-f categoryId="$(gh api graphql -f query='{ repository(owner: "langfuse", name: "skills") { discussionCategories(first: 10) { nodes { id name } } } }' --jq '.data.repository.discussionCategories.nodes[] | select(.name == "Ideas & Improvements") | .id')" \
|
|
45
|
-
-f title="<concise title>" \
|
|
46
|
-
-f body="<formatted feedback>"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
If the `gh` CLI is not authenticated or the request fails, give the user this link to create the discussion manually:
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
https://github.com/langfuse/skills/discussions/new?category=ideas-improvements
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
After submission, share the discussion URL with the user.
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: langfuse-evaluator-upgrade
|
|
3
|
-
description: Upgrade legacy trace-level or dataset-item LLM-as-a-Judge evaluators to observation-level or experiment evaluators. Use when a project needs the coding handoff for evaluator migration during the v4 transition.
|
|
4
|
-
metadata:
|
|
5
|
-
required_access:
|
|
6
|
-
- CODEBASE
|
|
7
|
-
- LANGFUSE_PROJECT_INTERFACE
|
|
8
|
-
- LANGFUSE_PROJECT_SCRIPT
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# Evaluator upgrade
|
|
12
|
-
|
|
13
|
-
Use the [evaluator migration guide](https://langfuse.com/faq/all/llm-as-a-judge-migration),
|
|
14
|
-
[v4 overview](https://langfuse.com/docs/v4), and current [Evaluation Rules](https://api.reference.langfuse.com/#tag/unstableevaluationrules)
|
|
15
|
-
and [Evaluators](https://api.reference.langfuse.com/#tag/unstableevaluators) API schemas as
|
|
16
|
-
the sources of truth. Read the current unstable schema before using it: only the unstable
|
|
17
|
-
Evaluation Rules API returns legacy `trace` and `dataset` targets; new rules use observation
|
|
18
|
-
or experiment targets.
|
|
19
|
-
|
|
20
|
-
## Inventory and scope
|
|
21
|
-
|
|
22
|
-
- Page through all rules and fetch each referenced evaluator. Record target, status, filters, mappings/JSONPaths, sampling, delay, time scope, evaluator, and score name.
|
|
23
|
-
- If a bulk page fails, retry with `limit=1` to isolate unreadable entries; report any page that still fails as a blocker and do not claim a complete inventory.
|
|
24
|
-
- Separate active, inactive, and blocked rules. Migrate only active rules that depend on new/live data. Historical-only rules (`EXISTING` without `NEW`) may be ignored; deactivation or deletion is optional and requires approval.
|
|
25
|
-
- Migrate only legacy trace and dataset targets here. Do not touch existing observation, experiment, or event rules. If the unstable API cannot mutate a legacy rule, return the exact UI action.
|
|
26
|
-
- Show the complete inventory and a consolidated retain/delete decision before changing project configuration.
|
|
27
|
-
|
|
28
|
-
## Trace to observation
|
|
29
|
-
|
|
30
|
-
In v4, a trace groups observations and has no separate trace input/output target. For each
|
|
31
|
-
retained trace rule, select one stable observation and verify its own fields:
|
|
32
|
-
|
|
33
|
-
1. Prefer an existing root or parent observation that already contains the required result.
|
|
34
|
-
2. If the rule used overall trace input/output, confirm that the previous SDK upgrade has already put those values on the root observation.
|
|
35
|
-
3. If it mixed trace context with one observation, propagate only the required context or filter attributes to that observation.
|
|
36
|
-
4. If required values span multiple observations, add a dedicated evaluation observation only when no existing observation can own them. Do not serialize the whole trace into metadata.
|
|
37
|
-
|
|
38
|
-
Use a stable observation name/type and root status where relevant. The selector should ideally match at
|
|
39
|
-
most one observation per trace when the legacy rule produced one score per trace. If it matches multiple observation, convey to the user that the rule will produce one score per observation. Keep names
|
|
40
|
-
and types stable across executions.
|
|
41
|
-
|
|
42
|
-
Preserve the evaluator-template: prompt, model, output, score name, sampling, delay. Time scope, filters, mappings, and JSONPaths need to be compatible with the new format. A legacy trace
|
|
43
|
-
name filter becomes `traceName`; it does not replace the observation selector. Every variable
|
|
44
|
-
and filter must exist on the selected observation, with trace attributes propagated according
|
|
45
|
-
to the applicable SDK or OpenTelemetry guide.
|
|
46
|
-
|
|
47
|
-
Inspect the resolved SDK/OTel path and a representative new trace; do not infer readiness
|
|
48
|
-
from a dependency declaration alone. Complete application instrumentation first when needed.
|
|
49
|
-
Keep deprecated trace-I/O calls only while an active legacy rule requires them, and remove
|
|
50
|
-
them after the successor is verified and the legacy rule is disabled.
|
|
51
|
-
|
|
52
|
-
## Dataset item to experiment
|
|
53
|
-
|
|
54
|
-
Read the legacy `dataset` rule and referenced evaluator, then create an `experiment` rule with
|
|
55
|
-
the same evaluator, score name, sampling, and mappings. Use the experiment target's current
|
|
56
|
-
dataset filter and dataset ID from the unstable schema.
|
|
57
|
-
As of the current API, this is `datasetId` with IDs from the v2 dataset endpoint. Translate
|
|
58
|
-
dataset-item expected output and metadata to the corresponding experiment-item fields, and
|
|
59
|
-
preserve input mappings and JSONPaths against the experiment-item shape.
|
|
60
|
-
|
|
61
|
-
For dataset runs, the root observation carries the run's input and output, so mapping legacy
|
|
62
|
-
trace input/output to observation input/output is safe and needs no evaluator-specific
|
|
63
|
-
instrumentation change.
|
|
64
|
-
|
|
65
|
-
Keep the legacy rule active while the project still uses low-level dataset-run APIs. Disable
|
|
66
|
-
it after the project emits experiment context; leaving both active can create duplicate
|
|
67
|
-
scores. Review any mapping that relies on a named observation or assumes a one-to-one input.
|
|
68
|
-
|
|
69
|
-
## Cut over and report
|
|
70
|
-
|
|
71
|
-
- Create the successor disabled when supported, validate it on new data, then enable it with approval. A brief overlap can create duplicate scores.
|
|
72
|
-
- Disable the legacy rule only after the successor is verified. Do not backfill historical data or delete historical scores.
|
|
73
|
-
- Verify the selected observation exists once when required, contains every mapped value and filter, and excludes sibling observations. Do not claim live verification without project access or a runnable path.
|
|
74
|
-
|
|
75
|
-
Return a concise per-rule table with the legacy rule, target, selector, mappings/filters,
|
|
76
|
-
required code changes, validation result, and remaining project actions or blockers.
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: langfuse-user-feedback
|
|
3
|
-
description: Wires up user feedback (thumbs up/down, ratings, comments) from an application's frontend to Langfuse scores. Use when user wants to capture end-user feedback, add ratings to traces, or connect user complaints to Langfuse.
|
|
4
|
-
metadata:
|
|
5
|
-
required_access:
|
|
6
|
-
- CODEBASE
|
|
7
|
-
- LANGFUSE_PROJECT_SCRIPT
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# User Feedback
|
|
11
|
-
|
|
12
|
-
Tracing must already be set up — feedback is stored as scores on traces.
|
|
13
|
-
|
|
14
|
-
Docs: https://langfuse.com/docs/observability/features/user-feedback
|
|
15
|
-
|
|
16
|
-
## Workflow
|
|
17
|
-
|
|
18
|
-
### 1. Determine What Feedback to Capture
|
|
19
|
-
|
|
20
|
-
If the user has asked for something specific, go with that. Otherwise, look at the application and **present a few UX options** for how feedback could work, then ask the user which they prefer before implementing.
|
|
21
|
-
|
|
22
|
-
Common UX patterns to suggest:
|
|
23
|
-
|
|
24
|
-
| UX Pattern | Best for | How it works |
|
|
25
|
-
|------------|----------|--------------|
|
|
26
|
-
| Thumbs up/down | Chat apps, Q&A | Simple binary buttons next to each response |
|
|
27
|
-
| Star rating (1–5) | Content generation, summaries | Star row or dropdown after each output |
|
|
28
|
-
| "Was this helpful?" banner | Search, documentation assistants | Single yes/no prompt at the bottom of a response |
|
|
29
|
-
| Regenerate / copy tracking | Any app with these actions | Implicit — log when users retry (negative signal) or copy output (positive signal) |
|
|
30
|
-
| Free-text comment | Complex outputs, internal tools | Optional text field alongside a rating |
|
|
31
|
-
| Report button | Any user-facing app | Flag icon to report bad/harmful responses |
|
|
32
|
-
|
|
33
|
-
This table is not exhaustive — if the application suggests a different feedback pattern that fits better, propose that instead. Present 2–3 options that match the application's use case and ask the user which approach they'd like. This decision shapes everything downstream (score names, data types, frontend components), so it's important to align early.
|
|
34
|
-
|
|
35
|
-
Feedback can be **explicit** (user rates via thumbs, stars, etc.) or **implicit** (derived from behavior like copying output, retrying, or escalating to support). Both are stored as scores. Explicit feedback requires the trace ID to reach the frontend; implicit feedback is logged server-side where the event already happens.
|
|
36
|
-
|
|
37
|
-
### 2. Choose Score Names
|
|
38
|
-
|
|
39
|
-
Name reflects the signal source, not what you hope it measures (e.g., `user-thumbs` not `response-quality` — a thumbs down doesn't tell you *what* was wrong). Avoid generic names like `feedback` or `score`.
|
|
40
|
-
|
|
41
|
-
Rules:
|
|
42
|
-
- Lowercase with hyphens
|
|
43
|
-
- One consistent name per feedback type across the entire app
|
|
44
|
-
- If capturing multiple signals, each gets its own distinct name
|
|
45
|
-
|
|
46
|
-
### 3. Implement Score Creation
|
|
47
|
-
|
|
48
|
-
**For implicit feedback (server-side):** Use `langfuse.create_score()` / `langfuse.score.create()` wherever the event is already handled in application code. Fetch SDK docs for current API: https://langfuse.com/docs/evaluation/evaluation-methods/scores-via-sdk
|
|
49
|
-
|
|
50
|
-
**For explicit feedback (frontend):** Use `LangfuseWeb` in the browser. It uses the public key only — no secret key exposed.
|
|
51
|
-
|
|
52
|
-
```typescript
|
|
53
|
-
import { LangfuseWeb } from "langfuse";
|
|
54
|
-
|
|
55
|
-
const langfuse = new LangfuseWeb({
|
|
56
|
-
publicKey: process.env.NEXT_PUBLIC_LANGFUSE_PUBLIC_KEY!,
|
|
57
|
-
baseUrl: process.env.NEXT_PUBLIC_LANGFUSE_HOST,
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
langfuse.score({
|
|
61
|
-
traceId,
|
|
62
|
-
name: "user-thumbs",
|
|
63
|
-
value: 1, // 1 = positive, 0 = negative
|
|
64
|
-
dataType: "BOOLEAN",
|
|
65
|
-
comment: optionalUserComment,
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
The trace ID must be available in the frontend for this to work. For Vercel AI SDK, the non-obvious pattern is using `generateMessageId`:
|
|
70
|
-
|
|
71
|
-
```typescript
|
|
72
|
-
import { getActiveTraceId } from "@langfuse/tracing";
|
|
73
|
-
|
|
74
|
-
// Inside route handler wrapped with observe()
|
|
75
|
-
return result.toUIMessageStreamResponse({
|
|
76
|
-
generateMessageId: () => getActiveTraceId() || crypto.randomUUID(),
|
|
77
|
-
});
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### 4. Verify
|
|
81
|
-
|
|
82
|
-
Trigger a feedback action and check the trace's Scores tab in Langfuse. Confirm the score name, value, and data type are correct.
|
|
83
|
-
|
|
84
|
-
Point users to what they can do with feedback data: filter traces by low scores, use score analytics for trends, build annotation queues for team review.
|
|
85
|
-
|
|
86
|
-
## Common Mistakes
|
|
87
|
-
|
|
88
|
-
| Mistake | Problem | Fix |
|
|
89
|
-
|---------|---------|-----|
|
|
90
|
-
| Secret key in frontend code | Security risk | Use `LangfuseWeb` with public key only |
|
|
91
|
-
| Missing `dataType` on boolean scores | Value `1` inferred as `NUMERIC` | Always pass `dataType: "BOOLEAN"` explicitly |
|
|
92
|
-
| Inconsistent score names across the app | Can't aggregate or filter reliably | Pick one name per feedback type, use it everywhere |
|