- 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.
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.Claude Code reads your coverage report, picks the riskiest untested modules and writes unit tests that pass, one small PR at a time.
Copilot and Claude review each PR for bugs, missing tests and risky changes before a human looks, so reviewers can focus on design.
A Claude Code-built agent checked ESPN every 30 minutes and sent each 2026 World Cup final score, written up in a persona, to a 3-person Signal group, with a code check on scores.