caliber-testing

caliber-testing is a skill for Claude Code, Codex from caliber-ai-org/ai-setup. It costs 0 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

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is vi.mock('../config.js', () => ({.

Good fit 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.

Compare 6 skills from other repositories ↓
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,309 stars · on GitHub · trycaliber.ai

Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

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

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/github.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/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for caliber-testing

Your own site · 80×15
<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="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 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. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.1 $0.00000 $0.03248
Opus 5.5 $0.00000 $0.01299
Sonnet 5.5 $0.00000 $0.00650
Haiku 4.5 $0.00000 $0.00325

Measured 1mo ago against content hash 8cdd36e800d8, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, 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 1mo 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. 1mo 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,309 stars, last pushed 27d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,248 tokens. 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

ralphctl-debugging-and-error-recovery

Systematic root-cause debugging. Use when tests fail, builds break, something that worked before broke, or behaviour does not match expectations — when you need to figure out what broke and why. Follow stop-the-line → reproduce → localize → reduce → root-cause → guard-with-regression-test → verify, not guessing; the…

lukas-grigis/ralphctl · 95 tokens

test-writer

Write thorough, meaningful tests for any function, module, or API. Use when user asks to add tests, improve coverage, or ensure a piece of code is tested before shipping.

chandrudp29/skillhub · 40 tokens

javascript-testing-patterns

Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use when writing JavaScript/TypeScript tests, setting up test infrastructure, or implementing TDD/BDD workflows.

ValorVie/custom-skills · 63 tokens

generate-tests

Generate comprehensive tests for a file or function.

SpaceMalamute/ai-rules · 11 tokens

tdd-workflow

Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.

affaan-m/ECC · 43 tokens

rust-testing

Rust testing patterns including unit tests, integration tests, async testing, property-based testing, mocking, and coverage. Follows TDD methodology.

affaan-m/ECC · 31 tokens