Index of every page on this site: llms.txt
All skills
comet-ml avatar

/opik-frontend

@9b3d88e
by Cometcomet-ml/opik23k stars
1,964
Run it yourself

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

Use this Skill: https://skilld.dev/gh/comet-ml/opik/opik-frontend

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

testing.md

≈505 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Frontend Testing Patterns

When to Write Tests

ALWAYS Test:

  • Utility functions with multiple scenarios
  • Data processing logic with edge cases
  • Parsing/transformation functions
  • Filter/search logic
  • Business logic with multiple branches

DON'T Test:

  • Simple UI components without logic
  • Third-party library integrations
  • Trivial getters/setters
  • Pure presentational components

Test Structure (AAA Pattern)

import { describe, it, expect } from "vitest";

describe("functionName", () => {
  describe("feature group", () => {
    it("should do something when condition", () => {
      // Arrange
      const input = createTestData();

      // Act
      const result = functionUnderTest(input);

      // Assert
      expect(result).toEqual(expectedOutput);
    });
  });
});

Edge Cases to Test

describe("edge cases", () => {
  it("should handle empty input", () => {
    expect(processData([])).toEqual([]);
  });

  it("should handle null/undefined input", () => {
    expect(processData(null)).toEqual(null);
    expect(processData(undefined)).toEqual(undefined);
  });

  it("should handle large datasets", () => {
    const largeArray = Array(1000).fill().map((_, i) => ({ id: i }));
    expect(processData(largeArray)).toHaveLength(1000);
  });

  it("should handle malformed data", () => {
    expect(() => processData({ invalid: "data" })).toThrowError();
  });
});

Mock Data Pattern

const createMockUser = (overrides = {}) => ({
  id: "user-1",
  name: "John Doe",
  email: "john@example.com",
  role: "admin",
  createdAt: "2024-01-01T00:00:00Z",
  ...overrides,
});

it("should process user data", () => {
  const user = createMockUser({ role: "guest" });
  expect(processUser(user).hasAdminAccess).toBe(false);
});

Running Tests

npm test                    # Run all tests
npm run test:ui             # Watch mode
npm test -- utils.test.ts   # Specific file
npm test -- --coverage      # With coverage

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts8mo4 checks · Risk SAFE
  • Gen Agent Trust Hub8mo

    This skill provides a comprehensive set of architectural guidelines and coding standards for developing the Opik React frontend. It promotes industry-standard best practices, such as using Zod for form validation and TanStack Query for data fetching, and contains no security vulnerabilities or malicious patterns.

  • Socket8mo

    No alerts

  • Snyk8mo

    Risk: LOW · No issues

  • Runlayer8mo

    7 files scanned · No issues

Signed by skilld at 9b3d88e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 4 months ago

README badge

README badge for comet-ml/opik/opik-frontend