create-refactor-plan
БесплатноБез исполняемых скриптовНе проверенWrite a refactor plan: quality gaps as items ordered by impact and effort. Use when planning readability, testability or maintainability work, or technical…
от torrust★ 539 звёзд на GitHubОб этом скилле
Creating Refactor Plans
When to Write a Refactor Plan
Write a refactor plan when:
- A completed implementation has known quality gaps that are not blocking but worth tracking.
- A code review, post-implementation audit, or routine quality check identifies improvements across multiple dimensions (readability, testability, maintainability, modularity, docs).
- The improvements are too numerous or varied to address in a single commit but collectively deserve a structured approach.
Do not write a refactor plan for:
- A single trivial fix — just fix it in place.
- Bug fixes — those belong in issue specs (
docs/templates/ISSUE.md). - Architectural decisions — those belong in ADRs (
docs/templates/ADR.md).
Workflow Overview
- Identify quality gaps by auditing the code, spec, and tests.
- Decompose gaps into discrete, independently completable items.
- Order items by impact vs effort (highest impact / lowest effort first).
- Draft the plan using the template.
- Run linters and fix any issues.
- Commit the plan.
- Implement items one at a time, ticking checkboxes as each is done.
- Revisit the plan after implementation to evaluate whether the template and skill need improvements.
Step-by-Step Process
Step 1: Identify and Categorize Quality Gaps
Review the following dimensions systematically:
| Dimension | Questions to Ask |
|---|---|
| Correctness | Are there edge cases not tested? Does documentation match actual behaviour? |
| Readability | Is intent clear at a glance? Are names self-explanatory? Are surprising choices explained? |
| Testability | Can behaviour be verified without spawning a process? Are unit and integration paths both covered? |
| Maintainability | Are concerns separated? Is any function too long or doing too many things? |
| Modularity | Are abstractions reusable? Are conversions done in idiomatic places (e.g. From impls)? |
| Documentation | Are public APIs documented? Are non-obvious invariants or contract details captured in spec and code? |
Step 2: Write Each Item
Each item in the plan must contain:
- Problem: what is wrong and why it matters — be specific (name files, functions, line ranges).
- Files: the files affected.
- Change: what exactly changes — prefer concrete before/after examples over vague descriptions.
Use the effort and impact labels consistently:
| Impact | Meaning |
|---|---|
| High | Correctness, observability, or user-facing contract issue |
| Medium | Developer experience, maintainability, clarity |
| Low | Nice-to-have polish or future-proofing |
| Effort | Meaning |
|---|---|
| Trivial | One-liner or wording change, no logic involved |
| Low | Small, self-contained code or doc change (< 1 hour) |
| Medium | Moderate refactor or new abstraction (1–4 hours) |
| High | Significant new code, e.g. mock server (> 4 hours) |
Step 3: Order Items
Sort items in the plan and in the execution table by:
- Highest impact first.
- Lowest effort first within the same impact band.
This ensures the most valuable, cheapest improvements are visible and tackled first.
Step 4: Create the Plan File
Plans follow the same drafts/ → open/ → closed/ lifecycle as issue specs.
mkdir docs/refactor-plans/drafts/{short-description}
touch docs/refactor-plans/drafts/{short-description}/REFACTOR-PLAN.md
Use the template at docs/templates/REFACTOR-PLAN.md.
Name the record directory {related-artifact-short-description}. Its primary document is always
REFACTOR-PLAN.md; keep related evidence and reports beside it in the same directory.
Example: 1178-monitor-udp-post-implementation-improvements/REFACTOR-PLAN.md
Each item heading uses a checkbox and an impact/effort label:
### 1. [ ] {Title} [HIGH impact / TRIVIAL effort]
The execution table also has a Status column with [ ]:
| 1 | [ ] | {Item} | High | Trivial |
To mark an item done, flip [ ] → [x] in both the heading and the table row.
Step 5: Validate and Commit
Move the plan from drafts/ to open/ when implementation starts:
git mv docs/refactor-plans/drafts/{short-description} \
docs/refactor-plans/open/{short-description}
linter all # Must pass
git add docs/refactor-plans/
git commit -S -m "docs({scope}): add refactor plan for
Установить create-refactor-plan в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл create-refactor-plan?
Write a refactor plan: quality gaps as items ordered by impact and effort. Use when planning readability, testability or maintainability work, or technical debt.
Как установить скилл create-refactor-plan?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл create-refactor-plan запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic