Iterative migration workflow with parity checks, tests, and code review
/plugin marketplace add JosephAnson/claude-plugin/plugin install josephanson-ja@JosephAnson/claude-plugin<legacy-url> <new-url> [--max-iterations N]Combines Ralph Wiggum loops with headless parity checks for iterative legacy→Vue migration validation.
/ja:migrate-parity <legacy-url> <new-url> [options]
Note: Pass full URLs including paths - legacy and new paths can differ.
| Argument | Required | Default | Description |
|---|---|---|---|
legacy-url | Yes | - | Full legacy URL (source of truth) |
new-url | Yes | - | Full new Vue URL |
--max-iterations | No | 20 | Ralph loop safety limit |
# Single page comparison (different paths allowed)
/ja:migrate-parity https://legacy.provetcloud.com/4/organization/administration/catalog/item_lists/ http://localhost:5171/4/catalog/management/item-lists
Extract from $ARGUMENTS:
legacy-url (required) - full URL including pathnew-url (required) - full URL including path--max-iterations (default: 20)Scan working directory for project directories containing:
package.json (JS/TS project)pyproject.toml or requirements.txt (Python project)For each detected project, auto-detect test command:
pnpm-lock.yaml exists → pnpm testpackage-lock.json exists → npm testpyproject.toml exists → pytestFor each detected project, auto-detect format command:
.pre-commit-config.yaml exists → pre-commit run --all-filespnpm-lock.yaml exists → pnpm lint:fixpyproject.toml exists → ruff formatnpm run lint:fixFor each detected project, auto-detect typecheck command:
tsconfig.json exists → pnpm typecheck or npm run typecheckpyproject.toml with mypy config → mypy or just typecheckpackage.json scripts for typecheck or type-check scriptImportant: Frontend projects often generate types from backend APIs. When backend APIs change, frontend types must be regenerated. Look for:
pnpm generate:types or similar scripts in package.jsonCreate .claude/ralph-loop.local.md with this content:
---
active: true
iteration: 1
max_iterations: {max-iterations}
completion_promise: "MIGRATION_PARITY_ACHIEVED"
started_at: "{ISO timestamp}"
---
Migration parity check for:
- Legacy: {legacy-url}
- New: {new-url}
- Projects: {projects}
- Test cmds: {test-cmds}
- Format cmds: {format-cmds}
- Typecheck cmds: {typecheck-cmds}
Check parity, fix issues, run typecheck, run tests for all projects, format code.
Output <promise>MIGRATION_PARITY_ACHIEVED</promise> when complete.
Create .claude/.migrate-parity-state.md:
# Migration Parity State
## Configuration
- Legacy URL: {legacy-url}
- New URL: {new-url}
## Projects
| Project | Test Command | Format Command | Typecheck Command |
|---------|--------------|----------------|-------------------|
{for each project: | {project} | {test-cmd} | {format-cmd} | {typecheck-cmd} |}
## Parity Status
- Status: PENDING
- Last Check: -
## Typecheck
| Project | Status | Last Run |
|---------|--------|----------|
{for each project: | {project} | PENDING | - |}
## Tests
| Project | Status | Last Run |
|---------|--------|----------|
{for each project: | {project} | PENDING | - |}
## Iteration: 1 of {max-iterations}
Invoke the /headless:parity skill to compare the legacy and new URLs:
/headless:parity {legacy-url} {new-url}
Or spawn a headless:parity-browser agent via Task tool.
For each FAIL result:
Focus on:
Critical for API changes: When backend API changes, frontend types must be regenerated first.
For frontend projects with API type generation:
# First regenerate types from backend API (if applicable)
cd {frontend-project-dir} && {type-generation-cmd} # e.g., pnpm generate:types
# Then run typecheck
cd {frontend-project-dir} && {typecheck-cmd} # e.g., pnpm typecheck
For backend projects:
cd {backend-project-dir} && {typecheck-cmd} # e.g., mypy or just typecheck
If typecheck fails:
Update state file with typecheck results for each project.
For each project, execute its test command:
# For each project directory
cd {project-dir} && {test-cmd}
If tests fail in any project:
Update state file with test results for each project.
For each project, execute its format command:
# For each project directory
cd {project-dir} && {format-cmd}
Ensure no lint errors remain in any project.
Before declaring complete, run /ja:pre-commit --skip-mr to ensure all quality gates pass.
Read .claude/.migrate-parity-state.md. Check if:
If NOT complete:
If COMPLETE:
@code-reviewer agent for final reviewWhen all conditions met:
## Migration Parity Complete
### Parity Check
- Legacy: {legacy-url}
- New: {new-url}
- Status: PASS
### Typecheck Results
| Project | Status | Command |
|---------|--------|---------|
{for each project: | {project} | PASS | {typecheck-cmd} |}
### Test Results
| Project | Status | Command |
|---------|--------|---------|
{for each project: | {project} | PASS | {test-cmd} |}
### Code Review: APPROVED
<promise>MIGRATION_PARITY_ACHIEVED</promise>
| Scenario | Action |
|---|---|
| Server not running | Prompt user to start servers |
| URL 404 | Mark as SKIP, warn user |
| Flaky tests | Retry up to 3 times |
| Max iterations reached | Report progress, suggest manual completion |
| Parity check timeout | Retry with increased timeout |
| Project not found | Warn user, skip that project |
| Mixed test results | Continue until all projects pass |
| Typecheck fails | Fix type errors before running tests |
| Frontend types out of sync | Regenerate types from backend API first |
| API type generation fails | Check backend server is running, schema is valid |
.claude/ralph-loop.local.md - Ralph loop state (iteration, promise).claude/.migrate-parity-state.md - Migration progress tracking