Langfuse

From HybridAIOne/hybridclaw · View interactive version

Langfuse is an AI agent skill from the GitHub repository HybridAIOne/hybridclaw. Use Langfuse for LLM observability and evaluation and look up Langfuse documentation. In HybridClaw, data access (traces, observations, sessions, scores, prompts, datasets, metrics) goes through the gateway-proxied langfuse.cjs helper with SecretRef auth — reads are green, writes are grant-gated. Do

How to use this skill

Skill file

Langfuse

This skill helps you use Langfuse effectively across all common workflows:

instrumenting applications, migrating prompts, debugging traces, accessing data,

and evaluating outputs.

HybridClaw integration. This is the official Langfuse skill

(github.com/langfuse/skills, MIT)

adapted for HybridClaw. Two things differ from the upstream skill:

1. Credentials never leave the gateway. Do not export

LANGFUSE_PUBLIC_KEY / LANGFUSE_SECRET_KEY, run npx langfuse-cli, or

paste keys anywhere. Store them once in the runtime stores (below); the

gateway injects them server-side.

2. Data access goes through langfuse.cjs, not the Langfuse CLI. The

helper builds each REST request and sends it through the HybridClaw gateway,

which resolves Authorization: Basic <secret:LANGFUSE_BASIC_AUTH> and the

<env:LANGFUSE_HOST> base URL. Wherever a reference says to run

langfuse-cli or curl -H "Authorization: Basic $AUTH", use the helper

instead. Documentation retrieval (section 2) is unchanged.

HybridClaw setup

The helper never sees credentials. Store two values once. For secrets, use this

order:

  1. Browser admin: open the active HybridClaw admin URL ending in /admin/secrets.
  2. Browser /chat or TUI fallback.
  3. Local console fallback.
  1. LANGFUSE_BASIC_AUTH — base64 of public-key:secret-key:

/secret set LANGFUSE_BASIC_AUTH "<base64-public-colon-secret>"

  1. LANGFUSE_HOST — your Langfuse base URL:

/env set LANGFUSE_HOST https://cloud.langfuse.com (use

https://us.cloud.langfuse.com for US, https://jp.cloud.langfuse.com for

JP, or your self-hosted origin).

Local console fallback: hybridclaw secret set LANGFUSE_BASIC_AUTH "<...>"

and hybridclaw env set LANGFUSE_HOST https://cloud.langfuse.com.

See references/operator-setup.md for key scope,

host selection, autonomy defaults, and network-policy notes.

Core Principles

Follow these principles for ALL Langfuse work:

  1. Documentation first: never implement from memory. Langfuse updates

frequently — fetch current docs (section 2) before writing instrumentation or

SDK code.

  1. Helper for data access: use langfuse.cjs (gateway + SecretRef) when

querying or modifying Langfuse data. It owns endpoints, methods, bodies,

stakes tiers, host, and the Basic auth placeholder.

  1. Best practices by use case: check the relevant reference below before

implementing.

  1. Use latest Langfuse versions: unless the user says otherwise, target the

latest Langfuse SDKs/APIs.

Use-case references

references/instrumentation.md

references/prompt-migration.md

references/user-feedback.md

deciding what to fix: references/error-analysis.md

matrices, metric ingestion):

references/judge-calibration.md

references/sdk-upgrade.md

references/ci-cd.md

references/cli.md

references/operator-setup.md

references/skill-feedback.md

1. Langfuse data access (HybridClaw gateway helper)

langfuse.cjs is the API wrapper. Do not handcraft Langfuse API URLs, JSON

bodies, tiers, host, or the Basic auth header from memory.

node skills/langfuse/langfuse.cjs --help

node skills/langfuse/langfuse.cjs --format json plan "average eval score this week"

Basic auth header):

node skills/langfuse/langfuse.cjs --format json run list-traces --user-id alice --limit 50

use it for dry-run inspection or runtimes without helper gateway access.

Read examples (green):

node skills/langfuse/langfuse.cjs --format json run get-trace --trace-id abc123
node skills/langfuse/langfuse.cjs --format json run list-observations --type GENERATION --trace-id abc123
node skills/langfuse/langfuse.cjs --format json run list-scores --name quality
node skills/langfuse/langfuse.cjs --format json run get-prompt --prompt-name support-reply --label production
node skills/langfuse/langfuse.cjs --format json run metrics --query '{"view":"traces","metrics":[{"measure":"count","aggregation":"count"}]}'

Guarded write examples (amber — only after an explicit operator grant):

node skills/langfuse/langfuse.cjs --format json run create-score \
  --trace-id abc123 --name quality --value 0.8 --data-type NUMERIC --comment "reviewed" --operator-grant
node skills/langfuse/langfuse.cjs --format json run create-prompt \
  --name summarizer --type text --prompt "Summarize: {{input}}" --label production --operator-grant

Select region or self-hosted host explicitly (otherwise <env:LANGFUSE_HOST>):

node skills/langfuse/langfuse.cjs --format json run list-traces --host https://us.cloud.langfuse.com

Working rules

create-dataset-item, create-prompt) require --operator-grant: produce a

plan, wait for the operator's grant, then run the exact approved command.

of scope. Use the Langfuse UI for those.

endpoints) to paginate. The helper rejects --limit above 100.

root observation rows (one application root per trace); get-trace returns

every observation row sharing the requested trace ID. Follow meta.cursor

with --cursor when more rows are available.

from the root observation; prompts and outputs may instead live on a child

GENERATION observation.

configs cannot be deleted.

as Authorization: Basic <secret:LANGFUSE_BASIC_AUTH>.

includes costMeasurement.system = "UsageTotals" for eval verification.

2. Langfuse documentation

Prefer your application's native web fetch/search tools (e.g. web_fetch,

web_search) over curl. The URLs work with any fetching method.

2a. Documentation index (llms.txt)

Fetch the full index of doc pages, then fetch the right one:

curl -s https://langfuse.com/llms.txt

2b. Fetch individual pages as markdown

Append .md to any doc path (or send Accept: text/markdown):

curl -s "https://langfuse.com/docs/observability/overview.md"

2c. Search documentation

When you don't know the page (also indexes GitHub issues/discussions):

curl -s "https://langfuse.com/api/search-docs?query=How+do+I+trace+LangGraph+agents"

Workflow: start with llms.txt to orient → fetch the specific page → fall

back to search when the topic is unclear.

Eval suite

node skills/langfuse/langfuse.cjs --format json eval-scenarios

The fixture at evals/scenarios.json contains 10 scenarios covering trace,

observation, session, score, metric, prompt, and dataset reads plus guarded

score, dataset, and prompt writes.

Skill feedback

If the skill gives wrong or outdated guidance, is missing something, or could be

improved, offer to submit feedback to the Langfuse skill maintainers following

references/skill-feedback.md. Do not trigger

this for issues with Langfuse the product — only this skill's instructions.

Attribution

Adapted from the official Langfuse skill

(github.com/langfuse/skills), MIT-licensed,

with HybridClaw gateway/SecretRef data access in place of the upstream

langfuse-cli + plaintext-key path. See NOTICE.md.

Validation

python3 skills/skill-creator/scripts/quick_validate.py skills/langfuse
node skills/langfuse/langfuse.cjs --help
node skills/langfuse/langfuse.cjs --format json eval-scenarios
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.