code-refactor

Installation
SKILL.md

Code Refactor

Refactor existing code without changing behavior. The skill's job is to make code easier to understand, modify, and test while keeping the observable contract stable.

Refactoring is not a license for broad cleanup. Treat every edit as a behavior-preserving transformation with evidence, a bounded target, and verification.

Default Behavior

Choose the mode from the user's scope.

  • Broad request: If the user says things like "refactor this module", "clean up this project", or "optimize the code structure", inspect first, propose safe refactor slices, and wait for user approval before broad edits.
  • Narrow request: If the user names a file, function, duplicated block, dead symbol, or specific cleanup, directly implement the smallest safe slice and verify it.
  • Review-only request: If the user asks for code quality review or maintainability findings without asking to edit, use a review skill such as code-quality-review instead.
  • Architecture/RFC request: If the user wants deep-module design, module-boundary candidates, or an RFC, use improve-codebase-architecture instead.

Refactor Types

Classify the requested work before editing. A task may include more than one type, but execute one coherent slice at a time.

Installs
1
GitHub Stars
16
First Seen
Jun 17, 2026
code-refactor — bahayonghang/my-claude-code-settings