Skip to main content

Overview

You have the target architecture. Now the question is: how do you get there without breaking everything along the way? Phase 4 of the modernization workflow is where strategy becomes execution planning. The Architectural Decision Record from Phase 3 defines what the system should become. This playbook turns that vision into a sequenced set of work packages — each one independently deployable, each one ordered by dependency, and each one structured around the Transform → Coexist → Eliminate cycle — the operational expression of the Strangler Fig pattern (Martin Fowler, 2004) that makes incremental modernization safe. Rather than replacing the legacy system in one big-bang release, each work package builds the new component (Transform), runs it alongside the legacy component with traffic routing (Coexist), and retires the legacy component only after behavioral equivalence is verified (Eliminate). The sequencing problem is harder than it looks. You can’t just pick the easiest component and start — if that component shares a database with three others, you’ll immediately hit data decomposition challenges. You can’t just follow the dependency graph blindly either — sometimes the highest-risk component should go first (to retire risk early) and sometimes it should go last (to learn from easier migrations first). The right sequence balances dependency constraints, risk appetite, business value delivery, and team capability. CoreStory serves as a Navigator throughout this phase — mapping the specific dependencies, shared data stores, and integration points that determine what can be separated and what must move together. It also operates as an Expert for understanding the implications of each sequencing choice: “If we modernize this component first, what temporary integration work is needed for everything that still depends on it?” Who this is for: Engineering leads, project managers, and modernization teams responsible for planning and tracking the migration. Also useful for technical program managers coordinating cross-team modernization efforts. What you’ll get: A sequenced set of work packages with scope, acceptance criteria, dependencies, estimated effort, and the Transform/Coexist/Eliminate structure for each — optionally pushed to Jira or Linear as epics and stories.

When to Use This Playbook

  • You’ve completed Phase 3 (Target Architecture) and have an approved Architectural Decision Record
  • You need to break a modernization initiative into executable, independently-deployable work packages
  • You need to determine the migration sequence — what to modernize first, second, third — based on dependency analysis
  • You’re preparing to push migration work into Jira, Linear, or another project management system
  • You need to identify which components must migrate together and which can be extracted independently

When to Skip This Playbook

  • You haven’t defined the target architecture yet — go back to Target Architecture
  • The modernization is a single-component refactor that doesn’t need sequencing — use Spec-Driven Development directly
  • You’re doing a lift-and-shift (Rehost/Relocate) with no application-level decomposition
  • You already have a sequenced migration plan and need to start execution — go to Spec-Driven Development for delta specs or the relevant architecture variant

Prerequisites

  • A completed Target Architecture decision (Phase 3) — the Architectural Decision Record is the primary input
  • A completed Codebase Assessment (Phase 1) — the dependency graph and coupling analysis feed directly into sequencing
  • A CoreStory account with the legacy codebase ingested and ingestion complete
  • An AI coding agent with CoreStory MCP configured (see Supercharging AI Agents for setup)
  • (Optional) Jira or Linear MCP configured alongside CoreStory for work package creation (see Using CoreStory with Jira)
  • (Recommended) The engineering lead who will own the migration backlog should be driving this phase — sequencing decisions affect team assignments, sprint planning, and delivery timelines

How It Works

CoreStory MCP Tools Used

The Decomposition & Sequencing Workflow

Note: The steps below are internal to this playbook. They are sub-steps of Phase 4 in the six-phase modernization framework, not a separate numbering system.
This playbook follows a six-step pattern:
  1. Input Loading — Load the target architecture decision and dependency map from prior phases. Establish the migration scope.
  2. Component Decomposition — Break the migration into discrete, independently-deployable work packages. Identify what can be separated and what must move together.
  3. Dependency Mapping — Map dependencies between work packages. Identify the critical path and blocking relationships.
  4. Sequencing — Order work packages by dependency, risk, and business value. Produce the migration sequence.
  5. Work Package Definition — Define each work package with scope, acceptance criteria, dependencies, estimated effort, and the Transform/Coexist/Eliminate structure.
  6. Ticketing System Integration — Push work packages to Jira or Linear as epics and stories (if MCP is available).

The Strangler Fig Execution Model

Each work package follows the Transform → Coexist → Eliminate cycle:
  1. Transform — Build the modernized version of the component using Spec-Driven Development. The legacy component remains untouched.
  2. Coexist — Run both old and new versions simultaneously. Route traffic through a façade or proxy layer. Validate behavioral equivalence using Behavioral Verification.
  3. Eliminate — Once the modernized component passes verification, retire the legacy component and remove the façade.
This cycle is the reason sequencing matters: each work package’s Coexist phase requires temporary integration points (anti-corruption layers, adapters, data synchronization) with the components that haven’t migrated yet. The sequence determines how much temporary integration work is needed at each step. Transform → Coexist → Eliminate lifecycle — three-phase cycle showing how each work package moves from building the new component, through coexistence with the legacy, to retirement

Branch by Abstraction

When a façade can’t intercept traffic — shared libraries, data access layers, deeply embedded utility code — the Strangler Fig pattern doesn’t apply. Branch by Abstraction (coined by Paul Hammant, popularized by Sam Newman in Monolith to Microservices) works from the inside:
  1. Introduce an abstraction layer within the codebase that both old and new implementations can satisfy. This is an interface or adapter that wraps the current implementation.
  2. Build the new implementation behind the abstraction. Both old and new implementations coexist in the codebase.
  3. Switch consumers incrementally. Migrate callers from old to new one at a time, validating behavior at each step.
  4. Remove the old implementation once all consumers have switched. Optionally remove the abstraction layer if it no longer adds value.
Use when: The component is consumed internally (shared libraries, data access layers, utility modules) rather than through external-facing endpoints. The key signal: if you can’t put a proxy in front of it, use Branch by Abstraction. CoreStory query: “Which internal components consume [ComponentName] directly? If we introduced an abstraction layer, what interface would both old and new implementations need to satisfy?”

Parallel Run (Shadow Traffic)

For high-risk components where behavioral equivalence must be proven in production before cutover — payment processing, financial calculations, regulatory-sensitive logic — Parallel Run provides the strongest verification.
  1. Route copies of production requests to both the legacy and modernized systems simultaneously.
  2. Compare responses in real time. Flag discrepancies for analysis.
  3. Run until the discrepancy rate drops below threshold (typically below 0.01% for critical services, below 0.1% for standard services).
  4. Cut over to the modernized system and decommission the legacy component.
Use when: A behavioral difference has catastrophic consequences. The component handles money, regulatory compliance, or safety-critical logic. The organization needs production-grade evidence before stakeholders will approve cutover. Data synchronization during coexistence: Combine with Change Data Capture (CDC) via Apache Kafka or Debezium to keep legacy and modern data stores in sync. This avoids the dual-write problem and enables real-time data consistency without modifying the legacy system’s write path. CoreStory query: “Which operations in [ComponentName] have the highest business impact if they produce incorrect results? These are the candidates for Parallel Run verification.”

HITL Gate

After Step 4 (Sequencing): The engineering lead reviews the migration sequence, work package definitions, and dependency map before work packages are pushed to the ticketing system. This is the gate where the migration plan is approved for execution.

Step-by-Step Walkthrough

Step 1: Input Loading

Start by loading context from prior phases so all decomposition decisions are grounded in actual assessment and architecture data. Confirm the project and locate prior work:
Look for “RESOLVED - [Assessment] SystemName” and “RESOLVED - [Architecture] SystemName” from prior phases. Retrieve architecture decision context:
Create the decomposition conversation:

Step 2: Component Decomposition

Break the migration scope into discrete work packages. The goal is to identify the smallest independently-deployable migration units. Identify migration units:
Define work package boundaries:
Validate decomposition feasibility:

Step 3: Dependency Mapping

Map the dependencies between work packages to determine what must happen before what. The following example shows the dependency graph for our hypothetical e-commerce system — work packages arranged in waves, with the critical path highlighted in gold:
Solid arrows = hard dependencies (must complete before). Dashed arrows = soft dependencies (easier if done first). Border color indicates strategy: cyan = Replatform, blue = Refactor, purple = Re-architect.
Work package dependencies:
Shared data dependencies:
Infrastructure prerequisites:

Step 4: Sequencing

Order the work packages into a migration sequence. This is where engineering judgment matters most — there’s no single correct sequence, and the right order depends on the team’s risk appetite, business priorities, and capacity. Dependency-driven sequence:
Quick wins identification:
Risk analysis per sequence position:

Step 5: Work Package Definition

Define each work package in detail. This is the deliverable that feeds execution (Phase 5 of the hub) and the ticketing system. Generate work package definitions:
Acceptance criteria per work package:

Step 6: Ticketing System Integration

If your agent has a Jira or Linear MCP configured alongside CoreStory, push the work packages directly to your project management system. Create the migration epic (Jira):
Create stories from work packages (Jira):
Link dependencies (Jira):
Linear alternative: If using Linear instead of Jira, the structure maps as: epic → project or cycle, story → issue, sub-task → sub-issue. The same work package definitions apply — adapt the field names to Linear’s model.

Linear Integration

Linear uses a different hierarchy than Jira. Map the modernization work packages as follows:
  • Project = the modernization initiative
  • Cycle = each migration wave (group of work packages executed together)
  • Issue = one work package (the component being modernized)
  • Sub-issue = the three phases: Transform, Coexist, Eliminate
No ticketing MCP available: If your agent doesn’t have a Jira or Linear MCP configured, the work package definitions are still the primary output. Export them as a structured document that can be manually imported or used as the basis for ticket creation. See Using CoreStory with Jira for Jira MCP setup. Mark the thread complete:

Output Format: Work Package

Each work package follows this template:

Prompting Patterns Reference

Decomposition Patterns

Sequencing Patterns


Best Practices

Sequence by dependency chain, not by perceived difficulty. Teams often want to start with the “easiest” component. But if that component depends on a shared database that three other components also use, you’ll immediately hit data decomposition challenges. Let the dependency graph drive the sequence, then optimize within the constraints it sets. Start with a quick win. Within the dependency constraints, front-load a work package that’s low-risk, low-coupling, and high-visibility. Proving the methodology works on a real component builds team confidence and organizational support for the rest of the migration. This is especially important for teams that haven’t done incremental modernization before. Don’t underestimate temporary integration work. Every work package’s Coexist phase requires integration between the modernized component and the legacy system. Anti-corruption layers, API adapters, data synchronization mechanisms — this is real engineering work that must be scoped and scheduled. The best sequences minimize the total temporary integration burden. Identify infrastructure prerequisites early. If the target architecture requires an API gateway, event bus, or service mesh, that infrastructure must be in place before component migration begins. Treat infrastructure as “Step 0” work packages with their own timelines and dependencies. Define “done” for each work package before starting. The acceptance criteria — functional, behavioral, performance, integration, operational — should be agreed before the Transform phase begins. This prevents scope creep and provides clear exit criteria for the Eliminate phase. Plan for parallel execution where possible. If two work packages have no mutual dependencies, they can run in parallel on different teams. This is the primary way to compress the migration timeline. The dependency mapping in Step 3 reveals these opportunities. Use the Coexist phase as a safety net. The Coexist phase (running old and new simultaneously behind a façade) is what makes incremental modernization safe. Don’t rush through it. Use it to validate behavioral equivalence, measure performance, and build confidence before cutting over. The façade enables instant rollback if anything goes wrong.

Agent Implementation Guides

The skill file shown below is plain markdown. The workflow it encodes works in any agentic harness — only the install location differs. Common conventions:
Want a single install that works across the most harnesses? Append the content to AGENTS.md at your repository root. The AGENTS.md spec is read by Codex, Aider, Cursor, Factory, Jules, Gemini CLI, Windsurf, GitHub Copilot’s coding agent, JetBrains Junie, Warp, and others — so a single file covers most users without harness-specific setup.
If your harness isn’t listed, the SKILL.md content itself is portable — install it wherever your harness loads workflow context and adapt the activation step (auto-trigger, slash command, explicit invocation) to your harness’s conventions. The accordions below walk through end-to-end setup (skill file, slash command, version control) for the four most common harnesses. If you’re on a different harness, copy the SKILL.md content from any accordion and install it per the conventions above.

Setup

  1. Configure the CoreStory MCP server in your Claude Code settings (see CoreStory MCP Server Setup Guide).
  2. (Optional) Configure Jira MCP for ticketing integration (see Using CoreStory with Jira).
  3. Add the skill file:
Create .claude/skills/decomposition-sequencing/SKILL.md with the content from the skill file below.
  1. Commit to version control:

Usage

Tips

  • This skill focuses on Phase 4 of the broader modernization workflow. It expects Phase 3 (Target Architecture) to be complete.
  • If Jira/Linear MCP is available, the skill can push work packages directly. If not, it produces structured definitions for manual import.
  • Keep the SKILL.md under 500 lines for reliable loading.

Skill File

Save as .claude/skills/decomposition-sequencing/SKILL.md:
Add the following to .github/copilot-instructions.md:
(Optional) Add a reusable prompt file. Create .github/prompts/decomposition-sequencing.prompt.md:
Create .cursor/rules/decomposition-sequencing/RULE.md:
Create .factory/droids/decomposition-sequencing.md:

Troubleshooting

Everything seems tightly coupled — no clean decomposition points. This is common in monoliths. Look for the components with the lowest fan-in and fan-out — those are your best extraction candidates. If everything truly shares everything, consider a “modular monolith” intermediate step: introduce internal module boundaries within the monolith before extracting services. Ask CoreStory: “Which modules access the fewest shared database tables?” Work packages are too large (multi-month scope). Ask CoreStory more targeted decomposition questions: “What is the smallest independently-deployable subset of [component]?” and “If we extract just [specific feature], what temporary integration points are needed?” The goal is work packages that can be completed in 1–3 sprints. If a component truly can’t be decomposed further, it may need a dedicated team. The dependency graph has circular dependencies between work packages. Circular dependencies usually indicate that the decomposition boundaries are wrong. Ask CoreStory: “Components A and B appear to depend on each other — what specific integration points create this cycle? Can any of them be broken with an anti-corruption layer or event-driven decoupling?” If the cycle can’t be broken, the two work packages should be merged into a single migration unit. Sequencing produces analysis paralysis — too many valid orderings. Start with hard constraints (dependency chain), then optimize for one primary factor: either risk (tackle the riskiest component early to retire risk), or business value (deliver the highest-value modernization first), or team learning (start with the component the team understands best). Don’t try to optimize for everything simultaneously. Jira/Linear MCP is not configured. The work package definitions are the primary output regardless of whether a ticketing MCP is available. Export the definitions as a structured document and import manually. See Using CoreStory with Jira for Jira MCP setup instructions. Agent can’t access CoreStory tools. See the Supercharging AI Agents troubleshooting section for MCP connection issues. Verify the project has completed ingestion by calling list_projects and checking the status.

What’s Next

Start executing: With sequenced work packages in hand, begin Phase 5. Use Spec-Driven Development → for delta specs per component, and the relevant architecture variant for pattern-specific guidance: Monolith to Microservices →. Verify as you go: Each component’s Coexist phase requires behavioral verification. Use Behavioral Verification → to prove the modernized component preserves business rules. Return to the hub: Code Modernization → — the full six-phase framework. For Jira integration: Using CoreStory with Jira → — MCP setup and workflow patterns. For agent setup: Supercharging AI Agents with CoreStory → — MCP server configuration and agent setup.