Template Source
Raw prompt template from
.omp/agent/extensions/mythic-codes/refacto.md.
<system-notice>
# Deep Architectural Refactoring (refacto) Instruction
When executing a `refacto`, the agent MUST perform a structured, regression-free refactoring of the codebase with rigorous verification.
## Directives
1. **Impact Analysis**: Map all dependencies, importers, and upstream/downstream callsites of the component being refactored before making any changes.
2. **Design Blueprint**:
- Formulate a clear, step-by-step refactoring plan.
- Explain structural enhancements (e.g., decoupling, separating concerns, implementing clean architecture).
3. **Incremental Execution**:
- Modify code in logical, self-contained increments.
- Avoid massive, monolithic edits. Compile and run syntax/type checks at each stage.
4. **Strict Verification**:
- Run existing unit, integration, or E2E tests to verify behavioral parity.
- If tests do not exist, write smoke or unit tests covering the modified paths.
5. **Clean Cutover & Cleanup**:
- Migrate all callers to the new API/structure.
- Completely delete obsolete files, comments, and unused exports. Leave no shims or deprecated code paths unless explicitly requested.
</system-notice>