refactoring-advisor
Skill0 starsChanged 4 months agoMITView on GitHub
Identifies safe, high-value refactors that preserve externally observable behavior. Use for debt, smells, or “clean this up” asks. Never changes behavior silently or recommends large rewrites without characterization tests and incremental plan.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- isaiahoh/skillstheir own version, first seen Apr 28, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- isaiahoh/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- adr-enforcerSkill
- ai-eval-harnessSkill
- api-contract-guardianSkill
- change-impact-analyzerSkill
- code-reviewerSkill
- context-loaderSkill
- defect-analystSkill
- delivery-plannerSkill
- engineering-mentorSkill
- engineering-osSkill
- feature-implementerSkill
- guardrails-configuratorSkill
- incident-commanderSkill
- loop-engineerSkill
- migration-surgeonSkill
- model-routerSkill
- observability-designerSkill
- performance-auditorSkill
- postmortem-writerSkill
- pr-generatorSkill
- quality-gateSkill
- requirements-grillSkill
- security-auditorSkill
- spec-validatorSkill
- tdd-executorSkill
- test-strategy-designerSkill
- threat-modelerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 46
Prefer rename/extract/module boundaries over framework swaps.
- Distinctive: line 92
Never mix refactors with unrelated features.
- Distinctive: line 93
Never recommend Big Bang rewrites as the default.
- Distinctive: line 94
Never claim “safe” without a validation story.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Purpose
Recommend behavior-preserving improvements prioritized by value × risk.
When to Use / When NOT to Use
Use when: maintainability pain, smells, prep for a feature, explicit refactor ask.
Do not use when: active incident (defect-analyst first); greenfield feature design; user wants a rewrite disguised as cleanup without approval.
Preconditions
Target code accessible. Prefer CONTEXT_PACK for patterns/ADRs.
Inputs / Outputs
Inputs: paths/hotspots, optional defect/debt history, CONTEXT_PACK, ADR_COMPLIANCE.
Outputs: refactor recommendations report (feeds delivery-planner if approved).
Upstream / Downstream
Upstream: code-reviewer, engineering-mentor, quality-gate debt notes.
Downstream: delivery-planner (if work approved), test-strategy-designer (characterization), feature-implementer.
Core Principles
- Behavioral equivalence is mandatory.
- Value = change frequency × complexity × defect history (qualitative OK if cited).
- Characterization tests required before Medium+ risk refactors.
- Incremental PR-sized steps.
- Respect ADRs.
- Reject drive-by cleanup in unrelated PRs.
- Prefer rename/extract/module boundaries over framework swaps.
Process
- Identify smells that matter (dead code, duplication, god objects, leaky boundaries)—ignore pedantry.
- Score value vs risk (Low/Medium/High).
- For Medium+ risk: require characterization/golden tests in the plan before structural change.
- Propose incremental sequence with validation after each step.
- Flag ADR impact → adr-enforcer.
- Explicitly reject suggestions that change UX/API contracts unless user approves a behavior change (then it’s a feature, not a refactor).
Evidence Requirements
Cite files and concrete smell. Value claims need a reason (churn, bugs, complexity).
Stop Conditions / Failure Modes
| Condition | Action |
| Cannot preserve behavior safely | Block / recommend rewrite as feature |
| ADR conflict | Hand off adr-enforcer |
| User wants refactor inside unrelated feature PR | Reject; separate PR |
Severity + Confidence
Align to portfolio severity. Priority: Immediate | Next | Backlog mapped from Critical/High/Medium/Low.
Output Contract
## REFACTOR_ADVICE
Targets: ...
Recommendations (priority ordered):
- smell, value, risk, characterization needed, steps, validation
ADR impact: ...
Decision: Proceed | ProceedWithConditions | Revise | BlockHandoffs
- delivery-planner — sequence approved refactors
- test-strategy-designer — characterization coverage
- adr-enforcer — architectural moves
Never
- Never mix refactors with unrelated features.
- Never recommend Big Bang rewrites as the default.
- Never claim “safe” without a validation story.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

