Skills Explorer Add Skills

vitest

An agent skill by antfu, from antfu/skills. Tags: cli, debugging, javascript, testing, validation.

What it does

Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.

Install

With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:

npx skills add antfu/skills --skill vitest

Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):

git clone --depth 1 https://github.com/antfu/skills
cp -r skills/skills/vitest ~/.claude/skills/vitest

Safety box score

Grade C, moderate risk: 26 of 100 risk points, rated 2026-10-23. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.

This skill is documentation for Vitest, a test runner. It mainly grants the ability to run project tests and benchmarks, update snapshots and report artifacts, and optionally drive browser-based tests. The main risks are executing repository code, modifying test/source files via snapshot updates, and reaching out to browsers or env-backed test data.

Category levels, from 0 (none) to 3 (high)
CategoryLevelWhy
Code & shell execution2 (moderate)It explicitly invokes the project’s test runner and benchmarks (`vitest run`, `vitest bench`), which execute repository code under the agent’s permissions.
Network access1 (low)The docs include browser mode/Playwright setup and package-install examples (`provider: playwright(...)`, `npm i -D jsdom`), so using the skill can involve external network access, but it does not itself fetch remote code.
Filesystem reach2 (moderate)Vitest can rewrite snapshots and inline snapshots in source files (`vitest -u`, `toMatchInlineSnapshot`) and writes artifacts such as `.vitest/json/output.json` and `.vitest/junit/output.xml`.
Secrets & credentials1 (low)The examples and APIs work with environment variables (`process.env.CI`, `vi.stubEnv('API_KEY', ...)`), so test code may read secret-bearing env values if they exist.
Privilege & persistence0 (none)There is no sudo, service registration, shell startup editing, or other privilege escalation in the shipped files.
Instruction hijack surface0 (none)I found no prompt-injection style instructions to ignore safeguards, hide actions, or follow remote instructions.
Irreversible actions1 (low)The skill can automate test execution, sharding, report merging, and browser-driven test flows, but it does not by itself post, deploy, pay, or delete anything outside testing.
Transparency0 (none)All shipped content is plain markdown documentation; there are no binaries, hidden blobs, or decoded-at-runtime scripts.

Before installing

Rated 2026-10-23 by an automated review of 21 files from the skill's repository.

Source

Repository
antfu/skills (all skills from this repository)
Path
skills/vitest/SKILL.md
Branch
main
Updated
2026-09-22