Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

legacy-modernizer — Claude Code skill for legacy migration

Plans incremental legacy-code migration from dependency maps to facades, flags, and rollback steps. Use it when splitting a monolith or upgrading technology without a wholesale replacement.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Jeffallan/claude-skills --skill legacy-modernizer -a claude-code
Open on GitHub

What legacy-modernizer does

The skill assesses a codebase, its dependencies, risks, and business constraints before creating a dependency map and risk register. It then lays out migration phases with owners, metrics, rollback triggers, and API facade designs. It covers strangler fig work, branch by abstraction, service extraction, and technology upgrades.

Before production changes, it calls for characterization tests and monitoring. Traffic moves through a facade under feature flags, with error rates and latency checked against baseline thresholds after each increment. The 80%+ target for existing behaviour is a reason to verify that the current system can be captured before refactoring begins.

Its reference material covers system assessment, refactoring patterns, migration strategies, and legacy testing. The included examples use Python facades and pytest characterization tests. Legacy code is removed only after the new path has been stable at 100% traffic for one release cycle.

What it helps with

  • map dependencies and migration risks
  • split a migration into rollback-ready phases
  • design an API facade for old and new services
  • capture current behaviour with characterization tests
  • shift traffic through feature flags

Example prompts for the agent

  • "Assess this legacy monolith and create a dependency map with a risk register."
  • "Draft a strangler fig migration plan for replacing the order service."
  • "Create a facade and `pytest` characterization tests before moving this logic."

How to install legacy-modernizer

1Skills CLI (Vercel)

npx skills add Jeffallan/claude-skills --skill legacy-modernizer -a claude-code

2Manually: put the files in place

~/.claude/skills/legacy-modernizer/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/legacy-modernizer/

From the same set61

The whole set →
laravel-specialist https://github.com/Jeffallan Configures the agent for Laravel 10+ and PHP 8.2+ development. It guides Eloquent modeling, Horizon queues, API resources, and Pest testing. Claude Code CX Codex Cursor +1 23,300installs golang-pro https://github.com/Jeffallan A Go skill for concurrent code, microservices, performance profiling, and idiomatic interfaces. Use it for goroutines, gRPC, benchmarks, and table-driven tests. Claude Code CX Codex Cursor +1 18,900installs php-pro https://github.com/Jeffallan Enforces PHP 8.3+ standards across Laravel and Symfony projects with strict typing, PHPStan level 9 checks, and automated Pest tests. Claude Code CX Codex Cursor +1 15,500installs flutter-expert https://github.com/Jeffallan Skill for building cross-platform apps with Flutter 3+ and Dart. Covers widgets, state management via Riverpod or Bloc, GoRouter navigation, and performance optimization. Claude Code CX Codex Cursor +1 14,300installs typescript-pro https://github.com/Jeffallan Implements advanced TypeScript type systems, branded types, and tRPC configurations. Use it when building type-first APIs or complex discriminated unions. Claude Code CX Codex Cursor +1 14,200installs kubernetes-specialist https://github.com/Jeffallan This skill helps create and validate Kubernetes manifests, set workload security, and troubleshoot failing pods. Use it for deployment and cluster operations. Claude Code CX Codex Cursor +1 14,100installs devops-engineer https://github.com/Jeffallan This skill creates Dockerfiles, CI/CD configs, Kubernetes manifests, and IaC templates. Use it for deployments, platform work, and incident response. Claude Code CX Codex Cursor +1 11,200installs wordpress-pro https://github.com/Jeffallan This skill builds WordPress themes, plugins, Gutenberg blocks, and WooCommerce features. Use it for REST API work, hooks, security checks, and performance tuning. Claude Code CX Codex Cursor +1 9,700installs

Similar

security-review getsentry Finds injections, XSS, authorization flaws, and other vulnerabilities in code. Reports only high-confidence findings. Claude Code CX Codex Cursor +1 21,100installs post-mortem thananon Skill writes an engineering post-mortem after debugging: root cause with code identifiers, symptom, mechanism, the fix, and why it slipped through. Use after validation, before closing the ticket. Claude Code CX Codex Cursor +1 4,700installs visual-pr humanlayer A skill that automates pull request descriptions: reads the diff, gathers context, and fills a template so reviewers understand why the change exists and how it's shaped. Claude Code CX Codex Cursor +1 3,000installs stream-chain ruvnet Chains sequential agent steps together using streaming JSON flow and provides ready-to-run pipelines. Claude Code CX Codex Cursor +1 1,200installs sparc-methodology ruvnet Structures development into SPARC phases with Claude Flow multi-agent orchestration. Useful for running projects from specification and architecture down to TDD tests and review. Claude Code CX Codex Cursor +1 1,200installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. Claude Code 990,453installs

Questions about legacy-modernizer

How do I install legacy-modernizer in Claude Code?

Run npx skills add Jeffallan/claude-skills --skill legacy-modernizer -a claude-code, then run npx skills add Jeffallan/claude-skills --skill legacy-modernizer -a claude-code again, and open ~/.claude/skills/legacy-modernizer/SKILL.md.

What does legacy-modernizer do?

It creates incremental migration strategies, dependency maps, risk registers, and migration roadmaps. It also guides API facade design, tests, monitoring, and rollback planning.

What validation does the migration workflow require?

External integrations and data contracts are documented before planning moves on. Characterization tests run against the unchanged legacy system, and error rates plus latency are checked against baseline thresholds after traffic increments.

Source text

SKILL.md · MIT
---
name: legacy-modernizer
description: Designs incremental migration strategies, identifies service boundaries, produces dependency maps and migration roadmaps, and generates API facade designs for aging codebases. Use when modernizing legacy systems, implementing strangler fig pattern or branch by abstraction, decomposing monoliths, upgrading frameworks or languages, or reducing technical debt without disrupting business operations.
license: MIT
metadata:
  author: https://github.com/Jeffallan
  company: https://synergetic.solutions
  version: "1.1.0"
  domain: specialized
  triggers: legacy modernization, strangler fig, incremental migration, technical debt, legacy refactoring, system migration, legacy system, modernize codebase
  role: specialist
  scope: architecture
  output-format: analysis-and-code
  related-skills: test-master, devops-engineer
---

# Legacy Modernizer

## Core Workflow

1. **Assess system** — Analyze codebase, dependencies, risks, and business constraints. Produce a dependency map and risk register before proceeding.
   - *Validation checkpoint:* Confirm all external integrations and data contracts are documented before moving to step 2.

2. **Plan migration** — Design an incremental roadmap with explicit rollback strategies per phase. Reference `references/system-assessment.md` for code analysis templates.
   - *Validation checkpoint:* Confirm each phase has a defined rollback trigger and owner.

3. **Build safety net** — Create characterization tests and monitoring before touching production code. Target 80%+ coverage of existing behavior.
   - *Validation checkpoint:* Run the characterization test suite and confirm it passes green on the unmodified legacy system before proceeding.

4. **Migrate incrementally** — Apply strangler fig pattern with feature flags. Route traffic via a facade; shift load gradually.
   - *Validation checkpoint:* Verify error rates and latency metrics remain within baseline thresholds after each traffic increment (e.g., 5% → 25% → 50% → 100%).

5. **Validate & iterate** — Run full test suite, review monitoring dashboards, and confirm business behavior is preserved before retiring legacy code.
   - *Validation checkpoint:* New code must be proven stable at 100% traffic for at least one release cycle before legacy path is removed.

## Reference Guide

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 |

## Code Examples

### Strangler Fig Facade (Python)
```python
# 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 Flag Wrapper
```python
# 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)
```

### Characterization Test Template (pytest)
```python
# 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']}"
    )
```

## Constraints

### MUST DO
- Maintain zero production disruption during all migrations
- Create comprehensive test coverage before refactoring (target 80%+)
- Use feature flags for all incremental rollouts
- Implement monitoring and rollback procedures
- Document all migration decisions and rationale
- Preserve existing business logic and behavior
- Communicate progress and risks transparently

### MUST NOT DO
- Big bang rewrites or replacements
- Skip testing legacy behavior before changes
- Deploy without rollback capability
- Break existing integrations or APIs
- Ignore technical debt in new code
- Rush migrations without proper validation
- Remove legacy code before new code is proven

## Output Templates

When implementing modernization, provide:
1. Assessment summary (risks, dependencies, approach)
2. Migration plan (phases, rollback strategy, metrics)
3. Implementation code (facades, adapters, new services)
4. Test coverage (characterization, integration, e2e)
5. Monitoring setup (metrics, alerts, dashboards)

## Knowledge Reference

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

Maintained by [@jeffallan](https://github.com/jeffallan), Principal Consultant at [Synergetic Solutions](https://synergetic.solutions)

[Documentation](https://jeffallan.github.io/claude-skills/skills/specialized/legacy-modernizer/)

© https://github.com/Jeffallan · MIT · Jeffallan/claude-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor