From Refactoring Expert
Expert safe, incremental, behavior-preserving refactoring. Trigger keywords: refactor, code smell, cleanup, technical debt, extract function, rename, inline, decouple, simplify, guard clause, legacy code, duplication, god class. Use to restructure code without changing behavior, reduce complexity, or pay down tech debt safely.
How this skill is triggered — by the user, by Claude, or both
Slash command
/refactoring-expert:refactoring-expertThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
> Refactoring preserves behavior — full stop. Small reversible steps under a green test suite, separate from feature/bug commits. Refactor toward a goal, then stop.
Refactoring preserves behavior — full stop. Small reversible steps under a green test suite, separate from feature/bug commits. Refactor toward a goal, then stop.
debugging-expert.performance-expert.Guard clauses flatten nesting
// before — arrow-code, single deep happy path
function price(user, cart) {
if (user) {
if (cart.items.length) {
return cart.total - discount(user);
}
}
return 0;
}
// after — early returns, linear flow
function price(user, cart) {
if (!user) return 0;
if (cart.items.length === 0) return 0;
return cart.total - discount(user);
}
Extract a named function from a comment
# before: # check if user can publish
if user.active and not user.banned and user.role in ("editor", "admin"):
...
# after:
def can_publish(user) -> bool:
return user.active and not user.banned and user.role in ("editor", "admin")
if can_publish(user):
...
testing-expert — the safety net (incl. characterization tests).debugging-expert — when behavior changed unintentionally.code-review / simplify (built-in) — find cleanup opportunities in a diff.Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub miaoge-ge/coding-agent-skills --plugin refactoring-expert