home / skills / ehtbanton / claudeskillsrepo / vitest-config-generator
This skill generates a complete Vitest configuration file (vitest.config.ts) with test environment, coverage, and setup for fast unit tests.
npx playbooks add skill ehtbanton/claudeskillsrepo --skill vitest-config-generatorReview the files below or copy the command above to add this skill to your agents.
---
name: vitest-config-generator
description: Generate Vitest configuration files for fast unit testing of JavaScript/TypeScript projects. Triggers on "create vitest config", "generate vitest configuration", "vitest setup", "unit test config".
---
# Vitest Config Generator
Generate Vitest configuration files for fast unit and integration testing.
## Output Requirements
**File Output:** `vitest.config.ts`
**Format:** Valid Vitest configuration
**Standards:** Vitest 1.x
## When Invoked
Immediately generate a complete Vitest configuration with test environment, coverage, and setup files.
## Configuration Template
```typescript
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'jsdom',
},
});
```
## Example Invocations
**Prompt:** "Create vitest config for React with coverage"
**Output:** Complete `vitest.config.ts` with jsdom and coverage settings.
This skill generates complete Vitest configuration files (vitest.config.ts) for fast unit and integration testing in JavaScript and TypeScript projects. It creates valid Vitest 1.x configurations with sensible defaults for environment, globals, coverage, and setup files. Use it to quickly scaffold test configs for frameworks like React or plain Node projects.
When triggered, the skill outputs a ready-to-use vitest.config.ts file that conforms to Vitest 1.x syntax. It selects test environment (jsdom or node), toggles globals, and can include coverage settings, setup files, and common aliases. The generated config is minimal by default but can be expanded to include reporters, transform options, or custom hooks.
What file does this skill produce?
It produces a vitest.config.ts file with valid Vitest 1.x configuration.
Which environment should I choose for React?
Use 'jsdom' for React to simulate a browser environment; use 'node' for backend code.
Can it enable coverage automatically?
Yes. The generated config can include coverage settings and common report formats.