extract-class-advisor
Purpose
Detect classes with swollen responsibilities and propose extract-class refactors that improve cohesion and reduce coupling.
Trigger this skill when
- You need a focused refactoring analysis or artifact rather than generic commentary.
- Code quality, maintainability, or testability concerns are affecting delivery.
- You need a reusable output another developer or agent can extend safely.
Expected inputs
- code, module, diff, or architecture slice under review
- known pain points or goals
- constraints or risk tolerance
- existing tests or validation signals
Deliverables
- refactor plan or advisory output
- ranked recommendations or plan
- assumptions and unresolved questions
- recommended next skill
Operating procedure
- Clarify the target artifact, pain point, and what successful improvement would look like.
- Separate explicit evidence from assumptions, missing context, or inference.
- Apply the relevant smell, anti-pattern, dependency, or refactor framing consistently.
- Produce compact findings that support prioritization, safe change, and validation.
- Recommend the next most useful refactoring, review, or testability step.
Quality gates
- Do not recommend refactors with no clear payoff, safety story, or validation path.
- Make uncertainty, evidence quality, and likely blast radius explicit.
- Prefer incremental, reversible changes over speculative rewrites.
- Tie recommendations to maintainability, correctness, testability, or delivery risk.
Handoff targets
- code-smell-detector
- dependency-simplifier
- refactoring-candidate-ranker
Output style
- Be explicit about evidence quality and uncertainty.
- Prefer structured findings over narrative filler.
- Tie recommendations to maintenance cost, defect risk, or delivery consequence.
- Use severity, priority, or confidence labels when useful.
Failure modes to avoid
- Do not equate unfamiliar style with a smell or anti-pattern.
- Do not prescribe rewrites when a smaller refactor would solve the problem.
- Do not hide uncertainty about dynamic behavior, framework constraints, or missing context.
- Do not ignore validation steps when suggesting structural changes.
Minimum output skeleton
## Summary
## Findings
## Structured outputs
## Evidence / confidence
## Assumptions
## Open questions
## Recommended next skill