| name | legacy-modernization |
| description | Modernize legacy applications and codebases. Use for COBOL conversion, framework upgrades, and technical debt reduction. |
🏗️ Legacy Modernization Skill
Modernization Patterns
Strangler Fig Pattern
1. Create new service alongside legacy
2. Route new features to modern service
3. Gradually migrate existing features
4. Eventually retire legacy system
Anti-Corruption Layer
const legacyResponse = await legacyApi.getUser(id);
const modernUser = {
id: legacyResponse.usr_id,
name: legacyResponse.usr_nm,
email: legacyResponse.usr_email
};
Common Modernization Tasks
JavaScript Upgrades
var name = 'John';
const name = 'John';
function add(a, b) { return a + b; }
const add = (a, b) => a + b;
getData(function(err, data) { ... });
getData().then(data => ...).catch(err => ...);
const data = await getData();
jQuery → Vanilla JS
$('.button').click(function() { ... });
$('#result').html(data);
document.querySelector('.button').addEventListener('click', () => { ... });
document.getElementById('result').innerHTML = data;
Class → Functional (React)
class Counter extends Component {
state = { count: 0 };
componentDidMount() { ... }
render() { return <div>{this.state.count}</div>; }
}
function Counter() {
const [count, setCount] = useState(0);
useEffect(() => { ... }, []);
return <div>{count}</div>;
}
Database Modernization
| From | To | Strategy |
|---|
| SQL Server | PostgreSQL | pg_chameleon |
| MySQL | PostgreSQL | pgloader |
| Oracle | PostgreSQL | ora2pg |
| MongoDB → SQL | Prisma | Custom scripts |
Modernization Checklist