Smithery Logo
MCPsSkillsDocsPricing
Login
Smithery Logo

Accelerating the Agent Economy

Resources

DocumentationPrivacy PolicySystem Status

Company

PricingAboutBlog

Connect

© 2026 Smithery. All rights reserved.

    comet-ml

    opik-frontend

    comet-ml/opik-frontend
    Coding
    17,703
    6 installs

    About

    SKILL.md

    Install

    Install via Skills CLI

    or add to your agent
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    ├─
    ├─
    └─

    About

    React frontend patterns for Opik. Use when working in apps/opik-frontend, on components, state, or data fetching.

    SKILL.md

    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

    // ❌ BAD
    useEffect(() => {
      fetch('/api/data').then(setData);
    }, []);
    
    // ✅ GOOD
    const { data } = useQuery({
      queryKey: ['data'],
      queryFn: fetchData,
    });
    

    Selective Memoization

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

    // ✅ GOOD - specific selector
    const selectedEntity = useEntityStore(state => state.selectedEntity);
    
    // ❌ BAD - selecting entire store causes re-renders
    const { selectedEntity, filters } = useEntityStore();
    

    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

    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

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

    • forms.md - React Hook Form + Zod patterns
    • ui-components.md - Button variants, typography, dark theme
    • responsive-design.md - Tailwind breakpoints vs useIsPhone
    • testing.md - When to test, Vitest patterns
    • code-quality.md - Lodash imports, naming, deps:validate
    • performance.md - Bundle optimization, rendering, memoization
    • permissions.md - usePermissions() guard guidance for UI actions
    Recommended Servers
    Docfork
    Docfork
    OpenZeppelin
    OpenZeppelin
    Nimble MCP Server
    Nimble MCP Server
    Repository
    comet-ml/opik
    Files