vitest

vitest is a skill for Claude Code from sentimony/skills. It costs 66 tokens per session (4,437 once invoked), scanned B, original, MIT.

A required guide for Vitest, a JavaScript and TypeScript test runner commonly used with projects such as Vite, Vue, React, and Node.js.

In plain words
What is it for?
Use it for Vitest tests, mocks, snapshots, coverage, flaky tests, workspaces, and checking whether local tests match continuous integration.
Why use it?
It provides task-specific support for setting up, writing, debugging, running, migrating, or auditing tests, including Jest migrations and CI differences.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the skills plugin — 9 skills shipped together

Good fit Use it for Vitest tests, mocks, snapshots, coverage, flaky tests, workspaces, and checking whether local tests match continuous integration.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/sentimony/skills/vitest
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.

Any agent
npx skills add sentimony/skills --skill vitest
Clone the repo
git clone --depth 1 https://github.com/sentimony/skills

Made for: Claude Code.

Or install skills, the plugin that ships this one along with the rest of its 9 skills.

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 vitest

README.md
[![agentmods](https://agentmods.dev/badge/skills/sentimony/skills/vitest/github.svg)](https://agentmods.dev/skills/sentimony/skills/vitest)
Your own site
<a href="https://agentmods.dev/skills/sentimony/skills/vitest"><img src="https://agentmods.dev/badge/skills/sentimony/skills/vitest/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 vitest

Your own site · 80×15
<a href="https://agentmods.dev/skills/sentimony/skills/vitest"><img src="https://agentmods.dev/badge/skills/sentimony/skills/vitest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 66 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 4,437 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • Socket pass 11 Oct 2026
  • Snyk pass 11 Oct 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.00066 $0.04437
Opus 5.5 $0.00026 $0.01775
Sonnet 5.5 $0.00013 $0.00887
Haiku 4.5 $0.00007 $0.00444

Measured 12d ago against content hash bf2890be2dd7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade B, and why

vitest scanned grade B 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 12d ago.

The scan reads SKILL.md. This mod also ships 7 executable files (examples/node_function.test.ts, examples/vue_component.test.ts, scripts/inspect_vitest.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletemediumDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

- **Stale `.nuxt` state**: do not delete `.nuxt`/`node_modules/.cache/nuxt` blindly for a "clean" run; it breaks the tests' tsconfig resolution and adds noisy false signals. Regenerate with `npx nuxt prepare`, not a bare

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

plugins/skills/skills/vitest/SKILL.md · 198 lines

How it starts

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

Vitest

Use this skill to add, fix, or run Vitest tests without turning the task into a Vitest API reference lookup.

Helper Scripts Available:

  • scripts/inspect_vitest.py - Reports normalized package, runtime, configuration, framework, filesystem-candidate, and diagnostic signals without exposing repository-controlled text
  • scripts/run_vitest.py - Runs Vitest through the detected package manager with useful defaults

<skill> means the path to this local skill folder. Run helper scripts with --help when usage is unclear or before first use in a session. Prefer using helper scripts as black-box tools. Read or modify their source only when debugging the skill itself or when behavior is unclear.

Decision Tree

User task -> Is this an existing project?
    - Audit -> Read: references/audit.md
               Run: python <skill>/scripts/inspect_vitest.py --root <project>
               Collect evidence before proposing changes.
    - Yes -> Run: python <skill>/scripts/inspect_vitest.py --root <project>
             Use detected framework, config, aliases, and package manager.
    - No / new setup -> Inspect package.json manually if present, then create the
                        smallest Vitest setup that matches the runtime.

Next -> What is under test?
    - Node/library logic -> environment: node
    - React/Vue/Svelte component -> environment: jsdom or happy-dom
    - Nuxt/Vue app code -> prefer existing Nuxt/Vite test utilities and config
    - Edge/Workers code -> match the project's existing worker test setup
    - Browser-specific behavior -> consider Vitest browser mode only if already used

Then -> Write or fix one focused test, run it directly, then broaden only as needed.

Core Workflow

  1. Inspect first: discover existing scripts, config files, setup files, aliases, and test conventions.
  2. Match the project: use its package manager, test naming, setup file, mock style, and import aliases.
  3. Keep tests behavioral: assert public outcomes instead of private implementation details.
  4. Isolate state: reset mocks, timers, DOM, environment variables, and module state when the test mutates them.
  5. Verify narrowly first: run one file or name pattern before running the whole suite.

Read the full file on GitHub · 198 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. 12d ago Changed · +3 lines bf2890be2dd7
  2. 13d ago Changed 8e6e113b3af8
  3. 15d ago Changed · -5 lines 49bc21561f4c
  4. 22d ago Changed · +1 lines ac79f0240245
  5. 1mo ago Changed · +4 lines 53f52170d0a9
  6. 1mo ago Changed · +2 lines 80a581e9c21f
  7. 1mo ago Changed · +8 lines 8bbdebfe412b
  8. 1mo ago First seen · 185 lines · 66 tokens per session scan B fbcda278b0bf

Subscribe to this mod's changes

vitest is a skill published in the GitHub repository sentimony/skills (6 stars, last pushed today), licensed MIT. It adds 66 tokens to every session and 4,437 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it B with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.