{"name":"plan-multi-file-refactor-prompt","description":"A prompt that sequences a multi-file change, lists affected paths, puts a verify step in each phase, and adds a rollback, then stops for a yes. Use when the user wants a multi-file refactor sequenced, a rollback before edits, or the safe order of file changes.","category":"coding-prompts","tags":["rollback"],"models":["any"],"proven":false,"passing_families":0,"model_testing":"Not yet model-tested; testing Jan 2027","url":"https://theskillvault.ai/skills/plan-multi-file-refactor-prompt","api_url":"https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt","raw_url":"https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/raw","body":"# Plan a multi-file refactor (prompt)\n\nA change that touches many files needs an order. This prompt writes that order and then stops. It does not edit.\n\n## When to use\n- Several files must change, and you want the sequence first.\n- You need affected paths, a verify step and a rollback.\n- You want the agent to wait before it edits.\n\n## When not to use\n- You want one messy function cleaned in place. Use fix-code-smells-prompt.\n- You want a review of shallow modules and tangled seams. Use review-codebase-architecture-prompt.\n- You already have a written plan and want it carried out. Use execute-plan-step-by-step-prompt.\n- You want tickets for a new feature. Use write-plan-and-tickets-prompt.\n\n## Steps\n1. Name the behaviour that must stay the same, and the behaviour that must change.\n2. Paste the prompt in the repo. Let it read. Do not accept edits yet.\n3. Check every path. Drop a file the plan cannot point to.\n4. Say yes only when the order, the checks and the rollback are clear.\n\n## Prompt\n```text\nPlan a multi-file refactor. Do not edit files. Do not create a branch.\n\nBehaviour that must stay: {{INVARIANTS}}\nBehaviour that must change: {{GOAL}}\nConstraint: {{TIME, COMPATIBILITY, OR \"NONE\"}}\n\nRead the code, the tests and the config that this goal touches.\nIf the goal is too vague to name files, ask up to three questions and stop.\n\nWrite the plan in this order:\n1. Current state. How the path works today. Cite files.\n2. Target state. What will be true after. No new product scope.\n3. Affected paths. For each file, say change, add or delete, and what it depends on.\n4. Sequence. Prefer this order when it fits: shared types or contracts, then implementations, then callers, then tests, then leftover cleanup. Each phase has a verify step a person can run.\n5. Rollback. For the riskiest phase, the steps to put the tree back.\n6. Risks. One line each, with a mitigation you could actually do.\n\nRules:\n- Cite a real path for every file. If you are unsure, write \"unconfirmed\".\n- Do not print secrets, tokens or .env values. Name the variable only.\n- Do not start the edit. End by asking whether to begin phase 1.\n```\n\n## How to adapt\n- A rename across a package can skip new types and start at callers.\n- A behaviour change needs a failing test in an early phase, not only at the end.\n- Works with any language. The verify step should be the command your repo already uses.\n\n## Gotchas\n- Do not paste API keys, passwords or .env values into the plan.\n- A plan that names folders you cannot open is a guess. Mark it unconfirmed.\n- Cleanup is last. Deleting the old path in phase 1 strands the callers.\n- Saying yes to phase 1 is a separate step. This prompt ends at the plan.\n\n## Portability\nWorks with any editor or host. If you track work in issues, copy the phases there after you accept them. Another tool can run the same verify command.\n\n## Done when\n- The plan lists real paths, an order, a verify step per phase and a rollback.\n- Unconfirmed files are marked, and no secret value appears.\n- No file was edited before you answered the closing question.\n\n## Example prompt\n\"Plan this multi-file refactor. Split the billing helper out of the checkout files. Sequence the affected paths, add a rollback, and do not edit yet.\"\n\n---\nAdapted from \"refactor-plan\" in github/awesome-copilot (MIT, Copyright GitHub, Inc.). See LICENSE.txt.","files":["LICENSE.txt"],"license":"MIT","license_name":"MIT License","license_url":"https://opensource.org/license/mit","attribution":"Based on work by GitHub awesome-copilot contributors (refactor-plan) (Copyright GitHub, Inc., MIT License), https://github.com/github/awesome-copilot/tree/5269f7ea2d6c3a9bfda5ed878b6726cf509121fd/skills/refactor-plan; adapted by TheSkillVault, https://theskillvault.ai","install":{"claude_code":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/raw' -o ~/'.claude/skills/plan-multi-file-refactor-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/files/LICENSE.txt' -o ~/'.claude/skills/plan-multi-file-refactor-prompt/LICENSE.txt'","cursor":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/raw' -o '.cursor/skills/plan-multi-file-refactor-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/files/LICENSE.txt' -o '.cursor/skills/plan-multi-file-refactor-prompt/LICENSE.txt'","agents":"curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/raw' -o '.agents/skills/plan-multi-file-refactor-prompt/SKILL.md' && curl -fsSL --create-dirs 'https://theskillvault.ai/api/skills/plan-multi-file-refactor-prompt/files/LICENSE.txt' -o '.agents/skills/plan-multi-file-refactor-prompt/LICENSE.txt'","mcp_url":"https://theskillvault.ai/mcp","cursor_mcp_deeplink":"cursor://anysphere.cursor-deeplink/mcp/install?name=theskillvault&config=eyJ1cmwiOiJodHRwczovL3RoZXNraWxsdmF1bHQuYWkvbWNwIn0%3D","mcp_config":{"mcpServers":{"theskillvault":{"url":"https://theskillvault.ai/mcp"}}}},"bundles":[],"tested_on":[{"family":"chatgpt","name":"ChatGPT","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"claude","name":"Claude","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"gemini","name":"Gemini","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"grok","name":"Grok","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"llama","name":"Llama","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"deepseek","name":"DeepSeek","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"mistral","name":"Mistral","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"qwen","name":"Qwen","outcome":null,"date":null,"source":null,"counts":false,"stale":false},{"family":"kimi","name":"Kimi K","outcome":null,"date":null,"source":null,"counts":false,"stale":false}],"proven_rule":{"threshold":5,"window_days":365,"computed_at":"2026-11-29T03:42:30.374Z"}}