Tooluck logoTooluck
SKILL.md

vitest

Agent skill fromjezweb/claude-skills

Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a sample test. Covers mocking patterns, coverage config, workspace setup, Jest migration. Use whenever the user mentions adding tests, setting up Vitest, configuring tests, migrating from Jest, fixing testing infrastructure, or asks 'how do I test this'.

How to install vitest

install vitest
# install the claude-skills pack with the skills CLI
npx skills add jezweb/claude-skills

# or add only this skill to Claude Code: copy the folder

plugins/dev-tools/skills/vitest/

# into

~/.claude/skills/vitest/ (all projects)

.claude/skills/vitest/ (one project)

plugins/dev-tools/skills/vitest/SKILL.md

MITFull file
1# Vitest Setup
2
3Detect the project type, generate the right Vitest configuration, and produce working test infrastructure. Not a reference card — this skill creates files.
4
5## Workflow
6
71. **Detect** — scan the project to determine type and existing setup
82. **Configure** — generate vitest.config.ts tailored to the environment
93. **Scaffold** — create test setup, utilities, and a sample test
104. **Wire up** — add package.json scripts and TypeScript config
11
12## Step 1: Detect Project Type
13
14Read these files to determine the project:
15
16```
17package.json → dependencies, scripts, type field
18tsconfig.json → paths, compiler options
19wrangler.toml → Cloudflare Workers project
20vite.config.ts → existing Vite setup (extend, don't replace)
21vitest.config.ts → already configured? just fill gaps
22jest.config.* → migration candidate
23src/ → source structure
24```
25
26Classify as one of:
27
28| Type | Signals | Environment |
29|------|---------|-------------|
30| **Cloudflare Workers** | wrangler.toml, @cloudflare/workers-types, cloudflare vite plugin | `node` with Workers-specific setup |
31| **React (Vite)** | @vitejs/plugin-react, react-dom | `jsdom` or `happy-dom` |
32| **React (SSR/TanStack Start)** | @tanstack/start, vinxi | Split: `node` for server, `jsdom` for client |
33| **Node/Hono API** | hono, express, no react-dom | `node` |
34| **Library** | exports field, no framework deps | `node` |
35…

Excerpt shown under the repository's MIT license.

More skills in claude-skills

Keep exploring

Similar skill repositories

thedotmack /

claude-mem
116k

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

CCCXGHGM+135 skills

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates