Subagent Fan-Out Plan for a Large Codebase Migration

Plans a big migration so an orchestrating agent can split it into independent chunks for parallel subagents, each with a clear brief, a verification command and merge rules.

You get: a survey summary with counts; a serial prerequisite step; a chunk table (Chunk, Files, Subagent brief, Verify command, Depends on); merge and rollback plan; and risks,…

More like this

The prompt

subagent-fan-out-plan-for-a-large-codebase-migration.md
You are the orchestrating agent in Claude Code or Codex. Plan this migration across the repository: {the migration to run}, such as a framework or library upgrade.

Do not edit code in this step. Produce a plan I can approve.

Rules:
1. Survey first: count and list the affected files with a search command, and group them into chunks that can change independently (by package, folder or feature). Note shared files that must change first, in one serial step.
2. Write a brief for each subagent: the exact files, the change pattern with one before-and-after example, what it must not touch, and the command that proves its chunk works (tests, typecheck or build for that package).
3. Size chunks so each subagent can finish in one session; keep the number of parallel subagents small enough to review.
4. Define merge rules: order, how to resolve conflicts, and a full-repo check after merging.
5. Plan the rollback: how to revert a single chunk.

Output format: a survey summary with counts; a serial prerequisite step; a chunk table (Chunk, Files, Subagent brief, Verify command, Depends on); merge and rollback plan; and risks, assumptions and next actions, such as a pilot chunk to run first.

Tips and common edits

Use in Claude Code (which can run subagents) or Codex before a migration touching dozens of files. Run one pilot chunk before fanning out the rest.

Questions about this prompt

Parallel Git Worktree Task Split with Interface Contracts and Merge Order

Turns a pasted feature spec into independent coding-agent tasks with file ownership, interface contracts, a merge order and a done command for each task.

Agent Run Post-Mortem: Trace Root Cause and Prompt or Tool Fixes

Analyzes a pasted agent trace to find the first real failure and proposes exact prompt rewrites or tool changes, each with a test.

Checkpoint and Rollback Manager with Compensation Steps and Failure Injection Tests

Guides Claude Code to implement checkpoint snapshots, rollback modes, and compensating actions for side-effecting agent phases, then prove them with failure-injection tests. Helps you decide the rollback strategy per phase.

DAG Scheduler with Fan-Out/Fan-In Barriers and Resumable Run Ledger for Agent Pipelines

Guides Claude Code to build or refactor a dependency-aware DAG scheduler for agent phases, with cycle validation, bounded parallelism, join policies, retries, and an append-only run ledger so interrupted runs resume without redoing finished nodes.

Orchestrator System Prompt Builder with Progress Ledger and Stop Conditions

Writes a ready-to-deploy orchestrator system prompt that delegates to your workers, tracks progress in a ledger, merges results and stops on defined conditions.

Typed Phase Handoff Contracts and Validator for Multi-Agent Pipelines

Has Claude Code define schema-based handoff contracts between agent phases, generate a validator, and add contract tests. Supports the decision of which phase boundaries need strict contracts versus lightweight checks.

Characterization Tests Before a Refactor

Writes tests that lock in a module's current behavior, including edge cases and quirks, so you can refactor safely.

Claude Code Behavior-Preserving Refactor with Characterization Tests and Staged Commits

Guides Claude Code to refactor a module safely by first pinning current behavior with characterization tests, then applying small reversible steps with verification after each. Delivers a diff, risk register, and rollback plan.

Conventional Commit and PR Description Writer Skill (SKILL.md)

A ready-to-save SKILL.md that makes your coding agent write Conventional Commits messages and pull request descriptions from the staged diff, never from guesses.

Pre-Merge Code Review Checklist Skill (SKILL.md)

A save-ready SKILL.md that has your coding agent review a branch before merge: correctness, security, tests and migrations, with findings ranked by severity and no style nitpicks.

Claude Code Feature Implementation Plan and Build from a Ticket with Repo Convention Discovery

Has Claude Code investigate how similar features are built in the repository, produce an implementation plan with acceptance tests, then implement it in verified increments. Surfaces risks, open questions, and next actions before and after coding.

Claude Code Hook Writer: Auto-Run Lint, Typecheck or Tests After Edits

Produces a PostToolUse hook entry for settings.json, the script it calls and a concrete procedure to test that the check runs after file edits.