Refactor

Execute one behavior-preserving structural transformation and report evidence. Triggers: "refactor this", "simplify without changing behavior".

majiayu000 f59dcd0 2 files · 2.6 KB Updated 567 repo stars

File contents

Refactor — one structural experiment

Refactor changes structure while preserving observable behavior. It performs one caller-selected transformation and reports the result.

Procedure

  1. Name the preserved behavior and the focused acceptance surface.
  2. Record an honest baseline, including any reproducible ambient failures.
  3. Apply one bounded transformation: extract, rename, inline, simplify, encapsulate, move, or delete dead code.
  4. Run the focused check and the smallest package-level regression check justified by the changed surface.
  5. Return the diff summary, commands, results, and behavior not checked.

Do not combine a newly discovered behavior fix with the structural change. A red result is evidence for the caller; this skill does not revert, narrow, retry, commit, validate, or route subsequent work automatically.

References

  • Behavior-preserving simplification
  • Behavior scenarios

majiayu000/claude-skill-registry-data/tree/main/development/refactor-boshu2-agentops-3 commit f59dcd08df

Frequently asked questions

npx skillmds add majiayu000/refactor-10