vitest

vitest is a skill for Claude Code from fubits1/svelte-skills. It costs 49 tokens per session (2,111 once invoked), scanned C, original, MIT.

A set of instructions for configuring Vitest, a JavaScript and TypeScript test runner, including projects that run in Node.js or in a browser. It also covers browser testing with Playwright and Svelte.

In plain words
What is it for?
Use it when editing Vitest configuration, separating Node and browser test projects, upgrading Vitest packages, or debugging browser tests.
Why use it?
It helps avoid configuration conflicts, flaky browser tests, and assertions that check only whether something exists instead of whether it has the right result.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the frontend plugin — 13 skills shipped together

Good fit Use it when editing Vitest configuration, separating Node and browser test projects, upgrading Vitest packages, or debugging browser tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/fubits1/svelte-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 fubits1/svelte-skills --skill vitest
Clone the repo
git clone --depth 1 https://github.com/fubits1/svelte-skills

Made for: Claude Code.

Or install frontend, the plugin that ships this one along with the rest of its 13 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/fubits1/svelte-skills/vitest/github.svg)](https://agentmods.dev/skills/fubits1/svelte-skills/vitest)
Your own site
<a href="https://agentmods.dev/skills/fubits1/svelte-skills/vitest"><img src="https://agentmods.dev/badge/skills/fubits1/svelte-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/fubits1/svelte-skills/vitest"><img src="https://agentmods.dev/badge/skills/fubits1/svelte-skills/vitest.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 49 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,111 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.00049 $0.02111
Opus 5 $0.00024 $0.01056
Sonnet 5 $0.00010 $0.00422
Haiku 4.5 $0.00005 $0.00211

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

Security

Grade C, and why

vitest scanned grade C 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 10d 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.

Recursive force deletehighDestructive command

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

2. `rm -rf node_modules/.vite node_modules/.cache/storybook`
plugins/frontend/skills/vitest/SKILL.md · 157 lines

How it starts

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

Vitest

  • Docs: if unsure about an API, fetch https://vitest.dev/llms.txt. Do not guess.
  • Config file: use vitest.config.{ts,mts,js,mjs} for test / test.projects. Vitest-only-in-vite.config merges badly with multiple projects and Storybook.
  • Gate: no vitest.config.* but vite.config has test: (or no Vitest file), ask before adding projects or Storybook whether to introduce vitest.config.ts and move test out of Vite.
  • page.viewport(width, height): import from vitest/browser.
  • test.projects for mixed node/browser and Storybook. Either extends: true (inherit merged root: Storybook Vitest example with mergeConfig(viteConfig, …)) or extends: './vite.config.ts' per project; put test + plugins on each project (svelte-5:storybook-vitest).
  • Browser concurrency: vitest-browser-svelte/pure when you need no auto-cleanup.
  • vitest-browser-svelte v3: render is async-only (await render(...)); usage in svelte-5:testing-svelte. v3 gives /pure full export parity with the main entry and exports the RenderResult type.
  • Assertions: value, not presence. Presence-only assertions (toBeInTheDocument, not.toBe(''), toHaveBeenCalled) ship regressions. Every interaction test must compute an expected value from the action and assert equality. See references/assertions.md for the pattern, callback-payload rules, and how to tell a harness failure from a behavior failure.
  • Locators: prefer accessible queries, avoid data-testid. data-testid is an a11y smell (tkdodo, 2025), adding a testid means the element has no accessible name, role, or text for users of AT either. Fix the a11y hole, not the test. Use page.getByRole(...), getByLabelText, getByText, getByPlaceholderText, getByTitle, getByAltText first. They mirror how screen readers find elements and fail when a11y regresses. Reach for data-testid only as a last resort: charting canvases, truly decorative content, or legacy markup you cannot change, and when you do, leave a comment explaining why no accessible selector worked.
  • Upgrade: bump all @vitest/* together.
  • browser.provider: import { playwright } from '@vitest/browser-playwright' to provider: playwright() (factory, not a string).
  • Use import { page } from 'vitest/browser': not @vitest/browser/context.
  • In test.projects, plugins / resolve / optimizeDeps belong inside each project, not only at root: projects do not inherit root plugins by default (extends: true inherits the merged root).
  • optimizeDeps.exclude: Svelte 5 runes in .svelte.js (e.g. Melt UI) so vite-plugin-svelte handles them, not Vite's dependency pre-bundler (Rolldown since Vite 8, esbuild before).
  • optimizeDeps.include: deps that trigger mid-test optimization (e.g. minisearch) to reduce flakes.
  • Storybook: vitest.config.ts + storybookTest + browser playwright(): svelte-5:storybook-vitest, manual setup.

Read the full file on GitHub · 157 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 10d ago First seen · 157 lines · 49 tokens per session scan C 4a693f84f416

Subscribe to this mod's changes

vitest is a skill published in the GitHub repository fubits1/svelte-skills (10 stars, last pushed 1mo ago), licensed MIT. It adds 49 tokens to every session and 2,111 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C 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.

Related

Other skills, from other repositories

dogfood

Systematically explore and test a mobile app on iOS/Android with agent-device to find bugs, UX issues, and other problems. Use when asked to dogfood, QA, exploratory test, find issues, bug hunt, or test this app on mobile.

callstack/agent-device · 55 tokens

test-warp-ui

Guides testing Warp UI features and changes using the computer use tool. Use this skill only when computer-use testing was requested (explicit request or accepted offer) and the computeruse tool is available to the agent. Covers launching Warp and verifying UI behavior.

warpdotdev/warp · 55 tokens

test-electron-app

Drive the real running PostHog Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser. Connect to the running app on port 9222, test desktop changes against a local Django stack, snapshot the accessibility tree, inspect network requests, and screenshot only when explicitly asked. Use when…

PostHog/posthog-foss · 112 tokens

pyats-dynamic-test

Generate and execute deterministic pyATS aetest validation scripts - interface state, OSPF neighbors, BGP paths, ping matrices, and custom compliance tests. Use when writing a network test, validating post-change state, running pass/fail checks, or building automated regression tests.

automateyournetwork/netclaw · 61 tokens

test-loop

Plan, generate, and heal an executable E2E test suite from approved acceptance criteria (web and mobile).

HoangNguyen0403/agent-skills-standard · 25 tokens

playwright-cli

Automates browser interactions for testing and validating your own web applications using playwright-cli. Use when you need terminal-first browser control for navigation, form filling, screenshots, tracing, bound browser sessions, debugging, or generating Playwright test code. Only use against applications you own or…

testdino-hq/playwright-skill · 64 tokens