This skill should be used when the user asks to "generate refactor tasks", "create a migration backlog", "build a roadmap", "create architecture decision records", "generate RFCs", "plan the refactoring work", or needs to produce actionable task lists, milestone-based roadmaps, and architecture decision records from a migration plan.
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.
Orchestrates subagents to execute phased plans: deploys for implementation, verification, anti-pattern checks, code quality review, and commits only after passing checks.
Transform the migration plan into actionable deliverables: a prioritized task backlog, a milestone-based roadmap with Gantt visualization, and architecture decision records (RFCs) for all major decisions. This is the final skill in the brownfield pipeline, producing the artifacts that engineering teams use to execute the migration.
[MIGRATION_PLAN.md + ARCH_GAPS_AND_RISKS.md + TO_BE_ARCHITECTURE.md] --> **REFACTOR BACKLOG & ROADMAP** --> [REFACTOR_TASKS.md + ROADMAP.md + RFC_LIST.md]
Input: MIGRATION_PLAN.md, ARCH_GAPS_AND_RISKS.md, TO_BE_ARCHITECTURE.md
Output: REFACTOR_TASKS.md, ROADMAP.md, and RFC_LIST.md written to artifacts directory
All three output artifacts follow the standard artifact template:
# [ARTIFACT TITLE]
## Summary
## Inputs
## Outputs
## Assumptions
## Open Questions
## Main Content
## Acceptance Criteria
MIGRATION_PLAN.md to understand:
ARCH_GAPS_AND_RISKS.md to understand:
TO_BE_ARCHITECTURE.md to understand:
Decompose each migration phase change into concrete, actionable engineering tasks.
For each CHG-NNNN in each PHASE-NNNN, generate one or more tasks:
Task format:
### TASK-0001: [Task Title]
- **Phase**: PHASE-NNNN
- **Priority**: P0 | P1 | P2
- **Type**: Implementation | Refactor | Test | Migration | Configuration | Documentation | Validation
- **Effort**: XS (< 2h) | S (2-8h) | M (1-3d) | L (3-5d) | XL (5-10d)
- **Description**: [What needs to be done, specifically]
- **Addresses**: [GAP-NNNN and/or RISK-NNNN that this task resolves or mitigates]
- **Dependencies**: [TASK-NNNN IDs that must complete before this task, or "None"]
- **Component**: [TCOMP-NNNN or COMP-NNNN affected]
- **Acceptance Criteria**:
- [ ] [Specific, verifiable criterion]
- [ ] [Additional criterion]
- **Testing Requirements**:
- [ ] [Unit tests for new/changed code]
- [ ] [Integration tests for interface changes]
- [ ] [Regression tests for preserved behavior]
- **Rollback Notes**: [How to undo this task if needed]
Task categories to generate for each phase change:
Assign TASK-NNNN IDs: Sort all tasks first by PHASE-NNNN (numerically), then by priority (P0 first), then alphabetically by task title. Assign sequential four-digit numbers starting at 0001.
Map dependencies between tasks to enable parallel execution where possible.
Identify dependencies:
Dependency diagram:
```mermaid
graph TD
TASK-0001[Introduce repository interface] --> TASK-0003[Implement repository for User]
TASK-0001 --> TASK-0004[Implement repository for Order]
TASK-0002[Add validation middleware] --> TASK-0005[Apply validation to user routes]
TASK-0003 --> TASK-0006[Integration tests for User repo]
TASK-0004 --> TASK-0007[Integration tests for Order repo]
TASK-0006 --> TASK-0008[GATE-0001 validation]
TASK-0007 --> TASK-0008
TASK-0005 --> TASK-0008
3. **Identify parallelizable task groups**: Tasks with no mutual dependencies that can be worked on simultaneously
### Step 4: Build Roadmap with Milestones
Create a milestone-based roadmap that maps phases to calendar time.
1. **Define milestones**:
```markdown
### MS-0001: [Milestone Title]
- **Phase**: PHASE-NNNN
- **Target Date**: [Date or relative offset]
- **Gate**: GATE-NNNN
- **Description**: [What this milestone represents]
- **Success Criteria**:
- [ ] [Specific criterion]
- [ ] [Additional criterion]
- **Tasks Included**: [TASK-NNNN list]
- **Dependencies**: [MS-NNNN IDs that must complete first, or "None"]
- **Risk Factors**: [What could delay this milestone]
Assign MS-NNNN IDs: Sort milestones by target date (earliest first), then alphabetically by title for same-date milestones. Assign sequentially starting at 0001.
Gantt chart:
```mermaid
gantt
title Refactoring Roadmap
dateFormat YYYY-MM-DD
section Phase 1: Foundation
TASK-0001: Introduce repository interface :t1, 2026-03-01, 3d
TASK-0002: Add validation middleware :t2, 2026-03-01, 2d
TASK-0003: Implement User repository :t3, after t1, 3d
TASK-0004: Implement Order repository :t4, after t1, 3d
TASK-0005: Apply validation to user routes :t5, after t2, 2d
TASK-0006: Integration tests (User) :t6, after t3, 2d
TASK-0007: Integration tests (Order) :t7, after t4, 2d
MS-0001: Foundation Complete :milestone, m1, after t6 t7 t5, 0d
section Phase 2: Security
TASK-0008: Implement auth service :t8, after m1, 5d
TASK-0009: Rotate secrets to vault :t9, after m1, 3d
MS-0002: Security Hardened :milestone, m2, after t8 t9, 0d
4. **Progress tracking table**:
```markdown
| MS ID | Phase | Title | Target Date | Status | Tasks Total | Tasks Done | % |
|-------|-------|-------|-------------|--------|-------------|-----------|---|
| MS-0001 | PHASE-0001 | Foundation Complete | 2026-03-14 | Not Started | 7 | 0 | 0% |
| MS-0002 | PHASE-0002 | Security Hardened | 2026-03-21 | Not Started | 4 | 0 | 0% |
Document major architecture decisions as formal RFCs.
Identify RFC-worthy decisions: Every TDEC-NNNN from the target architecture, plus any significant migration approach decisions
RFC format:
### RFC-0001: [Decision Title]
- **Status**: Proposed | Accepted | Rejected | Superseded
- **Date**: [Date proposed]
- **Decision Makers**: [Roles/stakeholders involved]
- **Related**: [TDEC-NNNN, PRINC-NNNN, GAP-NNNN, RISK-NNNN]
#### Context
[What situation necessitates this decision? What problem are we solving?]
> [Evidence from gap analysis or codebase] [ARCH_GAPS: GAP-NNNN]
#### Decision
[What is the decision? State it clearly and specifically.]
#### Alternatives Considered
| Alternative | Description | Pros | Cons |
|------------|-------------|------|------|
| [Option A] | [Brief description] | [Advantages] | [Disadvantages] |
| [Option B] | [Brief description] | [Advantages] | [Disadvantages] |
| **[Chosen]** | **[Brief description]** | **[Advantages]** | **[Disadvantages]** |
#### Consequences
**Positive**:
- [Benefit 1]
- [Benefit 2]
**Negative**:
- [Trade-off 1]
- [Trade-off 2]
**Neutral**:
- [Side effect that is neither clearly positive nor negative]
#### Implementation Notes
- [Key implementation consideration]
- [Migration phase where this applies]: PHASE-NNNN
- [Tasks that implement this decision]: TASK-NNNN
#### Reversibility
- **Level**: High | Medium | Low
- **Reversal Cost**: [What it would take to undo this decision]
- **Time Window**: [How long before reversal becomes impractical]
Create a master index linking all artifact IDs across the entire brownfield pipeline.
| TASK ID | Phase | GAP/RISK | TCOMP | TDEC | RFC | Milestone |
|---------|-------|----------|-------|------|-----|-----------|
| TASK-0001 | PHASE-0001 | GAP-0001 | TCOMP-0004 | TDEC-0002 | RFC-0003 | MS-0001 |
Write the three output artifacts.
# Refactor Tasks: [Project Name]
## Summary
[Total tasks, breakdown by phase, breakdown by priority, estimated total effort]
## Inputs
- MIGRATION_PLAN.md
- ARCH_GAPS_AND_RISKS.md
## Outputs
- REFACTOR_TASKS.md (this document)
## Assumptions
- [ASM-NNNN]: [Assumption]
## Open Questions
- [OQ-NNNN]: [Question]
## Main Content
### Task Summary
| Phase | P0 Tasks | P1 Tasks | P2 Tasks | Total | Est. Effort |
|-------|----------|----------|----------|-------|-------------|
### Task Inventory
#### PHASE-0001: [Title]
[TASK-NNNN entries sorted by priority then title]
#### PHASE-0002: [Title]
[TASK-NNNN entries]
### Task Dependency Graph
```mermaid
[Dependency diagram]
| Group | Tasks | Can Start After | Est. Duration |
|---|
| GAP/RISK ID | Tasks Addressing | Status |
|---|
### ROADMAP.md Structure
```markdown
# Roadmap: [Project Name]
## Summary
[Number of milestones, total timeline, key phases]
## Inputs
- MIGRATION_PLAN.md
- REFACTOR_TASKS.md
## Outputs
- ROADMAP.md (this document)
## Assumptions
- [ASM-NNNN]: [Assumption]
## Open Questions
- [OQ-NNNN]: [Question]
## Main Content
### Milestone Overview
| MS ID | Phase | Title | Target | Gate | Tasks | Status |
|-------|-------|-------|--------|------|-------|--------|
### Milestone Details
[MS-NNNN entries with full detail]
### Timeline
```mermaid
gantt
[Gantt chart with tasks and milestones]
| MS ID | Tasks Total | Tasks Done | % Complete | On Track |
|---|
[Longest dependency chain that determines minimum timeline]
graph LR
[Critical path diagram highlighting blocking tasks]
| Risk | Impact on Timeline | Mitigation |
|---|
### RFC_LIST.md Structure
```markdown
# Architecture Decision Records: [Project Name]
## Summary
[Number of RFCs, breakdown by status, key decisions]
## Inputs
- TO_BE_ARCHITECTURE.md
- MIGRATION_PLAN.md
- ARCH_GAPS_AND_RISKS.md
## Outputs
- RFC_LIST.md (this document)
## Assumptions
- [ASM-NNNN]: [Assumption]
## Open Questions
- [OQ-NNNN]: [Question]
## Main Content
### RFC Summary
| RFC ID | Title | Status | Category | Reversibility | Related TDEC |
|--------|-------|--------|----------|---------------|-------------|
### Architecture Decision Records
[RFC-NNNN entries with full detail]
### Decision Dependency Map
```mermaid
graph TD
[Which decisions depend on or constrain other decisions]
| RFC ID | Gaps Addressed | Risks Mitigated | Tasks | Phase |
|---|
**Output paths**:
- `artifacts/brownfield/<project_name>/REFACTOR_TASKS.md`
- `artifacts/brownfield/<project_name>/ROADMAP.md`
- `artifacts/brownfield/<project_name>/RFC_LIST.md`
**Templates**:
- `${CLAUDE_PLUGIN_ROOT}/reference/templates/REFACTOR_TASKS.template.md`
- `${CLAUDE_PLUGIN_ROOT}/reference/templates/ROADMAP.template.md`
- `${CLAUDE_PLUGIN_ROOT}/reference/templates/RFC_LIST.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. **TASK-NNNN IDs**: Sort by PHASE (numerically), then by priority (P0 first), then alphabetically by task title (case-insensitive). Assign sequential four-digit numbers starting at 0001 globally across all phases.
2. **MS-NNNN IDs**: Sort by target date (earliest first), then alphabetically by title for same-date milestones. Assign sequentially starting at 0001.
3. **RFC-NNNN IDs**: Sort alphabetically by decision title (case-insensitive). Assign sequentially starting at 0001.
4. **Task summary table rows**: Sort by Phase ID numerically
5. **Milestone overview rows**: Sort by MS-NNNN ID numerically
6. **RFC summary rows**: Sort by RFC-NNNN ID numerically
7. **Alternatives table rows**: Sort alphabetically by alternative name; chosen alternative bolded
8. **Cross-reference rows**: Sort by primary ID (TASK, MS, or RFC) numerically
9. **Sections**: Always in template order, never reordered
10. **No timestamps**: Do not include generation timestamps in artifact body (Gantt chart dates are planning estimates, not generation timestamps)
11. **Gantt task IDs**: Use lowercase `t` prefix with sequential numbers matching TASK-NNNN where possible
12. **Progress tracking**: Initialize all tasks at 0% / Not Started
## Evidence Citation Rules
Refactor backlog and roadmap reference upstream artifacts throughout.
**Format for upstream references**: `[ARTIFACT_NAME: ID]` (e.g., `[MIGRATION: PHASE-0001]`, `[ARCH_GAPS: GAP-0003]`, `[TO_BE: TCOMP-0004]`, `[TO_BE: TDEC-0001]`)
**Examples**:
```markdown
> This task implements the repository pattern defined in [TO_BE: TCOMP-0004] to address [ARCH_GAPS: GAP-0001]
> Milestone MS-0001 corresponds to passing [MIGRATION: GATE-0001] at the end of [MIGRATION: PHASE-0001]
> This RFC documents the decision recorded in [TO_BE: TDEC-0002] motivated by [ARCH_GAPS: GAP-0005, RISK-0003]
Rules:
[file:line] references are acceptable in task descriptions when referencing specific files to modifyBefore finalizing all three artifacts, verify: