request-refactor-plan
vinvcn/mattpocock-skills-zh-cn
Create detailed refactor plans with small commits through user interviews, then submit as GitHub issues.
What is request-refactor-plan?
This skill guides you through planning a codebase refactor by conducting a thorough user interview, exploring the repository, breaking the work into tiny commits, and generating a structured GitHub issue. Use it when you need to plan a refactor, create a refactor RFC, or decompose refactoring into safe incremental steps.
- Conducts detailed user interviews to understand refactoring goals and constraints
- Explores the repository to verify assumptions and understand current codebase state
- Explores alternative implementation options with the user
- Breaks refactoring into tiny, working commits following Martin Fowler's principles
- Checks test coverage in the affected areas and discusses testing strategy
- Generates a structured GitHub issue with problem statement, solution, commit plan, and decision document
How to install request-refactor-plan
npx skills add https://github.com/vinvcn/mattpocock-skills-zh-cn --skill request-refactor-planHow to use request-refactor-plan
- 1.Describe the problem you want to solve and any solution ideas you have in mind
- 2.Let the skill explore your repository to understand the current codebase state
- 3.Review and discuss alternative implementation options presented by the skill
- 4.Participate in a detailed interview about your implementation approach and constraints
- 5.Confirm the exact scope of what will and won't be changed
- 6.Review test coverage in the affected areas and discuss your testing plans
- 7.Review the generated commit plan broken into tiny, working steps
- 8.Create the GitHub issue with the generated refactor plan template
Use cases
- Planning a major refactor before implementation to ensure all stakeholders agree on scope and approach
- Creating a refactor RFC (Request for Comments) to document architectural decisions
- Breaking down a large refactoring into safe, reviewable incremental steps
- Documenting refactoring decisions and testing strategy for team alignment
- Software engineers planning refactors
- Tech leads creating refactor proposals
- Teams needing to document refactoring decisions
- Developers breaking down large refactors into manageable pieces
request-refactor-plan FAQ
Yes, the skill allows you to skip steps you consider unnecessary for your specific refactoring.
Each commit should be as small as possible while keeping the codebase in a working state, following Martin Fowler's refactoring principles.
The Decision Document lists implementation decisions made, including modules to modify, interface changes, architectural decisions, schema changes, and API contracts—but not specific file paths or code snippets.
The commit plan should be very detailed and written in plain English, breaking the implementation into the smallest possible commits that maintain a working codebase.
The skill will check test coverage in the affected areas and ask about your testing plans before finalizing the refactor plan.
Full instructions (SKILL.md)
Source of truth, from vinvcn/mattpocock-skills-zh-cn.
name: request-refactor-plan description: 通过用户访谈创建带小提交的详细重构计划,然后作为 GitHub issue 提交。适用于用户想规划重构、创建重构 RFC,或把重构拆成安全的增量步骤时。
当用户想创建 refactor request 时调用此 skill。按以下步骤执行。你可以跳过你认为不必要的步骤。
-
让用户详细描述他们想解决的问题,以及可能的 solution ideas。
-
探索 repo,验证他们的 assertions,并理解 codebase 当前状态。
-
询问他们是否考虑过其他 options,并向他们展示其他 options。
-
围绕 implementation 访谈用户。要非常详细、彻底。
-
敲定 implementation 的 exact scope。弄清你计划改什么,以及不改什么。
-
在 codebase 中检查该区域的 test coverage。如果 coverage 不足,询问用户的 testing plans。
-
把 implementation 拆成 tiny commits 的计划。记住 Martin Fowler 的建议:“make each refactoring step as small as possible, so that you can always see the program working.”
-
使用 refactor plan 创建 GitHub issue。issue description 使用下面模板:
Problem Statement
developer 面对的问题,从 developer 视角描述。
Solution
问题的 solution,从 developer 视角描述。
Commits
一份很长、详细的 implementation plan。用 plain English 写,把 implementation 拆到尽可能小的 commits。每个 commit 都应让 codebase 保持 working state。
Decision Document
已作出的 implementation decisions 列表。可以包括:
- 将 build/modify 的 modules
- 将 modify 的 module interfaces
- 来自 developer 的 technical clarifications
- Architectural decisions
- Schema changes
- API contracts
- Specific interactions
不要包含具体 file paths 或 code snippets。它们可能很快过时。
Testing Decisions
已作出的 testing decisions 列表。包括:
- 什么是好测试的描述(只测试 external behavior,不测试 implementation details)
- 哪些 modules 会被测试
- 测试的 prior art(即 codebase 中类似类型的 tests)
Out of Scope
本 refactor 范围外事项的描述。
Further Notes (optional)
关于 refactor 的其他 notes。
</refactor-plan-template>Related skills
More from vinvcn/mattpocock-skills-zh-cn and the wider catalog.

research
Research topics against primary sources and save findings as Markdown files in your repo.

resolving-merge-conflicts
Resolve git merge/rebase conflicts by understanding intent and preserving both sides when compatible.

scaffold-exercises
Scaffold exercise directory structures with chapters, problems, solutions, and explanations that pass linting.

setup-matt-pocock-skills
Configure repository settings for Matt Pocock's engineering skills: issue tracker, triage labels, and domain docs layout.

setup-pre-commit
Set up Husky pre-commit hooks with lint-staged, Prettier, type checking, and tests.

setup-ts-deep-modules
Enforce deep module boundaries in TypeScript monorepos using dependency-cruiser.