caliber-testing

caliber-testing is a skill for Claude Code, Codex from caliber-ai-org/ai-setup. It costs 113 tokens per session (3,248 once invoked), scanned A, original, MIT.

Testing instructions for projects that use Vitest, a JavaScript and TypeScript test runner. They describe where tests go, how mocks and environment variables are handled, and how tests are checked before committing.

In plain words
What is it for?
Use them when writing or updating Vitest tests, especially tests involving mocked modules, environment variables, temporary files, or a shared language-model mock. They cover running the test suite and coverage checks.
Why use it?
They reduce inconsistent test structure and common cleanup or mocking mistakes. They also make coverage and local verification requirements explicit.

Skill for Claude CodeCodex

About the project

Caliber is a tool that generates and continuously updates AI context and configuration files for software repositories, including CLAUDE.md, AGENTS.md, and platform-specific rules. Development teams use it to keep coding agents aligned with the current codebase across tools such as Claude Code, Cursor, Codex, OpenCode, and GitHub Copilot. Its catalogue entries include skills, hooks, rules, instructions, and settings for configuring that workflow.

caliber-ai-org/ai-setup · 1,259 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/caliber-ai-org/ai-setup/caliber-testing
Any agent
npx skills add caliber-ai-org/ai-setup --skill caliber-testing
Clone the repo
git clone --depth 1 https://github.com/caliber-ai-org/ai-setup

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for caliber-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/caliber-ai-org/ai-setup/caliber-testing.svg)](https://agentmods.dev/skills/caliber-ai-org/ai-setup/caliber-testing)
Your own site
<a href="https://agentmods.dev/skills/caliber-ai-org/ai-setup/caliber-testing"><img src="https://agentmods.dev/badge/skills/caliber-ai-org/ai-setup/caliber-testing.svg" alt="Measured on agentmods" height="20"></a>
Per session 113 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,248 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00113 $0.03248
Opus 5 $0.00056 $0.01624
Sonnet 5 $0.00023 $0.00650
Haiku 4.5 $0.00011 $0.00325

Measured 5d ago against content hash 8cdd36e800d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

caliber-testing scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Exec: `import { execSync } from 'child_process';`
.agents/skills/caliber-testing/SKILL.md · 368 lines

How it starts

The opening of the file, as written. The whole thing — 368 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Caliber Testing

Critical

  • All test files MUST be placed in __tests__/ directories parallel to source files: src/[module]/__tests__/[module].test.ts
  • Register any new __tests__/ directories in vitest.config.ts's include glob (already configured: src/**/*.test.ts)
  • NEVER mock src/test/setup.ts — it is the global LLM provider mock already applied to all tests
  • Environment variable tests MUST save process.env in beforeEach, restore in afterEach, and explicitly delete env vars to test absence
  • Temporary file/directory cleanup MUST happen in afterEach, not in individual test cleanup. Use fs.rmSync(dir, { recursive: true, force: true })
  • When a test requires unmocking modules mocked in global setup, call vi.unmock('../module.js') BEFORE the import statement
  • Run pnpm test locally and pnpm test:coverage before committing to verify coverage thresholds (lines: 50, functions: 50, branches: 50, statements: 50)

Instructions

Step 1: Create the test file in the correct directory

Create src/[module]/__tests__/[module].test.ts. The parent source file is src/[module]/[module].ts.

Verify: The __tests__ directory exists at the same level as the source file being tested.

Step 2: Import test framework

At the top of every test file, import from vitest:

import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';

Add additional imports based on what you're testing:

  • File system: import fs from 'fs'; import path from 'path'; import os from 'os';
  • Temporary files: Use fs.mkdtempSync(path.join(os.tmpdir(), 'caliber-prefix-'))
  • Exec: import { execSync } from 'child_process';

Verify: All required test utilities are imported before test definitions.

Step 3: Set up module mocking (if needed)

If testing a module that imports other modules you want to mock:

vi.mock('../config.js', () => ({
  loadConfig: vi.fn(),
  writeConfigFile: vi.fn(),
}));

For complex mocks with test-time factory functions (hoisted):

const { mockLoadConfig } = vi.hoisted(() => ({
  mockLoadConfig: vi.fn(),
}));

vi.mock('../config.js', () => ({
  loadConfig: () => mockLoadConfig(),
}));

Read the full file on GitHub · 368 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 368 lines · 0 tokens per session scan A 8cdd36e800d8

Subscribe to this mod's changes

caliber-testing is a skill published in the GitHub repository caliber-ai-org/ai-setup (1,259 stars, last pushed 1mo ago), licensed MIT. It adds 113 tokens to every session and 3,248 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

run-helix-tests

Submit and monitor .NET MAUI unit tests on Helix infrastructure. Supports running XAML, Resizetizer, Core, Essentials, and other unit test projects on distributed Helix queues.

dotnet/maui · 45 tokens

migrate-xunit-to-xunit-v3

Migrate .NET test projects from xUnit.net v2 to xunit.v3 and fix v3 breaks. Use for package/CPM conversion, OutputType=Exe, preserving the VSTest or MTP runner (including projects currently using YTest.MTP.XUnit2), incompatible TFMs, async void tests, string-to-Type attributes, custom Fact/Theory/BeforeAfterTest…

dotnet/skills · 149 tokens

bridge

Use when the user wants hyperflow's behavioral rules to apply outside the terminal CLI — in Claude Code Desktop, claude.ai web, or IDE extensions that don't load CLI plugins. Writes a managed doctrine block into the project's CLAUDE.md so autonomy + intent-routing + commit cadence + role separation + file-first rules…

jeremylongshore/tons-of-skills-marketplace · 126 tokens

nunit-testing

Use when writing or modifying tests in NUnit's own test projects, or when making a behavioral change to production code that needs test coverage. Covers test structure, attribute choice, helper visibility, platform guards, and which test projects are real.

nunit/nunit · 51 tokens

go-testing

Trigger: Go tests, go test coverage, Bubbletea teatest, golden files. Apply focused Go testing patterns.

Gentleman-Programming/gentle-ai · 26 tokens

add-go-test

Write or extend Go unit tests in this repo. Use when the user asks to add or update Go tests.

authgear/authgear-server · 26 tokens