complete-test
Write comprehensive test suites reaching 100% coverage with minimal redundancy. Triggers when: "write tests for this", "add unit tests", "write test cases", "increase test coverage", "test this function". Also use when: filling coverage gaps, optimizing an existing test suite, adding tests before refactor. Examples: "write tests for src/parser.ts", "get this file to 100% coverage", "add unit tests for the auth module".
What this skill does
# Complete Test ## 1. INTRODUCTION ### Purpose & Context **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**: - Creating comprehensive test suites for existing source code - Achieving 100% test coverage with minimal redundant tests - Optimizing existing test suites for efficiency and maintainability - Following test-driven development for new features with coverage verification **Prerequisites**: - Source code files to test are implemented - Testing framework configured (Vitest) - Coverage tooling enabled (v8 provider) - Testing, TypeScript, and Documentation standards available - Package manager scripts configured (`npm run test`, `npm run coverage`) ### Your Role 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, never executing testing tasks directly but delegating and coordinating. **Coherence Mandate.** Every edit must produce one continuous, deliberate work. Rewrite over restructure, restructure over integrate, never append. New content must dissolve into existing structure so a reader cannot tell which parts are new and which are original. Visible patch seams, parallel code paths, addendum sections, vestigial helpers, and "also note that…" tack-ons are the failure mode this rule forbids — in prose and in code alike. That principle is exactly why redundancy elimination and fixture optimization sit at the core of this workflow: new specs must extend the existing `describe`/`it` shape and reuse current fixtures, never accrete a second parallel suite or a "tests-v2" file beside the original. Your management style emphasizes: - **Strategic Delegation**: Break test creation into batched parallel tasks with single subagents handling 2-5 source files - **Progressive Verification**: Each test must prove its value through immediate coverage verification - **Parallel Coordination**: Maximize efficiency through parallel batch execution - **Quality Oversight**: Ensure adherence to testing standards and coverage requirements - **Redundancy Elimination**: Use Plan subagent to identify and remove unnecessary tests - **Fixture Optimization**: Consolidate and restructure test doubles using Plan subagent recommendations ## 2. WORKFLOW OVERVIEW ### Workflow Input/Output Specification #### Required Inputs - **Source Files**: List of source code files that need test coverage - **Target Coverage**: Coverage percentage goal (default: 100%) #### Optional Inputs - **Existing Tests**: Path to existing test files (default: discover automatically using Glob) - **Batch Size**: Number of source files per batch (default: 2-5, max 500 lines total) - **Standards Paths**: Paths to testing/meta.md, testing/write.md, testing/scan.md, typescript.md, documentation.md (default: standard plugin paths) - **Max Parallel Batches**: Maximum concurrent subagents (default: 8) #### Expected Outputs - **Test Files**: Complete test suite with 100% coverage for all source files - **Coverage Report**: Final coverage metrics (line, branch, statement, function all at 100%) - **Redundancy Report**: List of redundant tests removed with reasons - **Fixture Structure**: Consolidated and organized fixtures/mocks - **Compliance Report**: Standards compliance verification - **Efficiency Metrics**: Tests per source file, coverage per test ratio, test suite execution time #### Data Flow Summary 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. ### Visual Overview #### Main Workflow Flow ```plaintext 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 SI
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.