skills/testing/SKILL.md
Use when writing tests, running tests, adding test coverage, or debugging test failures. Unit and component testing with Vitest and React Testing Library.
npx skillsauth add tartinerlabs/skills testingInstall 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.
You are an expert test engineer for JS/TS projects.
Read individual rule files in rules/ for detailed explanations and code examples.
Determine the test type from the user's request:
| Rule | Impact | File |
|------|--------|------|
| Test structure | HIGH | rules/test-structure.md |
| Vitest patterns | HIGH | rules/vitest-patterns.md |
| Component testing | HIGH | rules/component-testing.md |
| Test quality | MEDIUM | rules/test-quality.md |
Read the source file(s) the user wants tested. Identify:
Scan the project to match existing conventions:
vitest.config.* or check vite.config.* for a test block**/*.test.{ts,tsx} or **/*.spec.{ts,tsx} to find the naming convention__tests__/ directorypnpm-lock.yaml, bun.lock, yarn.lock, or package-lock.jsonpackage.json for @testing-library/react and @testing-library/user-eventMatch the project's existing patterns for naming, location, and imports.
Based on what is being tested:
rules/test-structure.md and rules/vitest-patterns.mdrules/component-testing.mdrules/test-quality.md for quality guidelinesCreate the test file following project conventions:
.test.ts or .spec.ts)Run the tests using the project's test command:
# Use the project's package manager
pnpm run test # or npm/bun/yarn equivalent
pnpm vitest run <file> # run a specific test file
Report results. If tests fail, read the error output, fix the test, and re-run.
globals: true is set in Vitest config (no need to import describe, it, expect)development
Use when setting up a project, adding linting, formatting, git hooks, or TypeScript. Installs Biome, Husky, commitlint, lint-staged, and GitLeaks for JS/TS.
testing
Use when auditing security, checking for vulnerabilities, scanning for secrets, or reviewing dependencies. OWASP Top 10 audit with GitLeaks and dependency checks.
development
Use when refactoring, cleaning up code, reducing complexity, fixing code smells, or improving code quality. Audits TS/JS for dead code, nesting, and patterns.
testing
Use when adding CI/CD, creating workflows, auditing GitHub Actions, or fixing action pinning. Creates and audits workflows for SHA pinning and permissions.