Refactoring turns a working-but-alien solution into code expressed in the team's own terms. It is an ownership step, not cosmetic cleanup. section 1.3
Use refactoring as the final stage of a disciplined engineering loop:
- Explore deliberately with a disposable prototype, retaining the learned edge cases and data shape rather than the exploratory code. section 1.3
- Convert discoveries into an executable specification and reviewed plan, then implement tasks small enough to verify individually. section 1.3
- Refactor only after verification, using human judgment to reshape the mechanically produced solution and expose subtle errors. section 1.3
- Break complex modernization into manageable increments and use pull requests for due-diligence review. section 2.11
Incremental legacy modernization
A modernization can separate REST-layer, data-layer, and UI-layer migrations into pull requests, combining AI assistance with rigorous human review and conventional static tools where they fit better. section 2.11
Figure 1.1 The vibe engineering loop carries a feature from open-ended exploration through an executable specification and an iterating verification gate to tested, team-owned code.

Follow the loop from open-ended exploration through specification, verification, and tested team-owned code. section 1.3




























