refactor

Installation
SKILL.md

Refactor

Improve code shape without changing behavior. Use this when the user asks to refactor, simplify, tidy, clean up, reduce duplication, improve design, or make code easier to maintain.

Workflow

1. Understand

  • Use $ARGUMENTS, specified files, git diff, staged changes, or the latest commit.
  • If staged changes exist, review git diff HEAD; otherwise review git diff.
  • If there are no Git changes, review the most recently modified files named by the user or touched in the current task.
  • Read the target code, surrounding patterns, tests, contracts, invariants, and verification commands.
  • Identify what behavior must stay the same before editing.
  • For risky refactors, run existing focused tests first to establish the current baseline.

2. Find Simplifications

Look for changes that would make the code easier to understand, maintain, or safely extend:

Related skills
Installs
104
GitHub Stars
93
First Seen
Apr 13, 2026