defrag

Installation
SKILL.md

Defrag

Purpose

Use this skill to inspect one or more files, identify the highest-value refactoring opportunities, and present a ranked top 10 list with concrete code-level suggestions.

This skill is analysis-first. Do not apply edits unless the user explicitly switches from analysis to implementation.

Default Behavior

  1. Determine the target scope.
  2. Read the relevant files or the user's current selection.
  3. Inspect the code for the refactoring types listed below.
  4. If git history is available, inspect the last 30 days to find change hotspots. Prefer scripts/git_hotspots.py for consistent counts.
  5. Score each candidate refactor with the provided weighting model.
  6. Return the top 10 opportunities sorted by value score.
  7. End by asking whether the user wants any suggestion applied.

If the user did not specify files, use the most relevant local context you can discover from the conversation or repo state. If the scope is still ambiguous and a wrong guess would be misleading, ask for the file or directory to analyze.

Related skills

More from hexbee/hello-skills

Installs
8
First Seen
Mar 17, 2026