tdd-refactor-guard

Verify test coverage and generate characterization tests before refactoring code.

1|Updated Mar 26, 2026
One-click install
npx skills add https://github.com/venomez-viper/PathWise --skill tdd-refactor-guard-venomez-viper
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-refactor-guard
Source: https://github.com/venomez-viper/PathWise/tree/main/.claude/skills/testing/tdd-refactor-guard
Command: npx skills add https://github.com/venomez-viper/PathWise --skill tdd-refactor-guard-venomez-viper

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents AI-assisted refactoring from erasing regressions by ensuring test coverage exists and, if missing, generating characterization tests before proceeding.

Core Features & Use Cases

  • Pre-refactor safety gate: checks test coverage before any refactor.
  • Characterization test generation: creates tests when coverage is insufficient.
  • Guided workflow: outlines steps to identify scope, assess coverage, and greenlight changes.

Quick Start

Run the guard before refactoring to verify tests exist and surface coverage gaps.

Frequently Asked Questions about tdd-refactor-guard

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

FAQPage Schema
How do I prevent AI-assisted refactoring from breaking existing code behavior?

To prevent AI-assisted refactoring from breaking code behavior, you need a pre-refactor safety gate that verifies test coverage across public APIs and blocks modifications until passing tests exist.

What is a characterization test and when do I need it before refactoring?

A characterization test captures the current behavior of code before refactoring. You need it when existing test coverage is insufficient, triggering test generation to lock in current outputs before changes.

How do I check test coverage gaps before modifying a specific code scope?

To check test coverage gaps before modifying code, identify the refactoring scope, evaluate existing tests against public APIs, and surface missing coverage areas to determine if generated tests are required.

Can I block refactoring until generated characterization tests pass?

Yes, you can block refactoring until tests pass by using a guided workflow that triggers characterization test generation when coverage is insufficient and halts modifications until tests are green.

What is the best way to safeguard public APIs during code refactoring?

The best way to safeguard public APIs during refactoring is to evaluate current test coverage across those interfaces, surface gaps, and generate characterization tests to prevent regressions.