{"id":"088caa4e-9ac2-4ec3-a614-cb14d35a02c4","entityType":"agent","slug":"clawhub-skills-1kalin-afrexai-legacy-modernization","name":"afrexai-legacy-modernization","canonicalUrl":"https://www.xpersona.co/agent/clawhub-skills-1kalin-afrexai-legacy-modernization","canonicalPath":"/agent/clawhub-skills-1kalin-afrexai-legacy-modernization","generatedAt":"2026-10-10T00:03:29.404Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"description":"Legacy System Modernization Engine Legacy System Modernization Engine Complete methodology for assessing, planning, and executing legacy system modernization — from monolith decomposition to cloud migration. Works for any tech stack, any scale. --- Phase 1: System Assessment Modernization Brief Technical Debt Inventory Score each dimension 1-5 (1=critical, 5=healthy): | Dimension | Score | Evidence | |-----------|-------|----------| | **Code quality**","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. Last updated 4/15/2026.","installCommand":"clawhub skill install skills:1kalin:afrexai-legacy-modernization","sourceUrl":"https://github.com/openclaw/skills/tree/main/skills/1kalin/afrexai-legacy-modernization","homepage":null,"primaryLinks":[{"label":"View on ClawHub","url":"https://github.com/openclaw/skills/tree/main/skills/1kalin/afrexai-legacy-modernization","kind":"source"}],"safetyScore":84,"overallRank":62,"popularityScore":50,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Legacy System Modernization Engine Legacy System Modernization Engine Complete methodology for assessing, planning, and executing legacy system modernization — "},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[{"label":"requirements","status":"self-declared"}],"verifiedCount":0,"selfDeclaredCount":2,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"},{"key":"requirements","type":"capability","support":"supported","confidenceSource":"profile","notes":"Declared in agent profile metadata"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile capability:requirements|supported|profile"}},"adoption":{"evidence":{"source":"no-adoption-signals","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"No source adoption metrics were available."},"stars":null,"forks":null,"downloads":null,"packageName":null,"latestVersion":null,"tractionLabel":null},"release":{"evidence":{"source":"agent-index","verified":false,"confidence":"medium","updatedAt":"2026-02-25T06:17:39.783Z","emptyReason":null},"lastUpdatedAt":"2026-04-15T00:45:39.800Z","lastCrawledAt":"2026-02-25T06:17:39.783Z","lastIndexedAt":null,"nextCrawlAt":"2026-02-26T06:17:39.783Z","lastVerifiedAt":null,"highlights":[]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install skills:1kalin:afrexai-legacy-modernization","setupComplexity":"low","setupSteps":["Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.","Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T00:03:29.404Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-skills-1kalin-afrexai-legacy-modernization/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":null},"readme":"# Legacy System Modernization Engine\n\nComplete methodology for assessing, planning, and executing legacy system modernization — from monolith decomposition to cloud migration. Works for any tech stack, any scale.\n\n---\n\n## Phase 1: System Assessment\n\n### Modernization Brief\n\n```yaml\nsystem_name: \"[Name]\"\nage_years: 0\nprimary_language: \"\"\nframework: \"\"\ndatabase: \"\"\ndeployment: \"on-prem | VM | container | serverless\"\nlines_of_code: 0\nteam_size: 0\nmonthly_users: 0\nannual_revenue_supported: \"$0\"\ncompliance_requirements: []\nknown_pain_points: []\nbusiness_driver: \"cost | speed | talent | risk | compliance | scale\"\ntimeline_pressure: \"low | medium | high | critical\"\nbudget_range: \"$0-$0\"\nsponsor: \"\"\n```\n\n### Technical Debt Inventory\n\nScore each dimension 1-5 (1=critical, 5=healthy):\n\n| Dimension | Score | Evidence |\n|-----------|-------|----------|\n| **Code quality** — test coverage, complexity, duplication | | |\n| **Architecture** — coupling, modularity, clear boundaries | | |\n| **Infrastructure** — deployment automation, monitoring, scaling | | |\n| **Dependencies** — outdated libraries, EOL frameworks, security vulns | | |\n| **Data** — schema quality, migration history, backup/recovery | | |\n| **Documentation** — accuracy, coverage, onboarding effectiveness | | |\n| **Operations** — deployment frequency, MTTR, incident rate | | |\n| **Security** — auth patterns, encryption, audit trail, compliance gaps | | |\n| **Developer experience** — build time, local setup, debugging tools | | |\n| **Business logic clarity** — documented rules, test coverage of logic | | |\n\n**Total: /50**\n\n- **40-50**: Healthy — incremental improvement\n- **30-39**: Aging — targeted modernization\n- **20-29**: Legacy — systematic modernization needed\n- **10-19**: Critical — modernize or replace\n\n### Dependency Risk Matrix\n\nFor each major dependency:\n\n```yaml\ndependency: \"\"\ncurrent_version: \"\"\nlatest_version: \"\"\neol_date: \"\"  # End of life\nsecurity_vulns: 0  # Known CVEs\nupgrade_difficulty: \"trivial | moderate | hard | rewrite\"\nbusiness_risk: \"low | medium | high | critical\"\nalternatives: []\n```\n\n**Priority rules:**\n- EOL within 12 months → P0\n- Known unpatched CVEs → P0\n- 3+ major versions behind → P1\n- No active maintainer → P1\n- Everything else → P2\n\n---\n\n## Phase 2: Strategy Selection\n\n### Modernization Strategy Decision Matrix\n\n| Strategy | When to Use | Risk | Cost | Speed | Disruption |\n|----------|-------------|------|------|-------|------------|\n| **Rehost** (lift & shift) | Datacenter exit, minimal change | Low | Low | Fast | Low |\n| **Replatform** (lift & optimize) | Cloud benefits without rewrite | Low-Med | Medium | Medium | Low-Med |\n| **Refactor** (restructure) | Good code, bad architecture | Medium | Medium | Medium | Medium |\n| **Re-architect** (rebuild patterns) | Monolith→services, new patterns | High | High | Slow | High |\n| **Rebuild** (rewrite) | Small system, clear requirements | Very High | Very High | Very Slow | Very High |\n| **Replace** (buy/SaaS) | Commodity functionality | Medium | Variable | Fast | High |\n| **Retire** | No longer needed | None | Negative | Instant | Low |\n| **Retain** (do nothing) | Working fine, other priorities | None | Ongoing | N/A | None |\n\n### Strategy Selection Decision Tree\n\n```\nIs the system still needed?\n├─ No → RETIRE\n├─ Yes → Is it a commodity (CRM, email, etc.)?\n│  ├─ Yes → REPLACE (buy SaaS)\n│  └─ No → Is the code maintainable?\n│     ├─ Yes → Is the architecture the problem?\n│     │  ├─ Yes → RE-ARCHITECT (strangler fig)\n│     │  └─ No → Is the infrastructure the problem?\n│     │     ├─ Yes → REPLATFORM\n│     │     └─ No → REFACTOR incrementally\n│     └─ No → Is the system small (<50K LOC)?\n│        ├─ Yes → Can requirements be clearly defined?\n│        │  ├─ Yes → REBUILD\n│        │  └─ No → REFACTOR + RE-ARCHITECT\n│        └─ No → STRANGLER FIG (never big-bang rewrite)\n```\n\n### The Big Rewrite Anti-Pattern\n\n**NEVER do a full rewrite of a large system.** It fails 70%+ of the time because:\n1. The old system keeps getting features — moving target\n2. Hidden business rules only exist in code — they get lost\n3. Timeline always 2-3x longer than estimated\n4. Two systems to maintain during transition\n5. Team burns out before completion\n\n**Always use Strangler Fig instead.** Replace piece by piece.\n\n---\n\n## Phase 3: Strangler Fig Pattern\n\n### How It Works\n\n1. **Identify a boundary** — a feature, page, or API endpoint\n2. **Build the replacement** — new stack, new patterns\n3. **Route traffic** — proxy/facade sends requests to new or old\n4. **Verify parity** — same behavior, same data\n5. **Cut over** — remove the proxy, retire the old code\n6. **Repeat** — next boundary\n\n### Strangler Facade YAML\n\n```yaml\nfacade_name: \"[API Gateway / Reverse Proxy / BFF]\"\nrouting_rules:\n  - path: \"/api/users/*\"\n    target: \"new-service\"\n    status: \"migrated\"\n    migrated_date: \"2025-01-15\"\n  - path: \"/api/orders/*\"\n    target: \"legacy\"\n    status: \"planned\"\n    target_date: \"2025-Q2\"\n  - path: \"/api/reports/*\"\n    target: \"legacy\"\n    status: \"not-planned\"\n    notes: \"Low priority, rarely used\"\n```\n\n### Migration Sequence Rules\n\n1. **Start with the easiest, most isolated module** — build confidence\n2. **Then the highest-value business capability** — prove ROI early\n3. **Leave the hardest, most coupled parts for last** — team learns patterns first\n4. **Never migrate auth/identity early** — it touches everything\n5. **Migrate data access layer before business logic** — clean data = clean migration\n6. **Always keep the old system as fallback** until new is proven\n\n### Dual-Write / Data Sync Patterns\n\n| Pattern | When | Complexity | Risk |\n|---------|------|-----------|------|\n| **Dual write** | Both systems write simultaneously | High | Data inconsistency |\n| **CDC (Change Data Capture)** | Stream changes from old→new DB | Medium | Lag, ordering |\n| **ETL batch sync** | Periodic bulk sync | Low | Stale data |\n| **Event sourcing bridge** | Events from old, replay in new | High | Schema mapping |\n| **Read from new, write to old** | Transition period | Medium | Routing complexity |\n\n**Golden rule:** Pick ONE source of truth. Never let both systems own the same data simultaneously.\n\n---\n\n## Phase 4: Monolith Decomposition\n\n### Domain Discovery\n\nBefore splitting a monolith, identify bounded contexts:\n\n1. **Event Storming** (preferred) — sticky notes for domain events, commands, aggregates\n2. **Code analysis** — find clusters of related classes/tables\n3. **Team analysis** — which teams own which features?\n4. **Data coupling analysis** — which tables are joined together?\n\n### Bounded Context YAML\n\n```yaml\ncontext_name: \"\"\ndescription: \"\"\nteam: \"\"\nentities: []\ncommands: []\nevents_published: []\nevents_consumed: []\ndatabase_tables: []\nexternal_integrations: []\ncoupling_score: 0  # 0=independent, 10=deeply coupled\nextraction_difficulty: \"easy | moderate | hard | very-hard\"\nbusiness_value: \"low | medium | high | critical\"\n```\n\n### Extraction Priority Matrix\n\nPlot contexts on: **Business Value** (Y) × **Extraction Difficulty** (X)\n\n| | Easy | Moderate | Hard |\n|---|---|---|---|\n| **High value** | 🟢 Do first | 🟡 Do second | 🟠 Plan carefully |\n| **Medium value** | 🟢 Quick win | 🟡 Evaluate ROI | 🔴 Probably not worth it |\n| **Low value** | 🟡 If easy, why not | 🔴 Skip | 🔴 Definitely skip |\n\n### Service Extraction Checklist\n\nFor each service being extracted:\n\n- [ ] Bounded context clearly defined\n- [ ] API contract designed (OpenAPI spec)\n- [ ] Database separated (no shared tables)\n- [ ] Authentication/authorization integrated\n- [ ] Event publishing for cross-service communication\n- [ ] Circuit breaker for calls back to monolith\n- [ ] Monitoring and alerting configured\n- [ ] Deployment pipeline independent\n- [ ] Feature flag for traffic routing\n- [ ] Rollback plan documented\n- [ ] Performance baseline captured (before/after)\n- [ ] Data migration script tested\n- [ ] Integration tests with monolith passing\n- [ ] Runbook for on-call written\n\n---\n\n## Phase 5: Database Modernization\n\n### Database Migration Strategies\n\n| Strategy | Description | Downtime | Risk |\n|----------|-------------|----------|------|\n| **Parallel run** | New DB alongside old, sync both | Zero | High complexity |\n| **Blue-green** | Full copy, switch DNS | Minutes | Medium |\n| **Rolling** | Migrate table by table | Zero per table | Medium |\n| **Big bang** | Stop, migrate, start | Hours | High |\n\n### Schema Evolution Rules\n\n1. **Always additive** — add columns/tables, never remove in the same release\n2. **Two-phase removal** — Release 1: stop writing. Release 2: drop column (after backfill verified)\n3. **Default values always** — every new column gets a default\n4. **Backward compatible** — old code must work with new schema during rollout\n5. **Index concurrently** — never lock production tables\n6. **Test with production-scale data** — 100 rows ≠ 100M rows\n\n### Data Quality Gates\n\nBefore migrating data:\n\n```yaml\ntable: \"\"\nrow_count_source: 0\nrow_count_target: 0\ncount_match: false\nchecksum_match: false\nnull_analysis: \"pass | fail\"\nreferential_integrity: \"pass | fail\"\nbusiness_rule_validation: \"pass | fail\"\nsample_manual_review: \"pass | fail\"\nperformance_benchmark: \"pass | fail\"\nrollback_tested: false\n```\n\n**Rule: All gates must pass before cutover.** No exceptions.\n\n---\n\n## Phase 6: Cloud Migration\n\n### Cloud Readiness Assessment\n\nScore each workload:\n\n| Factor | Score (1-5) | Notes |\n|--------|-------------|-------|\n| Stateless design | | |\n| Configuration externalized | | |\n| Logging to stdout | | |\n| Health check endpoint | | |\n| Graceful shutdown | | |\n| Horizontal scalability | | |\n| Secret management | | |\n| 12-factor compliance | | |\n\n**35-40**: Cloud-native ready\n**25-34**: Minor modifications needed\n**15-24**: Significant refactoring\n**8-14**: Major redesign required\n\n### Cloud Migration Checklist\n\n- [ ] Network architecture designed (VPC, subnets, security groups)\n- [ ] Identity and access management configured\n- [ ] Data residency requirements verified\n- [ ] Compliance mapping (cloud controls ↔ requirements)\n- [ ] Cost estimation completed (TCO comparison)\n- [ ] Disaster recovery plan updated\n- [ ] Monitoring and alerting migrated\n- [ ] DNS and certificate management planned\n- [ ] CDN configuration\n- [ ] Load testing in cloud environment\n- [ ] Security scanning pipeline\n- [ ] Backup and restore verified\n- [ ] Runbooks updated for cloud operations\n- [ ] Team trained on cloud platform\n- [ ] Vendor lock-in assessment\n\n### Cost Optimization from Day 1\n\n- **Right-size instances** — start small, scale up with data\n- **Reserved/committed use** — only after 3 months of usage data\n- **Spot/preemptible** — for batch jobs, CI/CD, dev/test\n- **Auto-scaling** — scale down at night, weekends\n- **Storage tiers** — hot/warm/cold/archive based on access patterns\n- **Tag everything** — cost allocation by team, service, environment\n- **Monthly review** — unused resources, oversized instances\n\n---\n\n## Phase 7: API Modernization\n\n### API Wrapping Pattern\n\nFor legacy systems without APIs:\n\n1. **Screen scraping adapter** — parse HTML/mainframe screens\n2. **Database tap** — read directly from legacy DB (read-only!)\n3. **File-based integration** — watch folders, parse files\n4. **Message queue bridge** — legacy writes to queue, new reads\n5. **RPC wrapper** — expose existing functions via REST/gRPC\n\n### API Contract-First Migration\n\n```yaml\nendpoint: \"/api/v2/orders\"\nlegacy_source: \"stored_procedure: sp_GetOrders\"\nnew_implementation: \"orders-service\"\nmigration_status: \"legacy | dual-run | new-only\"\ncontract_changes:\n  - field: \"order_date\"\n    old_format: \"MM/DD/YYYY string\"\n    new_format: \"ISO 8601\"\n    adapter: \"date_format_adapter\"\n  - field: \"status\"\n    old_values: [\"A\", \"C\", \"P\"]\n    new_values: [\"active\", \"completed\", \"pending\"]\n    adapter: \"status_code_mapper\"\nparity_tests: 47\nparity_passing: 47\n```\n\n---\n\n## Phase 8: Testing Strategy\n\n### Migration Testing Pyramid\n\n```\n         /  Smoke Tests  \\           ← Whole system alive?\n        / Parity Tests    \\          ← Same behavior old vs new?\n       / Integration Tests \\         ← Services work together?\n      / Contract Tests      \\        ← API contracts honored?\n     / Performance Tests     \\       ← Not slower than before?\n    / Data Validation Tests   \\      ← Data migrated correctly?\n   /  Unit Tests               \\     ← New code works?\n```\n\n### Parity Testing Framework\n\nFor EVERY migrated feature:\n\n```yaml\nfeature: \"\"\ntest_type: \"api_parity | ui_parity | data_parity\"\nmethod: \"shadow traffic | replay | parallel run\"\nsample_size: 0\nmatch_rate: \"0%\"  # Target: 99.9%+\nmismatches_investigated: 0\nmismatches_accepted: 0  # Known intentional differences\nmismatches_bugs: 0\nsign_off: false\n```\n\n**Shadow traffic** — copy production requests to new system, compare responses (don't serve new responses to users yet).\n\n### Performance Regression Rules\n\n- P95 latency must not increase >10% vs legacy\n- Throughput must meet or exceed legacy under same load\n- Database query count must not increase per request\n- Memory usage must not increase >20%\n- If ANY metric regresses → investigate before proceeding\n\n---\n\n## Phase 9: Team & Process\n\n### Modernization Team Structure\n\n| Role | Responsibility | When Needed |\n|------|---------------|-------------|\n| **Modernization Lead** | Strategy, sequencing, blockers | Full-time |\n| **Legacy Expert** | Knows where the bodies are buried | Part-time, on-call |\n| **New Platform Engineer** | Builds target architecture | Full-time |\n| **Data Engineer** | Migration, sync, validation | Phase-dependent |\n| **QA/Test Engineer** | Parity testing, automation | Full-time |\n| **DevOps/Platform** | CI/CD, infrastructure | Part-time |\n| **Product Owner** | Business priority, acceptance | Part-time |\n\n### Knowledge Mining from Legacy\n\nThe most dangerous part of modernization is **losing undocumented business rules**.\n\n1. **Code archaeology** — git blame, find oldest unchanged code, understand why\n2. **Interview stakeholders** — \"What would break if we changed X?\"\n3. **Production log analysis** — what edge cases actually occur?\n4. **Error handling review** — each catch block is a documented business rule\n5. **Test suite review** — tests describe expected behavior\n6. **Configuration review** — magic numbers, feature flags, overrides\n\n### Communication Plan\n\n| Audience | Frequency | Content |\n|----------|-----------|---------|\n| Executive sponsor | Bi-weekly | Progress, risks, budget, timeline |\n| Engineering team | Weekly | Sprint goals, technical decisions, blockers |\n| Dependent teams | Monthly | Upcoming changes, migration dates, API changes |\n| End users | Per migration | What's changing, when, how it affects them |\n\n---\n\n## Phase 10: Risk Management\n\n### Top 10 Modernization Risks (Pre-Built)\n\n| # | Risk | Likelihood | Impact | Mitigation |\n|---|------|-----------|--------|------------|\n| 1 | Undocumented business rules lost | High | Critical | Code archaeology + stakeholder interviews + parity tests |\n| 2 | Timeline underestimation | Very High | High | 2x initial estimate, phase-gated checkpoints |\n| 3 | Data migration corruption | Medium | Critical | Checksums, parallel runs, rollback plans |\n| 4 | Feature parity gaps | High | High | Shadow traffic testing, user acceptance testing |\n| 5 | Team knowledge loss (people leave) | Medium | High | Document everything, pair programming, knowledge sharing |\n| 6 | Legacy system changes during migration | High | Medium | Feature freeze or dual-write contract |\n| 7 | Performance regression | Medium | High | Load testing at every phase, performance budgets |\n| 8 | Scope creep (improve while migrating) | Very High | Medium | Strict \"migrate, don't improve\" rule for Phase 1 |\n| 9 | Integration failures | Medium | High | Contract testing, circuit breakers, fallback routing |\n| 10 | Stakeholder fatigue | High | Medium | Quick wins early, visible progress dashboard |\n\n### Kill Criteria\n\nStop the modernization if:\n- Budget exceeds 2x initial estimate with <50% complete\n- Key business rules can't be verified after migration\n- Team attrition >30% during project\n- Legacy system stability degrades due to migration work\n- Business context changes (M&A, pivot, sunset)\n\n**If kill criteria triggered:** Stabilize what's done, document learnings, reassess in 6 months.\n\n---\n\n## Phase 11: Patterns & Playbooks\n\n### Language/Framework Migration Patterns\n\n**Java → Modern Java (8→17+)**\n- Records, sealed classes, pattern matching\n- Virtual threads (Project Loom) for thread-per-request\n- Migrate build: Maven→Gradle or update Maven plugins\n- Spring Boot 2→3: javax→jakarta namespace\n\n**Python 2→3**\n- Use `2to3` tool for automated conversion\n- Fix: print(), division, unicode, dict methods\n- Upgrade dependencies (check py3 compat)\n\n**jQuery→React/Vue**\n- Extract components from page sections\n- State management replaces DOM manipulation\n- Event handlers become component methods\n- Ajax calls become API service layer\n\n**Monolith→Microservices**\n- Strangler fig (see Phase 3)\n- Start with read models (reporting, search)\n- Extract stateless services first\n- Shared database → database-per-service last\n\n**On-Prem→Cloud**\n- Rehost first (lift & shift)\n- Then replatform (managed services)\n- Then re-architect (cloud-native patterns)\n- Never skip steps — each proves value\n\n### COBOL/Mainframe Modernization\n\n1. **API wrapping** — expose CICS/IMS transactions as REST APIs\n2. **Screen scraping** — automate 3270 terminal interactions\n3. **Gradual extraction** — one transaction at a time\n4. **Data replication** — DB2/VSAM → PostgreSQL/cloud DB\n5. **Rule extraction** — COBOL paragraphs → business rule engine\n6. **Never rewrite all at once** — decades of business logic = decades of edge cases\n\n### Microservices Anti-Patterns to Avoid\n\n| Anti-Pattern | Symptom | Fix |\n|-------------|---------|-----|\n| Distributed monolith | Services must deploy together | Identify and break coupling |\n| Shared database | Multiple services write same tables | Database-per-service |\n| Synchronous chains | A calls B calls C calls D | Async events, choreography |\n| Nano-services | Hundreds of tiny services | Merge related services |\n| Shared libraries for business logic | Library update breaks consumers | Duplicate code > shared coupling |\n| No API versioning | Breaking changes cascade | Semantic versioning, deprecation policy |\n\n---\n\n## Phase 12: Metrics & Reporting\n\n### Modernization Health Dashboard\n\n```yaml\nproject: \"\"\nassessment_date: \"\"\noverall_health: \"green | yellow | red\"\n\nprogress:\n  modules_total: 0\n  modules_migrated: 0\n  modules_in_progress: 0\n  percent_complete: \"0%\"\n  \nvelocity:\n  modules_per_sprint: 0\n  estimated_completion: \"\"\n  on_track: true\n\nquality:\n  parity_test_pass_rate: \"0%\"\n  production_incidents_from_migration: 0\n  rollbacks: 0\n  \nrisk:\n  open_risks: 0\n  p0_risks: 0\n  blocked_items: 0\n\ncost:\n  budget_total: \"$0\"\n  budget_spent: \"$0\"\n  budget_remaining: \"$0\"\n  burn_rate_monthly: \"$0\"\n```\n\n### 100-Point Modernization Quality Rubric\n\n| Dimension | Weight | Score (0-10) | Weighted |\n|-----------|--------|-------------|----------|\n| Strategy clarity | 15% | | |\n| Risk management | 15% | | |\n| Testing rigor | 15% | | |\n| Data integrity | 15% | | |\n| Architecture quality | 10% | | |\n| Team capability | 10% | | |\n| Stakeholder alignment | 10% | | |\n| Documentation | 10% | | |\n| **Total** | **100%** | | **/100** |\n\n**90-100**: Exemplary — reference project\n**70-89**: Strong — minor improvements\n**50-69**: Adequate — address gaps\n**Below 50**: At risk — pause and reassess\n\n### Weekly Status Template\n\n```markdown\n## Modernization Status — Week of [DATE]\n\n### Progress\n- Modules migrated this week: [N]\n- Total migrated: [N]/[TOTAL] ([X]%)\n- On track for [TARGET DATE]: [Yes/No]\n\n### Completed\n- [What shipped this week]\n\n### In Progress\n- [What's being worked on]\n\n### Blockers\n- [What's stuck and what's needed]\n\n### Risks\n- [New or changed risks]\n\n### Next Week\n- [Plan for next sprint]\n```\n\n---\n\n## Edge Cases\n\n### \"We need to modernize but can't stop adding features\"\n- **Strangler fig** — modernize around new features\n- Feature freeze on legacy module ONLY when that module is being migrated\n- New features build in new stack from day 1\n\n### \"We don't know what the system does\"\n- Start with observability: instrument logging, tracing, metrics\n- Run for 2-4 weeks to understand actual usage patterns\n- Code coverage analysis shows what code is actually executed\n- Interview longest-tenured team members\n\n### \"Multiple systems need modernizing simultaneously\"\n- Sequence by dependency order — downstream first\n- Shared services (auth, data) get modernized once, reused\n- Never parallelize more than 2 modernization streams\n\n### \"The original developers are gone\"\n- Treat code as the documentation\n- Invest 2-4 weeks in code archaeology before any migration work\n- Pair new developers with business stakeholders\n- Write tests for existing behavior before changing anything\n\n### \"We're being acquired / merging systems\"\n- Map overlapping functionality first\n- Pick \"winner\" system per domain — don't merge codebases\n- API integration layer between systems\n- 18-month realistic timeline for full consolidation\n\n### \"Compliance requires the old system\"\n- Maintain compliance evidence chain during migration\n- Dual-audit period with both systems\n- Get compliance team involved in migration planning from Day 1\n- Document control mapping: old control → new implementation\n\n---\n\n## Natural Language Commands\n\n| Command | Action |\n|---------|--------|\n| \"Assess this system for modernization\" | Run full Technical Debt Inventory |\n| \"Which modernization strategy should we use?\" | Walk through Strategy Decision Tree |\n| \"Plan a strangler fig migration\" | Generate Strangler Facade YAML + sequence |\n| \"Decompose this monolith\" | Domain discovery + Bounded Context mapping |\n| \"Migrate this database\" | Data Quality Gates + migration strategy |\n| \"Check cloud readiness\" | Run Cloud Readiness Assessment |\n| \"Create a migration testing plan\" | Build Testing Pyramid with parity tests |\n| \"What are the risks?\" | Generate Top 10 risk register |\n| \"How do we migrate from [X] to [Y]?\" | Pattern-specific playbook |\n| \"Status update for modernization\" | Generate Weekly Status Template |\n| \"Score this modernization project\" | Run 100-Point Quality Rubric |\n| \"Should we kill this modernization?\" | Evaluate Kill Criteria |\n","readmeExcerpt":"Legacy System Modernization Engine Complete methodology for assessing, planning, and executing legacy system modernization — from monolith decomposition to cloud migration. Works for any tech stack, any scale. --- Phase 1: System Assessment Modernization Brief Technical Debt Inventory Score each dimension 1-5 (1=critical, 5=healthy): | Dimension | Score | Evidence | |-----------|-------|----------| | **Code quality**","codeSnippets":[],"executableExamples":[{"language":"yaml","snippet":"system_name: \"[Name]\"\nage_years: 0\nprimary_language: \"\"\nframework: \"\"\ndatabase: \"\"\ndeployment: \"on-prem | VM | container | serverless\"\nlines_of_code: 0\nteam_size: 0\nmonthly_users: 0\nannual_revenue_supported: \"$0\"\ncompliance_requirements: []\nknown_pain_points: []\nbusiness_driver: \"cost | speed | talent | risk | compliance | scale\"\ntimeline_pressure: \"low | medium | high | critical\"\nbudget_range: \"$0-$0\"\nsponsor: \"\""},{"language":"yaml","snippet":"dependency: \"\"\ncurrent_version: \"\"\nlatest_version: \"\"\neol_date: \"\"  # End of life\nsecurity_vulns: 0  # Known CVEs\nupgrade_difficulty: \"trivial | moderate | hard | rewrite\"\nbusiness_risk: \"low | medium | high | critical\"\nalternatives: []"},{"language":"text","snippet":"Is the system still needed?\n├─ No → RETIRE\n├─ Yes → Is it a commodity (CRM, email, etc.)?\n│  ├─ Yes → REPLACE (buy SaaS)\n│  └─ No → Is the code maintainable?\n│     ├─ Yes → Is the architecture the problem?\n│     │  ├─ Yes → RE-ARCHITECT (strangler fig)\n│     │  └─ No → Is the infrastructure the problem?\n│     │     ├─ Yes → REPLATFORM\n│     │     └─ No → REFACTOR incrementally\n│     └─ No → Is the system small (<50K LOC)?\n│        ├─ Yes → Can requirements be clearly defined?\n│        │  ├─ Yes → REBUILD\n│        │  └─ No → REFACTOR + RE-ARCHITECT\n│        └─ No → STRANGLER FIG (never big-bang rewrite)"},{"language":"yaml","snippet":"facade_name: \"[API Gateway / Reverse Proxy / BFF]\"\nrouting_rules:\n  - path: \"/api/users/*\"\n    target: \"new-service\"\n    status: \"migrated\"\n    migrated_date: \"2025-01-15\"\n  - path: \"/api/orders/*\"\n    target: \"legacy\"\n    status: \"planned\"\n    target_date: \"2025-Q2\"\n  - path: \"/api/reports/*\"\n    target: \"legacy\"\n    status: \"not-planned\"\n    notes: \"Low priority, rarely used\""},{"language":"yaml","snippet":"context_name: \"\"\ndescription: \"\"\nteam: \"\"\nentities: []\ncommands: []\nevents_published: []\nevents_consumed: []\ndatabase_tables: []\nexternal_integrations: []\ncoupling_score: 0  # 0=independent, 10=deeply coupled\nextraction_difficulty: \"easy | moderate | hard | very-hard\"\nbusiness_value: \"low | medium | high | critical\""},{"language":"yaml","snippet":"table: \"\"\nrow_count_source: 0\nrow_count_target: 0\ncount_match: false\nchecksum_match: false\nnull_analysis: \"pass | fail\"\nreferential_integrity: \"pass | fail\"\nbusiness_rule_validation: \"pass | fail\"\nsample_manual_review: \"pass | fail\"\nperformance_benchmark: \"pass | fail\"\nrollback_tested: false"}],"parameters":{},"dependencies":[],"permissions":[],"extractedFiles":[],"languages":["typescript"],"docsSourceLabel":"CLAWHUB","editorialOverview":"Legacy System Modernization Engine Legacy System Modernization Engine Complete methodology for assessing, planning, and executing legacy system modernization — from monolith decomposition to cloud migration. Works for any tech stack, any scale. --- Phase 1: System Assessment Modernization Brief Technical Debt Inventory Score each dimension 1-5 (1=critical, 5=healthy): | Dimension | Score | Evidence | |-----------|-------|----------| | **Code quality**","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":359,"uniquenessScore":67,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-04-15T00:45:39.800Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T00:03:29.404Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}