TY

typescript-sdk

Provides best practices and architectural patterns for using the Opik TypeScript SDK for AI observability.

Install

mkdir -p .claude/skills/typescript-sdk && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/2146" && unzip -o skill.zip -d .claude/skills/typescript-sdk && rm skill.zip

Installs to .claude/skills/typescript-sdk

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

TypeScript SDK patterns for Opik. Use when working in sdks/typescript.
70 chars✓ has a “when” trigger
Intermediate

Key capabilities

  • Define SDK architecture with layered, non-blocking design
  • Buffer and flush data asynchronously to a backend
  • Ensure data is flushed before process exit
  • Prevent direct HTTP calls from domain objects
  • Handle HTTP and domain-specific errors

How it works

The skill outlines the TypeScript SDK architecture for Opik, detailing how public API calls flow through domain objects, batch queues, and a REST client to the backend, with specific patterns for flushing data and handling errors.

Inputs & outputs

You give it
Public API calls, trace/span updates, configuration settings
You get back
Buffered data, flushed data, error messages, updated traces/spans

When to use typescript-sdk

  • Instrumenting AI application traces
  • Configuring telemetry batching
  • Ensuring data is flushed before process exit
  • Handling SDK error states

About this skill

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

// ✅ REQUIRED - especially in CLI/tests
await client.flush();
// or globally:
await flushAll();

Domain Objects Don't Do HTTP

// ✅ 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

// ✅ 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

Prerequisites

Node.js >= 18

How it compares

This skill defines a specific SDK architecture with non-blocking batch queuing and explicit flush-before-exit mechanisms, contrasting with generic API client implementations.

Compared to similar skills

typescript-sdk side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
typescript-sdk (this skill)25moNo flagsIntermediate
turborepo612moReviewIntermediate
codex-skill125moReviewAdvanced
run-nx-generator53moReviewIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

turborepo

vercel

Turborepo monorepo build system guidance. Triggers on: turbo.json, task pipelines, dependsOn, caching, remote cache, the "turbo" CLI, --filter, --affected, CI optimization, environment variables, internal packages, monorepo structure/best practices, and boundaries. Use when user: configures tasks/workflows/pipelines, creates packages, sets up monorepo, shares code between apps, runs changed/affected packages, debugs cache, or has apps/packages directories.

61191

codex-skill

feiskyer

Use when user asks to leverage codex, gpt-5, or gpt-5.1 to implement something (usually implement a plan or feature designed by Claude). Provides non-interactive automation mode for hands-off task execution without approval prompts.

12110

run-nx-generator

nrwl

Run Nx generators with prioritization for workspace-plugin generators. Use this when generating code, scaffolding new features, or automating repetitive tasks in the monorepo.

571

zod-4

prowler-cloud

Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.

1260

copilot-sdk

github

Build agentic applications with GitHub Copilot SDK. Use when embedding AI agents in apps, creating custom tools, implementing streaming responses, managing sessions, connecting to MCP servers, or creating custom agents. Triggers on Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server, custom agent.

763

effect-ts-expert

ojowwalker77

This skill should be used when the user is working with Effect-TS, asks to "write Effect code", "use Effect", "functional TypeScript", "handle errors with Effect", "dependency injection Effect", "Effect Layer", or needs expert-level guidance on Effect-TS patterns, error handling, concurrency, and best practices.

744

Search skills

Search the agent skills registry