Add Vitest testing infrastructure and GitHub Actions CI/CD to any TypeScript project. Supports Next.js, NestJS, and React projects with 80% coverage thresholds...
Automatically sets up comprehensive test infrastructure for TypeScript projects including Vitest, coverage thresholds, and GitHub Actions CI/CD.
This skill should be used when:
The skill detects project type by scanning:
package.json dependencies (next, @nestjs/core, react, etc.)Ask Claude to:
Add testing and CI/CD to this project
Or be specific:
Set up Vitest with 80% coverage and GitHub Actions for this Next.js project
Dependencies installed:
bun add -D vitest @vitest/coverage-v8 @vitejs/plugin-react @testing-library/react @testing-library/jest-dom jsdom
Files created:
vitest.config.ts - Vitest with jsdom environmentsrc/test/setup.ts - Test setup with RTL matchers.github/workflows/ci.yml - CI pipelineTest pattern: **/*.{test,spec}.{ts,tsx}
Dependencies installed:
bun add -D vitest @vitest/coverage-v8 supertest @types/supertest
Files created:
vitest.config.ts - Vitest with node environmenttest/setup.ts - Test setup for NestJS.github/workflows/ci.yml - CI with MongoDB serviceTest pattern: src/**/*.spec.ts
Follows similar patterns based on detected framework.
Default thresholds (configurable):
Coverage is enforced:
The generated CI workflow includes:
Templates are located in the templates/ directory:
| Template | Purpose |
|---|---|
vitest.config.nextjs.ts |
Vitest config for Next.js |
vitest.config.nestjs.ts |
Vitest config for NestJS |
ci-nextjs.yml |
GitHub Actions for Next.js |
ci-nestjs.yml |
GitHub Actions for NestJS |
test-setup-react.ts |
Test setup with RTL |
test-setup-node.ts |
Test setup for Node.js |
For monorepos (detected by workspaces in package.json):
vitest.workspace.ts at rootvitest.config.ts per packagebun --filter '*' test for orchestration| Skill | Integration |
|---|---|
husky-test-coverage |
Adds pre-commit coverage enforcement |
linter-formatter-init |
Works alongside for code quality |
playwright-e2e-init |
Adds E2E testing after unit tests |
testing-expert |
Provides testing patterns guidance |
User: Add testing to this project
Claude:
1. Detects Next.js from package.json
2. Installs vitest, @vitest/coverage-v8, @testing-library/react
3. Creates vitest.config.ts with jsdom environment
4. Creates src/test/setup.ts
5. Creates .github/workflows/ci.yml
6. Adds test scripts to package.json
User: Set up tests for this NestJS API
Claude:
1. Detects NestJS from @nestjs/core dependency
2. Installs vitest, @vitest/coverage-v8, supertest
3. Creates vitest.config.ts with node environment
4. Creates test/setup.ts
5. Creates .github/workflows/ci.yml with MongoDB service
6. Adds test scripts to package.json
Ensure path aliases in vitest.config.ts match tsconfig.json:
resolve: {
alias: {
"@": path.resolve(__dirname, "./src"),
},
},
bun test --coverageEnsure bunx tsc --noEmit passes locally before pushing.
When this skill is active, Claude will: