Refactor

From hawkyre/hawk-skills · View interactive version

Refactor is an AI agent skill from the GitHub repository hawkyre/hawk-skills. Refactor existing code without changing behavior. Use when the user wants to improve readability, modularity, performance, type safety, or reduce duplication.

How to use this skill

Skill file

Refactor Code

Process

  1. Confirm the constraint (ask if not provided):

Always pick ONE dimension. Multi-axis refactors produce unreadable diffs and are impossible to review.

  1. Load context:
  1. Outline the plan:
  1. Execute incrementally: One step at a time. Confirm tests pass between steps. If something breaks, roll back one step, not the whole refactor.
  1. Verify the invariant:

Rules

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.