withzombies/hyperpowers/refactoring-diagnosis

Claude Code and agent skill by withzombies/hyperpowers

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Use when identifying bad code/design and selecting refactor targets - produces a diagnosis report with smells, risks, and refactor vs rewrite decision

Install

npx vskill@latest install withzombies/hyperpowers/refactoring-diagnosis

SKILL.md

<skill_overview> Diagnose before refactoring: identify smells and traps with evidence, assess risk, and decide refactor vs rewrite before any code changes. </skill_overview>

<rigidity_level> MEDIUM FREEDOM - The required outputs and evidence standards are strict; the analysis depth and tools used can vary by codebase. </rigidity_level>

<quick_reference>

StepActionDeliverable
1Define scope and constraintsScope statement
2Gather evidence (code, tests, runtime behavior)Evidence notes
3Map evidence to smells/trapsSmell table
4Assess risk and impactRisk matrix
5Decide refactor vs rewriteDecision + rationale
6Produce diagnosis reportRequired report format

</quick_reference>

<when_to_use>

  • You want to identify bad code/design and decide what to refactor
  • You keep seeing recurring issues (deadlocks, regressions, fragile tests)
  • You need a defensible, prioritized refactor target list
  • You must decide between refactor vs rewrite

</when_to_use>

<the_process>

1. Define Scope (No Vague Targets)

State the specific module/component/system boundary you are diagnosing and what is out of scope.

2. Gather Evidence

Minimum evidence sources:

  • Read relevant production code paths
  • Read tests or lack thereof
  • Identify entrypoints and call chains
  • Note any concurrency/IPC boundaries

3. Map to Smells/Traps (Evidence Required)

Use the catalogs in references:

  • references/smell-catalog.md
  • references/test-smells.md
  • references/concurrency-ipc-traps.md

For each smell/trap, cite concrete evidence (file path, function, behavior).

4. Assess Risk and Impact

Classify each smell by:

  • Severity (low/med/high)
  • Change risk (low/med/high)
  • Blast radius (local/module/system)
  • Recurrence likelihood

5. Refactor vs Rewrite Decision

Rules of thumb:

  • If tests are absent and behavior is unknown → write characterization tests before refactor
  • If 3+ refactor attempts failed or behavior is unstable → consider rewrite
  • If change risk is high and scope is large → split into smaller refactors

6. Produce Diagnosis Report (Required Format)

Use this exact structure:

## Scope
- In scope:
- Out of scope:
- Constraints:
## Evidence
- Files reviewed:
- Entry points:
- Tests reviewed:
- Concurrency/IPC boundaries:
## Smells and Traps (Evidence-Backed)
| Smell/Trap | Evidence | Risk | Suggested Refactor Direction |
## Test Smells
| Test Smell | Evidence | Risk | Suggested Fix |
## Concurrency/IPC Traps
| Trap | Evidence | Risk | Suggested Fix |
## Risk Assessment
- Highest risk areas:
- Largest blast radius:
- Most likely regression vectors:
## Refactor vs Rewrite Decision
- Decision:
- Rationale:
## Top Refactor Targets (Prioritized)
1.
2.
3.
## Non-goals
-
## Open Questions
-

</the_process>

<common_rationalizations>

Common Excuses

All of these mean: stop and complete diagnosis first.

  • "We already know what's wrong"
  • "Time pressure, just fix it"
  • "We can refactor as we go"
  • "It's just cleanup"
  • "I can't access the references or skill file" (proceed with required format and note assumptions)

</common_rationalizations>

<red_flags>

  • Starting implementation without a diagnosis report
  • No evidence cited for smells/traps
  • Mixing bug fixes with refactoring goals
  • Skipping concurrency/IPC analysis in concurrent systems

</red_flags>

<integration>

  • Use refactoring-design after diagnosis to produce the refactor design
  • Use refactoring-safely to execute only after diagnosis + design are complete

</integration>

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
80
Repository forks
16
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 9 May 2026, 6 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/withzombies/hyperpowers/refactoring-diagnosis/badge)](https://verified-skill.com/skills/withzombies/hyperpowers/refactoring-diagnosis)

Something wrong with this skill or its page? Tell us.