Agent skill

Opik Test

by comet-ml in comet-ml/opik-mcp

Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the…

Apache-2.0Auto-check: notesTesting & QA

Install Opik Test

skills CLI
$ npx skills add comet-ml/opik-mcp --skill opik-test -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install comet-ml/opik-mcp opik-test --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/comet-ml/opik-mcp.git skills-src && mkdir -p .claude/skills && cp -r skills-src/src/opik_mcp/skills/opik-test .claude/skills/opik-test && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
opik-test
GitHub stars
219
Token cost
~2.8k tokens
SKILL.md length
1,223 words
Files
9
Skills in repo
10
Repo updated
First seen
Licence
Apache-2.0

At a glance

Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the…

  • Works in 6 steps: Resolve the case → Read the trace (SDK-first) → Write the assertions → …
  • Turn this into a test
  • SKILL.md covers Inputs, Activation — the only in-scope…, Blockers and Output, plus 3 more sections
  • Runs Python scripts from its folder; needs OPIK_API_KEY

What it does

Opik Test is an agent skill from comet-ml/opik-mcp. Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the compare skill. Works over the SDK; uses the MCP write tool when connected. Returns the suite, the item, and the assertion. Use for "turn this into a test", "add a regression case for this trace", "make sure this doesn't happen again", "capture this failure", "add this to the test suite". Not for running the suite (use…

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 11 other files (for example `evals/HARNESS.md`, `evals/cases.yaml` and `evals/fixtures/toolbug/agent.py`). Compatibility notes: Tested with Claude Code; works with any Agent Skills-compatible host (Cursor, VS Code Copilot, Codex). Requires a Python or TypeScript project with Opik…

It sits in Testing & QA, covering Test generation and MCP servers. It works with Model Context Protocol. The repository describes itself as: Model Context Protocol (MCP) server for Opik, the open-source LLM observability and evaluation platform, built by Comet. Read traces, log scores, and manage prompts from Claude… The licence is Apache-2.0.

When your agent uses it

  • Turn this into a test
  • Add a regression case for this trace
  • Make sure this doesnt happen again
  • Capture this failure

Example prompts

  • “turn this into a test”
  • “add a regression case for this trace”
  • “make sure this doesn”
  • “/opik-test”

Requirements

  • Python 3
  • A credential in OPIK_API_KEY
  • Compatibility (from SKILL.md): 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 at least one trace, or a described input/expected pair. Install the `opik` skill alongside this one — it holds the shared test-suite and dataset references; without it, this skill falls back to the public docs.
  • Pre-approved tools (allowed-tools): Read, Grep, Glob, Bash

Workflow steps

6 steps, taken from the step headings in SKILL.md.

  1. Resolve the case
  2. Read the trace (SDK-first)
  3. Write the assertions
  4. Store the case (create or append)
  5. Verify
  6. Report

What it can do on your machine

Read from SKILL.md and the folder at commit e0c2057. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Grep
    • Glob
    • Bash

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships script files (Python), which the agent can run.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • comet.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • OPIK_API_KEY

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • 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 at least one trace, or a described input/expected pair. Install the `opik` skill alongside this one — it holds the shared test-suite and dataset references; without it, this skill falls back to the public docs.

    From compatibility in the SKILL.md frontmatter.

Context cost

Opik Test loads about 2.8k tokens when it runs. Until then it costs about 159 tokens; SKILL.md has 1,223 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~159
When it runs · the whole SKILL.md, loaded when a task matches
~2.8k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NotePre-approves every shell command (allowed-tools: Bash)SKILL.md
    allowed-tools: Read, Grep, Glob, Bash

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from comet-ml/opik-mcp at commit e0c2057, republished under its Apache-2.0 licence (© comet-ml). 1,223 words, ~2,783 tokens.

Download SKILL.mdSave it as .claude/skills/opik-test/SKILL.md (or your agent's skills folder). This skill also uses 8 other files; get the full folder from GitHub.
name
opik-test
description
Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the compare skill. Works over the SDK; uses the MCP write tool when connected. Returns the suite, the item, and the assertion. Use for "turn this into a test", "add a regression case for this trace", "make sure this doesn't happen again", "capture this failure", "add this to the test suite". Not for running the suite (use compare), building an evaluation from scratch (use evaluate), or explaining why the trace failed (use explain).
allowed-tools
Read, Grep, Glob, Bash
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 at least one trace, or a described input/expected pair. Install the `opik` skill alongside this one — it holds the shared test-suite and dataset references; without it, this skill falls back to the public docs.
metadata.last_updated
2026-09-15
metadata.source_commit
2.0.0
metadata.argument-hint
[trace id, or a description of the failure to capture]

Test — Capture a Failing Case as a Repeatable Check

Definition of done: one test-suite item exists in Opik that reproduces the failure — its data carries the failing input (and the expected output when one is known), and it has one or two binary assertions that would have failed on the bad trace and pass on a correct one. The item is in a named suite scoped to the project, is confirmed by reading it back, and is ready for /opik-compare to run. If the case can't be captured, stop at the first genuine blocker and return exactly one next step. Writing a pytest file, or describing a test in prose, is not success.

Operate: extract the case from real trace data, write assertions a judge can decide with a yes or no, store them where /opik-compare will find them — and change no application code. This skill writes to Opik, never to the repo.

Inputs

The entry point is /opik-test <trace-id> (capture that trace), /opik-test <describe the failure> (find the trace, or capture from the description alone), or /opik-test right after /opik-explain (capture the trace it just explained). Infer the rest; treat these as optional overrides:

  • suite name (default: <project>-regressions) · project (default: the trace's project, else the configured one) · expected output (default: none — assertions carry the expectation) · execution policy (default: the suite's; runs_per_item: 3, pass_threshold: 2 only for an intermittent failure).

Ask only at a genuine, non-inferable blocker (see Blockers).

Activation — the only in-scope work

1. Resolve the case
  • A trace id (uuid-shaped): that trace is the case.
  • A description ("the refund answer is wrong", "it hallucinated the shipping time"): search_traces on the project for the matching trace (error, low score, or free-text match) and take the best one. If none matches, capture from the description alone — the user's input and expectation become the item.
  • Confirm Opik is reachable: if ~/.opik.config exists or OPIK_API_KEY is set, use it. Otherwise → Blocker ("run opik configure, then rerun").
2. Read the trace (SDK-first)
python
import opik

client = opik.Opik()

tid = "<trace_id>"
trace = client.get_trace_content(
    tid
)  # TracePublic: .input, .output, .project_id — NOT .project_name (accessing it raises)
project = client.rest_client.projects.get_project_by_id(trace.project_id).name
spans = client.search_spans(
    project_name=project, trace_id=tid
)  # root span (no parent_span_id) names the entrypoint the compare skill will call
# Pass project_name: without it search_spans looks in the configured default project and returns nothing.

Take the input exactly as the trace recorded it (the root span / trace input), the actual output (what went wrong), and the root span name (the entrypoint). When the MCP is connected, read('trace', id) is an equivalent path — a convenience, not a requirement.

3. Write the assertions

Assertions are plain-English statements an LLM judge answers pass/fail from the item's data and the candidate output. Rules:

  1. One failure mode per assertion. State what a correct output does, not a list of qualities.
  2. Would have failed on the bad trace. Check it against the actual output you just read; if it would pass, it's the wrong assertion.
  3. Decidable from the output alone (plus expected_output when present). No "is helpful", no Likert scales.
  4. At most two: the positive expectation, and — only if the bad output did something specific and wrong — one negative ("does not claim …"). Prefer the positive form: small judge models misread negatives (observed: "does not promise a refund within 24 hours" judged true on an output that promised exactly that). If the negative matters, fold it into the positive ("states 5-7 business days, not 24 hours").

Prefer a deterministic check over a judge when the correct answer is exact: put it in data.expected_output as well, so /opik-compare can score it with a heuristic metric.

4. Store the case (create or append)

Suite naming: <project>-regressions unless the user names one. Reuse an existing suite; never create a second suite for the same project.

python
suite = client.get_or_create_test_suite(
    name="<project>-regressions",
    project_name=project,
    tags=["regression"],
)

# Dedupe on the source trace before inserting.
existing = suite.get_items(filter_string=f'data.source_trace_id = "{tid}"')
if not existing:
    suite.insert(
        [
            {
                "data": {
                    "input": trace.input,  # verbatim from the trace
                    "source_trace_id": tid,
                    # "expected_output": "...",           # only when the correct answer is exact
                },
                "assertions": ["<positive assertion>", "<optional negative assertion>"],
                "description": "Regression from trace <tid>: <one-line failure>. Entrypoint: <root span name>",
            }
        ]
    )

The description carries the entrypoint (root span name) because /opik-compare needs to know which function to call to run the item; the source_trace_id key is what keeps a second /opik-test on the same trace from duplicating it.

When the hosted MCP is connected, the write tool's test_suite.create and test_suite_item.upsert operations do the same thing — call schema("test_suite_item.upsert") for the exact envelope. Either transport ends in the same suite; the SDK path needs no MCP.

5. Verify

Read the item back — suite.get_items(filter_string=…) returns it with an id — and note the suite's current version (suite.get_current_version_name()). Don't report success from the insert call alone.

6. Report

Return the suite, the item, the assertions, and one next step (see Output). The natural next step is "/opik-compare <suite> once the fix is in". This skill captures; it does not run the suite (that is /opik-compare) and it changes no code.

Show full SKILL.md (505 more words)Show less

Blockers

Stop at the earliest blocker and return exactly one next step:

  • "Run opik configure, then rerun /opik-test <trace-id>."
  • "No trace found for <id> in project <name> — confirm the id and project, or describe the failure and I'll capture it from that."
  • "The trace has no recorded input — pass the input and expected behavior and I'll capture it from those."
  • "Which behavior is wrong here? Tell me what the output should have done and I'll write the assertion."

Output

User-facing: a short human message — the suite name and version, the item (input in one line, assertions verbatim), whether it was new or already present, and the single next step. Not JSON, not a pytest file.

Underneath (for composition / evals), one shape:

  • status: captured | exists | blocked
  • suite: name, project, version
  • item: id, source_trace_id, input (as stored), assertions (list), expected_output (when set), entrypoint
  • source: sdk | mcp
  • next_step: exactly one (typically "run /opik-compare <suite> after the fix")

Invariants: captured and exists carry an item with a non-empty assertions list and a suite; each assertion names one failure mode; exists means the dedupe found the trace already captured and nothing was inserted; blocked carries exactly one next_step; every path leaves the codebase unchanged.

Examples

From an explained trace. /opik-explain found the retrieve tool returned nothing and the answer claimed a 24-hour refund. /opik-test 019fd8a7-…: input = "what is your refund window?", root span = answer. Assertions: "Response states refunds take 5-7 business days" and "Response does not promise a refund within 24 hours". Suite support-bot-regressions created, item inserted, read back as v1. → captured; next step = "run /opik-compare support-bot-regressions once retrieve() is fixed".

Already captured. Same trace again. The source_trace_id filter finds the item. → exists: "Already in support-bot-regressions (item …) — run /opik-compare when ready."

From a description, no trace. /opik-test the bot should refuse to give legal advice. No matching trace, so the user's input and expectation become the item: input = the prompt they describe, assertion = "Response declines to give legal advice and points to a professional". → captured (with source_trace_id absent).

Blocked — no config. No ~/.opik.config, no OPIK_API_KEY. → blocked: "run opik configure, then rerun." (No code touched.)

Anti-patterns

Writing a pytest/vitest file instead of a suite item (the suite is what /opik-compare runs and what the UI shows); holistic assertions ("response is good", "response is accurate and helpful"); an assertion that would have passed on the failing trace; five assertions for one failure; a fresh suite per trace; paraphrasing the input instead of storing it verbatim; running the suite here (that is /opik-compare); editing application code; fixing the bug as a side effect.

References

Test-suite and dataset detail live in the opik skill, installed beside this one. Read the files directly — paths are relative to this file: ../opik/references/evaluation-test-suites.md (suites, items, assertions, execution policies, versions), ../opik/references/evaluation-datasets.md (OQL filter syntax, datasets from traces), ../opik/references/production.md (search_traces). For how to phrase a judge-decidable assertion, ../opik-evaluate/references/write-judge-prompt.md. If your host lays skills out differently, locate the opik skill's references/ directory.

If the opik skill isn't installed, say so in the report and use https://www.comet.com/docs/opik/ rather than working from memory.

© comet-ml, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 8 other files in src/opik_mcp/skills/opik-test of comet-ml/opik-mcp.

  • SKILL.md
  • evals/.gitignore
  • evals/HARNESS.md
  • evals/cases.yaml
  • evals/fixtures/toolbug/agent.py
  • evals/fixtures/toolbug/pyproject.toml
  • evals/grader.py
  • evals/metrics.py
  • evals/run_evals.py

Open the folder on GitHubat commit e0c2057

Compare with similar skills

Opik Test next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Opik Test compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Opik Test this skillcomet-ml/opik-mcp219—~2.8kAutomated safety check: NotesApache-2.0
Chatgpt App Submissionnteract/semiotic2.7k—~2.8kAutomated safety check: PassApache-2.0
Create Test Runjeremylongshore/tons-of-skills-marketplace2.8k—~3kAutomated safety check: PassMIT
Ue Test AuthoringJasonMa0012/MooaToon749—~2.1kAutomated safety check: NotesCustom licence
Zizkadb TestZIZKA-AI-SL/ZizkaDB123—~358Automated safety check: PassCustom licence
Azsdk Common Pipeline AnalysisAzure/azure-sdk-tools134—~1.2kAutomated safety check: PassMIT

Similar skills

  • Chatgpt App Submission

    nteract/semiotic

    Inspect a ChatGPT Apps MCP server codebase and generate chatgpt-app-submission.json with app info suggestions, tool hint justifications, test cases, and negative test cases, then report review-check…

    2.7k GitHub stars~2.8k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Create Test Run

    jeremylongshore/tons-of-skills-marketplace

    Create a Kobiton test run from a test case or suite, then offer to monitor it.

    2.8k GitHub stars~3k tokensUpdated today
    Testing & QAAuto-check passed
  • Ue Test Authoring

    JasonMa0012/MooaToon

    A skill your agent uses when writing or modifying UE automated tests (Automation, CQTest, Functional, Gauntlet, LowLevel) with Rider MCP available.

    749 GitHub stars~2.1k tokensUpdated 20 days ago
    Testing & QAAuto-check: notes
  • Zizkadb Test

    ZIZKA-AI-SL/ZizkaDB

    Run the full ZizkaDB test suite across all layers — lint, Python unit tests, SDK tests, MCP tests, TypeScript tests, and dashboard build verification.

    123 GitHub stars~358 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Azsdk Common Pipeline Analysis

    Azure/azure-sdk-tools

    Official

    Analyze Azure SDK CI/CD pipeline failures into a structured diagnosis, and define the required output format.

    134 GitHub stars~1.2k tokensUpdated today
    Testing & QAAuto-check passed
  • Testrail

    alirezarezvani/claude-skills

    Sync tests with TestRail. An agent skill from alirezarezvani/claude-skills.

    28k GitHub starsUsed in 1 repo~966 tokens
    Testing & QAAuto-check passed

More from comet-ml/opik-mcp

All 10 skills in this repo
  • Opik

    comet-ml/opik-mcp

    Reference for the Opik SDK — tracing, span types, framework integrations, threads, and the prompt library (Python, TypeScript, REST).

    219 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Opik Compare

    comet-ml/opik-mcp

    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…

    219 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Opik Diagnose

    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 low online-eval scores.

    219 GitHub stars~2.7k tokensUpdated today
    Auto-check: notes
  • Opik Evaluate

    comet-ml/opik-mcp

    Build an LLM evaluation and run it against the app, returning an Opik experiment with scores and its link.

    219 GitHub stars~2.5k tokensUpdated today
    Auto-check: notes
  • Opik Instrument

    comet-ml/opik-mcp

    Add Opik tracing to an existing app and verify a real trace lands.

    219 GitHub stars~2.7k tokensUpdated today
    Auto-check: notes
  • Opik Optimize

    comet-ml/opik-mcp

    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 held-out data, and save the winner as…

    219 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes

Questions about Opik Test

What does Opik Test do?

Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the…. Opik Test is an agent skill from comet-ml/opik-mcp. Turn a failing Opik trace (or a described failure) into a repeatable regression check — a test-suite item with the trace's input and one or two binary assertions — so a fix can be verified by the compare skill.

When should I use Opik Test?

Opik Test fits situations like: turn this into a test; add a regression case for this trace; make sure this doesnt happen again; capture this failure.

How do I install Opik Test in Claude Code?

Run `npx skills add comet-ml/opik-mcp --skill opik-test -a claude-code`. Or copy the skill folder (src/opik_mcp/skills/opik-test in comet-ml/opik-mcp) into .claude/skills/opik-test in your project. Claude Code loads it when a task matches its description.

How do I install Opik Test in Codex?

Run `npx skills add comet-ml/opik-mcp --skill opik-test -a codex`. Or copy the skill folder (src/opik_mcp/skills/opik-test in comet-ml/opik-mcp) into .agents/skills/opik-test in your project. Codex loads it when a task matches its description.

Can I use Opik Test in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add comet-ml/opik-mcp --skill opik-test -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/opik-test, .gemini/skills/opik-test, .github/skills/opik-test and .opencode/skills/opik-test in your project.

What does Opik Test need to run?

Going by SKILL.md and its folder, Opik Test needs Python for the scripts in its folder and credentials named OPIK_API_KEY. Our summary lists: Python 3; A credential in OPIK_API_KEY. Its frontmatter pre-approves these tools: Read, Grep, Glob, Bash. Compatibility (from SKILL.md): 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 at least one trace, or a described input/expected pair. Install the `opik` skill alongside this one — it holds the shared test-suite and dataset references; without it, this skill falls back to the public docs..

Does Opik Test access the network?

SKILL.md names 1 domain. As links in the text: comet.com. This is read from the text; nothing was executed.

Is Opik Test safe to install?

Our automated static check of SKILL.md found notes only (pre-approves every shell command (allowed-tools: bash)), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Opik Test use?

Opik Test is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Opik Test use?

About 2.8k tokens (SKILL.md is roughly 11k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Opik Test?

Skills that share tags, products or a category with Opik Test: Chatgpt App Submission (nteract/semiotic, 2.7k stars), Create Test Run (jeremylongshore/tons-of-skills-marketplace, 2.8k stars), Ue Test Authoring (JasonMa0012/MooaToon, 749 stars) and Zizkadb Test (ZIZKA-AI-SL/ZizkaDB, 123 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Opik Test?

comet-ml (a GitHub organization) maintains it in comet-ml/opik-mcp, which has 219 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

Source: comet-ml/opik-mcp on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.