spec-gen-execute-refactor

Execute refactor plans with read-edit-diff-test gates per change.

270|34|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/clay-good/spec-gen --skill spec-gen-execute-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spec-gen-execute-refactor
Source: https://github.com/clay-good/spec-gen/tree/main/examples/mistral-vibe/skills/spec-gen-execute-refactor
Command: npx skills add https://github.com/clay-good/spec-gen --skill spec-gen-execute-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the safe execution of refactor plans against a codebase, ensuring a plan-driven, auditable workflow that minimizes drift and broken builds.

Core Features & Use Cases

  • Stepwise plan execution: reads the plan, applies targeted changes, validates via git diff, and runs tests before marking changes complete.
  • Green baseline enforcement: requires a clean, passing test baseline before any edits are accepted and after each change.
  • Guarded automation: supports a circuit-breaker and per-change isolation to prevent cascading failures.

Quick Start

Invoke this skill to apply the confirmed refactor plan from .spec-gen/refactor-plan.md to the target codebase.

Frequently Asked Questions about spec-gen-execute-refactor

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

FAQPage Schema
How do I safely automate codebase refactoring without breaking existing tests?

Safe codebase refactoring automation requires a stepwise execution cycle that applies targeted changes, validates them via git diff, and runs tests against a green baseline to prevent broken builds.

What is a deterministic refactor execution workflow?

A deterministic refactor execution workflow reads a structured plan file, applies isolated per-change edits, and enforces read-edit-diff-test gates to ensure auditable, drift-free codebase modifications.

What prerequisites are needed to execute a refactor plan against my codebase?

Executing a refactor plan requires a pre-existing refactor-plan.md file, a clean git state, a passing test baseline, and explicit user confirmation before any automated changes are applied.

How does a circuit-breaker prevent cascading failures during automated refactoring?

A circuit-breaker stops automated refactoring immediately when a test fails or a diff validation errors, ensuring per-change isolation prevents subsequent broken edits from cascading through the codebase.

Can I apply targeted code changes step-by-step instead of refactoring an entire file at once?

Targeted code changes can be applied step-by-step by isolating each edit, validating the git diff, and running tests after every individual modification before proceeding to the next planned change.

Why does my automated refactor require a green test baseline before accepting edits?

A green test baseline is required before accepting edits to guarantee the codebase starts in a passing state, ensuring any test failures during the refactor are directly caused by the new applied changes.