workflow-refactor
Installation
SKILL.md
Refactor Code Skill
Degree of freedom: MIXED. Structure target [HIGH freedom];
behavior-preserving checks and affected tests [LOW freedom — run exactly].
How to reason
- Observe — current structure, callers, tests
- Interpret — duplication vs needed variation
- Classify — extract / inline / rename / stop (behavior would change)
- Severity — a public API change is not this skill
Worked example
Observe: three copy-pasted date formatters; tests only cover one. Interpret: same behavior, three implementations. Classify: extract
formatDate; add the missing two call-site tests first (red), then extract (green). Verify: same output; no new features.