Loading...
Loading...
Generate or update tests for changed files in the current git branch, using statement coverage as the evaluation metric (target: 80%+). Use when: (1) the user asks to "write tests for my changes", "add tests for the current branch", or "improve coverage", (2) after implementing a feature to ensure adequate test coverage, (3) before a PR to verify changed code is tested. Supports Vitest and Cargo projects. Invoked with /test-generator or phrases like "generate tests", "test my changes", "cover the diff".
npx skill4agent add nimiusrd/agent-skills test-generatorscripts/detect-changes.sh [base-branch]scripts/check-coverage.sh <threshold> [files...]bash <skill-path>/scripts/detect-changes.sh mainmain__mocks__/test/setupvitest.config.*vite.config.*Cargo.tomlsetupFiles<name>.test.ts<name>.spec.ts__tests__/<name>.tsAGENTS.mdCLAUDE.md.eslintrc*eslint.config.*expect()assertimport { describe } from 'vitest'vi.mock()*.test.ts*.spec.tsdescribeit@testing-library/reactgetByRolegetByTextquerySelectorfast-check*.property.test.tsbash <skill-path>/scripts/check-coverage.sh 80 src/services/foo.ts src/utils/bar.tsPASS 92.3% src/services/foo.tsFAIL 65.0% src/utils/bar.ts@vitest/coverage-v8@vitest/coverage-istanbulFAILcoverage/coverage-final.json## Test Coverage Report
| File | Coverage | Status |
|------|----------|--------|
| src/services/foo.ts | 92.3% | PASS |
| src/utils/bar.ts | 81.0% | PASS |
| src/components/Baz.tsx | 73.5% | FAIL |
Target: 80% | Passed: 2/3scripts/detect-changes.sh [base-branch]scripts/check-coverage.sh <threshold> [files...]