withzombies/hyperpowers/refactoring-design
Claude Code and agent skill by withzombies/hyperpowers
- community
Checking that the SKILL.md file is still in the repository.
Use when designing a refactor after diagnosis - selects patterns, defines composition and DI seams, and produces a test-ready refactor design spec
Install
npx vskill@latest install withzombies/hyperpowers/refactoring-designSKILL.md
<skill_overview> Design the refactor before touching code: choose the target structure, composition boundaries, DI seams, and a test strategy for happy/error paths. </skill_overview>
<rigidity_level> MEDIUM FREEDOM - Required outputs are strict; pattern selection and sequencing can vary by codebase. </rigidity_level>
<quick_reference>
| Step | Action | Deliverable | |
|---|---|---|---|
| 1 | Review diagnosis report | Confirmed refactor targets | |
| 2 | Define target design | Component diagram + responsibilities | |
| 3 | Choose refactor patterns | Pattern mapping | |
| 4 | Define DI seams | Interfaces + wiring plan | |
| 5 | Encode invariants | Invalid states unrepresentable plan | |
| 6 | Write test strategy | Happy/error tests + concurrency | |
| 7 | Produce design spec | Required format |
</quick_reference>
<when_to_use>
- You have a diagnosis report and need a refactor design
- You want composition-first architecture and DI seams
- You need a test plan for happy paths and error states
</when_to_use>
<the_process>
1. Confirm Inputs
You must have a diagnosis report from refactoring-diagnosis.
2. Define the Target Design
Specify:
- Components/classes/modules and responsibilities
- Composition boundaries and ownership
- Data flow and error flow
3. Choose Refactor Patterns
Use the mapping in references/patterns-and-choices.md to select refactor patterns that address the diagnosed smells.
4. Define DI Seams
State:
- What dependencies become interfaces
- How they are injected (constructor, factory, parameter)
- What default implementations are used
5. Encode Invariants
Use references/type-driven-design.md to:
- Make invalid states unrepresentable
- Parse at boundaries, not throughout the core
- Define explicit error types for failure modes
6. Test Strategy
Design tests that use DI:
- Happy path tests for each component
- Error path tests for each dependency failure
- Concurrency/IPC tests where applicable
7. Produce Refactor Design Spec (Required Format)
Use this exact structure:
</the_process>
<common_rationalizations>
Common Excuses
All of these mean: stop and complete the design spec first.
- "We'll figure it out as we code"
- "This is just cleanup"
- "Design is overkill"
- "I can't access the references or skill file" (proceed with required format and note assumptions)
</common_rationalizations>
<red_flags>
- No DI seams defined for dependencies
- No error-path tests planned
- Invariants left as comments instead of types
- Pattern choices not linked to smells
</red_flags>
<integration>
- Requires
refactoring-diagnosis refactoring-safelyexecutes the refactor only after this design exists
</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
- SKILL.md in the repositoryCheckingskills/refactoring-design/SKILL.md
Popularity
- Repository stars
- 69
- Repository forks
- 12
- 7-day trend score
- 21
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 16 Mar 2026, 8 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
[](https://verified-skill.com/skills/withzombies/hyperpowers/refactoring-design)