Agent skill

Opik Frontend Patterns

by comet-ml in comet-ml/opik

Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.

Apache-2.0Auto-check passedFrontend & Design

Install Opik Frontend Patterns

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

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

GitHub CLI
$ gh skill install comet-ml/opik opik-frontend --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/opik-frontend .claude/skills/opik-frontend && 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-frontend
GitHub stars
22k
Token cost
~1.1k tokens
SKILL.md length
260 words
Files
8
Skills in repo
19
Repo updated
First seen
Licence
Apache-2.0

At a glance

Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes.

  • Adding a component, page or form to the Opik frontend
  • SKILL.md covers Architecture Decisions, Critical Gotchas, Layer Architecture and State Location Decisions, plus 3 more sections
  • Calls npm; needs ENTITY_KEY
  • Deciding where state should live: URL, Zustand or React state

What it does

The skill records the stack decisions for apps/opik-frontend: file-based TanStack Router, TanStack Query for all data fetching instead of raw fetch inside useEffect, Zustand for global state with React state for local, shadcn/ui on Radix UI for components, and React Hook Form with Zod for forms. It adds guidance on selective memoization and on writing specific Zustand selectors.

A layer architecture keeps imports one-way from ui through shared to the per-version pages, forbids v1 and v2 code from importing each other, and requires shared components to stay backward compatible and not version-aware; npm run deps:validate checks imports afterward. A gotcha section explains that browser auto-translation can crash React when it reconciles bare dynamic text, and says to wrap such text in its own element. Extra files cover code quality, forms, performance, permissions, responsive design, testing and UI components.

When your agent uses it

  • Adding a component, page or form to the Opik frontend
  • Deciding where state should live: URL, Zustand or React state
  • Fixing a removeChild error that appears when users translate the page

Example prompts

  • “Add a filtered table to the Opik traces page using TanStack Query.”
  • “Where should the selected project live: the URL, Zustand or local state?”
  • “A user with Google Translate gets a removeChild error on this button. Fix it the Opik way.”

Requirements

  • A checkout of the Opik repository's frontend app

What it can do on your machine

Read from SKILL.md and the folder at commit 8e3f6e5. 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

    Shell commands in SKILL.md call:

    • npm

    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):

    • github.com

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

  • Credentials

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

    • ENTITY_KEY

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

Context cost

Opik Frontend Patterns loads about 1.1k tokens when it runs. Until then it costs about 32 tokens; SKILL.md has 260 words of instructions outside code blocks.

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

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 8e3f6e5, republished under its Apache-2.0 licence (© comet-ml). 260 words, ~1,061 tokens.

Download SKILL.mdSave it as .claude/skills/opik-frontend/SKILL.md (or your agent's skills folder). This skill also uses 7 other files; get the full folder from GitHub.
name
opik-frontend
description
React frontend patterns for Opik. Use when working in apps/opik-frontend, on components, state, or data fetching.

Opik Frontend

Architecture Decisions

  • Routing: TanStack Router (file-based)
  • Data fetching: TanStack Query (never raw fetch/useEffect)
  • State: Zustand for global, React state for local
  • Components: shadcn/ui + Radix UI base
  • Forms: React Hook Form + Zod validation

Critical Gotchas

Never useEffect for Data Fetching
typescript
// ❌ BAD
useEffect(() => {
  fetch('/api/data').then(setData);
}, []);

// ✅ GOOD
const { data } = useQuery({
  queryKey: ['data'],
  queryFn: fetchData,
});
Selective Memoization
typescript
// ✅ USE useMemo for: complex computations, large data transforms
const filtered = useMemo(() =>
  data.filter(x => x.status === 'active').map(transform),
  [data]
);

// ✅ USE useCallback for: functions passed to children
const handleClick = useCallback(() => doSomething(id), [id]);

// ❌ DON'T memoize: simple values, primitives, local functions
const name = data?.name ?? '';  // No useMemo needed
Zustand Selectors
typescript
// ✅ GOOD - specific selector
const selectedEntity = useEntityStore(state => state.selectedEntity);

// ❌ BAD - selecting entire store causes re-renders
const { selectedEntity, filters } = useEntityStore();
Browser Translation Safety (Google Translate)

Many users auto-translate the page; the translator wraps text nodes in <font> elements, so React throws NotFoundError: removeChild when it reconciles a bare dynamic text node it re-parented. Wrap dynamic/conditional strings in their own element instead of rendering bare text.

typescript
// ❌ bare dynamic text → crash under translation
<button>{icon}{label}</button>
// ✅ wrap it → React swaps a stable element, stays translatable
<button>{icon}<span>{label}</span></button>

For timer-driven text (typewriter/counter), also avoid per-tick setState — write into a ref'd node's textContent (React never reconciles it), or mark a decorative node translate="no". Ref: facebook/react#11538 (OPIK-7428, OPIK-7435).

Layer Architecture

Shared layers (used by all versions)

ui → shared (one-way only)

Per-version layers

ui → shared → v1/pages-shared → v1/pages (one-way only) ui → shared → v2/pages-shared → v2/pages (one-way only)

Module boundaries
  • v1/ CANNOT import from v2/
  • v2/ CANNOT import from v1/
  • src/components/ is BLOCKED (old structure, no longer exists)
  • After modifying imports: npm run deps:validate
Shared component rules
  • Backward-compatible changes only
  • Must not be version-aware (use showProjectSelector={true} not isV2={true})
  • If behavior needs to change, create a new component instead

State Location Decisions

  • URL state: filters, pagination, selected items
  • Zustand: user preferences, cross-component state
  • React state: form inputs, UI toggles

Component Structure

typescript
const Component: React.FC<Props> = ({ prop }) => {
  // 1. State hooks
  // 2. Queries/mutations
  // 3. Memoization (only when needed)
  // 4. Event handlers

  if (isLoading) return <Loader />;
  if (error) return <ErrorComponent />;

  return <div>...</div>;
};

Query Patterns

typescript
// Query with params
const { data } = useQuery({
  queryKey: [ENTITY_KEY, params],
  queryFn: (context) => fetchEntity(context, params),
});

// Mutation with invalidation
const mutation = useMutation({
  mutationFn: updateEntity,
  onSuccess: () => {
    queryClient.invalidateQueries({ queryKey: [ENTITY_KEY] });
  },
});

Reference Files

© 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 7 other files in .agents/skills/opik-frontend of comet-ml/opik.

  • SKILL.md
  • code-quality.md
  • forms.md
  • performance.md
  • permissions.md
  • responsive-design.md
  • testing.md
  • ui-components.md

Open the folder on GitHubat commit 8e3f6e5

Compare with similar skills

Opik Frontend Patterns 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 Frontend Patterns compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Opik Frontend Patterns this skillcomet-ml/opik22k—~1.1kAutomated safety check: PassApache-2.0
Buzzformbuildnbuzz/buzzform101—~1.5kAutomated safety check: PassMIT
Frontend UI Patternsbiersoeckli/QuickStack362—~704Automated safety check: PassGPL-3.0
Frontend Patterns Templatebybren-llc/safe-agentic-workflow421—~2kAutomated safety check: PassMIT
React ExpertJeffallan/claude-skills12k—~1.4kAutomated safety check: PassMIT
React TypescriptMadAppGang/claude-code284—~4.1kAutomated safety check: PassMIT

Similar skills

  • Buzzform

    buildnbuzz/buzzform

    A skill your agent uses when working with BuzzForm schema-driven forms, @buildnbuzz/form-core, @buildnbuzz/form-react, or any related APIs like defineSchema, InferType, FormProvider, useDataField…

    101 GitHub stars~1.5k tokensUpdated 4 mo ago
    Frontend & DesignAuto-check passed
  • Frontend UI Patterns

    biersoeckli/QuickStack

    Create and update QuickStack frontend pages, React components, forms, dialogs, tables, streaming UI, and Zustand-backed state using the project's established UI conventions.

    362 GitHub stars~704 tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Frontend Patterns Template

    bybren-llc/safe-agentic-workflow

    Frontend patterns for modern web frameworks, component libraries, auth flows, and analytics. Use when building UI components, creating pages, implementing…

    421 GitHub stars~2k tokensUpdated 2 mo ago
    Frontend & DesignAuto-check passed
  • React Expert

    Jeffallan/claude-skills

    Builds React 19 components in TypeScript with Server Components, useActionState forms, custom hooks and state libraries, checked with tsc and React Testing Library.

    12k GitHub stars~1.4k tokensUpdated 5 days ago
    Frontend & DesignAuto-check passed
  • React Typescript

    MadAppGang/claude-code

    Modern React 19+ patterns with TypeScript including function components, hooks, state management, TanStack Query integration, form handling with Zod, error boundaries, and performance optimization.

    284 GitHub stars~4.1k tokensUpdated 6 mo ago
    Frontend & DesignAuto-check passed
  • Web Artifacts Builder

    anthropics/skills

    Official

    Builds multi-component claude.ai HTML artifacts as a small React, TypeScript and Tailwind project, then bundles it into one shareable HTML file.

    180k GitHub starsUsed in 41 repos~769 tokens
    Frontend & DesignAuto-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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    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 yesterday
    Auto-check passed

Questions about Opik Frontend Patterns

What does Opik Frontend Patterns do?

Sets the conventions for the Opik React frontend: TanStack Query for data, Zustand for shared state, one-way layer imports and a fix for Google Translate crashes. The skill records the stack decisions for apps/opik-frontend: file-based TanStack Router, TanStack Query for all data fetching instead of raw fetch inside useEffect, Zustand for global state with React state for local, shadcn/ui on Radix UI for components, and React Hook Form with Zod for forms. It adds guidance on selective memoization and on writing specific Zustand selectors.

When should I use Opik Frontend Patterns?

Opik Frontend Patterns fits situations like: adding a component, page or form to the Opik frontend; deciding where state should live: URL, Zustand or React state; fixing a removeChild error that appears when users translate the page.

How do I install Opik Frontend Patterns in Claude Code?

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

How do I install Opik Frontend Patterns in Codex?

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

Can I use Opik Frontend Patterns 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 opik-frontend -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-frontend, .gemini/skills/opik-frontend, .github/skills/opik-frontend and .opencode/skills/opik-frontend in your project.

What does Opik Frontend Patterns need to run?

Going by SKILL.md and its folder, Opik Frontend Patterns needs the command-line tools its instructions call (npm) and credentials named ENTITY_KEY. Our summary lists: A checkout of the Opik repository's frontend app.

Does Opik Frontend Patterns access the network?

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

Is Opik Frontend Patterns 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 Frontend Patterns use?

Opik Frontend Patterns 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 Frontend Patterns use?

About 1.1k tokens (SKILL.md is roughly 4.2k 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 Frontend Patterns?

Skills that share tags, products or a category with Opik Frontend Patterns: Buzzform (buildnbuzz/buzzform, 101 stars), Frontend UI Patterns (biersoeckli/QuickStack, 362 stars), Frontend Patterns Template (bybren-llc/safe-agentic-workflow, 421 stars) and React Expert (Jeffallan/claude-skills, 12k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Opik Frontend Patterns?

comet-ml (a GitHub organization) maintains it in comet-ml/opik, which has 22,443 GitHub stars. The repository holds 19 skills in this directory. The repository was last updated on October 8, 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.