| name | refactor |
| description | Improve structure while preserving behavior. |
| argument-hint | file, module, subsystem, or smell |
| license | MIT |
| metadata | {"category":"daily-work","tags":["refactor","maintainability"],"effort":"medium","side_effect":"code-write","explicit_invocation":false} |
Refactor
Improve maintainability without behavior changes.
Process
- Read the current implementation and tests.
- Identify the smallest structural improvement.
- Keep public APIs stable unless the user approves a breaking change.
- Run tests before and after when possible.
- Document any risk or behavior uncertainty.
Self-validation
Before final output, verify:
- Route, side-effect, and confirmation requirements match metadata.
- Required artifacts or read-only result are explicit.
- Verification, blockers, and next route are stated.
Rules
- No unrelated cleanup.
- No opportunistic dependency changes.
- Add tests first if behavior is not protected.