This skill should be used when the user asks to "plan the migration", "create a migration strategy", "design the transition plan", "define migration phases", "plan rollback strategy", or needs to produce a phased migration plan with validation gates and rollback triggers for transitioning a brownfield codebase from its current state to the target architecture.
From pm-architect-brownfieldnpx claudepluginhub nbkm8y5/claude-plugins --plugin pm-architect-brownfieldThis skill uses the workspace's default tool permissions.
Guides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Details PluginEval's skill quality evaluation: 3 layers (static, LLM judge), 10 dimensions, rubrics, formulas, anti-patterns, badges. Use to interpret scores, improve triggering, calibrate thresholds.
Produce a phased, evidence-backed migration plan for transitioning from the as-is architecture to the target architecture. Each phase includes concrete steps, validation gates, rollback triggers, and risk mitigations linked to the gap analysis. The strategy prioritizes safety — moving the safest, highest-impact changes first.
[TO_BE_ARCHITECTURE.md + ARCH_GAPS_AND_RISKS.md + AS_IS_SYSTEM_MODEL.md] --> **MIGRATION STRATEGY** --> [MIGRATION_PLAN.md] --> Refactor Backlog & Roadmap --> ...
Input: TO_BE_ARCHITECTURE.md, ARCH_GAPS_AND_RISKS.md, AS_IS_SYSTEM_MODEL.md
Output: MIGRATION_PLAN.md written to artifacts directory
The output artifact follows the standard artifact template:
# [ARTIFACT TITLE]
## Summary
## Inputs
## Outputs
## Assumptions
## Open Questions
## Main Content
## Acceptance Criteria
TO_BE_ARCHITECTURE.md to understand:
ARCH_GAPS_AND_RISKS.md to understand:
AS_IS_SYSTEM_MODEL.md to understand:
Select the overall migration strategy based on system characteristics.
Evaluate approaches:
Document decision:
### Migration Approach: [Selected Approach]
- **Rationale**: [Why this approach fits the system and constraints]
- **Alternatives Rejected**: [Other approaches and why they don't fit]
- **Constraints Respected**: [CON-NNNN from review brief]
- **Risk Level**: Low | Medium | High
Break the migration into ordered phases, safest and highest-impact first.
Phase ordering principles:
For each phase, define:
### PHASE-0001: [Phase Title]
- **Duration**: [Estimated time range]
- **Objective**: [One-sentence goal of this phase]
- **Prerequisites**: [PHASE-NNNN IDs that must complete first, or "None"]
- **Migration Approach**: [Which overall approach applies to this phase]
#### Changes
| Change ID | Description | Type | From (AS-IS) | To (TO-BE) | Gaps Addressed |
|-----------|-------------|------|-------------|-----------|----------------|
| CHG-0001 | Introduce repository pattern | Refactor | COMP-0003 | TCOMP-0004 | GAP-0001 |
| CHG-0002 | Add input validation middleware | Add | (none) | TCOMP-0001 | GAP-0003, RISK-0002 |
#### Validation Gate: GATE-0001
- **Name**: [Gate name]
- **Criteria**:
- [ ] [Specific, measurable validation criterion]
- [ ] [Additional criterion]
- **Validation Method**: [How to verify: automated tests, manual review, load test, security scan]
- **Pass Threshold**: [What constitutes passing]
- **Blocking**: Yes | No (if No, phase can proceed with documented exceptions)
#### Rollback Strategy
- **Trigger Conditions**: [What would trigger a rollback]
- [Specific metric threshold or failure condition]
- [Additional trigger]
- **Rollback Steps**:
1. [Step-by-step rollback procedure]
2. [Next step]
- **Rollback Time Estimate**: [How long rollback takes]
- **Data Considerations**: [How to handle data created during the phase]
- **Point of No Return**: [Is there a point after which rollback is not feasible? If so, when?]
#### Risk Mitigations
| Risk ID | Mitigation Action | Owner | Status |
|---------|------------------|-------|--------|
| RISK-0001 | [Specific mitigation for this phase] | [Role] | Planned |
Assign PHASE-NNNN IDs: Phases are ordered by execution sequence, numbered sequentially starting at 0001.
Create a comprehensive validation gate inventory.
### GATE-0001: [Gate Name]
- **Phase**: PHASE-0001 -> PHASE-0002 (or PHASE-0001 completion)
- **Type**: Automated | Manual | Hybrid
- **Criteria**:
- [ ] All unit tests pass (zero failures)
- [ ] Integration tests cover new interfaces
- [ ] No P0 or P1 regressions in affected components
- [ ] Performance benchmarks within acceptable range
- [ ] Security scan shows no new vulnerabilities
- **Evidence Required**: [What artifacts prove the gate is passed]
- **Approval Required**: [Who must sign off]
- **Fallback**: [What happens if gate fails]
Gate types:
Assign GATE-NNNN IDs: Number sequentially by phase order, then by gate order within phase
Link every RISK-NNNN from the gap analysis to specific mitigation actions within migration phases.
For each RISK-NNNN, determine:
Risk mitigation matrix:
| RISK ID | Title | Severity | Mitigated In | Mitigation Action | Residual Risk | Monitor |
|---------|-------|----------|-------------|-------------------|---------------|---------|
| RISK-0001 | DB single point of failure | Critical | PHASE-0002 | Add read replica + failover | Manual failover delay | DB health check |
| RISK-0003 | Auth token leakage | High | PHASE-0001 | Rotate secrets, add vault | Key rotation window | Audit logs |
Outline how migration progress is tracked and communicated.
Stakeholder communication:
Team coordination:
Documentation updates:
Produce a visual timeline of the migration.
```mermaid
graph LR
PHASE-0001[Phase 1: Foundation] --> PHASE-0002[Phase 2: Security]
PHASE-0001 --> PHASE-0003[Phase 3: Data Layer]
PHASE-0002 --> PHASE-0004[Phase 4: API Refactor]
PHASE-0003 --> PHASE-0004
PHASE-0004 --> PHASE-0005[Phase 5: Performance]
2. **Gantt chart** (estimated):
```markdown
```mermaid
gantt
title Migration Timeline
dateFormat YYYY-MM-DD
section Foundation
PHASE-0001: Foundation :p1, 2026-03-01, 2w
GATE-0001: Quality Gate :milestone, g1, after p1, 0d
section Security
PHASE-0002: Security Hardening :p2, after g1, 1w
GATE-0002: Security Gate :milestone, g2, after p2, 0d
section Data Layer
PHASE-0003: Data Abstraction :p3, after g1, 3w
GATE-0003: Data Gate :milestone, g3, after p3, 0d
### Step 8: Compile Migration Plan Artifact
Assemble all findings into the final artifact.
1. **Write** `MIGRATION_PLAN.md` following the template
2. **Verify** every GAP-NNNN is addressed in at least one phase
3. **Verify** every RISK-NNNN has a mitigation entry
4. **Verify** every phase has a validation gate and rollback strategy
5. **Verify** phase dependencies form a valid DAG (no circular dependencies)
## Output Format
### MIGRATION_PLAN.md Structure
```markdown
# Migration Plan: [Project Name]
## Summary
[3-5 sentences: number of phases, overall timeline estimate, migration approach, key risks]
## Inputs
- TO_BE_ARCHITECTURE.md
- ARCH_GAPS_AND_RISKS.md
- AS_IS_SYSTEM_MODEL.md
## Outputs
- MIGRATION_PLAN.md (this document)
## Assumptions
- [ASM-NNNN]: [Assumption with rationale]
## Open Questions
- [OQ-NNNN]: [Questions requiring resolution before migration begins]
## Main Content
### Migration Approach
[Approach selection with rationale]
### Phase Overview
| Phase ID | Title | Duration | Prerequisites | Gaps Addressed | Gate |
|----------|-------|----------|--------------|----------------|------|
### Phase Details
[PHASE-NNNN entries with full detail including changes, gates, rollback, mitigations]
### Validation Gate Registry
| Gate ID | Phase | Type | Key Criteria | Approval |
|---------|-------|------|-------------|----------|
### Rollback Summary
| Phase | Trigger | Rollback Time | Point of No Return |
|-------|---------|--------------|-------------------|
### Risk Mitigation Matrix
| RISK ID | Severity | Phase | Action | Residual Risk |
|---------|----------|-------|--------|---------------|
### Migration Timeline
```mermaid
[Phase dependency diagram]
[Gantt chart]
[Stakeholder and team coordination details]
| GAP ID | Priority | Addressed In | Change IDs |
|---|
**Output path**: `artifacts/brownfield/<project_name>/MIGRATION_PLAN.md`
**Template**: `${CLAUDE_PLUGIN_ROOT}/reference/templates/MIGRATION_PLAN.template.md`
## Determinism Rules
These rules ensure reproducible output regardless of when or how many times the skill is invoked on the same inputs.
1. **PHASE-NNNN IDs**: Ordered by execution sequence (dependency-respecting topological sort), numbered sequentially starting at 0001. For phases at the same dependency level, sort alphabetically by phase title.
2. **GATE-NNNN IDs**: Numbered sequentially by phase order, then by gate order within a phase, starting at 0001
3. **CHG-NNNN IDs**: Within each phase, sort changes alphabetically by description, assign sequentially starting at 0001 per phase (or globally, consistently)
4. **Risk mitigation rows**: Sort by RISK-NNNN ID numerically
5. **Gap resolution rows**: Sort by GAP-NNNN ID numerically
6. **Phase overview table rows**: Sort by PHASE-NNNN ID
7. **Sections**: Always in template order, never reordered
8. **No timestamps**: Do not include generation timestamps in artifact body (Gantt chart dates are planning estimates, not generation timestamps)
9. **Gantt chart dates**: Use relative offsets from a configurable start date if actual dates are not known
## Evidence Citation Rules
Migration strategy references upstream artifacts rather than raw code (since code evidence was already established in prior skills).
**Format for upstream references**: `[ARTIFACT_NAME: ID]` (e.g., `[TO_BE: TCOMP-0003]`, `[ARCH_GAPS: GAP-0001]`, `[AS_IS: COMP-0002]`)
**Examples**:
```markdown
> Phase 1 addresses the critical security gap [ARCH_GAPS: GAP-0005] by introducing the auth service [TO_BE: TCOMP-0002]
> Rollback for this phase reverts to the original API handler [AS_IS: COMP-0001]
> This phase mitigates the database single-point-of-failure risk [ARCH_GAPS: RISK-0001]
Rules:
[file:line] references are acceptable for rollback procedures that reference specific filesBefore finalizing the artifact, verify: