home / skills / sandraschi / advanced-memory-mcp / refactoring-specialist
This skill guides safe code refactoring to improve quality and reduce debt using a structured playbook and evidence-based practices.
npx playbooks add skill sandraschi/advanced-memory-mcp --skill refactoring-specialistReview the files below or copy the command above to add this skill to your agents.
---
name: refactoring-specialist
description: Code refactoring expert for improving code quality, reducing technical debt, and safe transformations
license: Proprietary
---
# Refactoring Specialist
> **Status**: ✅ Research complete
> **Last validated**: 2025-11-08
> **Confidence**: 🟡 Medium — Research-backed refactoring playbook – review annually
## How to use this skill
1. Clarify objectives via [modules/core-guidance.md](modules/core-guidance.md).
2. Assess technical debt with [modules/assessment-and-prioritization.md](modules/assessment-and-prioritization.md).
3. Select tactical moves from [modules/refactoring-patterns.md](modules/refactoring-patterns.md).
4. Build safety nets with [modules/safety-net-and-testing.md](modules/safety-net-and-testing.md).
5. For large initiatives, rely on [modules/architecture-modernization.md](modules/architecture-modernization.md).
6. Manage stakeholders using [modules/change-management-and-communication.md](modules/change-management-and-communication.md).
7. Track follow-ups in [modules/known-gaps.md](modules/known-gaps.md) and revisit [modules/research-checklist.md](modules/research-checklist.md) annually.
## Module overview
- [Core guidance](modules/core-guidance.md) — charter, success metrics, constraints.
- [Assessment & prioritization](modules/assessment-and-prioritization.md) — code smell catalog, impact scoring.
- [Refactoring patterns](modules/refactoring-patterns.md) — common transformations and IDE tooling.
- [Safety net & testing](modules/safety-net-and-testing.md) — characterization tests, automation.
- [Architecture modernization](modules/architecture-modernization.md) — modularization, strangler fig, domain alignment.
- [Change management & communication](modules/change-management-and-communication.md) — stakeholder buy-in, rollout communications.
- [Known gaps](modules/known-gaps.md) — research backlog.
- [Research checklist](modules/research-checklist.md) — annual refresh process.
## Research status
- Incorporates latest refactoring literature, debt metrics research, and evolutionary architecture practices.
- Next review due 2026-11-01 or earlier if major tooling innovations emerge.
- Known gaps track AI-assisted refactoring and socio-technical metrics pending further validation.
This skill is a code refactoring expert focused on improving code quality, reducing technical debt, and performing safe transformations in Python codebases. It provides a structured playbook for setting objectives, assessing debt, selecting refactoring tactics, and building safety nets. The guidance balances incremental fixes with larger architecture modernization when needed. It emphasizes measurable outcomes and repeatable processes.
The skill inspects code quality indicators, catalogs common code smells, and scores issues by risk and impact to prioritize work. It recommends concrete refactoring patterns and IDE/tooling tactics, and designs characterization tests and automation to ensure safety. For larger initiatives it outlines modularization and migration strategies while advising stakeholder communication and rollout plans.
How do you measure success after a refactor?
Use predefined metrics such as reduced cyclomatic complexity, lower bug rates, fewer hotfixes, improved test coverage, and cycle time for related changes.
How do you keep refactors from breaking production?
Use characterization tests, automated CI checks, small incremental changes, feature flags, staged rollouts, and thorough code review to mitigate regression risk.