OpenParable
Skip to content
← Back to skills

Bench

Testing & Quality
bench

Bench is an Agent Skill for testing & quality published in the majiayu000/claude-skill-registry repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Generate mitata benchmark files following project conventions

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/majiayu000/claude-skill-registry/blob/HEAD/skills/data/bench/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/bench, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Generate Benchmark

Generate a mitata benchmark file for the {{ category }} category.

Project Conventions

This project uses mitata for benchmarking. Follow the patterns in bench/.

Setup Import

Always import the shared setup:

import { run, bench, group, baseline } from "mitata";
import {
  Decimal,
  decimalJs,
  bigJs,
  bignumberJs,
  dineroAmount,
} from "./setup";

Benchmark Structure

// Group related benchmarks
group("{{ category }} - operation name", () => {
  // Always include baseline (usually Decimal or native)
  baseline("Centimal", () => {
    // benchmark code
  });

  // Compare against other libraries
  bench("decimal.js", () => {
    // equivalent operation
  });

  bench("big.js", () => {
    // equivalent operation
  });

  bench("bignumber.js", () => {
    // equivalent operation
  });
});

// Run all benchmarks
await run();

Example Pattern (from arithmetic.bench.ts)

group("addition - small numbers", () => {
  baseline("Centimal", () => {
    Decimal.from("123.45").add(Decimal.from("67.89"));
  });

  bench("decimal.js", () => {
    decimalJs("123.45").plus("67.89");
  });

  bench("big.js", () => {
    bigJs("123.45").plus("67.89");
  });

  bench("bignumber.js", () => {
    bignumberJs("123.45").plus("67.89");
  });
});

Test Data Recommendations

CategoryTest Cases
ArithmeticSmall numbers, large numbers, high precision
ParsingIntegers, decimals, scientific notation, edge cases
ComparisonEqual, not equal, less than, greater than
PercentageSmall %, large %, fractional %
Allocation2-way split, 3-way split, uneven ratios

Output Location

Create: bench/{{ category }}.bench.ts

Your Task

  1. Read existing benchmarks in bench/ to understand patterns
  2. Read bench/setup.ts to understand available test fixtures
  3. Create bench/{{ category }}.bench.ts with comprehensive benchmarks
  4. Ensure the new file is imported in bench/run.ts if needed