Refactor code
Safe refactors with simplify and review. Restructure code without changing behavior, then bundle the verify-and-commit step with ship.
Overview
- **Goal**: cleaner code, behavior preserved, reviewed and committed.
- **Time**: 20–60 minutes.
- **Skills used**: plan, implement, ship.
Prerequisites
- A green test suite (the safety net for behavior-preserving changes).
- A scoped refactor goal — avoid open-ended rewrites.
Step 1: Plan the refactor
Define the target structure and the steps to get there without behavior change.
/vk:eng:plan "<refactor goal>"Step 2: Implement the restructuring
Apply the plan; keep tests green after every logical step.
/vk:eng:implement "from latest plan"Step 3: Ship (simplify + test + review + commit)
/vk:eng:ship bundles the post-refactor cleanup: simplify, test, code review, and commit in one command. There is no separate /vk:eng:simplify skill.
/vk:eng:shipNext steps
- Optimize performance — If the refactor was a precursor to perf work.
- Documentation — Reflect structural changes in the docs.