agentic/code/frameworks/sdlc-complete/extensions/javascript/skills/vitest-runner/SKILL.md
Execute JavaScript/TypeScript tests with Vitest, supporting coverage, watch mode, and parallel execution. Use for JS/TS test automation.
npx skillsauth add jmagly/aiwg vitest-runnerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Single responsibility: Execute and manage Vitest test suites with proper configuration, coverage reporting, and failure analysis. (BP-4)
Before executing, VERIFY:
DO NOT run tests without verifying node_modules installed.
ASK USER instead of guessing when:
NEVER modify test configurations without user approval.
| Context Type | Included | Excluded | |--------------|----------|----------| | RELEVANT | Test files, vitest config, package.json | Application logic | | PERIPHERAL | Coverage reports, test utilities | Build configs | | DISTRACTOR | Deployment configs | Other frameworks |
# 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
# Show test collection
npx vitest --run --reporter=verbose --passWithNoTests 2>&1 | head -50
# List test files
npx vitest list
Basic execution:
npx vitest run
With coverage:
npx vitest run --coverage
Specific file or pattern:
npx vitest run src/utils.test.ts
npx vitest run --grep "authentication"
Watch mode:
npx vitest --watch
Parallel execution:
npx vitest run --pool threads --poolOptions.threads.maxThreads 4
# 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
On error:
Cannot find module → Check imports, tsconfig pathsSyntaxError → Check TypeScript compilationTimeout → Increase timeout or check async handlingENOENT → Check file paths, fixturesState 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
| Option | Purpose |
|--------|---------|
| --run | Single run (no watch) |
| --watch | Watch mode |
| --coverage | Generate coverage |
| --reporter=verbose | Detailed output |
| --grep "pattern" | Filter tests |
| --bail | Stop on first failure |
| --update | Update snapshots |
| --ui | Open UI |
vitest.config.ts:
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'
}
})
data-ai
Report which research-corpus radar sidecars are overdue for refresh. Computes staleness (days since last refresh vs the cadence window) for every radar, sorted most-overdue-first. Runs via `aiwg corpus radar-status`.
data-ai
Aggregate research-corpus radar sidecars into a corpus or per-cluster freshness report — totals, overdue count, per-cluster / per-GRADE / per-trajectory breakdowns, an overdue table, and per-radar rationale snippets. Runs via `aiwg corpus radar-report`.
testing
Scaffold radar/freshness sidecars for research-corpus REFs. Pulls title/authors from the citation sidecar and GRADE from the analysis doc, defaults the refresh cadence from GRADE and the cluster from a corpus-local map, and stamps documentation/radar/REF-XXX-radar.md. Runs via `aiwg corpus radar-init`.
data-ai
Compute an entity's publication trajectory — per-year paper counts, topic drift, hot-streak detection (≥3 consecutive A-grade years), and career phase. Runs via `aiwg corpus profile-temporal`.