Use for testing tasks including test strategy design, writing Vitest unit/integration tests, ensuring coverage, and exploring edge cases...
Write the minimum number of tests that confidently exercise real behavior.
All test rules, templates, helpers, and CLI patterns live in
.github/instructions/testing.instructions.md(loaded automatically when editing*.test.ts(x)). This skill owns role boundaries, test-strategy design, and judgment calls.
Before writing a test, ask: "If I deleted the implementation, would this test fail?" If no — don't write it.
A test is tautological if it could pass with the feature broken. Reject:
Feature: <name>
## Parsing
- [ ] Required-field happy path
- [ ] All-optional path
- [ ] Empty body / minimal form
## Validation
- [ ] Reject invalid states (errors)
- [ ] Warn on missing recommended fields
## Linking / scoping
- [ ] Forward reference resolves
- [ ] Cross-file reference resolves
- [ ] Missing reference → undefined, no crash
## Edge cases
- [ ] Empty / whitespace
- [ ] Unicode in identifiers
- [ ] Very long input
- [ ] Duplicate names (FQN collision)
## LSP (if applicable)
- [ ] Hover content via real provider
- [ ] Completion via real provider
- [ ] Multi-file scoping
## CLI (if applicable)
- [ ] Integration test spawning real `bin/cli.js`
- [ ] Exit code asserted
| Area | Target |
|---|---|
| Grammar parsing | 100% |
| Validation rules | 100% |
| Scoping / linking | 90%+ |
| LSP features | 80%+ |
| Utilities | 60%+ |
| Overall | ≥80% |
Lowering thresholds in vitest.config.ts requires explicit user approval.
Think like an adversary. For every feature, probe:
Merge tests with test.each when:
Keep separate when one failing variant would point to a different root cause.
vi.mock('node:fs') or vi.spyOn(defaultFileSystem, ...) (OOM-prone). Use DI or full module mock instead.bin/cli.js for end-to-end coverage of arg parsing and path resolution.npm run build — TS errors in tests are real failures.