void-refactor

Executes named Fowler refactors in separate commits while keeping tests green.

Updated May 29, 2026
One-click install
npx skills add https://github.com/voidcorp-core/void-harness --skill void-refactor-voidcorp-core
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: void-refactor
Source: https://github.com/voidcorp-core/void-harness/tree/main/packages/core/skills/void-refactor
Command: npx skills add https://github.com/voidcorp-core/void-harness --skill void-refactor-voidcorp-core

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring work often gets mixed with feature changes in the same commit, producing unreviewable and unrevertable history, vague "cleanup" commits, and accidental behavior changes that break tests. This Skill enforces a disciplined refactoring workflow where structural changes are isolated, named, and verified. ## Core Features & Use Cases - Two-Hat Discipline: Separates Tidyings (structure-only changes) from Behavior Changes, requiring each to land in its own commit with tests staying green at every step. - Named Fowler Refactors: Restricts changes to a catalog of named refactors (Extract Function, Rename Variable, Move Function, Replace Primitive with Branded Type, etc.) instead of vague restructuring. - Strict and Souple Modes: Strict mode requires one Tidying per commit; souple mode allows mechanical batches of the same refactor applied repeatedly. - Legacy Code Support: Applies Feathers' Sprout Method and Wrap Method to add tested behavior around untested legacy code before refactoring inward. - Use Case: When a function has grown too long before adding a feature, use this Skill to extract helper functions in separate refactor: commits, then switch to TDD for the feature itself. ## Quick Start Ask the agent to refactor the long checkout function by extracting named helpers in separate commits without changing any behavior.

Frequently Asked Questions about void-refactor

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

FAQPage Schema
How do I refactor code without changing behavior?

Apply one named Fowler refactor at a time, such as Extract Function or Rename Variable, run the test suite after each step, and commit each refactor separately. If tests turn red, behavior changed and the work must be recategorized as a TDD task.

What is the Tidy First approach to refactoring?

Tidy First, from Kent Beck, means making structural improvements in separate commits before adding a feature when the current code shape resists the change. Tidyings and behavior changes never share a commit, keeping each commit reviewable and revertable.

How do I refactor legacy code that has no tests?

Use Michael Feathers' Sprout Method or Wrap Method: add new logic in a new tested function called from the legacy code, or wrap the legacy function with a tested delegate. Refactor inward only after a test seam exists.

When should I not refactor code?

Do not refactor without a current task triggering it, for speculative future flexibility (YAGNI), or as a big-bang rewrite. Exploratory code is meant to be thrown away, not refactored, and rewrites belong in a planned feature project.

What is the difference between strict and souple refactoring modes?

Strict mode requires one Tidying per commit named after its Fowler refactor. Souple mode allows batching the same mechanical refactor applied many times, such as renaming a field across 15 occurrences, but never batches different refactors together.