Modernization Flow - Execute Phases Sequentially
Context
This modernization process is designed to systematically analyze, specify, and implement code modernization/migration projects. The process is divided into phases that MUST be executed one-by-one.
Critical Requirements
- ONE PHASE AT A TIME: Read one phase file, execute it completely, update state file, then move to next phase.
- DO NOT SKIP PHASES: Each phase builds on the previous one.
- STATE TRACKING: After each phase, update
agents/modernization-flow-state.md with completion status, keep this document concise.
- USER CONFIRMATION: Wait for user confirmation before proceeding to next phase.
- Make sure to have todo tasks for each phase! Do not skip phases!
- REMEMBER Do not put decisions/recommendations/suggestions/implementation code for the next phases in the output documents! The decisions are made at phase 6 and review at phase 7 AFTER full analysis. Respect that.
- MUST Create and update files that ARE EXPLICITLY stated here, ASK for permission to create any other file!
- MUST use grep/search on large files to read "table of contents" and then use line ranges to read what is needed.
- MUST use only applicable phases according to the target of the modernization (acquire user approval first and store it in state), as those phases are for multi-project cross-tech modernization. Do not take shortcuts within the phase!
- Prioritize ACCURACY over SPEED!
- THIS is very large workflow: MUST use best matching available separate subagents for each phase, top level agent is orchestrator, orchestrator must be smart with reading/writing files (avoid, fallback to grep and reading line-ranges, as those are very large)
- Phase subagents must contain additionally: "MUST APPLY PHASE <phase.md> — FULLY EXECUTE ALL STEPS", goal, context, original user request, inputs, expected outputs, and summary in the format useful for orchestrator, subagents must be informed they are used as subagents.
User Customizations
- If user did not specify any preferences perform all steps except optional.
- User CAN customize and ask only for specific steps OR steps could have been done already OR towards specific goal OR for specific case, in this case LISTEN and ADOPT to the user.
- Modernization scope could be small or could be done in place (example: upgrade Java 8 to 17 or 17 to 21), in this case only use
Phase 2 and Phase 6, skip the other phases and their prerequisites, record this in the state file, unless you discover dependencies and project becomes bigger.
- If there is no need to rewrite code (example: upgrade .NET 6 to .NET 8), then take original and target code specs LIGHTLY, only document WHAT IS NECESSARY TO CHANGE (example: new way to use app builder).
Modernization Flow - Phase Overview
Phase 0: Prerequisites
- All Rosetta prep steps MUST be FULLY completed
- USE SKILL
load-project-context, orchestration, hitl
- MUST ALWAYS use todo tasks ledger, ASAP. Phases are sequential. Independent tasks can run in parallel.
Phase 1: Existing Library Analysis for Reusing in Target State [modernization-flow-reuse.md]
- APPLY SKILL FILE
phases/modernization-flow-reuse.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 2: Old Code Analysis, Generating Original Specs [modernization-flow-analysis.md]
- APPLY SKILL FILE
phases/modernization-flow-analysis.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 3: Pre-Modernization Test Coverage (OPTIONAL) [modernization-flow-testing.md]
NOTE: Execute this phase if user explicitly approves it
- APPLY SKILL FILE
phases/modernization-flow-testing.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 4: Class Group Analysis [modernization-flow-grouping.md]
- APPLY SKILL FILE
phases/modernization-flow-grouping.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 5: Cross-Project Analysis [modernization-flow-crossproject.md]
- APPLY SKILL FILE
phases/modernization-flow-crossproject.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 6: Implementation Mapping, Generating Target Specs [modernization-flow-mapping.md]
- APPLY SKILL FILE
phases/modernization-flow-mapping.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 7: Final Review [modernization-flow-review.md]
- APPLY SKILL FILE
phases/modernization-flow-review.md
- Execute phase instructions
- Update
agents/modernization-flow-state.md with brief state
- Validate by listing files in respective folders
Phase 8: Implementation [modernization-flow-implement.md]
- APPLY SKILL FILE
phases/modernization-flow-implement.md
- Get explicit human approval
- Follow approved target specs
- Implement one project at-a-time
- Maintain backward compatibility
- Write comprehensive tests
- Achieve 80% code coverage
State File Format
Create/update agents/modernization-flow-state.md briefly after each phase using sample:
# Modernization State
**Last Updated**: [Date and Time]
**Current Status**: [Phase Number or COMPLETE]
**Project**: [Project/Feature Name]
## Phase Completion Status
- [x] Phase 1: Existing Library Analysis - Completed [Date]
- [ ] Phase 2: Old Code Analysis - Not Started
- [ ] Phase 3: Test Coverage (OPTIONAL) - Not Started / Skipped
- [ ] Phase 4: Class Group Analysis - Not Started
- [ ] Phase 5: Cross-Project Analysis - Not Started
- [ ] Phase 6: Implementation Mapping - Not Started
- [ ] Phase 7: Final Review - Not Started
- [ ] Implementation Phase - Not Started
## Phase Details
### Phase 1
- Completed: [Date/Time]
- Files Created: [List files]
- Projects Analyzed: [List projects]
- Notes: [Any relevant notes]
[Add similar sections for each completed phase]
Important Notes
- Sequential Execution Required: Phases build on each other and must be done in order
- No Assumptions: If information is missing, track it in spec files
- User Guidance: Ask questions to resolve critical unknowns
- Evidence-Based: All findings must reference actual code
- Get Approval: Implementation phase requires explicit human approval
1---2name: modernization-flow-43description: "Workflow for converting, modernizing, upgrading, or re-architecting code (e.g. C++→Java, monolith→microservices), etc."4metadata:5 source: https://skillmd.com/skills/griddynamics/modernization-flow-46---78# Modernization Flow - Execute Phases Sequentially910## Context1112This modernization process is designed to systematically analyze, specify, and implement code modernization/migration projects. The process is divided into phases that **MUST be executed one-by-one**.1314### Critical Requirements1516- **ONE PHASE AT A TIME**: Read one phase file, execute it completely, update state file, then move to next phase.17- **DO NOT SKIP PHASES**: Each phase builds on the previous one.18- **STATE TRACKING**: After each phase, update `agents/modernization-flow-state.md` with completion status, keep this document concise.19- **USER CONFIRMATION**: Wait for user confirmation before proceeding to next phase.20- Make sure to have todo tasks for each phase! Do not skip phases!21- **REMEMBER** Do not put decisions/recommendations/suggestions/implementation code for the next phases in the output documents! The decisions are made at phase 6 and review at phase 7 AFTER full analysis. Respect that.22- **MUST** Create and update files that ARE EXPLICITLY stated here, ASK for permission to create any other file!23- **MUST** use grep/search on large files to read "table of contents" and then use line ranges to read what is needed.24- **MUST** use only applicable phases according to the target of the modernization (acquire user approval first and store it in state), as those phases are for multi-project cross-tech modernization. Do not take shortcuts within the phase!25- Prioritize ACCURACY over SPEED!26- THIS is very large workflow: MUST use best matching available separate subagents for each phase, top level agent is orchestrator, orchestrator must be smart with reading/writing files (avoid, fallback to grep and reading line-ranges, as those are very large)27- Phase subagents must contain additionally: "MUST APPLY PHASE <phase.md> — FULLY EXECUTE ALL STEPS", goal, context, original user request, inputs, expected outputs, and summary in the format useful for orchestrator, subagents must be informed they are used as subagents.2829### User Customizations3031- If user did not specify any preferences perform all steps except optional.32- User CAN customize and ask only for specific steps OR steps could have been done already OR towards specific goal OR for specific case, in this case LISTEN and ADOPT to the user.33- Modernization scope could be small or could be done in place (example: upgrade Java 8 to 17 or 17 to 21), in this case only use `Phase 2` and `Phase 6`, skip the other phases and their prerequisites, record this in the state file, unless you discover dependencies and project becomes bigger.34- If there is no need to rewrite code (example: upgrade .NET 6 to .NET 8), then take original and target code specs LIGHTLY, only document WHAT IS NECESSARY TO CHANGE (example: new way to use app builder).3536## Modernization Flow - Phase Overview3738**Phase 0: Prerequisites** 391. All Rosetta prep steps MUST be FULLY completed402. USE SKILL `load-project-context`, `orchestration`, `hitl`413. MUST ALWAYS use todo tasks ledger, ASAP. Phases are sequential. Independent tasks can run in parallel.4243**Phase 1: Existing Library Analysis for Reusing in Target State** [modernization-flow-reuse.md]441. APPLY SKILL FILE `phases/modernization-flow-reuse.md`452. Execute phase instructions463. Update `agents/modernization-flow-state.md` with brief state474. Validate by listing files in respective folders4849**Phase 2: Old Code Analysis, Generating Original Specs** [modernization-flow-analysis.md]501. APPLY SKILL FILE `phases/modernization-flow-analysis.md`512. Execute phase instructions523. Update `agents/modernization-flow-state.md` with brief state534. Validate by listing files in respective folders5455**Phase 3: Pre-Modernization Test Coverage (OPTIONAL)** [modernization-flow-testing.md]56**NOTE: Execute this phase if user explicitly approves it**571. APPLY SKILL FILE `phases/modernization-flow-testing.md`582. Execute phase instructions593. Update `agents/modernization-flow-state.md` with brief state604. Validate by listing files in respective folders6162**Phase 4: Class Group Analysis** [modernization-flow-grouping.md]631. APPLY SKILL FILE `phases/modernization-flow-grouping.md`642. Execute phase instructions653. Update `agents/modernization-flow-state.md` with brief state664. Validate by listing files in respective folders6768**Phase 5: Cross-Project Analysis** [modernization-flow-crossproject.md]691. APPLY SKILL FILE `phases/modernization-flow-crossproject.md`702. Execute phase instructions713. Update `agents/modernization-flow-state.md` with brief state724. Validate by listing files in respective folders7374**Phase 6: Implementation Mapping, Generating Target Specs** [modernization-flow-mapping.md]751. APPLY SKILL FILE `phases/modernization-flow-mapping.md`762. Execute phase instructions773. Update `agents/modernization-flow-state.md` with brief state784. Validate by listing files in respective folders7980**Phase 7: Final Review** [modernization-flow-review.md]811. APPLY SKILL FILE `phases/modernization-flow-review.md`822. Execute phase instructions833. Update `agents/modernization-flow-state.md` with brief state844. Validate by listing files in respective folders8586**Phase 8: Implementation** [modernization-flow-implement.md]871. APPLY SKILL FILE `phases/modernization-flow-implement.md`882. Get explicit human approval893. Follow approved target specs904. Implement one project at-a-time915. Maintain backward compatibility926. Write comprehensive tests937. Achieve 80% code coverage9495## State File Format9697Create/update `agents/modernization-flow-state.md` briefly after each phase using sample:9899```markdown100# Modernization State101102**Last Updated**: [Date and Time]103**Current Status**: [Phase Number or COMPLETE]104**Project**: [Project/Feature Name]105106## Phase Completion Status107108- [x] Phase 1: Existing Library Analysis - Completed [Date]109- [ ] Phase 2: Old Code Analysis - Not Started110- [ ] Phase 3: Test Coverage (OPTIONAL) - Not Started / Skipped111- [ ] Phase 4: Class Group Analysis - Not Started112- [ ] Phase 5: Cross-Project Analysis - Not Started113- [ ] Phase 6: Implementation Mapping - Not Started114- [ ] Phase 7: Final Review - Not Started115- [ ] Implementation Phase - Not Started116117## Phase Details118119### Phase 1120- Completed: [Date/Time]121- Files Created: [List files]122- Projects Analyzed: [List projects]123- Notes: [Any relevant notes]124125[Add similar sections for each completed phase]126```127128## Important Notes129130- **Sequential Execution Required**: Phases build on each other and must be done in order131- **No Assumptions**: If information is missing, track it in spec files132- **User Guidance**: Ask questions to resolve critical unknowns133- **Evidence-Based**: All findings must reference actual code134- **Get Approval**: Implementation phase requires explicit human approval