defrag
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
- Determine the target scope.
- Read the relevant files or the user's current selection.
- Inspect the code for the refactoring types listed below.
- If git history is available, inspect the last 30 days to find change hotspots. Prefer
scripts/git_hotspots.pyfor consistent counts. - Score each candidate refactor with the provided weighting model.
- Return the top 10 opportunities sorted by value score.
- 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.
More from hexbee/hello-skills
deep-productivity
Master deep work productivity through the three types of work framework (Building, Maintenance, Recovery). Use when user needs to: (1) Build a sustainable deep work routine with just 1 hour/day, (2) Create vision/anti-vision for life direction, (3) Structure goals using the 10-year → 1-year → 1-month → 1-week hierarchy, (4) Apply project-based learning to bridge skill gaps, (5) Identify lever-moving tasks that actually progress goals, (6) Balance focus work with necessary recovery for creativity.
852mungers-lattice
Multidisciplinary analytical engine using Charlie Munger's latticework of mental models. Applies cross-disciplinary thinking (math, physics, biology, psychology, economics) to dissect life and business decisions. Use when user presents a decision problem, investment question, or complex analysis request requiring deep rational analysis.
86cross-domain-thinking-toolbox
Apply 25 professional mental models to solve complex problems. Use when: (1) facing multi-faceted challenges that require diverse perspectives, (2) stuck in single-minded approaches, (3) need innovative solutions, (4) making major decisions with multiple stakeholders, (5) understanding complex human behavior, or (6) seeking to break cognitive biases and adopt alternative viewpoints.
79hn-top10
Fetch the current top Hacker News stories and return agent-friendly structured results. Use this whenever the user explicitly asks about Hacker News or HN, and also when they ask for today's developer, startup, YC, or tech-community hot stories where Hacker News is a strong default source.
71learning-first-principles
A cognitive framework based on learning first principles, providing learning method diagnosis, efficiency assessment, and optimization advice. Use when: (1) Diagnosing if current learning methods align with first principles, (2) Evaluating learning plan efficiency and time investment, (3) Analyzing learning behavior problems and providing improvement suggestions, (4) Determining if learning content is worth the time investment. Core principle chain: Self-learning → Induction → Self-output → Expression restructuring → Logical understanding → Practice.
64instreet-operator
Use this when working with InStreet forum or Playground flows. It restores account state from ~/.instreet, can auto-register when no local account exists, and routes all InStreet API requests through the bundled Python client. It has first-class commands for forum, groups, literary, arena, oracle, and games workflows, with raw api fallback for long-tail endpoints.
58