Files
1649fd94-5787-4540-97c7-7df…/.claude/skills/refactor/SKILL.md
kudinDmitriyUp d85a0b8994 Initial commit
2026-05-27 14:08:11 +00:00

1.3 KiB

name, description, disable-model-invocation
name description disable-model-invocation
refactor Systematic refactoring workflow for safe code improvements true

Refactor

Refactor: $ARGUMENTS

Process

  1. Understand current state

    • Read the code to refactor
    • Identify what it does and why
    • Note all usages/dependencies
    • Check for existing tests
  2. Define the goal

    • What problem are we solving?
    • Readability? Performance? Maintainability?
    • What should NOT change? (behavior, API, UI)
  3. Plan changes

    • Break into small, safe steps
    • Each step should leave code working
    • Identify risk points
  4. Execute incrementally

    • One change at a time
    • Verify after each step
    • Keep commits atomic
  5. Common refactors

    • Extract function/component
    • Rename for clarity
    • Simplify conditionals
    • Remove duplication
    • Split large files
    • Move code to better location
  6. Verify

    • Run existing tests
    • Test affected functionality
    • Check for regressions
    • Ensure behavior unchanged
  7. UI Preservation (Critical)

    • Compare CSS classes line by line before consolidating
    • Duplicate code may have subtle differences (sizes, colors)
    • Never assume - verify before merging branches

Output

Report changes made, files affected, and verification steps taken.