/declutter:migratefrom declutter
Incremental migration workflow - safely migrate legacy code to modern patterns
Ships in declutter. Installing the plugin adds it to Claude Code.
Start an incremental migration workflow for moving legacy code to modern patterns.
/migrate # Interactive mode
/migrate strangler # Use Strangler Fig pattern
/migrate branch-by-abstraction # Use Branch by Abstraction
/migrate --language=python # Python-specific migration
/migrate --framework=react # React-specific migration
Gradually replace legacy system by:
digraph strangler {
rankdir=LR;
old [label="Legacy\nSystem"];
new [label="New\nSystem"];
router [label="Router" shape=diamond];
client [label="Client"];
client -> router;
router -> old [label="90%"];
router -> new [label="10%"];
}
Migrate implementation behind abstraction:
digraph branch {
rankdir=TB;
client [label="Client Code"];
iface [label="Interface\n(Abstraction)"];
legacy [label="Legacy\nImplementation"];
modern [label="Modern\nImplementation"];
client -> iface;
iface -> legacy [style=dashed label="before"];
iface -> modern [label="after"];
}
| Option | Description |
|---|---|
--strategy=X | strangler, branch-by-abstraction |
--language=X | python, typescript, java |
--framework=X | react, vue, angular |
--scope=X | Limit migration scope |
--dry-run | Plan only |
User: /migrate strangler --scope=auth
Claude: Starting Strangler Fig migration for auth module...
Phase 1: Analysis
- Legacy auth in: src/legacy/auth/
- Entry points: 3 (login, logout, verify)
- Dependencies: database, cache, email
- Risk: Medium (critical path)
Phase 2: Planning
Migration plan:
1. Create AuthService interface
2. Implement interface with legacy code
3. Create new implementation
4. Add routing layer
5. Migrate login endpoint (10% traffic)
6. ... gradually increase ...
7. Remove legacy when 100%
Approve? [Yes/Revise/Cancel]
User: Yes
Phase 3: Implementation
[Step 1] Creating AuthService interface...
- Interface created
- Tests: PASSING
[Step 2] Wrapping legacy...
...
Migration in progress. Current routing: 10% new, 90% legacy.
Monitor at: /status/migration/auth
During migration:
# Migration Status: auth
## Routing
- Legacy: 90%
- Modern: 10%
## Metrics (Last 24h)
| Metric | Legacy | Modern |
|--------|--------|--------|
| Requests | 9000 | 1000 |
| Errors | 12 | 1 |
| Latency p99 | 120ms | 45ms |
## Status
Migration proceeding normally.
Recommend increasing to 25% modern.
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
3 commands in this plugin
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.json declares PreToolUse/PermissionRequest at its top level, outside the "hooks" object — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
Other plugins' commands for the same job