/context-engineering:refactor-planfrom context-engineering
Creates a concrete, evidence-backed plan before multi-file refactors. Investigates the codebase, identifies affected files and hidden coupling, sequences changes safely, and includes verification and rollback steps. Stops for confirmation before making edits.
Ships in context-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Investigate the repository without editing, define a safe phased refactor plan, include verification and rollback steps, then stop for confirmation before code changes unless the user explicitly authorized continuing after the plan.
If the request is too ambiguous to plan safely, ask concise clarifying questions instead of editing files.
| Area | What to capture | Why it matters |
|---|---|---|
| Current state | How the code works now, including entry points and data flow. | Prevents plans based on assumptions. |
| Target state | The intended architecture or behavior after the refactor. | Keeps phases aligned to the user's goal. |
| Affected files | Modify/create/delete classification and dependencies. | Shows scope and review size. |
| Boundaries | API contracts, ownership, generated code, external integrations. | Avoids breaking callers or editing regenerated files. |
| Hidden coupling | Tests, config, docs, fixtures, serialization, DI, reflection, migrations. | Refactors often fail outside the obvious source files. |
| Verification | Checks after each phase plus final command. | Provides early failure points and confidence. |
| Rollback | How to undo risky phases. | Makes the plan executable under uncertainty. |
| Phase | Prefer | Avoid |
|---|---|---|
| Types and interfaces | Add or adjust contracts before implementations. | Editing callers first without a stable contract. |
| Implementation | Change internals behind the prepared contracts. | Mixing broad cleanup with behavior changes. |
| Callers | Migrate call sites in small groups with verification. | Big-bang updates with no intermediate checks. |
| Tests | Update or add tests that prove preserved behavior and new structure. | Weakening assertions to make the refactor pass. |
| Cleanup | Remove deprecated code and update documentation after validation. | Removing compatibility shims before all callers move. |
## Refactor Plan: [title]
### Current State
[Brief description of how things work now]
### Target State
[Brief description of how things will work after]
### Affected Files
| File | Change Type | Dependencies |
|------|-------------|--------------|
| path | modify/create/delete | blocks X, blocked by Y |
### Execution Plan
#### Phase 1: Types and Interfaces
- [ ] Step 1.1: [action] in `file.ts`
- [ ] Verify: [how to check it worked]
#### Phase 2: Implementation
- [ ] Step 2.1: [action] in `file.ts`
- [ ] Verify: [how to check]
#### Phase 3: Tests
- [ ] Step 3.1: Update tests in `file.test.ts`
- [ ] Verify: Run `npm test`
#### Phase 4: Cleanup
- [ ] Remove deprecated code
- [ ] Update documentation
### Rollback Plan
If something fails:
1. [Step to undo]
2. [Step to undo]
### Risks
- [Potential issue and mitigation]
Shall I proceed with Phase 1?
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
refactoring, code-planning, safe-refactor, multi-file-changes
npx claudepluginhub gbb-acelerators/awesome-harness-primitives --plugin context-engineering3 skills in this plugin
/context-mapBuild a concise map of files relevant to a requested code change before implementation. Use when the user asks to identify affected files, plan changes, map dependencies, find tests, locate reference patterns, or assess risk before editing./what-context-neededIdentify the minimum files, symbols, configuration, tests, and prior context GitHub Copilot needs before answering a codebase question. Use this skill when the user asks what context is needed, what files to provide, or wants a context checklist before asking an implementation, debugging, review, or architecture question.Other plugins' skills for the same job