Skip to main content

Overview

Phase 3 of the modernization workflow is where strategy becomes structure. You have the assessment data from Phase 1 and the business rules inventory from Phase 2. Now the question is: what are we modernizing to, and how? This is the most human-driven phase in the entire modernization workflow. CoreStory provides the analysis — natural service boundaries, coupling hotspots, data dependency maps, effort estimates — but the architectural decision belongs to the architect and stakeholders. AI is excellent at revealing what a system is; humans decide what it should become. The reason this boundary matters: architectural decisions are organizational commitments. They determine team structure, hiring plans, vendor contracts, timelines, and budgets. They affect compliance posture, operational complexity, and the skills your team needs to develop. These are not decisions an AI should make, no matter how good its analysis is. CoreStory serves as an Expert throughout this phase — explaining system behavior, identifying natural boundaries and extension points, and quantifying the gap between current and target states. It also serves as a Navigator when defining the target architecture, pointing to specific code patterns, data flows, and integration points that inform where boundaries should be drawn. Who this is for: Architects, engineering leads, and technical decision-makers responsible for choosing the modernization strategy and defining the target architecture. Also useful for consultants and system integrators presenting options to stakeholders. What you’ll get: An Architectural Decision Record (ADR) documenting the selected modernization strategy, target architecture, migration scope, constraints, and stakeholder approval — the input that Phase 4 (Decomposition & Sequencing) turns into executable work packages.

When to Use This Playbook

  • You’ve completed Phase 1 (Codebase Assessment) and have a Modernization Readiness Report with component-level readiness scores
  • You need to choose a modernization strategy (from the 7 Rs) for each component — not a single system-wide strategy
  • You need to define the target architecture before decomposing work into executable packages
  • You’re presenting modernization options to stakeholders and need data-backed analysis to support the recommendation
  • You need to document an architectural decision with rationale, constraints, and approval for the audit trail

When to Skip This Playbook

  • You’ve already made the architectural decision and need to decompose it into work packages — go to Decomposition & Sequencing
  • You’re still assessing the current system — go back to Codebase Assessment
  • The modernization is a straightforward lift-and-shift (Rehost/Relocate) with no architectural changes — this playbook adds minimal value to infrastructure-only moves
  • You’re doing a single-component refactor that doesn’t require a formal architectural decision — use Spec-Driven Development directly

Prerequisites

  • A completed Codebase Assessment (Phase 1) — the Modernization Readiness Report is the primary input to this phase
  • A completed or in-progress Business Rules Inventory (Phase 2) — understanding what the system does is essential for deciding what it should become
  • 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)
  • The right people in the room: This phase requires architectural judgment. The architect or tech lead who will own the target architecture should be driving this phase, not delegating it to the agent.
  • (Recommended) Access to the Codebase Assessment conversation thread in CoreStory for cross-referencing findings

How It Works

CoreStory MCP Tools Used

The Strategy & Architecture Workflow

Note: The steps below are internal to this playbook. They are sub-steps of Phase 3 in the six-phase modernization framework, not a separate numbering system.
This playbook follows a five-step pattern:
  1. Input Review — Load the Codebase Assessment report and Business Rules Inventory from prior phases. Establish the baseline that all strategy decisions reference.
  2. Strategy Exploration — Query CoreStory to explore which modernization patterns are feasible given the current architecture. This is the divergent phase — open the option space before narrowing.
  3. Target Architecture Definition — Define the target architecture with CoreStory’s guidance on natural service boundaries, extension points, and alignment with the selected strategy.
  4. Risk & Effort Estimation — Assess the gap between current and target architecture. Estimate effort and risk per component. This is where the strategy meets reality.
  5. Decision Documentation — Record the architectural decision, rationale, constraints, and approval in an Architectural Decision Record (ADR). This artifact feeds Phase 4 and serves as the audit trail.

The HITL Boundary

This phase has the most critical human-in-the-loop gate in the entire modernization workflow:
After Step 4: The architect or tech lead reviews the target architecture, strategy recommendations, and risk/effort estimates. This is the gate where the architectural decision is made and approved by stakeholders. It must not be delegated to AI.
CoreStory’s role is to provide the best possible analysis so the human decision-maker has complete information. The agent should present options with trade-offs, not make recommendations that assume the decision is already made.

Step-by-Step Walkthrough

Step 1: Input Review

Start by loading context from prior phases so all strategy exploration is grounded in actual assessment data. Confirm the project and locate prior work:
The agent calls list_projects and list_conversations to locate the assessment conversation. If you used the naming convention from the Codebase Assessment playbook, look for “RESOLVED - [Assessment] SystemName - Modernization Readiness”. Retrieve assessment context:
The agent calls get_conversation to retrieve the assessment findings. This establishes the baseline for strategy exploration. Create the architecture decision thread:

Step 2: Strategy Exploration

With the assessment baseline loaded, explore which modernization patterns are feasible. This is the divergent phase — the goal is to understand the option space before narrowing to a decision. Natural boundaries and decomposition candidates:
Coupling and independence analysis:
Strategy feasibility per component:
Deployment model implications:
Existing alignment:

Step 3: Target Architecture Definition

Narrow from exploration to definition. Use CoreStory to validate the emerging target architecture against the actual codebase. Service boundary definition:
Pattern carryforward:
Gap analysis:
Data architecture implications:
Cross-cutting concerns:
Behavior tagging: Once service boundaries and patterns are defined, tag every behavior identified in the specification with an explicit migration intent. This prevents silent changes — each behavior gets a deliberate decision.
The tags have direct consequences downstream:
  • Phase 4 (Decomposition): Each work package’s scope is defined by its tags. A package dominated by PRESERVE and MODERNIZE is lower-risk than one heavy on CHANGE and NEW.
  • Phase 5 (Execution): TDD assertions differ by tag. PRESERVE behaviors get regression tests asserting identical output. CHANGE behaviors get tests asserting the new expected output. NEW behaviors need tests written from scratch.
  • Phase 6 (Verification): Verification criteria differ by tag. PRESERVE items require behavioral equivalence proof. MODERNIZE items require equivalence plus improvement metrics. CHANGE items require stakeholder sign-off on the new behavior.
Scope creep detection: If CHANGE + NEW tags exceed roughly 20% of the tagged items in a work unit, the unit is drifting from modernization toward rewrite — fundamentally different risk characteristics. Flag to the program manager for scope review before proceeding to Phase 4.

Step 4: Risk & Effort Estimation

Quantify the gap between current and target state so the decision-makers have realistic expectations. Component-level effort estimation:
Risk register for the migration:
Alternative architectures:
This is where the human decision-maker should engage directly. The agent has surfaced the options, feasibility analysis, effort estimates, and risks. The architect reviews this analysis and makes the call.

Step 5: Decision Documentation

Record the decision in an Architectural Decision Record. This artifact serves three purposes: it documents the rationale for future reference, it provides the input for Phase 4 (Decomposition & Sequencing), and it creates the audit trail for governance. Generate the ADR:
Mark the thread complete:

Output Format: Architectural Decision Record

The following diagram illustrates the transformation from current to target architecture — the visual complement to the ADR’s Components table. Mapping arrows show which current modules become which target services, color-coded by strategy: Current-to-Target Architecture Comparison — side-by-side showing the monolith modules on the left mapping to independent services on the right, color-coded by modernization strategy The primary deliverable is an ADR that feeds Phase 4 (Decomposition & Sequencing). Here is the template:

Prompting Patterns Reference

Strategy Exploration Patterns

The goal of Step 2 is to open the option space. Use divergent queries that explore multiple strategies rather than converging on one prematurely. The following decision tree provides a starting heuristic for mapping component characteristics to modernization strategies. This is a heuristic, not a prescription — the architect makes the final call:

Architecture Definition Patterns

Step 3 narrows from exploration to definition. Use convergent queries that validate specific architectural choices.

Best Practices

Present options, not conclusions. The agent should surface multiple feasible strategies with trade-offs, not converge on a single recommendation. The architectural decision belongs to the human. Framing matters: “Here are three viable approaches with their trade-offs” is better than “You should do X.” Ground every recommendation in assessment data. Every strategy recommendation should reference specific findings from the Phase 1 assessment. “Re-architect is recommended for OrderService because the assessment found it shares 12 database tables with 4 other services and has a readiness score of 2” is actionable. “Re-architect is recommended for OrderService because it would benefit from modernization” is not. Don’t force a single strategy. 53% of enterprises pursue hybrid strategies (Kyndryl 2025 State of IT Infrastructure Report). Different components should get different strategies based on their readiness scores, coupling profiles, and business value. The ADR should explicitly document the per-component strategy, not a single system-wide approach. Address data architecture explicitly. Data decomposition is consistently the hardest part of modernization — especially for monolith-to-microservices patterns. The target architecture must address how shared databases will be handled during and after migration. Skipping this produces a target architecture that looks clean on paper but is infeasible in practice. Include alternatives considered. Documenting rejected alternatives and the reasons for rejection is as valuable as documenting the selected strategy. It prevents relitigating the decision later and demonstrates that the choice was deliberate. Account for organizational constraints. The best technical architecture is useless if the team can’t build or operate it. Factor in team skills, hiring timelines, operational complexity, compliance constraints, and budget when evaluating strategies. CoreStory can analyze the code; the humans must assess the organization. Use a staged target if needed. Not every modernization needs to reach the final target architecture in one program. An intermediate architecture (e.g., modular monolith before microservices) may be more feasible and still deliver significant value. The ADR should document whether the target is the final state or an intermediate step.

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. Add the skill file:
Create .claude/skills/target-architecture/SKILL.md with the content from the skill file below.
  1. Commit to version control:

Usage

The skill activates automatically when Claude Code detects architecture decision requests:

Tips

  • This skill focuses on Phase 3 of the broader modernization workflow. It expects Phase 1 (Codebase Assessment) to be complete.
  • The skill should present options and trade-offs, not make the architectural decision. The human decides.
  • Keep the SKILL.md under 500 lines for reliable loading.

Skill File

Save as .claude/skills/target-architecture/SKILL.md:

Setup

Add the following to .github/copilot-instructions.md:
(Optional) Add a reusable prompt file. Create .github/prompts/target-architecture.prompt.md:
Create .cursor/rules/target-architecture/RULE.md:
Create .factory/droids/target-architecture.md:

Troubleshooting

The assessment conversation can’t be found. Use list_conversations to see all available threads. If the assessment used the naming convention from the Codebase Assessment playbook, search for “RESOLVED - [Assessment]”. If the assessment was done in a prior session or by a different team member, you may need to retrieve the assessment report as a document rather than through CoreStory conversation history. CoreStory recommends a single strategy for everything. Push back with targeted queries. Ask about specific components: “What about the payment processing module specifically — could it be retained while the rest is re-architected? What would the integration boundary look like?” Different components have different readiness profiles, and the analysis should reflect that. The target architecture is too ambitious for the team. Consider a staged approach. Ask CoreStory: “What intermediate architecture could we reach that delivers value but is less complex than full microservices?” A modular monolith or a partial decomposition (extracting 2–3 high-value services while keeping the rest monolithic) is often the right first step. Data decomposition seems impossible. This is the most common sticking point in monolith-to-microservices patterns. Ask targeted questions: “Which tables are written by only one module?” (those are the easy ones), “Which tables are written by multiple modules?” (those need careful planning), “Can we use an event-driven approach to sync data between services during coexistence?” The Monolith to Microservices variant playbook addresses this in detail. Stakeholders can’t agree on a strategy. Document each competing approach as an alternative in the ADR with trade-offs. Use CoreStory to provide objective data: effort estimates, risk profiles, component dependency analysis. Data-backed trade-offs are easier to resolve than opinion-based disagreements. 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

Decompose and sequence: The ADR feeds directly into Phase 4. Use Decomposition & Sequencing → to break the target architecture into executable work packages ordered by dependency. Extract business rules (if not complete): If Phase 2 is still in progress, complete it before starting execution. Use Business Rules Extraction → — the behavioral contract that Phase 6 verifies against. Review the first variant: If the selected strategy is monolith-to-microservices, review Monolith to Microservices → for pattern-specific guidance. Return to the hub: Code Modernization → — the full six-phase framework. For agent setup: Supercharging AI Agents with CoreStory → — MCP server configuration and agent setup.