mg-refactor

Coordinate characterization tests and incremental changes for safe refactoring workflows.

1|1|Updated Feb 4, 2026
One-click install
npx skills add https://github.com/wonton-web-works/miniature-guacamole --skill mg-refactor
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: mg-refactor
Source: https://github.com/wonton-web-works/miniature-guacamole/tree/main/src/framework/skills/mg-refactor
Command: npx skills add https://github.com/wonton-web-works/miniature-guacamole --skill mg-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Coordinates a safe, test-driven refactoring workflow that preserves external behavior while restructuring code and maintaining high test coverage.

Core Features & Use Cases

  • Characterization tests first: QA captures current behavior before any refactor.
  • Green bar before refactor: All tests must pass before making structural changes.
  • Small steps: Refactor in small increments with continuous validation.
  • No behavior changes: Refactor changes structure, not functionality.
  • High coverage: Maintain 99%+ test coverage throughout the refactor.
  • Follow output format: Conforms to prescribed output templates for traceability.

Quick Start

Define your refactor scope and start the characterization-test–driven workflow to refactor in small steps with continuous verification.

Frequently Asked Questions about mg-refactor

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

FAQPage Schema
What is the best way to refactor legacy code without changing its behavior?▼

Safe code refactoring uses characterization tests to capture existing behavior before making incremental structural changes, ensuring the external functionality remains strictly preserved throughout the workflow.

How do I coordinate a test-driven refactor across QA and engineering roles?▼

Cross-role code refactoring requires QA to write characterization tests first, devs to pass all tests before changing structure, and a strict verification gate to maintain high test coverage before merging.

Do I need 99% test coverage before starting an automated refactor workflow?▼

High test coverage is required for automated refactoring workflows because characterization tests validate that external behavior remains unchanged while restructuring code in small, continuously validated increments.

How does a characterization test workflow handle incremental code changes?▼

Characterization testing workflows handle incremental code refactoring by enforcing a green test bar before structural changes, making small modifications, and running continuous validation checks to prevent behavior regressions.

Can I use automated refactoring workflows for large software projects?▼

Automated refactoring workflows apply to software projects of any scale, using a 6-agent spawn cap and cross-role collaboration to coordinate strict verification gates and maintain 99%+ test coverage.

When should I not use an automated test-backed refactoring approach?▼

Test-backed refactoring should be avoided when you need to change application functionality rather than structure, as this workflow enforces no behavior changes and relies entirely on existing characterization tests.