caliber-testing

Automates creation of Vitest tests with standard __tests__ layout and env isolation.

1.2k|119|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/caliber-ai-org/ai-setup --skill caliber-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: caliber-testing
Source: https://github.com/caliber-ai-org/ai-setup/tree/main/.cursor/skills/caliber-testing
Command: npx skills add https://github.com/caliber-ai-org/ai-setup --skill caliber-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill automates the creation of Vitest tests following project conventions, including tests/ directories, module mocks, global setup, and env var isolation.

Core Features & Use Cases

  • Create test files in tests/ directories next to the code being tested.
  • Enforce a global test setup in src/test/setup.ts and consistent describe/it blocks.
  • Ensure environment variables are saved/restored between tests to maintain isolation.

Quick Start

Ask Caliber to generate Vitest tests in tests/ adjacent to the code, using the global mocks and env-var isolation pattern.

Frequently Asked Questions about caliber-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate Vitest tests that match existing project conventions?

To generate Vitest tests matching project conventions, this skill automates test file creation in the __tests__/ directory next to your code. It enforces standard describe/it blocks, uses vi.mock for module mocking, and maintains environment variable isolation using beforeEach and afterEach blocks.

Can I create Vitest mocks for TypeScript modules at the top of the test file?

Yes, you can create Vitest mocks for TypeScript modules at the top of the test file. This skill enforces using vi.mock for module mocks with top-of-file usage, ensuring consistent mocking patterns across your automated unit tests.

What is the standard directory layout for automated Vitest unit tests?

The standard directory layout for automated Vitest unit tests is placing __tests__/ directories directly alongside the code being tested. This skill enforces this placement pattern in TypeScript or JavaScript projects to maintain consistent test organization.

How do I isolate environment variables between Vitest test cases?

To isolate environment variables between Vitest test cases, this skill uses beforeEach and afterEach blocks to save and restore environment variables. This ensures complete env var isolation and prevents test contamination across your describe/it blocks.

Does this Vitest test generation approach work for TypeScript project refactoring?

Yes, this Vitest test generation approach works for TypeScript project refactoring. The skill enables automated test generation specifically for new features, refactors, or onboarding in TypeScript and JavaScript projects using Vitest.