Help us improve
Share bugs, ideas, or general feedback.
Refactors code while preserving behavior: cleanup, modularize, deduplicate, rename, simplify structure in small reversible steps. Not for behavioral changes.
npx claudepluginhub bravekingzhang/agent-coding-playbook --plugin agent-coding-playbookHow this skill is triggered — by the user, by Claude, or both
Slash command
/agent-coding-playbook:acp-refactorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Use this skill when the user asks for refactoring, cleanup, simplification, modularization, or architecture improvement.
Refactors code to improve structure, readability, and maintainability while preserving behavior. Guides test-driven cycle, checklists, and patterns like extract function.
Refactors code to improve structure, reduce duplication, and apply SRP/DRY principles without changing behavior. Use for incremental code quality enhancements with test verification.
Refactors code to improve structure without changing behavior. Automatically activates when asked to simplify, clean up, or reduce duplication.
Share bugs, ideas, or general feedback.
Use this skill when the user asks for refactoring, cleanup, simplification, modularization, or architecture improvement.
The goal of refactoring is to improve structure while preserving behavior.
If behavior changes, it is not just refactoring anymore.
Before editing, state the exact goal:
Do not refactor just because code looks old or ugly.
Public behavior must remain unchanged unless the user explicitly asks for a behavior change.
Before editing, identify:
Prefer small, reversible changes. For multi-step refactors, create a TodoWrite list so each step (rename, extract, move, dedupe) is tracked and can be verified independently.
Good steps:
Bad steps:
After each meaningful step, run relevant checks when possible:
If checks are unavailable, explain the risk.
Refactor goal:
- ...
Behavior preserved:
- ...
Changed:
- ...
Verified:
- ...
Risk:
- ...
Stop and ask for confirmation if: