Agent skill

Vitest

by Asymmetric-al in Asymmetric-al/core

Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 5 configuration.

AGPL-3.0Auto-check passedTesting & QA

Install Vitest

skills CLI
$ npx skills add Asymmetric-al/core --skill vitest -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Asymmetric-al/core vitest --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Asymmetric-al/core.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/vitest .claude/skills/vitest && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
vitest
GitHub stars
381
Token cost
~1.1k tokens
SKILL.md length
476 words
Files
2 (incl. references)
Skills in repo
43
Repo updated
First seen
Licence
AGPL-3.0

At a glance

Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 5 configuration.

  • Works in 6 steps: Choose the boundary. Test observable… → Place the test in an included path.… → Control the environment. The default is… → …
  • Tests under Cores Vitest include paths
  • SKILL.md covers Authority and test surface, Commands, Workflow and Core-specific guardrails, plus 2 more sections
  • Calls bun and bunx

What it does

Vitest is an agent skill from Asymmetric-al/core. Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 5 configuration. Use for tests under Core's Vitest include paths, vi.mock/spies/timers, jsdom component tests, coverage output, focused reruns, or unit-test failures. Do not use for browser E2E flows or async Next.js Server Components.

Its SKILL.md is about 1.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/upstream.md`).

It sits in Testing & QA, covering Unit testing. It works with Vitest and Next.js. The repository describes itself as: A high-performance, enterprise-grade Next.js 16 application for mission-focused non-profit organizations. Built for high impact teams. The licence is AGPL-3.0.

When your agent uses it

  • Tests under Cores Vitest include paths
  • Vi.mock/spies/timers
  • Jsdom component tests
  • Coverage output

Example prompts

  • “s installed Vitest 5 configuration. Use for tests under Core”
  • “/vitest”

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. Choose the boundary. Test observable behavior at the smallest stable
  2. Place the test in an included path. Match the existing tests/unit,
  3. Control the environment. The default is node. Add
  4. Mock boundaries, not the unit's internals. Remember that vi.mock is
  5. Reset all changed state. clearMocks: true clears call history but does
  6. Run focused, then full. Iterate on the smallest file/name filter and run

What it can do on your machine

Read from SKILL.md and the folder at commit c30c8ff. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • bun
    • bunx

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use bunx, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Vitest loads about 1.1k tokens when it runs, and up to ~1.5k if it reads all its reference files. Until then it costs about 85 tokens; SKILL.md has 476 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~85
When it runs · the whole SKILL.md, loaded when a task matches
~1.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Asymmetric-al/core at commit c30c8ff, republished under its AGPL-3.0 licence (© Asymmetric-al). 476 words, ~1,102 tokens.

Download SKILL.mdSave it as .claude/skills/vitest/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
vitest
description
Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 5 configuration. Use for tests under Core's Vitest include paths, `vi.mock`/spies/timers, jsdom component tests, coverage output, focused reruns, or unit-test failures. Do not use for browser E2E flows or async Next.js Server Components.

Vitest in Core

Use the repository harness as the source of truth. Core currently resolves Vitest 5.0.3 from bun.lock; verify the exact version before relying on a newly introduced API.

Authority and test surface

Read these before changing tests or configuration:

  • vitest.config.ts — include globs, aliases, Node default environment, timeouts, mock clearing, setup, and the custom coverage provider.
  • tests/setup/unit-env.ts — safe env defaults and browser shims.
  • scripts/verify/unit-tests.mjs — the full unit gate and platform behavior.
  • docs/ai/rules/testing.md — repository-wide test and CI policy.
  • .next-docs/01-app/02-guides/testing/vitest.mdx when testing Next.js code.

Do not use bun test; that selects Bun's test runner. Use Vitest through the committed scripts or bunx vitest.

Commands

bash
# Full CI-equivalent unit suite with Core's coverage provider
bun run test:unit

# Focused file or directory while iterating
bunx vitest run tests/unit/path/to/example.test.ts

# Focused test name
bunx vitest run tests/unit/path/to/example.test.ts -t "expected behavior"

# Watch a focused surface
bunx vitest tests/unit/path/to/example.test.ts

# Structured failure report and targeted reruns
bun run test:unit:feedback

Workflow

  1. Choose the boundary. Test observable behavior at the smallest stable public boundary. Prefer pure logic/unit coverage; use Playwright when the claim depends on a real browser, routing, hydration, or an async Server Component.
  2. Place the test in an included path. Match the existing tests/unit, packages/api/tests/unit, or packages/auth conventions from vitest.config.ts; do not invent a disconnected test root.
  3. Control the environment. The default is node. Add // @vitest-environment jsdom only to files that need DOM APIs, and clean up rendered components and mutated globals.
  4. Mock boundaries, not the unit's internals. Remember that vi.mock is hoisted. Use vi.hoisted for shared mock state, dynamic imports when a module must load after mocks, and vi.importActual for intentional partial mocks.
  5. Reset all changed state. clearMocks: true clears call history but does not restore globals, timers, dates, env values, or spy implementations. Undo those changes in hooks.
  6. Run focused, then full. Iterate on the smallest file/name filter and run bun run test:unit before handoff.
Show full SKILL.md (209 more words)Show less

Core-specific guardrails

  • Unit tests must not call live Supabase, Stripe, Resend, Payload, or network services. Use deterministic fakes at repository boundaries.
  • Keep real credentials out of tests. The committed env defaults are placeholders and intentionally clear the Supabase service-role key.
  • Assert behavior and durable contracts, not incidental class strings or implementation order unless that order is itself the contract.
  • Prefer explicit test data builders/helpers over large untyped fixture blobs.
  • Avoid .only; use .skip/.todo only with a documented reason and no hidden loss of required coverage.
  • Core's custom raw V8 coverage provider records script/function information but does not compute line, statement, or branch coverage. Its placeholder totals do not establish coverage quality. Do not claim a threshold the provider does not measure.

Checklist

  • The test exercises an observable contract at the right test layer.
  • The file is inside a configured include path and uses the correct env.
  • Mocks intercept external boundaries and respect Vitest hoisting.
  • Globals, env, timers, dates, spies, DOM, and module state are isolated.
  • Assertions are deterministic and do not depend on network or test order.
  • Focused tests pass, then bun run test:unit passes.
  • Coverage output is described without overstating its current signal.

Provenance

See references/upstream.md for the reviewed upstream source, version compatibility decision, license, and refresh workflow.

© Asymmetric-al, AGPL-3.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in .agents/skills/vitest of Asymmetric-al/core.

  • SKILL.md
  • references/upstream.md

Open the folder on GitHubat commit c30c8ff

Compare with similar skills

Vitest next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Vitest compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Vitest this skillAsymmetric-al/core381—~1.1kAutomated safety check: PassAGPL-3.0
Nextjs TestingHoangNguyen0403/agent-skills-standard572—~768Automated safety check: PassMIT
Nuqs Scaffolderpproenca/dot-skills215—~1.8kAutomated safety check: PassMIT
Turborepo Monorepogiuseppe-trisciuoglio/developer-kit357—~2.3kAutomated safety check: NotesMIT
Test Writing WorkflowiOfficeAI/AionUi33k1 repos~1.2kAutomated safety check: PassApache-2.0
Vitestsupabase/supabase111k12 repos~1.1kAutomated safety check: PassApache-2.0

Similar skills

  • Nextjs Testing

    HoangNguyen0403/agent-skills-standard

    Write Jest or Vitest unit tests with React Testing Library and Playwright E2E tests for Next.js projects.

    572 GitHub stars~768 tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Nuqs Scaffolder

    pproenca/dot-skills

    Scaffolds URL-state filters for a Next.js page — typed searchParams.ts parser map and a <Filters / client component backed by useQueryStates.

    215 GitHub stars~1.8k tokensUpdated 1 mo ago
    Testing & QAAuto-check passed
  • Turborepo Monorepo

    giuseppe-trisciuoglio/developer-kit

    Provides comprehensive Turborepo monorepo management guidance for TypeScript/JavaScript projects.

    357 GitHub stars~2.3k tokensUpdated 1 mo ago
    DevelopmentAuto-check: notes
  • Test Writing Workflow

    iOfficeAI/AionUi

    Sets the test-writing workflow for the repository: risk-first scenario lists, behavior-focused Vitest tests, a full run before each commit and a coverage target.

    33k GitHub starsUsed in 1 repo~1.2k tokens
    Testing & QAAuto-check passed
  • Vitest

    supabase/supabase

    Official

    Vitest API and config reference (Jest-compatible) — mocking with vi., spies, fake timers, coverage configuration, fixtures, snapshots, and test filtering.

    111k GitHub starsUsed in 12 repos~1.1k tokens
    Testing & QAAuto-check passed
  • Test Guard

    amElnagdy/guard-skills

    Reviews newly written or edited tests against nine rules that cut test bloat, such as mock-heavy checks and near-duplicate cases, before they are committed.

    1.3k GitHub starsUsed in 2 repos~2.1k tokens
    Testing & QAAuto-check passed

More from Asymmetric-al/core

All 43 skills in this repo
  • Idempotency Handling

    Asymmetric-al/core

    Implement idempotency keys and handling to ensure operations can be safely retried without duplicate effects.

    381 GitHub stars~867 tokensUpdated today
    Auto-check passed
  • Accessibility Review

    Asymmetric-al/core

    Audit and fix accessibility in Core UI. An agent skill from Asymmetric-al/core.

    381 GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Email Inbox

    Asymmetric-al/core

    A skill your agent uses when building any system where email content triggers actions — AI agent inboxes, automated support handlers, email-to-task pipelines, or any workflow processing untrusted…

    381 GitHub stars~4.1k tokensUpdated today
    Auto-check: notes
  • Components Build

    Asymmetric-al/core

    Build modern, composable, and accessible React UI components following the components.build specification.

    381 GitHub stars~2.1k tokensUpdated today
    Auto-check passed
  • Create Agent

    Asymmetric-al/core

    Guides a one-question-at-a-time design interview, captures alignment in agent/EVE-BRIEF.md, then scaffolds and implements a runnable eve agent with verbose teaching comments.

    381 GitHub stars~2.6k tokensUpdated today
    Auto-check: notes
  • Emil Design Engineering

    Asymmetric-al/core

    Design engineering principles and patterns for building polished, accessible web interfaces.

    381 GitHub stars~1.4k tokensUpdated today
    Auto-check passed

Works with

Categories

Questions about Vitest

What does Vitest do?

Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 5 configuration. Vitest is an agent skill from Asymmetric-al/core. Write, review, filter, mock, and debug Core unit tests with the repository's installed Vitest 5 configuration.

When should I use Vitest?

Vitest fits situations like: tests under Cores Vitest include paths; vi.mock/spies/timers; jsdom component tests; coverage output.

How do I install Vitest in Claude Code?

Run `npx skills add Asymmetric-al/core --skill vitest -a claude-code`. Or copy the skill folder (.agents/skills/vitest in Asymmetric-al/core) into .claude/skills/vitest in your project. Claude Code loads it when a task matches its description.

How do I install Vitest in Codex?

Run `npx skills add Asymmetric-al/core --skill vitest -a codex`. Or copy the skill folder (.agents/skills/vitest in Asymmetric-al/core) into .agents/skills/vitest in your project. Codex loads it when a task matches its description.

Can I use Vitest in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Asymmetric-al/core --skill vitest -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/vitest, .gemini/skills/vitest, .github/skills/vitest and .opencode/skills/vitest in your project.

What does Vitest need to run?

Going by SKILL.md and its folder, Vitest needs the command-line tools its instructions call (bun and bunx).

Does Vitest access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Vitest safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Vitest use?

Vitest is published under the AGPL-3.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Vitest use?

About 1.1k tokens (SKILL.md is roughly 4.4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 437 tokens, read only when the agent opens those files.

What are the alternatives to Vitest?

Skills that share tags, products or a category with Vitest: Nextjs Testing (HoangNguyen0403/agent-skills-standard, 572 stars), Nuqs Scaffolder (pproenca/dot-skills, 215 stars), Turborepo Monorepo (giuseppe-trisciuoglio/developer-kit, 357 stars) and Test Writing Workflow (iOfficeAI/AionUi, 33k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Vitest?

Asymmetric-al (a GitHub organization) maintains it in Asymmetric-al/core, which has 381 GitHub stars. The repository holds 43 skills in this directory. The repository was last updated on October 9, 2026.

Source: Asymmetric-al/core on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.