request-refactor-plan

作者: mattpocock

透過使用者訪談,建立包含小型提交的詳細重構計畫,並將其歸檔為 GitHub 議題。適用於使用者想要規劃重構、建立重構 RFC,或將重構拆解為安全漸進步驟時。

npx skills add https://github.com/mattpocock/skills --skill request-refactor-plan

This skill will be invoked when the user wants to create a refactor request. You should go through the steps below. You may skip steps if you don't consider them necessary.

  1. Ask the user for a long, detailed description of the problem they want to solve and any potential ideas for solutions.

  2. Explore the repo to verify their assertions and understand the current state of the codebase.

  3. Ask whether they have considered other options, and present other options to them.

  4. Interview the user about the implementation. Be extremely detailed and thorough.

  5. Hammer out the exact scope of the implementation. Work out what you plan to change and what you plan not to change.

  6. Look in the codebase to check for test coverage of this area of the codebase. If there is insufficient test coverage, ask the user what their plans for testing are.

  7. Break the implementation into a plan of tiny commits. Remember Martin Fowler's advice to "make each refactoring step as small as possible, so that you can always see the program working."

  8. Create a GitHub issue with the refactor plan. Use the following template for the issue description:

Problem Statement

The problem that the developer is facing, from the developer's perspective.

Solution

The solution to the problem, from the developer's perspective.

Commits

A LONG, detailed implementation plan. Write the plan in plain English, breaking down the implementation into the tiniest commits possible. Each commit should leave the codebase in a working state.

Decision Document

A list of implementation decisions that were made. This can include:

  • The modules that will be built/modified
  • The interfaces of those modules that will be modified
  • Technical clarifications from the developer
  • Architectural decisions
  • Schema changes
  • API contracts
  • Specific interactions

Do NOT include specific file paths or code snippets. They may end up being outdated very quickly.

Testing Decisions

A list of testing decisions that were made. Include:

  • A description of what makes a good test (only test external behavior, not implementation details)
  • Which modules will be tested
  • Prior art for the tests (i.e. similar types of tests in the codebase)

Out of Scope

A description of the things that are out of scope for this refactor.

Further Notes (optional)

Any further notes about the refactor.

來自 mattpocock 的更多技能

improve-codebase-architecture
mattpocock
在程式碼庫中尋找深化機會,依據 CONTEXT.md 中的領域語言與 docs/adr/ 中的決策。適用於使用者想要改善架構、尋找重構機會、整合緊密耦合的模組,或讓程式碼庫更易於測試及便於 AI 導航時使用。
developmentcode-reviewapi
tdd
mattpocock
以紅-綠-重構循環進行測試驅動開發。當使用者想透過TDD建立功能或修復錯誤、提及「紅-綠-重構」、需要整合測試,或要求測試優先開發時使用。
developmenttesting
handoff
mattpocock
將當前對話壓縮成一份交接文件,供其他代理接手處理。
communicationproject-managementdocument
prototype
mattpocock
建立一個可拋棄的原型,在確定設計前先完善構想。在兩個分支之間切換——一個可執行的終端應用程式,用於測試狀態或商業邏輯問題;或從同一路由切換多種截然不同的UI變體。當使用者想要製作原型、驗證資料模型或狀態機、模擬UI、探索設計選項,或說出「把這個做成原型」、「讓我玩玩看」、「試試幾種設計」時使用。
developmentdesigncreative
triage
mattpocock
透過由分類角色驅動的狀態機來分類問題。當使用者想要建立問題、分類問題、審查傳入的錯誤或功能請求、為AFK代理準備問題,或管理工作流程時使用。
developmentproject-managementcommunication
obsidian-vault
mattpocock
在Obsidian筆記庫中搜尋、建立及管理筆記,支援維基連結與索引筆記。適用於使用者想在Obsidian中尋找、建立或整理筆記時。
productivitydocument
edit-article
mattpocock
編輯並改善文章,透過重組章節、提升清晰度與精煉文句。適用於使用者希望編輯、修訂或改善文章草稿時。
documentcreative
writing-great-skills
mattpocock
撰寫與編輯技能的良好參考——讓技能可預測的詞彙與原則。
documentdevelopment