code-smell-detector
Purpose
Identify code smells in a change, file, module, or codebase and explain why they increase maintenance cost, defect risk, or design friction.
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
- structured findings or risk review
- 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
- refactoring-candidate-ranker
- duplication-reviewer
- testability-refactor-planner
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
1---2name: code-smell-detector3description: code-smell-detector4---5# code-smell-detector67## Purpose8Identify code smells in a change, file, module, or codebase and explain why they increase maintenance cost, defect risk, or design friction.910## Trigger this skill when11- You need a focused refactoring analysis or artifact rather than generic commentary.12- Code quality, maintainability, or testability concerns are affecting delivery.13- You need a reusable output another developer or agent can extend safely.1415## Expected inputs16- code, module, diff, or architecture slice under review17- known pain points or goals18- constraints or risk tolerance19- existing tests or validation signals2021## Deliverables22- structured findings or risk review23- ranked recommendations or plan24- assumptions and unresolved questions25- recommended next skill2627## Operating procedure281. Clarify the target artifact, pain point, and what successful improvement would look like.292. Separate explicit evidence from assumptions, missing context, or inference.303. Apply the relevant smell, anti-pattern, dependency, or refactor framing consistently.314. Produce compact findings that support prioritization, safe change, and validation.325. Recommend the next most useful refactoring, review, or testability step.3334## Quality gates35- Do not recommend refactors with no clear payoff, safety story, or validation path.36- Make uncertainty, evidence quality, and likely blast radius explicit.37- Prefer incremental, reversible changes over speculative rewrites.38- Tie recommendations to maintainability, correctness, testability, or delivery risk.3940## Handoff targets41- refactoring-candidate-ranker42- duplication-reviewer43- testability-refactor-planner4445## Output style46- Be explicit about evidence quality and uncertainty.47- Prefer structured findings over narrative filler.48- Tie recommendations to maintenance cost, defect risk, or delivery consequence.49- Use severity, priority, or confidence labels when useful.5051## Failure modes to avoid52- Do not equate unfamiliar style with a smell or anti-pattern.53- Do not prescribe rewrites when a smaller refactor would solve the problem.54- Do not hide uncertainty about dynamic behavior, framework constraints, or missing context.55- Do not ignore validation steps when suggesting structural changes.5657## Minimum output skeleton58```md59## Summary60## Findings61## Structured outputs62## Evidence / confidence63## Assumptions64## Open questions65## Recommended next skill66```