Prompt Details
Model
(claude-5-5-sonnet)
Token size
5,238
Example input
[LEGACY_SYSTEM_CONTEXT]: An enterprise retail company operates a 12-year-old inventory and order management system. It handles 50,000 orders per month.
[CURRENT_TECH_STACK]: Java 8, Spring Framework 4, monolithic architecture, Oracle Database 12c, JSP frontend, and Apache Tomcat.
[MODERNIZATION_OBJECTIVES]: Modernize to Java 21, Spring Boot 3, React, and cloud infrastructure. Improve scalability, security, maintainability, and performance.
[DATA_AND_INFRASTRUCTURE]: Oracle Database 12c, REST APIs, third-party payment gateway, warehouse integration, Linux servers, and manual deployments.
[MIGRATION_CONSTRAINTS]: Maximum downtime of 2 hours, preserve historical order data, maintain payment processing, limited migration budget, and no disruption to daily business operations.
Example output
### PHASE 1 β π LEGACY SYSTEM DISCOVERY & INVENTORY
1.1 Application inventory
| Component | Existing Technology | Responsibility |
| ------------------ | -------------------- | ------------------------- |
| Frontend | JSP | User interface |
| Backend | Java 8 | Business logic |
| Framework | Spring 4 | Application framework |
| Architecture | Monolith | Application execution |
| Database | Oracle 12c | Transactional data |
| Application server | Tomcat | Application hosting |
| Payment | External API | Payment processing |
| Warehouse | External integration | Inventory synchronization |
| Deployment | Manual | Production releases |
1.2 Initial dependency map
```mermaid
flowchart TD
A[Retail Users] --> B[JSP Frontend]
B --> C[Java Spring Monolith]
C --> D[Oracle Database]
C --> E[Payment Gateway]
C --> F[Warehouse Integration]
G[Linux Servers] --> H[Tomcat]
H --> C
```
1.3 Discovery gaps
* Source code structure is unknown.
* Database schema is not provided.
* Payment API contract is unavailable.
* Warehouse integration mechanism is unverified.
* Backup and disaster recovery procedures are unknown.
* Automated test coverage is unknown.
Result: Initial inventory established. Complete discovery requires repository, database, and infrastructure access.
### PHASE 2 β ποΈ CURRENT-STATE ARCHITECTURE ASSESSMENT
Architecture observations
| Area | Initial Assessment |
| ----------------- | ------------------------------ |
| Modularity | Potentially limited |
| Scalability | Potential monolith bottleneck |
| Maintainability | Framework modernization needed |
| Security | Requires detailed review |
| Database coupling | Requires investigation |
| Deployment | Manual process |
| Observability | Unknown |
| Reliability | Requires baseline assessment |
Identified architectural concerns
* Single application deployment may increase release risk.
* Database coupling could make future decomposition difficult.
* JSP frontend and backend modernization may require coordinated changes.
* Manual deployment increases human error risk.
* External payment and warehouse integrations require compatibility protection.
Recommendation: Establish a modular monolith before considering microservices.
### PHASE 3 β β οΈ TECHNICAL DEBT & LEGACY RISK ASSESSMENT
| ID | Component | Technical Debt | Severity | Recommended Action |
| ----- | ------------ | ------------------------------ | -------- | -------------------------------- |
| TD-01 | Java runtime | Outdated runtime | High | Upgrade to Java 21 |
| TD-02 | Spring | Legacy framework | High | Upgrade to Spring Boot 3 |
| TD-03 | Frontend | JSP architecture | Medium | Gradual React migration |
| TD-04 | Deployment | Manual releases | High | CI/CD automation |
| TD-05 | Database | Legacy Oracle version | High | Compatibility and support review |
| TD-06 | Testing | Coverage unknown | High | Characterization testing |
| TD-07 | Integrations | Contract documentation missing | Medium | API documentation |
Business impact:
* Higher maintenance costs.
* Increased deployment risk.
* Difficult onboarding of developers.
* Potential security and support concerns.
* Increased complexity when adding new functionality.
Result: Seven initial technical debt items identified. Severity requires confirmation through technical inspection.
### PHASE 4 β π― MODERNIZATION STRATEGY SELECTION
| Strategy | Suitability | Decision |
| ----------- | ----------------------------- | ------------------ |
| Retain | Short-term stabilization | Partial |
| Rehost | Infrastructure improvement | Optional |
| Replatform | Cloud migration | Recommended |
| Refactor | Improve application structure | Recommended |
| Rearchitect | Modernize architecture | Selective |
| Rebuild | Replace entire system | Rejected initially |
| Replace | Commercial solution | Not justified |
| Decompose | Separate business modules | Incremental |
Primary recommendation:
Incremental modernization using the Strangler Fig approach.
Reasons:
* Protects existing business workflows.
* Reduces migration risk.
* Avoids unnecessary complete replacement.
* Allows controlled technology upgrades.
* Supports gradual frontend modernization.
### PHASE 5 β βοΈ MONOLITH VS MODULAR MONOLITH VS MICROSERVICES
| Criteria | Monolith | Modular Monolith | Microservices |
| --------------- | -------------------- | -------------------- | -------------------------- |
| Deployment | Single | Single | Independent |
| Complexity | Low initially | Moderate | High |
| Scaling | Application-wide | Application-wide | Per service |
| Data management | Shared | Controlled ownership | Distributed |
| Maintenance | Can become difficult | Improved boundaries | Requires mature operations |
| Cost | Lower | Moderate | Higher |
Recommendation: Modular monolith.
Proposed internal modules:
* Customer Management
* Product Catalog
* Inventory Management
* Order Management
* Payment Management
* Warehouse Integration
* Reporting
Microservices should only be considered later if independent scaling, deployment ownership, or other measurable requirements justify the additional complexity.
### PHASE 6 β π§© TARGET ARCHITECTURE & SERVICE DECOMPOSITION
Proposed architecture
```mermaid
flowchart TD
A[Users] --> B[React Frontend]
B --> C[API Layer]
C --> D[Spring Boot Application]
D --> E[Customer Module]
D --> F[Product Module]
D --> G[Inventory Module]
D --> H[Order Module]
D --> I[Payment Module]
D --> J[Warehouse Module]
E --> K[(Oracle Database)]
F --> K
G --> K
H --> K
I --> K
J --> K
I --> L[Payment Gateway]
J --> M[Warehouse System]
```
Module responsibilities
| Module | Responsibility | Data Ownership |
| --------- | ------------------------- | ------------------ |
| Customer | Customer records | Customer data |
| Product | Product information | Product data |
| Inventory | Stock management | Inventory data |
| Order | Order processing | Order data |
| Payment | Payment lifecycle | Payment references |
| Warehouse | Warehouse synchronization | Integration state |
Note: Logical module ownership does not imply separate databases. Physical separation should be considered only when justified.
### PHASE 7 β ποΈ DATABASE MODERNIZATION & DATA MIGRATION
Recommended approach:
Initially retain Oracle while modernizing the application.
Avoid combining a database engine migration with the first major application migration.
Migration strategy
* Inspect Oracle schema and dependencies.
* Document stored procedures and triggers.
* Identify critical order and payment tables.
* Establish verified backups.
* Create a staging environment.
* Test schema compatibility with the new framework.
* Execute migration rehearsals.
* Reconcile migrated data.
* Perform controlled production cutover.
Data validation matrix
| Validation | Acceptance Criteria |
| ------------------ | ----------------------------- |
| Customer records | Exact reconciliation |
| Historical orders | Exact reconciliation |
| Primary keys | Preserved |
| Foreign keys | No unexplained violations |
| Payment references | Reconciled |
| Duplicate records | No unexplained duplicates |
| Financial totals | Reconciled |
| Null values | Approved transformation rules |
Rollback strategy: Retain Oracle as the system of record during the initial application modernization. Do not assume a database rollback is safe after incompatible writes or destructive schema changes.
### PHASE 8 β βοΈ FRAMEWORK, RUNTIME & DEPENDENCY MIGRATION
Proposed technology upgrade
| Existing | Target |
| ------------------ | -------------------------------------- |
| Java 8 | Java 21 |
| Spring Framework 4 | Spring Boot 3 |
| JSP | React (incrementally) |
| Tomcat deployment | Supported Spring Boot deployment model |
| Manual builds | Automated build pipeline |
Upgrade sequence
* Inventory dependencies.
* Establish automated regression tests.
* Review Java compatibility.
* Resolve deprecated APIs.
* Upgrade framework dependencies.
* Migrate configuration.
* Validate ORM and database drivers.
* Test authentication and authorization.
* Execute performance and security tests.
Important: Spring Boot 3 requires Java 17 or later and introduces Jakarta EE namespace changes. The Java 21 target satisfies its minimum Java requirement, but individual dependencies still require compatibility verification.
### PHASE 9 β π API & INTEGRATION TRANSFORMATION
Existing integrations
* Payment gateway.
* Warehouse management.
* Internal application APIs.
Proposed improvements
| Integration | Modernization |
| ---------------- | ------------------------------- |
| Payment | Backward-compatible API adapter |
| Warehouse | Versioned integration contract |
| Frontend | REST API layer |
| Internal modules | Explicit interfaces |
| Error handling | Standardized responses |
Critical controls
* Idempotency for payment requests.
* Retry policies with limits.
* Request timeout management.
* API authentication.
* Backward compatibility.
* Integration monitoring.
Never retry a payment operation blindly without checking its transaction state.
### PHASE 10 β π SECURITY, COMPLIANCE & BUSINESS CONTINUITY
Security modernization
| Security Area | Proposed Control |
| -------------- | --------------------------------- |
| Authentication | Centralized identity management |
| Authorization | Role-based access control |
| Secrets | Centralized secrets management |
| Data | Encryption in transit and at rest |
| API | Authentication and rate limiting |
| Logging | Security audit logging |
| Infrastructure | Network segmentation |
| Database | Least-privilege access |
Business continuity requirements
* Preserve order processing.
* Preserve payment reconciliation.
* Maintain warehouse synchronization.
* Protect historical records.
* Verify backups and recovery.
* Establish disaster recovery procedures.
Critical decision: Define actual RPO and RTO targets with business stakeholders. The two-hour downtime limit is not sufficient to establish either target.
### PHASE 11 β π
PHASED IMPLEMENTATION ROADMAP
| Phase | Objective | Deliverable |
| ----- | -------------------------- | ------------------------------ |
| A | Discovery | System inventory |
| B | Stabilization | Critical defects addressed |
| C | Architecture | Modular boundaries |
| D | Runtime migration | Java 21 and Spring Boot 3 |
| E | Database preparation | Validated schema compatibility |
| F | Application transformation | Modular application |
| G | Integration migration | Compatible APIs |
| H | Production cutover | Validated release |
| I | Legacy retirement | Approved decommissioning |
Dependencies
* Phase A must establish the technical baseline.
* Phase B should establish regression coverage.
* Phase C defines boundaries before restructuring.
* Phase D requires dependency compatibility.
* Phase E requires database migration rehearsals.
* Phase H requires business and operational approval.
* Phase I requires verified production stability.
Acceptance criteria: Every phase must have documented test evidence, owner approval, and a recovery plan.
### PHASE 12 β π§ͺ TESTING & MIGRATION VALIDATION
| Migration Change | Risk | Required Test | Acceptance Criteria |
| --------------------- | -------- | ---------------- | ------------------------------- |
| Java upgrade | High | Regression | Critical workflows pass |
| Framework upgrade | High | Integration | Interfaces remain compatible |
| React migration | Medium | UI/E2E | Existing workflows function |
| Database changes | Critical | Reconciliation | No unexplained data differences |
| Payment integration | Critical | Contract/E2E | Payment lifecycle validated |
| Warehouse integration | High | Integration | Synchronization validated |
| Deployment automation | High | Deployment test | Repeatable deployment |
| Security changes | High | Security testing | Approved security findings |
Testing sequence
* Characterization testing.
* Unit testing.
* Integration testing.
* Contract testing.
* Regression testing.
* Data migration testing.
* Performance testing.
* Security testing.
* Resilience testing.
* End-to-end testing.
No test is considered passed without actual execution evidence.
### PHASE 13 β π ROLLBACK, CUTOVER & RECOVERY ENGINEERING
Production cutover approach
* Take and verify backups.
* Deploy the new application.
* Execute smoke tests.
* Validate database connectivity.
* Validate payment processing.
* Validate warehouse synchronization.
* Gradually redirect traffic where supported.
* Monitor business transactions.
* Obtain production acceptance.
Rollback triggers
* Payment processing failures above approved thresholds.
* Critical order processing failures.
* Data reconciliation mismatches.
* Severe application errors.
* Security incidents.
* Performance degradation beyond approved limits.
Recovery strategy
| Failure | Recovery |
| ---------------------- | ------------------------------------------------------ |
| Application failure | Restore previous application version |
| API incompatibility | Restore compatible API routing |
| Database schema issue | Use tested compatibility or forward-recovery procedure |
| Payment inconsistency | Reconcile transaction states |
| Infrastructure failure | Restore previous infrastructure configuration |
Important: Application rollback and database rollback are separate operations. New production writes must be reconciled before switching back.
### PHASE 14 β π° COST & OPERATIONAL IMPACT ANALYSIS
Cost categories
| Category | Expected Impact |
| -------------------- | --------------------------------- |
| Engineering | Additional modernization effort |
| Cloud infrastructure | New recurring cost |
| Database | Existing licensing review |
| Testing | Increased initial investment |
| Monitoring | Additional tooling cost |
| Training | Java, Spring Boot and React |
| Migration | Temporary parallel infrastructure |
Financial recommendation:
Use a phased budget rather than funding a complete replacement immediately.
Actual financial estimates require infrastructure pricing, licensing information, team size, and implementation scope.
### PHASE 15 β π MIGRATION GOVERNANCE & EXECUTION CONTROL
Governance roles
| Role | Responsibility |
| -------------------- | ----------------------------- |
| Enterprise Architect | Architecture decisions |
| Engineering Lead | Application transformation |
| DBA | Database integrity |
| DevOps Engineer | Deployment and infrastructure |
| Security Lead | Security approvals |
| QA Lead | Testing and validation |
| Business Owner | Workflow acceptance |
Migration decision register
| ID | Decision | Status |
| ------ | ----------------------------- | -------- |
| ADR-01 | Adopt modular monolith | Proposed |
| ADR-02 | Upgrade to Java 21 | Proposed |
| ADR-03 | Adopt Spring Boot 3 | Proposed |
| ADR-04 | Retain Oracle initially | Proposed |
| ADR-05 | Incrementally introduce React | Proposed |
| ADR-06 | Automate deployment | Proposed |
Program success indicators
* Critical workflow compatibility.
* Database reconciliation results.
* Test pass rate.
* Deployment failure rate.
* Production incidents.
* Legacy component retirement.
* Technical debt reduction.
Targets must be approved using the actual business baseline.
### PHASE 16 β π FINAL ENTERPRISE MODERNIZATION BLUEPRINT
### 16.1 Executive Summary
The retail enterprise should modernize its legacy application incrementally rather than replace the entire system.
The proposed target is a Java 21 and Spring Boot 3 modular monolith with a React frontend, initially retaining Oracle Database.
### 16.2 Final architecture decisions
| Area | Final Recommendation |
| -------------- | --------------------------------------- |
| Backend | Java 21 |
| Framework | Spring Boot 3 |
| Frontend | React |
| Architecture | Modular monolith |
| Database | Retain Oracle initially |
| Integrations | Versioned APIs |
| Deployment | Automated CI/CD |
| Infrastructure | Cloud-ready architecture |
| Security | Centralized identity and access control |
| Monitoring | Centralized observability |
### 16.3 Components to retain, modernize and retire
| Component | Action |
| -------------------- | ------------------- |
| Business rules | Retain and refactor |
| Order processing | Modernize |
| Inventory management | Refactor |
| Payment integration | Modernize adapter |
| JSP frontend | Gradually replace |
| Java 8 runtime | Upgrade |
| Spring 4 | Upgrade |
| Oracle database | Retain initially |
| Manual deployment | Replace with CI/CD |
### 16.4 Executive approval requirements
Before implementation, obtain approval for:
* Modernization budget.
* Target architecture.
* Technology compatibility.
* Database migration approach.
* Production cutover strategy.
* Business continuity requirements.
* Security and compliance controls.
* Rollback authority.
### 16.5 Final acceptance criteria
The modernization project is accepted only when:
* All critical business workflows are validated.
* Historical order data is reconciled.
* Payment processing is verified.
* Warehouse integration is verified.
* Security requirements are approved.
* Performance meets agreed baselines.
* Recovery procedures are successfully tested.
* Deployment automation is operational.
* Business owners approve production functionality.
* Legacy retirement is formally authorized.
### π§ͺ FINAL SAMPLE TEST EVALUATION
SAMPLE TEST COMPLETED
| Evaluation Area | Result |
| ------------------------- | ------ |
| Legacy discovery | |
| Architecture assessment | |
| Technical debt | |
| Strategy selection | |
| Monolith vs microservices | |
| Target architecture | |
| Database migration | |
| Framework migration | |
| API transformation | |
| Security | |
| Implementation roadmap | |
| Testing | |
| Rollback | |
| Cost analysis | |
| Governance | |
| Final blueprint | |
Overall assessment:
### Strong enterprise architecture planning coverage
The prompt successfully guides an AI through all 16 modernization phases and produces a coherent enterprise modernization blueprint.
Three areas to test further before considering the prompt production-ready:
* Feed it an actual legacy source-code repository to test evidence-based discovery.
* Provide a complex database migration scenario with stored procedures, triggers, and millions of records.
* Test a failed production migration scenario to evaluate whether it produces a realistic recovery and forward-fix strategy.
Final verdict: Good coverage of enterprise modernization strategy, architecture decisions, migration planning, data integrity, and operational governance. Actual implementation quality still requires repository-level testing and technical validation.
By purchasing this prompt, you agree to our terms of service
CLAUDE-5-5-SONNET
Transform complex legacy applications into maintainable, scalable, and future-ready enterprise systems.
This advanced engineering prompt acts as a Principal Enterprise Architect, Legacy Modernization Strategist, Database Migration Architect, and Distributed Systems Consultant.
It analyzes existing legacy systems, identifies technical debt, evaluates modernization alternatives, and creates implementation-ready transformation strategies.
...more
Added 57 minutes ago
