Build, update, test, and document Opik SDK integrations (Python & TypeScript). Use when adding a new framework/provider integration under sdks/python/src/opik/integrations or sdks/typescript/src/opik/integrations, updating an existing one, or verifying that an integration logs traces correctly.
72
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
This skill is for building integrations into the Opik SDK itself — the code that ships inside opik / opik-* packages so that users can trace a framework (OpenAI, LangChain, Mistral, …) with one call.
Do not confuse this with the user-facing
instrument/opikskills, which add Opik tracing to someone else's application. This skill is for SDK contributors editingsdks/pythonandsdks/typescript.If the integration lives outside this repo — a standalone
opik-*package, or Opik support contributed into a third-party project (LiteLLM, Dify, a plugin, …) — use theopik-external-integrationsskill instead. This skill assumes the code ships insidesdks/.
Never assume or suggest a target. Collect, from the user, before doing anything: what to integrate (name + reference links), where it lives (this repo vs. external — route external requests to opik-external-integrations), language (python/typescript/both), mode (new/update/maintain), and any specific flows to cover. Do not present a menu of candidate libraries — the user names the target.
Integration work is multi-step. By default this skill runs autonomously: it makes its own preparations (deps, credentials, backend), runs every phase, self-verifies, and ends with a high-level report — only stopping early on a true blocker. Ask for the interactive variant if you want to approve the design before any code is written. The full playbook — phases, execution modes, the Opik-MCP verification loop, and the report template — lives in workflow.md. At a glance:
read/list the trace & spans).Never build an integration from a blank file. Identify the existing integration that shares the target's mechanism, copy its structure, and adapt. The decision tree:
| Target shape | Python pattern | TS pattern | Clone from |
|---|---|---|---|
| SDK client with methods to wrap (most providers) | Method patching (BaseTrackDecorator subclass) | Proxy wrapper | openai/ · opik-openai |
| Framework with a callback/tracer interface | Pure callback (BaseTracer) | Callback handler | langchain/ · opik-langchain |
| Framework already emitting OpenTelemetry spans | OTel | OTel exporter | otel/ · opik-vercel |
| Callbacks exist but are unreliable / need method hooks too | Hybrid | (rare) | adk/ |
If the target exposes an OpenAI-compatible endpoint, first check whether track_openai(..., provider=...) already covers the need before building a dedicated integration — sometimes the right answer is a docs page, not new code.
OpenTelemetry is backend-first. If the target already emits OpenTelemetry spans, the heavy lifting is done by Opik's OTLP ingestion endpoint on the backend — many such integrations are docs-only (point the framework's OTLP exporter at Opik with auth headers; no SDK code). Build a client-side piece only when you must shape what the backend receives — set Opik semantics, remap attributes, or bridge a framework that won't export raw OTLP. The client-side building block is a SpanProcessor in Python (integrations/otel/) or a SpanExporter in TypeScript (opik-vercel); a framework-specific OTel tracer wrapper (adk/patchers/adk_otel_tracer/) is the heavier variant. See the OTel sections in python.md / typescript.md.
sdks/typescript/design/INTEGRATIONS.md.python-sdk — three-layer architecture, batching, fake_backend, testlib verifiers, error handling.typescript-sdk — layered client, flush semantics, testing with vitest.write-docs — Fern MDX authoring, routing YAML, callouts, images.aae4650
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.