Verified against GitHub Copilot Edits · 2026-07-26
Plan a multi-file migration before Copilot Edits touches a single file in the working set
A migration brief for Copilot Edits that forces a dependency-ordered plan across an explicit working set of files and a one-file pilot checkpoint before any multi-file rewrite starts.
The prompt
Ready to copy — highlighted parts are example details you can swap.
I want to migrate the class-component + Redux connect() pattern to function components with hooks and the existing useAppSelector/useAppDispatch hooks using Copilot Edits, working from an explicit file working set rather than letting Copilot decide on its own which files belong in this change. Before adding a single file to the working set or proposing an edit, produce a plan and wait for my approval. WORKING SET Every component under components/dashboard/ plus dashboard/types.ts — 15 files total. MUST NOT BREAK The memoized selectors in dashboard components must not re-render on every store update — that performance behavior is load-bearing on the live dashboard. PLAN FORMAT 1. For every file in the working set, state the specific change it needs — not 'update as needed,' since Edits proposes a diff per file in the working set and a vague plan entry produces a diff with no clear standard to check it against. 2. Order the files so a shared or foundational file — a type definition, a config value, a base pattern the others extend — is migrated before the files depending on it, and explain why that order avoids a broken intermediate state where a dependent file has already been migrated against a shape the foundational file has not actually adopted yet. 3. Name one file from the working set to migrate first as a pilot, and state exactly what reviewing that one file's diff should tell me about whether the overall approach for the rest is right, before any other file in the set is touched. 4. For each item under MUST NOT BREAK, name which specific file's migration in the working set could threaten it, and how the plan avoids that — a generic reassurance that nothing important will break gives nothing to check the actual diffs against later. After I approve the plan, add only the pilot file to the working set and propose its diff. Stop there. Do not add the remaining files to the working set until I have reviewed that first diff and told you to continue. Migrate DashboardSummaryCard.tsx first — it is the smallest component using the pattern and appears on the lowest-traffic page. CONSTRAINTS - Review every proposed diff in the working set individually before accepting it — do not accept the whole working set's changes in one action just because the first two files you checked looked right; a working set can include a file whose diff was generated correctly in isolation but is wrong in combination with an adjacent file's diff that changed the same shared interface. - If, partway through, a file outside the original working set turns out to need a change for the migration to actually hold together, stop and say so explicitly rather than silently adding it to the working set and folding its diff in with the rest — an unannounced scope expansion in a migration is exactly the kind of change that gets missed in review because nobody was told to look for it.
Customize
Optional — swap in your own details for the highlighted parts above.
Why this works
Copilot Edits works from an explicit working set of files and proposes a diff per file in that set, reviewed and accepted individually rather than as one combined patch — which is exactly the mechanism that makes an unscoped migrate X to Y across the codebase request risky: a model given no explicit set will decide which files belong in the migration as it goes, in whatever order it encounters them, which can leave a file migrated against a shared type or config before that foundational file has actually been changed to match, producing a broken intermediate state that is difficult to bisect once several files' diffs are already mixed together. Naming the working set explicitly and ordering it by dependency, foundational files first, mirrors how a careful human would sequence the same migration by hand, and gives you a concrete thing to check the proposed order against before any diff is generated at all rather than after. The pilot-file requirement turns a large migration into a cheap checkpoint for exactly the same reason it matters in an autonomous-agent context: if the chosen approach is wrong, there is one file's diff to revert, not a working set's worth, and that one file tells you concretely whether the pattern generalizes before you commit to reviewing the rest under the assumption that it does. Reviewing each file's diff individually rather than accepting the whole batch in one action targets a specific and easy-to-miss failure: a diff that reads as correct in isolation can still be wrong in combination with a second file's diff if the two files share an interface that one migrated one way and the other migrated a slightly different way — a per-file review that stops at this file looks right without checking it against the sibling file it depends on will pass exactly the kind of bug that only shows up when both files run together. The constraint against silently expanding the working set exists because that expansion is invisible to anyone reviewing the originally-approved plan against the final diff — a file added mid-migration without being flagged is a file nobody was told to specifically check, which defeats the entire purpose of having approved a bounded working set in the first place.
What you get back
Plan (excerpt): 1. Migrate dashboard/types.ts first — foundational, no component logic. 2. Migrate DashboardSummaryCard.tsx as the pilot. 3. Risk check: DashboardSummaryCard.tsx's memoized selector relies on connect()'s shallow-equal check today — the hooks version must use useAppSelector with an equivalent selector, not a bare useSelector(state => state.dashboard), or it re-renders on every store update, violating the must-not-break constraint.
Verified against
GitHub Copilot Edits Copilot Edits 1.270 (VS Code, working-set mode) · 2026-07-26
Changelog
- 2026-07-26 — Initial publish, verified against Copilot Edits 1.270 (VS Code) working-set mode.
Need this built into your business?
If a prompt isn't enough — custom software, built and maintained for you — that's Scult's day job.
EXPLORE CUSTOM SOFTWARE
