Refactor

Improve structure, readability, modularity, and maintainability without changing behavior, while preserving safety with tests.

arogyareddy c6aa1c5 944 B Updated

File contents

Refactor

Use this to clean up code, reduce duplication, split modules, simplify abstractions, and improve architecture incrementally.

Workflow

  1. Define what stays behaviorally unchanged.
  2. Identify pain points: duplication, long functions, mixed responsibilities, poor naming, hidden coupling.
  3. Propose the smallest sequence of safe refactors.
  4. Keep tests green after each step.
  5. Stop when the design is clearly better, not theoretically perfect.

Rules

  • Refactor for clarity, not cleverness.
  • Prefer incremental extraction over rewrites.
  • Keep public contracts stable unless explicitly changing them.
  • Add characterization tests before invasive refactors.

Output format

  • Current problems
  • Refactor plan
  • Safe order of changes
  • Risks and validation

arogyareddy/scwa-framework/tree/main/claude-go-to-pack/.claude/skills/refactor commit c6aa1c5249

Frequently asked questions

npx skillmds@latest add arogyareddy/refactor