Overview
Every modernization program starts with the same question: what exactly are we dealing with? The answer is almost never what people expect. Engineering teams who’ve worked on a system for years consistently discover architectural connections, dead code paths, and undocumented dependencies during a formal assessment. Tribal knowledge covers the 20% of the system that changes regularly. The other 80% — the batch jobs that run once a month, the integration points nobody remembers building, the utility modules that seven services quietly depend on — hide until you look systematically. Traditional assessment approaches rely on manual code sampling and architect interviews, producing a snapshot of what people think the system looks like. CoreStory changes this by ingesting and semantically understanding the entire codebase, giving your assessment team an Oracle that can answer specific architectural questions against the full system — not a sample, not a summary, the actual code. This playbook provides a structured methodology for evaluating a codebase’s modernization readiness across seven domains: architectural complexity, dependency chains, technical debt, security and compliance, testability, data architecture, and — critically for mainframe systems — non-code artifacts that encode business logic never captured in application code. Who this is for: Architects, engineering leads, and modernization teams performing the first phase of a modernization initiative. Also useful for consultants and system integrators scoping modernization engagements. What you’ll get: A Modernization Readiness Report with an architecture map, dependency graph, tech debt inventory, risk register, and component-level readiness scores with a recommended modernization strategy per component. Relationship to M&A Due Diligence: This playbook shares methodology DNA with the M&A Technical Due Diligence playbook — both systematically interrogate a codebase across risk domains. The difference is the lens. M&A evaluates a codebase you don’t own for acquisition risk. Codebase Assessment evaluates a codebase you do own for transformation readiness. The interrogation categories differ accordingly: M&A focuses on deal-affecting risks (licensing, secrets, PII exposure); Codebase Assessment focuses on transformation-readiness factors (coupling, decomposability, testability, data architecture).When to Use This Playbook
- You’re planning a modernization initiative and need a rigorous baseline of the current system’s architecture, dependencies, and technical debt
- You need to determine which modernization strategy (the 7 Rs) applies to each component — not a single system-wide strategy
- You’re evaluating whether a legacy system is ready for modernization at all, or whether prerequisites (test coverage, documentation, domain expertise) must be addressed first
- You need evidence-based scope and effort estimates for a modernization proposal
- You’re inheriting a legacy system from another team and need architectural orientation before making changes
When to Skip This Playbook
- You already have a recent, thorough architectural assessment and need to move directly to strategy selection — start at Target Architecture
- You’re evaluating a codebase for acquisition rather than internal modernization — use M&A Technical Due Diligence instead
- The system is trivially small (under ~10k LOC) and its architecture is self-evident — you can proceed directly to refactoring
- You’ve already decided on a full rebuild with no legacy component reuse — the assessment adds less value when nothing will be retained
Prerequisites
- 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)
- Repository access for the legacy codebase (for the agent to cross-reference CoreStory findings against source)
- (Recommended) Access to architecture documentation, if it exists — even outdated docs help frame questions
- (Recommended) Domain experts who can validate architectural findings — especially for mainframe systems where business logic hides in non-code artifacts (JCL, copybooks, CICS configuration, VSAM data stores)
How It Works
CoreStory MCP Tools Used
This playbook uses the following tools from the CoreStory MCP server:| Tool | Step(s) | Purpose |
|---|---|---|
list_projects | 1 | Find the target project |
create_conversation | 1 | Start a dedicated assessment conversation thread |
send_message | 2, 3, 4, 5, 6 | Query CoreStory for architecture analysis and risk assessment |
get_project_prd | 1 | Retrieve synthesized PRD for business context |
get_project_techspec | 1 | Retrieve synthesized TechSpec for architecture analysis |
list_conversations | Any | Review existing conversation threads |
get_conversation | Any | Retrieve conversation history for report synthesis |
rename_conversation | 6 | Mark completed thread with “RESOLVED” prefix |
send_message. CoreStory has already ingested these documents and can answer targeted questions about them efficiently.
The Assessment Workflow
Note: The steps below are internal to this playbook. They are sub-steps of Phase 1 in the six-phase modernization framework, not a separate numbering system.Codebase assessment with CoreStory follows a six-step pattern:
- Setup & Orientation — Confirm the target project, review synthesized specs for architectural context, and create a named conversation thread for the assessment.
- Architecture Mapping — Map major components, services, data stores, and communication patterns. Establish the structural vocabulary that all subsequent steps reference.
- Dependency Analysis — Identify internal coupling, external dependencies, shared data stores, and integration points. This step reveals what can be decomposed and what must move together.
- Tech Debt & Risk Assessment — Catalog technical debt, security risks, compliance gaps, and code quality issues. Each finding includes severity and blast radius.
- Modernization Readiness Scoring — Score each component on modernization readiness. Recommend a modernization strategy (from the 7 Rs) per component, not one strategy for the whole system.
- Report Generation — Synthesize findings into the Modernization Readiness Report. This is the deliverable that feeds Phase 3 (Target Architecture) of the broader modernization workflow.
Oracle Before Navigator
Before searching for specific issues or code paths, first use CoreStory to understand how the system is designed to work — its intended architecture, data flow patterns, and integration model. This architectural baseline makes it far easier to spot deviations, shortcuts, coupling hotspots, and technical debt. Ask “what is this system?” before asking “what’s wrong with this system?”Step-by-Step Walkthrough
Step 1: Setup & Orientation
Start every assessment by confirming the target and building architectural context. Confirm the target project:list_projects and returns your available projects. Confirm the correct project before proceeding — this prevents accidentally assessing the wrong codebase if multiple projects are loaded.
Review synthesized specifications:
get_project_techspec and get_project_prd. This gives you architectural orientation and — critically — the vocabulary (service names, module names, data model names) that makes all subsequent queries specific and productive.
Create the assessment conversation:
Step 2: Architecture Mapping
With architectural context established, usesend_message to build a comprehensive map of the system’s structure. This step establishes the facts that all subsequent steps analyze.
The following worked example shows what an architecture map looks like for a hypothetical e-commerce monolith. Your map will look different — this shows the structure and level of detail to aim for:
Note the shared-write database highlighted in red — data coupling is typically the primary decomposition challenge.Component inventory:
Step 3: Dependency Analysis
Dependency analysis reveals what can be decomposed and what must move together. This is the step that most directly feeds Phase 4 (Decomposition & Sequencing) of the broader modernization workflow. Internal coupling:Step 4: Tech Debt & Risk Assessment
This step catalogs specific issues that affect modernization feasibility, cost, and risk. Each finding should include a severity assessment and blast radius (how much of the system does it affect). Code quality and structural debt:Step 5: Modernization Readiness Scoring
With the architectural map, dependency graph, and risk inventory complete, score each component’s readiness for modernization and recommend a strategy. The interactive heatmap below shows what the output looks like — click any row for component details:Sample data shown above — replace with actual assessment scores from your Step 5 analysis.Component-level readiness scoring:
Step 6: Report Generation
Synthesize the assessment into the Modernization Readiness Report — the deliverable that feeds Phase 3 (Target Architecture) of the broader modernization workflow.HITL Gate
After Step 6 (Report Generation): The Modernization Readiness Report must be reviewed and approved by technical leadership before proceeding to Phase 2 (Business Rules Inventory) or Phase 3 (Target Architecture). This is a go/no-go decision point.The report should be reviewed by:
- Technical leadership (CTO, VP Engineering, or Principal Architect) — validates the assessment methodology and strategic recommendations
- Product/business stakeholders — validates that the recommended modernization strategy aligns with business priorities and timelines
- (Recommended) Domain experts — especially for mainframe or legacy systems where business logic resides in non-code artifacts. Domain experts can validate whether the assessment correctly identified hidden dependencies and business rules
- (Recommended) Security/compliance — if the assessment flagged compliance constraints that affect modernization strategy
- Go / No-go: Is modernization warranted, or is Retain the right strategy for all or most components?
- Scope confirmation: Do the recommended strategies per component make sense? Should any be reclassified?
- Priority alignment: Does the recommended sequencing align with business priorities?
- Prerequisite resolution: Are there organizational prerequisites (staffing, governance, budget) that must be addressed before proceeding?
Output Format: Modernization Readiness Report
The assessment produces a structured report that serves as the input to Phase 3 (Target Architecture & Strategy). Here is the template:Prompting Patterns Reference
Assessment Patterns
Effective assessment queries are specific, domain-anchored, and evidence-oriented. They ask for file paths, concrete examples, and measurable indicators — not summaries.| Pattern | Example |
|---|---|
| Component inventory | ”List all major components with their purpose, technology, and approximate size. Organize by domain.” |
| Communication mapping | ”Map all inter-service communication paths. For each, identify source, target, mechanism, and whether it’s synchronous or asynchronous.” |
| Coupling detection | ”Which components share database tables? For each shared table, list all reading and writing components.” |
| Tech debt identification | ”Identify god classes over 500 lines with methods that mix business logic and infrastructure concerns. Provide file paths.” |
| Testability assessment | ”Which critical code paths have no test coverage? Identify the highest-risk untested paths.” |
| Non-code artifact discovery | ”Identify all JCL jobs, copybook definitions, and CICS transaction maps. For each, describe the business logic it encodes.” |
Query Specificity
After reviewing the Tech Spec in Step 1, use the architectural vocabulary it provides in all subsequent queries. Vague queries produce vague answers.| Instead of | Use |
|---|---|
| ”Tell me about the architecture" | "Map the communication paths between OrderService, InventoryService, and PaymentService, including shared database tables and message queues" |
| "How’s the code quality?" | "Identify modules with circular dependencies, classes over 500 lines, or methods with more than 5 parameters. Provide file paths." |
| "What are the dependencies?" | "Which components would break if we extracted OrderService as a standalone service? What data and logic would need to move with it?" |
| "Is it ready to modernize?" | "For the inventory module specifically: what is its test coverage, how many other components depend on it, and does it share database tables with other modules?” |
Best Practices
Start with the synthesized specs, not with questions. Useget_project_techspec and get_project_prd before diving into send_message queries. The specs give you architectural vocabulary — service names, data model names, API patterns — that make your queries far more specific and productive.
Assess every component, even the ones you think you know. Engineers who’ve worked on a system for years consistently discover surprises during a formal assessment. CoreStory surfaces connections that tribal knowledge misses — the utility module that seven services quietly depend on, the batch job that silently populates a cache every night, the database trigger that enforces a business rule nobody documented.
Don’t forget non-code artifacts. For mainframe systems and older legacy platforms, 30–50% of business logic lives in JCL workflows, copybook definitions, CICS transaction maps, stored procedures, and configuration files. If your assessment only covers application code, your modernization scope estimate will be significantly under-counted.
Ask for file paths, always. Every finding in the readiness report needs evidence. Train your queries to always request file paths and specific code references. “Identify X and provide the file path” should be your default pattern.
Score honestly — Retain is a legitimate outcome. 53% of enterprises pursue hybrid strategies (Kyndryl 2025 State of IT Infrastructure Report). Not every component needs to be modernized. The assessment should identify components where the cost of modernization exceeds the benefit, and “Retain” is the correct strategy for those components. A good assessment saves money by preventing unnecessary modernization as much as by enabling necessary modernization.
Low test coverage is a blocker, not a footnote. If a component has no test coverage, you cannot verify behavioral equivalence after modernization. The readiness report should flag this as a prerequisite: “Before modernizing [component], establish characterization tests that capture current behavior.” This is not optional — it’s what prevents the 79% failure rate.
Scope your queries to avoid noise. A query like “find all technical debt” will return an overwhelming response. Break it into targeted categories: code quality, security, compliance, testability, operational complexity. Each produces focused, actionable findings.
Track confidence levels for every finding. Assessment findings are AI-derived — they vary in reliability. As you work through Steps 2–5, mentally categorize each finding as Verified (confirmed by a human or cross-referenced against running code), High-confidence (CoreStory is confident, consistent across multiple queries), Hypothesized (plausible but not yet validated), or Contradicted (conflicts with other evidence). This matters because downstream phases inherit your findings. A readiness score built on Hypothesized findings needs validation before it drives architectural decisions. See Working with AI-Derived Findings for the full Confidence Protocol.
Agent Implementation Guides
Claude Code
Claude Code
Setup
- Configure the CoreStory MCP server in your Claude Code settings (see CoreStory MCP Server Setup Guide).
- Add the skill file. Create the skill directory and file:
.claude/skills/codebase-assessment/SKILL.md with the content from the skill file below.- (Optional) Add the slash command:
.claude/commands/assess.md with a short description referencing the six-step assessment workflow.- Commit to version control:
Usage
The skill activates automatically when Claude Code detects assessment-related requests:Tips
- This skill focuses on Phase 1 of the broader modernization workflow. For the full six-phase workflow, use the code-modernization skill instead.
- Create a single CoreStory conversation for the entire assessment to maintain context across all steps.
- Keep the SKILL.md under 500 lines for reliable loading.
Skill File
Save as.claude/skills/codebase-assessment/SKILL.md:GitHub Copilot
GitHub Copilot
Setup
- Configure the CoreStory MCP server in your VS Code settings. Add it to your MCP server configuration (typically in VS Code settings JSON or the MCP configuration UI).
-
Add custom instructions. Copilot reads project-level instructions from
.github/copilot-instructions.md. This is the primary mechanism for teaching Copilot specialized workflows:
.github/copilot-instructions.md:- (Optional) Add a reusable prompt file. Create
.github/prompts/codebase-assessment.prompt.md:
- Commit to version control:
Usage
In Copilot Chat (agent mode):Tips
- Copilot’s agent mode (available in VS Code) can execute terminal commands and edit files autonomously — this workflow works best in agent mode.
- On Team/Enterprise plans, organization-level instructions apply across all repositories.
- Copilot automatically references
.github/copilot-instructions.mdin chat responses.
Cursor
Cursor
Setup
- Configure the CoreStory MCP server in Cursor’s MCP settings (Settings → MCP Servers, or edit the MCP config JSON directly).
- Add project rules:
.cursor/rules/codebase-assessment/RULE.md with the content from the rule file below.- Commit to version control:
Usage
In Cursor’s Composer or Chat, the rule activates automatically for assessment-related requests:Tips
- Rules with
alwaysApply: trueload in every session. Set this if your team regularly performs assessments. Otherwise, usealwaysApply: falsewith a gooddescriptionso Cursor loads it when relevant. - The
.cursor/rules/directory structure is the current recommended approach. - Rules apply to Composer and Chat but do not affect Cursor Tab or inline edits.
Project Rule
Save as.cursor/rules/codebase-assessment/RULE.md:Factory.ai
Factory.ai
Setup
-
Configure the CoreStory MCP server in your Factory.ai environment. Verify with the
/mcpcommand that CoreStory tools are accessible. - Add the custom droid:
.factory/droids/codebase-assessment.md with the content from the droid file below.- Commit to version control:
Usage
Invoke the droid via the Task tool:Tips
- Use
model: inheritin the YAML frontmatter to use whatever model the session is configured with. - The
toolsfield explicitly lists required MCP tools — this restricts the droid to only the CoreStory tools needed for assessment. - The assessment queries may produce long streaming responses — this is expected.
Custom Droid
Save as.factory/droids/codebase-assessment.md:Troubleshooting
CoreStory returns generic or shallow answers about the architecture. Your queries are too broad. After retrieving the Tech Spec, use the architectural vocabulary it provides — specific service names, module names, data model names — in your queries. “What are the dependencies?” is weak. “Which components depend on OrderService, and do any of them share the orders database tables?” is strong. The assessment reveals the system isn’t ready for modernization. This is a valid and valuable finding. Common blockers: no test coverage (can’t verify behavioral equivalence), extreme coupling (can’t decompose), missing domain knowledge (can’t validate business rules), compliance constraints that limit target architecture options. Use the assessment to build the case for investing in readiness before attempting modernization. A good assessment prevents expensive failures. Non-code artifacts aren’t showing up in the assessment. CoreStory will surface JCL, copybooks, CICS maps, and other non-code artifacts if you explicitly ask about them. The default assessment queries focus on application code. For mainframe and older legacy systems, always include the “Beyond the Code” queries from Step 2. Response exceeds token limit. Break large queries into smaller scopes. Instead of “Map the complete architecture,” ask about specific domains or layers. If a response is truncated, ask the agent to continue or narrow the scope. Findings don’t match current source code. CoreStory’s analysis reflects the codebase at ingestion time. If the system has changed significantly since ingestion, request a re-ingestion before finalizing your assessment report. Always note the ingestion date in your report for traceability. Agent can’t access CoreStory tools. See the Supercharging AI Agents troubleshooting section for MCP connection issues. Verify the project has completed ingestion by callinglist_projects and checking the status.