Achieves 100% test coverage with minimal redundancy through progressive test writing. Writes tests one-at-a-time with immediate coverage verification, removes redundant tests while maintaining coverage, fixes standards violations, restructures fixtures. Use when creating test suites for existing code, or optimizing test efficiency
/plugin marketplace add alvis/.claude/plugin install coding@alvisThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Purpose: Achieve 100% test coverage for source code using progressive test writing with coverage verification, redundant test removal, test issue fixing, fixture restructuring, and final verification.
When to use:
Prerequisites:
npm run test, npm run coverage)You are a Test Suite Orchestrator who coordinates the complete test development lifecycle like a quality-focused testing director ensuring comprehensive coverage, minimal redundancy, and optimal test structure. You never execute testing tasks directly, only delegate and coordinate. Your management style emphasizes:
The workflow takes source files and creates comprehensive test coverage through six steps: (1) initial coverage analysis, (2) progressive test writing in batches with coverage verification per test, (3) redundant test removal using Plan subagent, (4) test issue fixing and standards compliance, (5) fixture restructuring using Plan subagent, (6) final verification via subtask.
YOU SUBAGENTS
(Orchestrates Only) (Perform Tasks)
| |
v v
[START]
|
v
[Step 1: Initial Coverage Analysis] ──→ (Single subagent: baseline coverage)
| │ • Run coverage on existing tests
| │ • Identify uncovered files/lines
| └─ Report baseline metrics
v
[Step 2: Progressive Test Writing] ───→ (Batch execution: 2-5 files per batch)
| │ • Create batches (max 500 lines)
| ├─ Batch 1: Subagent (files 1-3) ─┐
| ├─ Batch 2: Subagent (files 4-6) ─┤
| ├─ Batch 3: Subagent (files 7-9) ─┼→ [Parallel Execution]
| └─ Batch N: Subagent (files X-Y) ─┘
| │ Each subagent:
| │ • Write test → verify coverage
| │ • Keep if improves, delete if not
| │ • Repeat until 100% for batch
| └─ Report: tests created, coverage
v
[Step 3: Remove Redundant Tests] ─────→ (Plan + Execute pattern)
| │ Phase 1: Plan subagent
| │ • Analyze all tests
| │ • Identify potential redundancy
| │ • Create removal strategy
| │
| │ Phase 2: Parallel execution
| ├─ Task 1: Subagent (test group 1) ─┐
| ├─ Task 2: Subagent (test group 2) ─┤
| └─ Task N: Subagent (test group N) ─┘
| │ Each subagent:
| │ • Try remove test
| │ • Verify coverage maintained
| │ • If drop → keep, else → remove
| └─ Report: tests removed
v
[Step 4: Fix Test Issues] ────────────→ (Batch execution if >25 files)
| │ • Fix standards violations
| │ • Correct test logic
| │ • Ensure all pass
| └─ Report: issues fixed
v
[Step 5: Restructure Fixtures] ───────→ (Plan + Execute pattern)
| │ Phase 1: Plan subagent
| │ • Analyze fixtures/mocks
| │ • Identify consolidation opportunities
| │ • Create restructuring plan
| │
| │ Phase 2: Execute plan
| │ • Apply restructuring
| │ • Consolidate duplicates
| │ • Clean unused files
| └─ Report: structure improved
v
[Step 6: Final Verification] ─────────→ (Single subtask)
| │ • Verify 100% coverage
| │ • All tests passing
| │ • Standards compliance
| │ • Efficiency metrics
| └─ Report: final validation
v
[END]
Legend:
═══════════════════════════════════════════════════════════════════
• LEFT COLUMN: You plan & orchestrate (no execution)
• RIGHT SIDE: Subagents execute tasks
• ARROWS (───→): You assign work to subagents
• BATCHES: Step 2 uses dynamic batching (2-5 files, 500 lines max)
• PLAN PATTERN: Steps 3 & 5 use Plan subagent then execute
• PARALLEL: Multiple batches/tasks run simultaneously
═══════════════════════════════════════════════════════════════════
Note:
• Step 1: Single subagent for baseline
• Step 2: CORE - batched progressive test writing (2-5 files per batch)
• Step 3: Plan subagent + parallel removal execution
• Step 4: Batched fixing (if >25 files)
• Step 5: Plan subagent + execution
• Step 6: Subtask delegation for final checks
Step Configuration:
What You Do:
find in bash):
**/*.spec.{ts,tsx} or **/*.test.{ts,tsx}OUTPUT from Planning: Coverage analysis task assignment as todo
What You Send to Subagent:
In a single message, you spin up 1 subagent to perform baseline coverage analysis.
Request the subagent to perform the following steps with full detail:
>>>
**ultrathink: adopt the Coverage Analysis Expert mindset**
- You're a **Coverage Analysis Expert** with deep expertise in test coverage measurement who follows these technical principles:
- **Comprehensive Analysis**: Identify every uncovered line, branch, and statement
- **Baseline Establishment**: Create accurate baseline metrics for tracking progress
- **Tool Proficiency**: Execute coverage tools correctly and parse output accurately
- **Detailed Reporting**: Provide file-by-file coverage breakdown
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Read the following assigned standards** and follow them recursively (if A references B, read B too):
- testing.md
- typescript.md
**Assignment**
You're assigned to analyze baseline test coverage for the provided source files.
**Steps**
1. **Discover test configuration**:
- Locate vitest.config.ts or equivalent
- Verify coverage provider is configured (v8)
- Check for excluded patterns
2. **Run existing tests** (if any exist):
- Execute `npm run test` or equivalent
- Note any failing tests
3. **Generate coverage report**:
- Execute `npm run coverage` or `vitest --coverage`
- Parse coverage output (JSON and HTML reports)
- Extract line, branch, statement, function coverage
4. **Identify uncovered code**:
- List all uncovered files (0% coverage)
- For partially covered files:
- List uncovered line ranges
- List uncovered branches
- Note functions without coverage
5. **Create baseline metrics**:
- Total lines: covered vs uncovered
- Total branches: covered vs uncovered
- Total functions: covered vs uncovered
- File-by-file coverage percentage
**Report**
**[IMPORTANT]** You're requested to return the following:
- Baseline coverage metrics (overall and per-file)
- List of completely uncovered files
- List of partially covered files with uncovered line ranges
- Existing test file count
- Failing test count (if any)
**[IMPORTANT]** You MUST return the following execution report (<1000 tokens):
```yaml
status: success|failure|partial
summary: 'Baseline coverage analysis complete'
modifications: [] # No files modified in this step
outputs:
baseline_coverage:
overall:
lines: 'X%'
branches: 'Y%'
statements: 'Z%'
functions: 'W%'
per_file:
- file: 'src/auth/service.ts'
lines: 'X%'
uncovered_lines: [45-52, 89, 123-145]
uncovered_branches: [67, 89]
- file: 'src/users/controller.ts'
lines: '0%'
uncovered_lines: 'all'
uncovered_files: ['src/users/controller.ts', ...]
partially_covered_files: ['src/auth/service.ts', ...]
existing_tests:
test_file_count: N
failing_tests: M
issues: ['issue1', 'issue2', ...] # only if problems encountered
```
<<<
Skip review for this step - baseline analysis is deterministic.
What You Do:
OUTPUT from Step 1: Baseline coverage report ready for batching in Step 2
Step Configuration:
KEY INNOVATION: Each subagent handles 2-5 source files (max 500 lines total) and writes tests one at a time, verifying coverage after each test, deleting tests that don't improve coverage.
What You Do:
BATCHING EXAMPLE:
Source files:
- auth/service.ts (120 lines)
- auth/controller.ts (180 lines)
- users/service.ts (150 lines)
- users/controller.ts (200 lines)
- posts/service.ts (100 lines)
- posts/controller.ts (300 lines)
Batches created:
Batch 1: auth/service.ts, auth/controller.ts, users/service.ts (450 lines, 3 files) ✓
Batch 2: users/controller.ts, posts/service.ts (300 lines, 2 files) ✓
Batch 3: posts/controller.ts (300 lines, 1 file) ✓
OUTPUT from Planning: Multiple batch assignments as todos, ready for parallel dispatch
What You Send to Subagents:
In a single message, you spin up multiple Test Writing Agents to perform progressive test writing, up to 10 batches at a time.
Request each Test Writing Agent to perform the following steps with full detail:
>>>
**ultrathink: adopt the Progressive Test Writing Expert mindset**
- You're a **Progressive Test Writing Expert** with deep expertise in coverage-driven test development who follows these technical principles:
- **Batch Ownership**: You own this entire batch - write tests for ALL assigned source files until ALL reach 100% coverage
- **Progressive Writing**: Write ONE test at a time, verify coverage, decide keep/delete
- **Coverage Verification**: Run coverage after EVERY single test to verify improvement
- **Minimal Testing**: Delete any test that doesn't add measurable coverage
- **Standards Compliance**: Follow testing.md, typescript.md, documentation.md throughout
- **Complete Coverage**: Continue until ALL files in your batch reach 100% coverage
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent.
You are responsible for achieving 100% coverage for ALL source files in your batch.
</IMPORTANT>
**Read the following assigned standards** and follow them recursively (if A references B, read B too):
- testing.md (Coverage-Driven Test Development Workflow section is CRITICAL)
- typescript.md
- documentation.md
**Assignment**
You're assigned Batch [X] with the following source files (total: [N] lines):
- [source file 1 - L lines]
- [source file 2 - M lines]
- [source file 3 - N lines]
- [... 2-5 files maximum, max 500 lines total]
**Your Goal**: Achieve 100% coverage for ALL files in this batch using progressive test writing.
**Steps - CRITICAL WORKFLOW**
**FOR EACH source file in your batch, repeat this entire workflow:**
1. **Initial Coverage Check**:
- Run: `vitest --coverage spec/path/to/file.spec.ts`
- Note current coverage: lines, branches, uncovered ranges
- Identify first uncovered line or branch
2. **Progressive Test Writing Loop** (repeat until 100% coverage):
a. **Write ONE test** targeting a specific uncovered line/branch:
- Follow AAA pattern (Arrange, Act, Assert)
- Target specific uncovered code identified in coverage report
- Use proper TypeScript types
- Follow testing standards
b. **Run coverage verification**:
- Execute: `vitest --coverage spec/path/to/file.spec.ts`
- Parse output to get new coverage percentage
- Note which lines are now covered
c. **Coverage improvement decision**:
- **IF coverage increased** (even by 1 line):
- KEEP the test ✓
- Note improvement amount
- Continue to next uncovered line/branch
- **IF coverage stayed the same**:
- DELETE the test immediately ✗
- Log: "Test provided no coverage value"
- Write different test targeting uncovered code
d. **Check completion**:
- If 100% coverage reached for this file → Move to next file in batch
- If <100% coverage → Repeat from step 2a
3. **Batch Completion Verification**:
- Run coverage for ALL test files in batch together
- Verify EVERY source file in batch is at 100%
- Count total tests created vs deleted
- Calculate coverage efficiency (coverage % per test)
4. **Standards Compliance Check**:
- Run: `npm run lint` on all created test files
- Verify all tests follow testing.md standards
- Fix any TypeScript errors
- Ensure proper documentation
**CRITICAL REMINDERS**:
- You MUST write tests one at a time with immediate coverage verification
- You MUST delete any test that doesn't improve coverage
- You MUST continue until ALL files in your batch reach 100%
- You CANNOT move to next batch until current batch is complete
- You MUST follow testing.md standards (especially Zero Redundancy Rule)
**Report**
**[IMPORTANT]** You're requested to return the following batch results:
- All test files created for your batch
- Coverage metrics for each source file (must be 100%)
- Test count statistics (created, kept, deleted)
- Coverage efficiency metrics
- Standards compliance status
**[IMPORTANT]** You MUST return the following execution report (<1000 tokens):
```yaml
status: success|failure|partial
summary: 'Batch [X]: Achieved 100% coverage for [N] files with [M] tests'
modifications: ['spec/auth/service.spec.ts', 'spec/users/controller.spec.ts', ...]
outputs:
batch_info:
batch_number: X
source_files_count: N
total_source_lines: M
coverage_per_file:
- file: 'src/auth/service.ts'
test_file: 'spec/auth/service.spec.ts'
coverage:
lines: '100%'
branches: '100%'
statements: '100%'
functions: '100%'
tests_created: 25
tests_kept: 18
tests_deleted: 7
- file: 'src/users/controller.ts'
test_file: 'spec/users/controller.spec.ts'
coverage:
lines: '100%'
branches: '100%'
statements: '100%'
functions: '100%'
tests_created: 30
tests_kept: 22
tests_deleted: 8
batch_summary:
total_tests_created: 55
total_tests_kept: 40
total_tests_deleted: 15
coverage_efficiency: '2.5% per test' # (100% coverage / 40 tests)
standards_compliance:
testing_standard: pass|fail
typescript_standard: pass|fail
documentation_standard: pass|fail
verification:
all_files_100_percent: true|false
all_tests_passing: true|false
lint_check: pass|fail
issues: ['issue1', 'issue2', ...] # only if problems encountered
```
<<<
Skip review phase if all batches report success. Only trigger review if batches report partial success or issues.
What You Do:
OUTPUT from Step 2: Complete test suite with 100% coverage for all source files
Step Configuration:
KEY INNOVATION: Use Plan subagent to analyze all tests and identify potential redundancies, then execute removals in parallel.
What You Do:
What You Send to Plan Subagent:
Use the Task tool with subagent_type="Plan" to dispatch the plan subagent:
>>>
**ultrathink: adopt the Test Redundancy Analyst mindset**
- You're a **Test Redundancy Analyst** with deep expertise in identifying unnecessary tests who follows these principles:
- **Coverage Analysis**: Understand which tests cover which code paths
- **Redundancy Detection**: Identify tests that duplicate coverage without adding value
- **Strategic Planning**: Create removal strategy that preserves 100% coverage
- **Risk Assessment**: Flag tests that appear redundant but may be essential
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Read the following assigned standards** to understand redundancy criteria:
- testing.md (especially Zero Redundancy Rule and Minimal Testing Principle)
**Assignment**
Analyze all test files and identify potential redundant tests.
**Analysis Steps**:
1. **Read all test files** created in Step 2
2. **For each test**, determine:
- What source code lines it covers
- What branches it exercises
- What unique behavior it verifies
3. **Identify redundancy patterns**:
- Tests with same logic but different data values
- Tests that cover same lines as other tests
- Tests for artificial scenarios (not real edge cases)
- Wrapper function tests (just calling other functions)
4. **Create removal candidates list**:
- Group tests by file
- Mark each as: 'safe_to_remove', 'uncertain', 'keep'
- Provide removal strategy for each group
5. **Create removal tasks**:
- Group removal candidates into tasks (max 10 tests per task)
- Specify removal order (remove least risky first)
**Report**
**[IMPORTANT]** You're requested to return:
- List of all tests analyzed
- Redundancy candidates grouped by file
- Removal tasks with specific test names
- Risk assessment for each candidate
- Estimated coverage preservation likelihood
Provide a comprehensive plan for redundant test removal that the orchestrator can use to dispatch parallel removal subagents.
<<<
4. Receive Plan subagent report 5. Parse removal tasks from plan 6. Use TodoWrite to create task list from removal tasks (each task = one todo item) 7. Prepare removal task assignments for parallel execution
OUTPUT from Phase 1: Removal tasks ready for parallel dispatch
What You Send to Subagents:
In a single message, you spin up multiple Test Removal Agents to perform removal attempts, up to 10 tasks at a time.
Request each Test Removal Agent to perform the following:
>>>
**ultrathink: adopt the Surgical Test Removal Expert mindset**
- You're a **Surgical Test Removal Expert** who follows these principles:
- **Coverage Preservation**: 100% coverage must be maintained
- **Careful Removal**: Remove one test at a time, verify immediately
- **Rollback Ready**: Restore test if coverage drops
- **Verification Focus**: Coverage reports guide all decisions
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Assignment**
You're assigned Removal Task [X] - attempt to remove the following tests:
- Test: '[test name 1]' at line [N] in [test file]
- Reason: [redundancy reason]
- Risk: [low|medium]
- Test: '[test name 2]' at line [M] in [test file]
- Reason: [redundancy reason]
- Risk: [low|medium]
- [... up to 10 tests per task]
**Steps - CRITICAL WORKFLOW**
**FOR EACH test in your assignment:**
1. **Pre-removal coverage check**:
- Run: `vitest --coverage spec/path/to/file.spec.ts`
- Note current coverage percentages (must be 100%)
2. **Remove single test**:
- Comment out or delete the specific test block
- Save file
3. **Post-removal coverage verification**:
- Run: `vitest --coverage spec/path/to/file.spec.ts`
- Compare with pre-removal coverage
4. **Decision**:
- **IF coverage maintained at 100%**:
- KEEP test removed ✓
- Log: "Test successfully removed - redundant"
- Continue to next test
- **IF coverage dropped (even 1%)**:
- RESTORE test immediately ✗
- Log: "Test necessary - restored"
- Mark as 'essential'
5. **Move to next test** in assignment
**Report**
**[IMPORTANT]** You're requested to return:
- Tests attempted for removal
- Tests successfully removed
- Tests restored (coverage dropped)
- Final coverage status
**[IMPORTANT]** You MUST return the following execution report (<1000 tokens):
```yaml
status: success|failure|partial
summary: 'Removal Task [X]: Removed [N] redundant tests, restored [M] essential tests'
modifications: ['spec/auth/service.spec.ts', ...]
outputs:
task_info:
task_id: X
tests_attempted: 10
tests_removed: 7
tests_restored: 3
removal_details:
- test_name: 'should calculate tax for $100'
action: 'removed'
coverage_before: '100%'
coverage_after: '100%'
outcome: 'success'
- test_name: 'should validate email format'
action: 'restored'
coverage_before: '100%'
coverage_after: '98%'
outcome: 'essential - coverage dropped'
final_coverage:
lines: '100%'
branches: '100%'
statements: '100%'
functions: '100%'
verification:
coverage_maintained: true|false
all_tests_passing: true|false
issues: ['issue1'] # if any
```
<<<
Skip review - coverage verification is built into removal process.
What You Do:
OUTPUT from Step 3: Optimized test suite with redundant tests removed, 100% coverage maintained
Step Configuration:
What You Do:
find in bash)OUTPUT from Planning: Task assignments ready for dispatch
What You Send to Subagents:
In a single message, you spin up Test Issue Fixing Agents, up to 10 at a time if batching is needed.
Request each Test Issue Fixing Agent to perform the following:
>>>
**ultrathink: adopt the Test Standards Enforcer mindset**
- You're a **Test Standards Enforcer** with deep expertise in test quality who follows these principles:
- **Standards Mastery**: Apply all testing, TypeScript, and documentation standards thoroughly
- **Issue Correction**: Fix logic errors, type issues, and standards violations
- **Preservation Focus**: Maintain test intent and coverage while fixing
- **Quality Assurance**: Verify all fixes through testing and linting
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Read the following assigned standards** and follow them recursively (if A references B, read B too):
- testing.md
- typescript.md
- documentation.md
**Assignment**
You're assigned to fix issues in the following test files:
- [test file 1]
- [test file 2]
- [... up to 10 files if batching, or all files if ≤25]
**Steps**
1. **Analysis Phase**:
- Read each test file to understand current issues
- Identify standards violations
- Note logic errors or incorrect behavior
2. **Issue Fixing**:
- Fix TypeScript errors (no `any` types)
- Apply AAA pattern corrections
- Ensure proper test naming
- Add missing documentation
- Correct test logic issues
3. **Verification**:
- Run: `npm run test` to ensure all tests pass
- Run: `npm run lint` to verify standards compliance
- Run: `npx tsc --noEmit` for type checking
- Verify coverage maintained at 100%
**Report**
**[IMPORTANT]** You're requested to return:
- Test files modified
- Issues fixed (type errors, logic errors, standards violations)
- Verification results
**[IMPORTANT]** You MUST return the following execution report (<1000 tokens):
```yaml
status: success|failure|partial
summary: 'Fixed [N] issues across [M] test files'
modifications: ['spec/auth/service.spec.ts', ...]
outputs:
issues_fixed:
type_errors: N
logic_errors: M
standards_violations: X
documentation_missing: Y
verification:
all_tests_passing: true|false
lint_check: pass|fail
type_check: pass|fail
coverage_maintained: '100%'
standards_compliance:
testing_standard: pass|fail
typescript_standard: pass|fail
documentation_standard: pass|fail
issues: ['issue1'] # if any
```
<<<
Skip review if all reports show success. Only trigger if issues reported.
What You Do:
OUTPUT from Step 4: Test files with all issues resolved and standards compliance verified
Step Configuration:
KEY INNOVATION: Use Plan subagent to analyze fixture structure and identify consolidation opportunities.
What You Do:
What You Send to Plan Subagent:
Use the Task tool with subagent_type="Plan":
>>>
**ultrathink: adopt the Test Structure Architect mindset**
- You're a **Test Structure Architect** with deep expertise in fixture organization who follows these principles:
- **Pattern Recognition**: Identify duplicate fixture patterns
- **Organization Design**: Create logical fixture structure
- **Reusability Focus**: Maximize fixture reuse across tests
- **Cleanup Awareness**: Identify unused fixtures and mocks
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Read the following assigned standards**:
- testing.md (Test Double Organization section)
- typescript.md
- documentation.md
**Assignment**
Analyze all fixtures, mocks, and test support files and create restructuring plan.
**Analysis Steps**:
1. **Discover all test support files**:
- Find fixtures: spec/fixtures/**/*.ts
- Find mocks: spec/mocks/**/*.ts
- Find inline fixtures in test files
- Find inline mocks in test files
2. **Identify duplication patterns**:
- Similar fixture data in multiple files
- Repeated mock configurations
- Inline fixtures that could be shared
3. **Analyze organization**:
- Current directory structure
- Naming consistency
- Type safety compliance
4. **Find unused files**:
- Fixtures not imported by any test
- Mocks defined but never used
- Factory functions without references
5. **Create restructuring plan**:
- Consolidation opportunities (which fixtures to merge)
- Organization improvements (directory structure changes)
- Deletion candidates (unused files)
- Migration strategy (how to refactor safely)
**Report**
Provide comprehensive restructuring plan that the orchestrator can use to execute fixture consolidation and organization improvements.
<<<
4. Receive Plan subagent report 5. Parse restructuring plan 6. Use TodoWrite to create execution tasks from plan 7. Prepare execution assignments
OUTPUT from Phase 1: Restructuring execution plan ready
What You Send to Subagent(s):
Based on plan complexity, dispatch 1 subagent (simple) or multiple subagents (complex).
>>>
**ultrathink: adopt the Test Refactoring Specialist mindset**
- You're a **Test Refactoring Specialist** who follows these principles:
- **Safe Refactoring**: Preserve test functionality while restructuring
- **Type Safety**: Maintain TypeScript compliance throughout
- **Incremental Changes**: Apply changes step-by-step with verification
- **Testing Focus**: Verify tests pass after each change
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Read the following assigned standards**:
- testing.md
- typescript.md
- documentation.md
**Assignment**
Execute the restructuring plan provided:
[Include relevant portion of plan for this subagent]
**Steps**:
1. **Create new shared fixture/mock files** as specified in plan
2. **Migrate fixtures/mocks** from old locations to new shared files
3. **Update imports** in all test files using the migrated fixtures/mocks
4. **Remove old fixture definitions** (inline or in old files)
5. **Delete unused files** as identified in plan
6. **Verify tests** after each major change:
- Run: `npm run test`
- Ensure all tests still pass
- Fix any broken imports or references
7. **Type check** all changes:
- Run: `npx tsc --noEmit`
- Fix any TypeScript errors
8. **Lint check**:
- Run: `npm run lint`
- Fix any linting issues
**Report**
**[IMPORTANT]** You're requested to return:
- Files created (shared fixtures/mocks)
- Files modified (test files with updated imports)
- Files deleted (unused fixtures/mocks)
- Verification results
**[IMPORTANT]** You MUST return the following execution report (<1000 tokens):
```yaml
status: success|failure|partial
summary: 'Restructuring complete - created [N] shared files, migrated [M] fixtures'
modifications: ['spec/fixtures/user.fixture.ts', 'spec/auth/service.spec.ts', ...]
outputs:
restructuring_summary:
shared_files_created: N
fixtures_consolidated: M
mocks_consolidated: X
unused_files_deleted: Y
test_files_updated: Z
created_files:
- file: 'spec/fixtures/user.fixture.ts'
exports: ['createUser', 'createAdminUser']
consolidates: ['spec/auth/fixtures.ts', 'spec/users/fixtures.ts']
- file: 'spec/mocks/api-client.mock.ts'
exports: ['createMockApiClient']
consolidates: ['inline from 3 files']
deleted_files:
- 'spec/fixtures/old-format.fixture.ts'
- 'spec/mocks/deprecated.mock.ts'
verification:
all_tests_passing: true|false
type_check: pass|fail
lint_check: pass|fail
imports_valid: true|false
issues: ['issue1'] # if any
```
<<<
Skip review - verification is built into restructuring process.
What You Do:
OUTPUT from Step 5: Restructured fixture/mock organization with improved reusability
Step Configuration:
KEY INNOVATION: Delegate entire verification to a subtask subagent for independent validation.
What You Do:
OUTPUT from Planning: Verification subtask ready for delegation
What You Send to Subtask:
Use the Task tool to delegate verification to independent subagent:
>>>
**ultrathink: adopt the Quality Assurance Validator mindset**
- You're a **Quality Assurance Validator** performing final comprehensive verification with these principles:
- **Independent Validation**: Verify all claims independently
- **Comprehensive Checking**: Test all aspects (coverage, passing, standards, efficiency)
- **Metrics Focus**: Provide concrete numbers and measurements
- **Pass/Fail Authority**: Make final determination on test suite quality
<IMPORTANT>
You've to perform the task yourself. You CANNOT further delegate the work to another subagent
</IMPORTANT>
**Read the following standards to verify compliance**:
- testing.md
- typescript.md
- documentation.md
**Assignment**
Perform final comprehensive verification of test suite.
**Verification Steps**:
1. **Coverage Verification**:
- Run: `npm run coverage` or `vitest --coverage`
- Extract final metrics:
- Line coverage: must be 100%
- Branch coverage: must be 100%
- Statement coverage: must be 100%
- Function coverage: must be 100%
- Verify NO uncovered code remains
- Check coverage reports for accuracy
2. **Test Execution Verification**:
- Run: `npm run test`
- Verify ALL tests pass
- Count total tests
- Note execution time
- Check for flaky tests (run twice if suspicious)
3. **Standards Compliance Verification**:
- Run: `npm run lint`
- Verify: No linting errors
- Check TypeScript: `npx tsc --noEmit`
- Verify: No type errors
- Manually review test structure compliance:
- AAA pattern usage
- Proper naming conventions
- JSDoc documentation
- Type safety (no `any` types)
4. **Efficiency Metrics**:
- Calculate:
- Total source files
- Total test files
- Total tests
- Average tests per source file
- Coverage per test ratio
- Test suite execution time
- Assess:
- Are tests minimal? (testing.md Minimal Testing Principle)
- Are fixtures properly organized?
- Is redundancy eliminated?
5. **Final Quality Assessment**:
- Overall grade: A/B/C/D/F
- Production readiness: yes/no
- Blockers: list any
- Recommendations: list improvements if any
**Report**
Provide comprehensive final verification report with pass/fail verdict and quality assessment.
<<<
Skip review - this is the final verification step.
What You Do:
OUTPUT from Step 6: Final validation confirming test suite quality
Report the workflow output as specified:
workflow: complete-test
status: completed|failed
outputs:
step_1_baseline:
initial_coverage: 'X%'
uncovered_files: N
analysis_status: completed
step_2_progressive_writing:
batches_executed: N
source_files_covered: M
tests_created: X
tests_kept: Y
tests_deleted: Z
final_coverage: '100%'
writing_status: completed
step_3_redundancy_removal:
redundancy_candidates_identified: N
tests_removed: M
tests_kept_essential: X
coverage_maintained: '100%'
removal_status: completed
step_4_issue_fixing:
test_files_fixed: N
issues_resolved: M
standards_compliance: 'pass'
fixing_status: completed
step_5_fixture_restructuring:
shared_fixtures_created: N
fixtures_consolidated: M
unused_files_deleted: X
restructuring_status: completed
step_6_final_verification:
coverage_verified: '100%'
all_tests_passing: true
standards_compliant: true
efficiency_grade: 'A|B|C|D|F'
production_ready: true|false
verification_status: pass|fail
final_metrics:
total_source_files: N
total_test_files: M
total_tests: X
coverage_percentage: '100%'
tests_per_source_file: Y
redundancy_eliminated: Z
test_suite_execution_time: 'W seconds'
workflow_summary: |
Successfully created comprehensive test suite with 100% coverage for [N] source files.
Created [M] tests through progressive writing with coverage verification.
Removed [X] redundant tests while maintaining 100% coverage.
Fixed [Y] test issues and ensured standards compliance.
Restructured fixtures for improved organization and reusability.
Final verification confirms production-ready test suite with grade [A/B/C/D/F].
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.