Set up Vitest in a project using `@jabraf/dev`'s `baseVitestConfig` factory. Load when the user asks to add Vitest, set up unit tests, configure `vitest.config.ts`, or wire up `@jabraf/dev` Vitest specifically. Do not load for Jest, Mocha, or general testing questions unrelated to `@jabraf/dev`.
Ships in jabraf-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
jabraf-vitestAdds Vitest to the current project via the baseVitestConfig factory from
@jabraf/dev. The factory takes
{ react?: boolean, coverage?: boolean, reporters?: string[] }; enable
react: true to load the React Testing Library setup.
Canonical setup lives in
packages/jabraf-dev/README.md.
Load when the user's prompt mentions any of:
vitest.config"@jabraf/dev vitest", "jabraf vitest"Do not load for Jest, Mocha, Tap, or general "write tests" requests that don't
involve Vitest. Do not load alongside jabraf-dev-setup — the umbrella will
invoke this one.
Brief acknowledge + project-shape detection. Detect:
react / react-dom in deps → default react: truereact: falsecoverage/ folder or a coverage npm script → propose coverage: trueOne sentence: "I'll add Vitest via @jabraf/dev. Detected <react|no react> → baseVitestConfig({ react: <bool> }). Proceed?" [wait for user]
Detect package manager. Standard logic.
Detect existing config. Check for vitest.config.{js,ts,mjs,mts,cjs,cts} and any vitest block in package.json. If found, show contents and ask: "Replace with the @jabraf/dev factory call, leave alone, or merge?" [wait for user] Never overwrite silently.
Install @jabraf/dev if missing. Dev dep, at latest.
Write vitest.config.ts. Default body — adjust the options object based on detection:
import { baseVitestConfig } from '@jabraf/dev/vitest';
export default baseVitestConfig();
With options:
import { baseVitestConfig } from '@jabraf/dev/vitest';
export default baseVitestConfig({ react: true, coverage: true });
Available options (from the README):
| Option | Type | Default | Description |
|---|---|---|---|
react | boolean | false | Adds the React Testing Library setup file |
coverage | boolean | false | Enables V8 coverage provider |
reporters | string[] | ['default'] | Vitest reporter list |
Add scripts. Add to package.json scripts, only if absent:
{
"scripts": {
"test": "vitest run",
"test:watch": "vitest",
},
}
If the project also uses jabraf-tsconfig, propose composing typecheck into test (tsc --noEmit && vitest run) — but only if a typecheck script already exists. [wait for user if conflict]
Validate. Run <pm> run test (or npx vitest run). Report:
*.test.ts (or *.spec.ts) and re-run."Final report. Summarize: package manager, detected React/coverage flags, install status, config written, scripts added, validation outcome.
package.json scripts without confirmation.@jabraf/dev to a specific version — install at latest.vitest.config.ts and package.json scripts.@testing-library/* packages directly — they come transitively via @jabraf/dev.| Situation | Action |
|---|---|
Project has no package.json | Stop. Ask the user to initialise the project first. |
| Vitest 1.x already installed at a pinned older version | Note that @jabraf/dev's factory targets Vitest 4+. Ask whether to upgrade. [wait for user] Do not auto-upgrade. |
| Project uses Jest | Do not migrate. Ask the user to decide before proceeding. Migration is out of scope. |
Monorepo with vitest.workspace.ts | Leave the workspace file alone. Apply this skill per-package. If the user wants a workspace-level config too, ask explicitly. [wait for user] |
react: true requested but no react in deps | Block. The factory's React setup imports @testing-library/react; without react/react-dom, tests will fail. Tell the user to install React first. |
| Browser-mode Vitest | Out of scope for the base factory. If the user asks for browser mode, tell them to extend the config manually. |
Coverage flag set but no @vitest/coverage-v8 resolved | The factory pulls coverage via Vitest 4's built-in provider; if a resolution error appears, surface it and stop. |
@jabraf/dev Vitest docs: packages/jabraf-dev/README.md#vitest@jabraf/dev/vitest (factory), @jabraf/dev/vitest/react-setup (setup file used internally when react: true) — see packages/jabraf-dev/package.json exports mapWhat SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
17 skills in this plugin
/jabraf-app-config-setupSet up `@jabraf/app-config` end-to-end in a project — install the runtime dep, scaffold `config/make-config.ts`, augment the `FeatureMap`, gitignore the generated artifact, add `prebuild`/`predev` scripts, wire the bootstrap `setConfig` call, and (React apps) mount the in-app `FeatureFlagsPanel` toggle UI. Load when the user asks to add app config, set up feature flags, configure `@jabraf/app-config`, wire `jabraf-config build`, or add a feature flags toggle panel / floating button./jabraf-commitlintSet up commitlint in a project using `@jabraf/dev`'s shared base (conventional commits). Load when the user asks to add commitlint, enforce conventional commits, configure `commitlint.config.js`, or wire up `@jabraf/dev` commitlint specifically. Do not load for general commit-message-quality questions unrelated to `@jabraf/dev`./jabraf-dev-setupOrchestrate a full `@jabraf/dev` setup in a project by invoking the granular `jabraf-*` skills in order — TSConfig, Prettier, ESLint, Vitest, Playwright (when relevant), commitlint, lint-staged. Load when the user asks for the full `@jabraf/dev` stack, a greenfield setup, or "everything from `@jabraf/dev`". Requires the granular skills to be installed alongside this one./jabraf-eslintSet up ESLint in a project using `@jabraf/dev`'s shared base config. Load when the user asks to add ESLint, set up linting, configure `eslint.config.{js,ts}`, or wire up `@jabraf/dev` ESLint specifically. Do not load for general linter questions unrelated to `@jabraf/dev`./jabraf-ground-rulesJabran's ground rules for every project — how to work (clarify first, stay scoped, report real results) plus default stack (Cloudflare, Tailwind v4), TypeScript, testing, git/PR, gh, CI, security and docs conventions, and the cloud-session rules (git identity, plan-only main agent, model choices). Load at the start of any coding, repo, review, commit, PR or GitHub Actions task, and whenever a repo's AGENTS.md points to it or is silent on a convention./jabraf-lint-stagedSet up lint-staged in a project using `@jabraf/dev`'s shared base (runs Prettier on stage, then ESLint and/or oxlint + related Vitest specs), wired through Husky for the `pre-commit` hook. Load when the user asks to add lint-staged, configure `.lintstagedrc`, set up a `pre-commit` hook for staged files, or wire up `@jabraf/dev` lint-staged specifically./jabraf-skills:jabraf-vitestfrom jabraf-skills
npx claudepluginhub jabranr/skills --plugin jabraf-skills