opik-diagnose
Surface the Opik traces worth a developer's attention, ranked by signal — Diagnostics issues first, then errors, failed tool calls, latency, regressions, and…
Run a candidate against the baseline over an Opik test suite and read the numbers back — which cases broke, which got fixed, the per-metric deltas, worst rows, and whether the two runs are comparable — with the Opik compare-view link. Runs via the SDK; reads results via the MCP
$ npx -y skills add comet-ml/opik-mcp --skill opik-compare --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/opik-compareContext preview
The summary Claude sees to decide when to auto-load this skill.
Run a candidate against the baseline over an Opik test suite and read the numbers back — which cases broke, which got fixed, the per-metric deltas, worst rows, and whether the two runs are comparable — with the Opik compare-view link. Runs via the SDK; reads results via the MCP
name: opik-compare description: Run a candidate against the baseline over an Opik test suite and read the numbers back — which cases broke, which got fixed, the per-metric deltas, worst rows, and whether the two runs are comparable — with the Opik compare-view link. Runs via the SDK; reads results via the MCP when connected. Does not issue a ship/no-ship verdict. Use for "did my fix work", "compare against the baseline", "run the regression suite", "why did quality drop", "which cases regressed", "compare these two experiments". Not for live production triage (use diagnose), building an evaluation from scratch (use evaluate), or capturing a single case (use test). compatibility: Tested with Claude Code; works with any Agent Skills-compatible host (Cursor, VS Code Copilot, Codex). Requires a Python or TypeScript project with Opik configured and a test suite (from the test or evaluate skill) or two existing experiments. Install the `opik` skill alongside this one — it holds the shared test-suite and experiment references; without it, this skill falls back to the public docs. allowed-tools: - Read - Grep - Glob - Bash - Write metadata: last_updated: "2026-09-15" source_commit: "2.0.0" argument-hint: "[suite name, or two experiment ids/names]"
**Definition of done:** two experiments on the same suite — a **baseline** and a **candidate** — read back item by item, with the **per-metric deltas**, the cases that went **pass → fail** (regressions) and **fail → pass** (fixes), the worst rows, a note on whether the runs are comparable, and the **Opik compare-view link**. If only one run exists, the done state is "baseline created — rerun after the change". If the suite can't be run or read, stop at the **first** genuine blocker and return **exactly one** next step. Aggregate scores alone are not a comparison; a verdict is not this skill's job.
Operate: **run the candidate the same way the baseline was run, read both back from Opik rather than from the run's console output, name the specific cases that changed — and change no application code.** The only file this skill writes is a throwaway runner outside the repo.
The entry point is `/opik-compare <suite>` (run the suite now as the candidate, compare against the latest prior run), `/opik-compare <experiment-A> <experiment-B>` (read two existing runs, no new run), or `/opik-compare` right after `/opik-test` (that suite). Infer the rest; treat these as **optional overrides**:
Ask only at a genuine, non-inferable blocker (see **Blockers**).
import opik client = opik.Opik() suite = client.get_test_suite(name="<suite>", project_name="<project>") prior = client.get_test_suite_experiments(name="<suite>", project_name="<project>") # newest first is not guaranteed — sort by created_at yourself
Baseline = the most recent prior experiment on this suite, unless the user names one. **No prior experiment → this run *is* the baseline** (step 3 still runs; status `baseline_created`). Two explicit experiments → skip step 3, go to step 4.
Confirm Opik is reachable: if `~/.opik.config` exists or `OPIK_API_KEY` is set, use it. Otherwise → **Blocker**.
The suite's items say what to call: each item `description` written by `/opik-test` ends in `Entrypoint: <root span name>`. Grep the repo for that function, import it, and wrap it:
def task(item: dict) -> dict:
return {"input": item["input"], "output": str(entrypoint(item["input"]))}Write the runner as a **temp file outside the repo** (or a scratch path the user names) — never into the codebase, never committed. It needs the app's provider credentials; if they're absent → **Blocker** (the app can't answer the items). Never point the runner at a production entrypoint that writes, sends, or spends.
**Prompt candidates** (the change is a prompt version, not code): there is no adapter — run server-side instead:
client.rest_client.experiments.execute_experiment(
dataset_name=suite.name, dataset_id=suite.id,
prompts=[{"model": "<model>", "messages": [...], "configs": {}, "prompt_versions": [{"id": "<prompt_version_id>"}]}],
project_name="<project>",
) # 202 Accepted; one experiment per prompt variant, processed asynchronously — poll get_experiment_by_id until items fillSame suite, same version, same judge model, same runs-per-item as the baseline — vary **only** the thing under test.
result = opik.run_tests(
test_suite=suite, # or suite.get_version_view("<baseline's version>") to pin
task=task,
experiment_name="candidate-<sha>",
experiment_tags=["compare", "<sha>"],
model="<same judge model as baseline>",
)
candidate_id = result.experiment_id # result.experiment_url is the single-run link
# GUARD: a missing judge credential does NOT raise — every item comes back failed with
# scoring_failed=True and a "Missing credentials" reason, and the experiment is still created.
# Treat that as a Blocker, not as a regression; do not compare against that run.
judge_failed = [
r for ir in result.item_results.values() for t in ir.test_results
for r in t.score_results if getattr(r, "scoring_failed", False)
]Do not read scores off `result` and stop — step 4 reads both runs from Opik so baseline and candidate go through the same path.
base = client.get_experiment_by_id("<baseThe official Model Context Protocol (MCP) server for Opik, the open-source LLM observability and evaluation platform, built by Comet.
Repo: comet-ml/opik-mcp
Surface the Opik traces worth a developer's attention, ranked by signal — Diagnostics issues first, then errors, failed tool calls, latency, regressions, and…
Build an LLM evaluation and run it against the app, returning an Opik experiment with scores and its link. Picks a test suite with judge assertions or a…
Root-cause a specific Opik trace, or a pattern across traces, and return a grounded explanation. Uses the hosted Opik MCP when it is connected, and falls back…
Add Opik tracing to an existing app and verify a real trace lands. Installs the Opik package, detects the language and LLM framework, adds the minimum tracing,…
Take a judge live on production traffic — create an Opik online evaluation rule (LLM-as-judge or Python metric) on a project with sampling, filters, variable…
Improve a prompt with the Opik Agent Optimizer — resolve the prompt, a dataset, and a metric, pick the algorithm, run a bounded optimization, check the gain on…