From qe-framework
Designs incremental migration strategies, identifies service boundaries, produces dependency maps and migration roadmaps, and generates API facade designs for aging codebases.
How this skill is triggered — by the user, by Claude, or both
Slash command
/qe-framework:Qlegacy-modernizerThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
1. **Assess system** — Analyze codebase, dependencies, risks, and business constraints. Produce a dependency map and risk register before proceeding.
Assess system — Analyze codebase, dependencies, risks, and business constraints. Produce a dependency map and risk register before proceeding.
Plan migration — Design an incremental roadmap with explicit rollback strategies per phase. Reference references/system-assessment.md for code analysis templates.
Build safety net — Create characterization tests and monitoring before touching production code. Target 80%+ coverage of existing behavior.
Migrate incrementally — Apply strangler fig pattern with feature flags. Route traffic via a facade; shift load gradually.
Validate & iterate — Run full test suite, review monitoring dashboards, and confirm business behavior is preserved before retiring legacy code.
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Strangler Fig | references/strangler-fig-pattern.md | Incremental replacement, facade layer, routing |
| Refactoring | references/refactoring-patterns.md | Extract service, branch by abstraction, adapters |
| Migration | references/migration-strategies.md | Database, UI, API, framework migrations |
| Testing | references/legacy-testing.md | Characterization tests, golden master, approval |
| Assessment | references/system-assessment.md | Code analysis, dependency mapping, risk evaluation |
# facade.py — routes requests to legacy or new service based on a feature flag
import os
from legacy_service import LegacyOrderService
from new_service import NewOrderService
class OrderServiceFacade:
def __init__(self):
self._legacy = LegacyOrderService()
self._new = NewOrderService()
def get_order(self, order_id: str):
if os.getenv("USE_NEW_ORDER_SERVICE", "false").lower() == "true":
return self._new.fetch(order_id)
return self._legacy.get(order_id)
# feature_flags.py — thin wrapper around an environment or config-based flag store
import os
def flag_enabled(flag_name: str, default: bool = False) -> bool:
"""Check whether a migration feature flag is active."""
return os.getenv(flag_name, str(default)).lower() == "true"
# Usage
if flag_enabled("USE_NEW_PAYMENT_GATEWAY"):
result = new_gateway.charge(order)
else:
result = legacy_gateway.charge(order)
# test_characterization_orders.py
# Captures existing legacy behavior as a golden-master safety net.
import pytest
from legacy_service import LegacyOrderService
service = LegacyOrderService()
@pytest.mark.parametrize("order_id,expected_status", [
("ORD-001", "SHIPPED"),
("ORD-002", "PENDING"),
("ORD-003", "CANCELLED"),
])
def test_order_status_golden_master(order_id, expected_status):
"""Fail loudly if legacy behavior changes unexpectedly."""
result = service.get(order_id)
assert result["status"] == expected_status, (
f"Characterization broken for {order_id}: "
f"expected {expected_status}, got {result['status']}"
)
Use language-appropriate documentation at every legacy↔new boundary:
JSDoc (JavaScript/TypeScript)
/**
* @deprecated Use newPaymentService() instead.
* @migration Started 2026-Q2, target completion Q3.
* Wrapped by anti-corruption layer in `paymentFacade.js`.
* @see {@link paymentFacade.js} for routing logic.
*/
function legacyChargeCard(cardToken) { ... }
Python docstring
def charge_legacy_card(card_token: str) -> Dict:
"""Charge card via legacy gateway (DEPRECATED).
Migration: Anti-corruption layer in payment_facade.py routes new requests
to new_gateway. Keep until 2026-Q3 for backward compatibility.
See: MIGRATION_LOG.md for timeline.
"""
| Anti-pattern | ✗ Wrong | ✓ Correct |
|---|---|---|
| Rewrite Strategy | Big bang rewrite of entire system | Incremental strangler fig with feature flags |
| Testing | Deploy new code before covering legacy behavior | Write characterization tests first; then refactor against golden master |
| API Contracts | Break existing endpoints during migration | Dual-write to old+new; maintain backward compatibility until 100% traffic proven stable |
| Monitoring | Deploy without metrics; check logs manually | Instrument facade with latency/error/traffic splits; automated alerts on anomalies |
| Shared State | Share mutable state between old+new code | Use facade as state boundary; new code owns its state; legacy data is read-only reference |
When implementing modernization, provide:
Strangler fig pattern, branch by abstraction, characterization testing, incremental migration, feature flags, canary deployments, API versioning, database refactoring, microservices extraction, technical debt reduction, zero-downtime deployment
npx claudepluginhub inho-team/qe-framework --plugin qe-frameworkCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.