test-coverage-retrofit

Automate unit test retrofitting with coverage-driven planning and parallel generation.

Updated Mar 19, 2026
One-click install
npx skills add https://github.com/drdanmaggs/rocket-fuel --skill test-coverage-retrofit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-coverage-retrofit
Source: https://github.com/drdanmaggs/rocket-fuel/tree/main/internal/plugin/skills/test-coverage-retrofit
Command: npx skills add https://github.com/drdanmaggs/rocket-fuel --skill test-coverage-retrofit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill systematically retrofits unit tests to existing codebases using coverage-driven parallel test writing, enabling teams to raise test quality and achieve high coverage with guided, scalable steps.

Core Features & Use Cases

  • Pattern discovery and planning: identifies test opportunities, architectural conventions, and integration points to focus retrofit efforts.
  • Two-phase test generation: plan and write unit tests first, then integrate tests if needed, with automatic early stopping at target coverage.
  • Haiku-guided test writing: uses lightweight, architecture-aware prompts to generate clear, maintainable tests aligned with project standards.
  • Self-cleaning tests and isolation: encourages dynamic test data and cleanup patterns to prevent pollution and flakiness.
  • Tracking and governance: generates a progress tracker and documentation to monitor coverage improvements over time.

Quick Start

Run the skill in your project root to generate a test retrofit plan and begin writing tests.

Frequently Asked Questions about test-coverage-retrofit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I retrofit unit tests in a legacy codebase to reach high coverage?

Coverage-driven test planning analyzes your codebase to discover architectural patterns and integration points, then generates a phased test plan targeting specific files. This systematic approach focuses retrofit efforts on the most impactful test opportunities rather than writing tests blindly.

Can I automatically generate Vitest tests with coverage targets for an existing project?

Yes, you can generate Vitest tests with coverage targets by running the skill in your project root. It applies Haiku-style guidance to write strict type-safe tests and uses early stopping to automatically halt once your specified coverage threshold is achieved.

What is coverage-driven test pattern discovery and when do I need it?

Coverage-driven test pattern discovery identifies architectural conventions, integration points, and test opportunities by analyzing existing code coverage. You need it when upgrading legacy projects requiring strict coverage upgrades, ensuring new tests align with project standards rather than introducing inconsistent patterns.

Does this test retrofitting approach work for both unit and integration tests?

Yes, the two-phase test generation approach writes unit tests first, then generates integration tests if needed. This sequential method ensures foundational isolation before expanding scope, automatically stopping early once the target coverage threshold is met.

How do I prevent flaky tests when retrofitting unit tests at scale?

Preventing flaky tests during retrofitting requires self-cleaning tests that use dynamic test data and automatic cleanup patterns. This skill enforces test isolation by encouraging cleanup conventions that prevent state pollution across parallel test generation runs.

What are the limitations of automated test retrofitting with Haiku-guided generation?

Automated test retrofitting with Haiku-guided generation relies on discovering existing architectural patterns, meaning poorly structured or undocumented codebases may yield less optimal test plans. Additionally, reaching exactly 95% coverage depends on the accuracy of the underlying Vitest coverage tooling integration.