jmagly/aiwg/vitest-runner

Claude Code and agent skill by jmagly/aiwg

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Execute JavaScript/TypeScript tests with Vitest, supporting coverage, watch mode, and parallel execution. Use for JS/TS test automation.

Install

npx vskill@latest install jmagly/aiwg/vitest-runner

SKILL.md

Vitest Runner Skill

Purpose

Single responsibility: Execute and manage Vitest test suites with proper configuration, coverage reporting, and failure analysis. (BP-4)

Grounding Checkpoint (Archetype 1 Mitigation)

Before executing, VERIFY:

  • [ ] Node.js installed and version appropriate
  • [ ] package.json exists with vitest dependency
  • [ ] Test files exist (.test.ts, .spec.ts)
  • [ ] vitest.config.ts or vite.config.ts present (optional)

DO NOT run tests without verifying node_modules installed.

Uncertainty Escalation (Archetype 2 Mitigation)

ASK USER instead of guessing when:

  • Multiple test configurations detected
  • Coverage threshold unclear
  • Watch mode vs single run
  • Specific test patterns needed

NEVER modify test configurations without user approval.

Context Scope (Archetype 3 Mitigation)

Context TypeIncludedExcluded
RELEVANTTest files, vitest config, package.jsonApplication logic
PERIPHERALCoverage reports, test utilitiesBuild configs
DISTRACTORDeployment configsOther frameworks

Workflow Steps

Step 1: Environment Check (Grounding)
bash
# Verify Node.js
node --version
npm --version
# Check vitest installed
npx vitest --version || npm install -D vitest
# List test files
find . -name "*.test.ts" -o -name "*.spec.ts" | grep -v node_modules | head -20
Step 2: Discover Tests
bash
# Show test collection
npx vitest --run --reporter=verbose --passWithNoTests 2>&1 | head -50
# List test files
npx vitest list
Step 3: Execute Tests

Basic execution:

bash
npx vitest run

With coverage:

bash
npx vitest run --coverage

Specific file or pattern:

bash
npx vitest run src/utils.test.ts
npx vitest run --grep "authentication"

Watch mode:

bash
npx vitest --watch

Parallel execution:

bash
npx vitest run --pool threads --poolOptions.threads.maxThreads 4
Step 4: Analyze Results
bash
# Verbose output with failures
npx vitest run --reporter=verbose 2>&1 | tee test_results.txt
# Extract failures
grep -E "^FAIL|AssertionError|Error:" test_results.txt
# Coverage summary
npx vitest run --coverage --coverage.reporter=text-summary

Recovery Protocol (Archetype 4 Mitigation)

On error:

  1. PAUSE - Capture test output
  2. DIAGNOSE - Check error type:
  • Cannot find module → Check imports, tsconfig paths
  • SyntaxError → Check TypeScript compilation
  • Timeout → Increase timeout or check async handling
  • ENOENT → Check file paths, fixtures
  1. ADAPT - Adjust test selection or configuration
  2. RETRY - With narrower scope (max 3 attempts)
  3. ESCALATE - Report failures with context

Checkpoint Support

State saved to: .aiwg/working/checkpoints/vitest-runner/

checkpoints/vitest-runner/
├── test_collection.json # Discovered tests
├── test_results.json # Last run results
├── coverage_report.json # Coverage data
└── failure_analysis.md # Failure diagnostics

Common Vitest Options

OptionPurpose
--runSingle run (no watch)
--watchWatch mode
--coverageGenerate coverage
--reporter=verboseDetailed output
--grep "pattern"Filter tests
--bailStop on first failure
--updateUpdate snapshots
--uiOpen UI

Configuration Templates

vitest.config.ts:

typescript
import { defineConfig } from 'vitest/config'
export default defineConfig({
test: {
include: ['**/*.{test,spec}.{js,ts}'],
exclude: ['node_modules', 'dist'],
coverage: {
provider: 'v8',
reporter: ['text', 'html', 'json'],
exclude: ['node_modules/', 'test/']
},
globals: true,
environment: 'node'
}
})

References

  • Vitest documentation: https://vitest.dev/
  • REF-001: Production-Grade Agentic Workflows (BP-4 single responsibility)
  • REF-002: LLM Failure Modes (Archetype 1 grounding)

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
96
Repository forks
12
Repository npm downloads, 7 days
2,424
7-day trend score
41

Stars and forks are for the whole GitHub repository, not this skill alone. Downloads are for the repository's npm package. Refreshed 19 Mar 2026, 8 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/jmagly/aiwg/vitest-runner/badge)](https://verified-skill.com/skills/jmagly/aiwg/vitest-runner)

Something wrong with this skill or its page? Tell us.