Decompose Framework Migrations into Subagent Work Batches

You get a structured task graph that maps migration steps into isolated, low-risk subagent work batches with defined file boundaries and interface contracts.

Agent prompt for Claude

Prompt

Prompt
Act as a Senior Software Architect specializing in large-scale framework migrations. Your goal is to decompose a breaking migration into atomic, non-overlapping work batches for Claude Code. First, ask me these three questions: 1. What is the current framework and the target framework? 2. What is the primary pain point or breaking change causing the most friction? 3. Can you paste the current directory structure or a list of key dependency files? Wait for my answer. Once I provide the details, analyze the migration path and create a task graph. Rules: 1. Define batches that ensure a zero-regression state at the end of each task. 2. Specify the exact file boundaries for each batch to avoid merge conflicts. 3. Define the interface contract for any shared utilities being migrated. 4. Identify the blast radius for each batch. Output format: ### Migration Strategy Overview. ### Task Graph: A table with columns Batch ID, Objective, Files Involved, Risk Level, and Interface Contract. ### Validation Plan: A checklist of commands to run after each batch. This is not professional software engineering advice; consult your lead architect for critical production changes.

Example output

Example for: migrating a React 16 project to React 18 with concurrent features.

Migration Strategy Overview

This migration follows an incremental approach. We prioritize upgrading the core runtime and dependency tree first, followed by isolated component updates. Each batch is designed to be fully testable without requiring the full migration completion.

Task Graph
Batch IDObjectiveFiles InvolvedRisk LevelInterface Contract
B1Update core dependenciespackage.json, lockfileHighNode 18+ requirement
B2Refactor legacy class componentssrc/components/legacy/*MediumProp-types parity
B3Implement new root APIsrc/index.js, src/App.jsHighcreateRoot(container)
B4Audit and fix hookssrc/hooks/*LowDependency array strictness
Validation Plan
  • [ ] Run npm audit to resolve dependency conflicts.
  • [ ] Verify that all components render without console errors after B2.
  • [ ] Assert that createRoot handles existing DOM nodes correctly in B3.
  • [ ] Run full test suite including end-to-end coverage after B4.

This is not professional software engineering advice; consult your lead architect for critical production changes.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Requires explicit file boundaries to prevent cross-contamination of code.
  • Enforces a validation checklist to ensure the codebase remains stable.
  • Uses a risk-level assessment to prioritize the most complex changes first.

Use this when you are planning a major version upgrade or framework switch in a large repository. Copy and paste this into Claude or Claude Code. It works best when you have your file structure ready to paste.

Common edits

  • Add a column for specific test files if your project requires heavy unit testing.
  • Include a column for manual QA steps if your migration involves UI changes.

Reuse it: Use in a workflowAdapt in the builder

Prompt details

By
Prompts-GPT editors
Published
How prompts are written and checked

Did this prompt work?

More in Claude Code

Perform Static Call Graph Trace Before Modifying Code

Generate a clear visual map of function calls and file dependencies to identify exactly where your changes will ripple before you type a single line of code.

Cursor Incremental Dependency Migration Plan and Codemod Execution

Plans and executes a library or framework version migration in Cursor in small, verifiable batches, with an impact inventory, rollback points, and per-batch test gates instead of one risky bulk edit.

Automation & Workflows

Decompose monolithic automation into modular subflows

Restructure overly complex, branched automations into clean parent-child workflows. Use this when your workflow breaks frequently, times out, or has become impossible to maintain.

Coding

Plan an incremental refactor for legacy code

Break down monolith or fragile legacy modules into safe, testable milestones using branch-by-abstraction patterns.

Compare Three Feature Architectures Against Module Boundaries

Get a scored trade-off matrix comparing three feature architectures by file touchpoints, coupling risks, and rollback cost before running Cursor Composer.

Generate Scoped Cursor Rules for Project Architecture

Create targeted .cursorrules files that enforce strict architectural boundaries between frontend, API, and database layers to prevent code leaks.