What problem does it solve?
Refactor-workflow prevents accidental behavior changes by forcing a structured, test-gated process that preserves observable behavior while restructuring code.
Core Features & Use Cases
- Caller-first scoping: Enumerates every caller of the target interface to define the real blast radius before any design changes.
- Behavior-preserving gates: Builds a BDD spec of existing behavior (spec gate) and then adapts tests and production code without extending capability (test gate + implementation gate).
- Design before modification: Produces a documented adapter map and key architectural decisions so implementation can’t silently invent structure.
- Use case: Extracting ports/adapters, converting inheritance to protocol-style abstractions, changing interface shapes for callers, or adapting components to new interfaces while guaranteeing the original behavior remains equivalent.
Quick Start
Tell your AI to refactor an existing interface using refactor-workflow by enumerating callers, documenting the current and target interfaces with an adapter map, producing/using a BDD spec gate, adapting tests, and then adapting each caller while ensuring the full existing suite remains green after each caller.