Use when designing a refactor after diagnosis - selects patterns, defines composition and DI seams, and produces a test-ready refactor design spec
Creates a refactoring design spec with pattern selection, dependency injection seams, and a comprehensive test strategy.
npx claudepluginhub withzombies/hyperpowersThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/patterns-and-choices.mdreferences/type-driven-design.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>
<the_process>
You must have a diagnosis report from refactoring-diagnosis.
Specify:
Use the mapping in references/patterns-and-choices.md to select refactor patterns that address the diagnosed smells.
State:
Use references/type-driven-design.md to:
Design tests that use DI:
Use this exact structure:
## Target Design
- Components:
- Responsibilities:
- Composition boundaries:
- Data flow:
- Error flow:
## Pattern Mapping
| Smell/Trap | Pattern/Refactor | Rationale |
## Dependency Injection Plan
- Interfaces:
- Injection points:
- Default implementations:
## Invariants and Types
- Invalid states to eliminate:
- Boundary parsing plan:
- Error type strategy:
## Test Strategy
- Happy path tests:
- Error path tests:
- Concurrency/IPC tests:
## Sequencing
1.
2.
3.
## Non-goals
-
</the_process>
<common_rationalizations>
All of these mean: stop and complete the design spec first.
<red_flags>
Activates when the user asks about AI prompts, needs prompt templates, wants to search for prompts, or mentions prompts.chat. Use for discovering, retrieving, and improving prompts.
Search, retrieve, and install Agent Skills from the prompts.chat registry using MCP tools. Use when the user asks to find skills, browse skill catalogs, install a skill for Claude, or extend Claude's capabilities with reusable AI agent components.
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol", "connect external service", mentions "${CLAUDE_PLUGIN_ROOT} with MCP", or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Provides comprehensive guidance for integrating Model Context Protocol servers into Claude Code plugins for external tool and service integration.