Agent skill

Opik TypeScript SDK Conventions

by comet-ml in comet-ml/opik

Documents the Opik TypeScript SDK's layered architecture, flush and batching rules, and error-handling conventions for anyone changing code under sdks/typescript.

Apache-2.0Auto-check passedAI & LLM Engineering

Install Opik TypeScript SDK Conventions

skills CLI
$ npx skills add comet-ml/opik --skill typescript-sdk -a claude-code

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

GitHub CLI
$ gh skill install comet-ml/opik typescript-sdk --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.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/typescript-sdk .claude/skills/typescript-sdk && 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
typescript-sdk
GitHub stars
22k
Token cost
~440 tokens
SKILL.md length
124 words
Files
2
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Documents the Opik TypeScript SDK's layered architecture, flush and batching rules, and error-handling conventions for anyone changing code under sdks/typescript.

  • Making changes inside the Opik TypeScript SDK's sdks/typescript folder
  • SKILL.md covers Architecture, Layer Flow, Critical Gotchas and Batching Semantics, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Writing a new integration that wraps the Opik TypeScript client

What it does

This skill describes how the Opik TypeScript SDK is put together: a layered, non-blocking design where calls flow from the public API through an OpikClient, into domain objects such as Trace and Span, through batch queues and a REST client, to the backend. It targets Node 18 and above and ships both ESM and CJS builds.

Several rules are marked critical. Callers must flush the client before exit, especially in CLI tools and tests, and domain objects must enqueue updates rather than make HTTP calls directly. The public API re-exports only safe surfaces like Opik, track and flushAll, and must never leak the internal rest_api. Batching rules say updates wait for pending creates and deletes wait for creates and updates, with flush() draining every queue in order and a configurable debounce window.

Error handling distinguishes OpikApiError and OpikApiTimeoutError for HTTP failures, with 404s translated into domain errors such as DatasetNotFoundError. Integrations are expected to wrap only the public API, stay thin and non-blocking, and expose their own flush() escape hatch. A linked testing.md reference covers Vitest patterns, mocking and flush timing.

When your agent uses it

  • Making changes inside the Opik TypeScript SDK's sdks/typescript folder
  • Writing a new integration that wraps the Opik TypeScript client
  • Debugging a flush or batching issue in Opik trace or span updates
  • Checking whether a change leaks an internal module through the public API

Example prompts

  • “I'm adding a new integration for Opik in TypeScript. What should it wrap and what should it avoid?”
  • “Why would spans be missing after a short-lived CLI script exits?”
  • “Review this SDK change for whether it leaks rest_api through the public exports.”
  • “Explain the batching order between trace creates, updates and deletes in the TypeScript SDK.”

Requirements

  • A checkout of the Opik repository's sdks/typescript package
  • Node.js 18 or later

What it can do on your machine

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

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are typescript).

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

  • Network

    No URLs in SKILL.md.

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

  • Credentials

    Names no API keys, tokens, secrets or passwords.

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

Context cost

Opik TypeScript SDK Conventions loads about 440 tokens when it runs. Until then it costs about 21 tokens; SKILL.md has 124 words of instructions outside code blocks.

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

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 passed

The automated check found no risky patterns in SKILL.md.

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 at commit f217a86, republished under its Apache-2.0 licence (© comet-ml). 124 words, ~440 tokens.

Download SKILL.mdSave it as .claude/skills/typescript-sdk/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
typescript-sdk
description
TypeScript SDK patterns for Opik. Use when working in sdks/typescript.

TypeScript SDK

Architecture

  • Layered, non-blocking by default
  • Data buffered and flushed async to backend
  • Node >= 18, ESM + CJS builds

Layer Flow

Public API → OpikClient → Domain (Trace/Span) → BatchQueues → REST Client → Backend

Critical Gotchas

  • When changing dependencies or minimum versions, update and verify version references in README.md and integration README files in the same PR.
Flush Before Exit
typescript
// ✅ REQUIRED - especially in CLI/tests
await client.flush();
// or globally:
await flushAll();
Domain Objects Don't Do HTTP
typescript
// ✅ GOOD - domain objects enqueue, not HTTP
trace.update({ metadata: { key: 'value' } }); // Enqueues update
trace.end();  // Enqueues update

// ❌ BAD - don't call REST directly from domain
Never Leak rest_api
typescript
// ✅ GOOD - export from public API
export { Opik, track, flushAll } from 'opik';

// ❌ BAD - don't expose generated clients
import { TracesApi } from 'opik/rest_api';  // Internal!

Batching Semantics

  • Updates wait for pending creates
  • Deletes wait for creates and updates
  • flush() flushes all queues in order
  • Debounce window configurable via OpikConfig

Error Handling

  • HTTP failures: OpikApiError, OpikApiTimeoutError
  • 404s translate to domain errors: DatasetNotFoundError, ExperimentNotFoundError
  • Never swallow errors, include context in logs

Integration Guidelines

  • Integrations wrap public API only
  • Keep adapters thin, non-blocking
  • Provide flush() escape hatch if needed

Reference Files

  • testing.md - Vitest patterns, mocking, flush timing

© 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 1 other file in .agents/skills/typescript-sdk of comet-ml/opik.

  • SKILL.md
  • testing.md

Open the folder on GitHubat commit f217a86

Compare with similar skills

Opik TypeScript SDK Conventions 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 TypeScript SDK Conventions compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Opik TypeScript SDK Conventions this skillcomet-ml/opik22k—~440Automated safety check: PassApache-2.0
Failproof AI SDK IntegrationFailproofAI/failproofai5.3k—~6kAutomated safety check: PassCustom licence
Langchain Dependencieslangchain-ai/langchain-skills1.3k1 repos~3.6kAutomated safety check: PassMIT
Langsmith Custom Appslangchain-ai/langsmith-skills159—~3.2kAutomated safety check: PassMIT
Phoenix Tracinggithub/awesome-copilot40k3 repos~1.6kAutomated safety check: PassApache-2.0
Phoenix Integration SnippetsArize-ai/phoenix12k—~1.4kAutomated safety check: PassApache-2.0

Similar skills

  • Failproof AI SDK Integration

    FailproofAI/failproofai

    Helps instrument a custom Python or TypeScript agent to record events for Failproof AI, verify what gets written, and run an evaluator worker that scores the runs.

    5.3k GitHub stars~6k tokensUpdated yesterday
    AI & LLM EngineeringAuto-check passed
  • Langchain Dependencies

    langchain-ai/langchain-skills

    Official

    INVOKE THIS SKILL when setting up a new project or when asked about package versions, installation, or dependency management for LangChain, LangGraph, LangSmith, or Deep Agents.

    1.3k GitHub starsUsed in 1 repo~3.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Langsmith Custom Apps

    langchain-ai/langsmith-skills

    Official

    INVOKE THIS SKILL when building, iterating on, copying, or sharing a LangSmith Custom App — a React/TypeScript UI that runs inside LangSmith and reads the LangSmith API.

    159 GitHub stars~3.2k tokensUpdated 4 days ago
    AI & LLM EngineeringAuto-check passed
  • Phoenix Tracing

    github/awesome-copilot

    Official

    OpenInference semantic conventions and instrumentation for Phoenix AI observability.

    40k GitHub starsUsed in 3 repos~1.6k tokens
    AI & LLM EngineeringAuto-check passed
  • Generates onboarding code snippets for Phoenix tracing integrations and wires them into the project onboarding UI.

    12k GitHub stars~1.4k tokensUpdated today
    AI & LLM EngineeringAuto-check passed
  • Phoenix Skills Audit

    Arize-ai/phoenix

    Audit recent changes to Phoenix's user-facing surfaces (Python clients, TypeScript clients, CLI, REST/GraphQL APIs) and patch the three external-facing agent skills — phoenix-tracing, phoenix-cli…

    12k GitHub stars~5.1k tokensUpdated today
    AI & LLM EngineeringAuto-check passed

More from comet-ml/opik

All 19 skills in this repo
  • Checklist for wiring a new linter into Opik's Code Quality pipeline: the four files to edit, the silent-failure gotchas and the pass/fail verification loop.

    22k GitHub stars~2.3k tokensUpdated today
    Auto-check passed
  • Shows how to add product analytics events to Opik's frontend, Java backend and Python SDK, all reporting through Segment to PostHog with an opik_ name prefix.

    22k GitHub stars~4.4k tokensUpdated today
    Auto-check passed
  • Investigates a failed Opik end-to-end test from CI, TestOps or a local run, decides regression versus flake, and proposes a fix without editing tests.

    22k GitHub stars~1.8k tokensUpdated today
    Auto-check passed
  • Rules for writing PR descriptions, changelog entries and feature documentation in the Opik repository, including the exact headings that CI requires.

    22k GitHub stars~1.3k tokensUpdated today
    Auto-check passed
  • Turns a code change into one committed, passing Playwright end-to-end spec by resolving the change scope and handing authoring to a companion skill.

    22k GitHub stars~3.4k tokensUpdated today
    Auto-check passed
  • Starts, rebuilds, and troubleshoots the Opik local dev stack, including an optional Comet Platform integration mode for the Opik team.

    22k GitHub stars~734 tokensUpdated today
    Auto-check passed

Works with

Questions about Opik TypeScript SDK Conventions

What does Opik TypeScript SDK Conventions do?

Documents the Opik TypeScript SDK's layered architecture, flush and batching rules, and error-handling conventions for anyone changing code under sdks/typescript. This skill describes how the Opik TypeScript SDK is put together: a layered, non-blocking design where calls flow from the public API through an OpikClient, into domain objects such as Trace and Span, through batch queues and a REST client, to the backend. It targets Node 18 and above and ships both ESM and CJS builds.

When should I use Opik TypeScript SDK Conventions?

Opik TypeScript SDK Conventions fits situations like: making changes inside the Opik TypeScript SDK's sdks/typescript folder; writing a new integration that wraps the Opik TypeScript client; debugging a flush or batching issue in Opik trace or span updates; checking whether a change leaks an internal module through the public API.

How do I install Opik TypeScript SDK Conventions in Claude Code?

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

How do I install Opik TypeScript SDK Conventions in Codex?

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

Can I use Opik TypeScript SDK Conventions 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 --skill typescript-sdk -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/typescript-sdk, .gemini/skills/typescript-sdk, .github/skills/typescript-sdk and .opencode/skills/typescript-sdk in your project.

What does Opik TypeScript SDK Conventions need to run?

SKILL.md names no scripts, command-line tools or credentials: Opik TypeScript SDK Conventions is instructions for the agent only. Our summary lists: A checkout of the Opik repository's sdks/typescript package; Node.js 18 or later.

Does Opik TypeScript SDK Conventions access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Opik TypeScript SDK Conventions safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Opik TypeScript SDK Conventions use?

Opik TypeScript SDK Conventions 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 TypeScript SDK Conventions use?

About 440 tokens (SKILL.md is roughly 1.8k 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 TypeScript SDK Conventions?

Skills that share tags, products or a category with Opik TypeScript SDK Conventions: Failproof AI SDK Integration (FailproofAI/failproofai, 5.3k stars), Langchain Dependencies (langchain-ai/langchain-skills, 1.3k stars), Langsmith Custom Apps (langchain-ai/langsmith-skills, 159 stars) and Phoenix Tracing (github/awesome-copilot, 40k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Opik TypeScript SDK Conventions?

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

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