- Run coverage
- Pick 3 riskiest files
- Write + run tests
Generate missing unit tests for untested modules
Claude Code reads your coverage report, picks the riskiest untested modules and writes unit tests that pass, one small PR at a time.
Plan, execute and review a cross-cutting refactor in small batches, with Claude Code making the edits and GitHub Copilot reviewing each PR.
“Ship a 40-file refactor with a coding agent” is an advanced Coding AI agent workflow from Software. It connects Claude Code and GitHub Copilot in 6 steps. Setup takes about 3 hours, running costs are about $110/mo and it saves roughly 15 hours a week.
Cross-cutting changes like swapping a logging library, renaming a core type or moving from callbacks to async/await sit in the backlog for months because they touch dozens of files. Doing them by hand eats a week of senior time and produces one giant PR nobody wants to review. Half-finished migrations then leave two patterns in the codebase for years.
Before touching anything, make sure the test suite and type checker pass on main and finish in under ten minutes. Add a few characterization tests around the riskiest modules if coverage is thin; the agent relies on them to know when it broke something.
Document the old pattern, the new pattern with one before/after example, files that are out of scope, and the exact verification commands, for example npm run typecheck and npm test. Claude Code reads this file at the start of every session.
Start Claude Code in plan mode with the planning prompt below. It should search for every call site and return batches of 5–8 files grouped by module, with risky files flagged. Review and edit the plan; this is where most of your judgement goes.
Ask the agent to implement a single batch, run the type checker and related tests, fix failures and commit. Keep each batch on its own branch and PR so a reviewer can read it in under 15 minutes.
Request a review from Copilot on each PR alongside one human reviewer. Paste any valid findings back into Claude Code and fix them on the same branch before merging.
After the last batch, have the agent search for any remaining uses of the old pattern. Then add a lint rule such as no-restricted-imports so the old pattern cannot creep back in.
We are migrating {{old_pattern}} to {{new_pattern}} across this repository. Read CLAUDE.md for the rules and an example.
Do not edit any files yet. First:
1. Find every file that uses {{old_pattern}}, including dynamic usages and test helpers. Show the search commands you ran.
2. Group the files into batches of 5-8 that can be merged independently, ordered from lowest to highest risk.
3. For each batch, list the files, what changes in each, and which tests cover them.
4. Flag files where behaviour could change (error handling, ordering, side effects) and explain why.
5. List anything you are unsure about as questions for me.
Write the plan to docs/migration-plan.md.Implement batch {{batch_number}} from docs/migration-plan.md and nothing else.
For each file, apply the new pattern exactly as shown in CLAUDE.md, keep behaviour identical, and do not reformat unrelated code.
After editing, run {{typecheck_command}} and {{test_command}}. If anything fails, fix it and run both again. If a fix would require changing a file outside this batch, stop and tell me instead.
When everything passes, commit with the message "refactor: {{short_description}} (batch {{batch_number}})" and summarise the files changed, anything you were unsure about, and tests you think are missing.Plan, execute and review a cross-cutting refactor in small batches, with Claude Code making the edits and GitHub Copilot reviewing each PR.
You need Claude Code and GitHub Copilot. Claude Code: maps every call site, writes the migration plan, edits files in batches and runs the type checker and tests after each one (Claude Max plan). GitHub Copilot: reviews each pull request as a second pass and flags missed call sites or behaviour changes (Copilot Pro).
Plan for about 3 hours. It is rated advanced. The guide walks through 6 steps, starting with “Lock down the safety net”.
Expect about $110/mo in running costs ($100+/mo range).
About 15 hours a week, as reported for this setup. Cross-cutting changes like swapping a logging library, renaming a core type or moving from callbacks to async/await sit in the backlog for months because they touch dozens of files. Doing them by hand eats a week of senior time and produces one giant PR nobody wants to review. Half-finished migrations then leave two patterns in the codebase for years.
Claude Code reads your coverage report, picks the riskiest untested modules and writes unit tests that pass, one small PR at a time.
A coordinating agent splits long projects into tasks, runs parallel coding workers, and enforces review loops before merges.
Via Bluesky · @dolthub.bsky.social ↗Copilot and Claude review each PR for bugs, missing tests and risky changes before a human looks, so reviewers can focus on design.
Built this workflow? Show it is featured on AgentUseHub with a live upvote count that links back here. About badges