owflow 0.4.3 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: owflow:migration-plan
3
+ description: Migration — delegates implementation planning with a rollback/checkpoint step mandated in every task group, then refines the plan with a diagram (plan-created).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Plan — Rollback-Guarded Implementation Plan (plan-created)
9
+
10
+ Work phase of the migration workflow. Delegates planning to the reused `implementation-planner` agent with the migration requirement that **every task group carries a rollback/checkpoint step**, then refines the plan with an execution diagram.
11
+
12
+ ## Entry Gate
13
+
14
+ ### 1. Argument resolution
15
+
16
+ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
17
+
18
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
19
+ - **Identifier** — exact directory name inside `.owflow/tasks/migrations/` (e.g., `2026-01-12-framework-upgrade`); resolve to its path.
20
+ - Missing argument, a path that does **not exist**, or no identifier match → print the blocked block (part 3), then STOP. Never guess or auto-pick a task.
21
+
22
+ ### 2. Prerequisites
23
+
24
+ | Required for this skill | Where verified | Produced by |
25
+ | ----------------------- | -------------------------------------------------------------------- | ------------------------------------ |
26
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:migration <description>` (dispatcher init) or mid-pipeline bootstrap |
27
+ | Strategy specified | `strategy-specified` in `completed_phases` **and** `implementation/spec.md` exists | `/owflow:migration-spec <task-path>` |
28
+ | Rollback plan consumed | `analysis/rollback-plan.md` exists (source of per-group rollback content) | `/owflow:migration-spec <task-path>` |
29
+
30
+ ### 3. Blocked output
31
+
32
+ 1. Steps that must be completed first (in order), each with its command:
33
+ - Requirements, specification & rollback/dual-run plans (`strategy-specified`) → `/owflow:migration-spec <task-path>`
34
+ - Target state planning (`target-planned`) → `/owflow:migration-target <task-path>` (if also missing)
35
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>` (if also missing)
36
+ - State initialization → `/owflow:migration <description>` (new task)
37
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
38
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
39
+
40
+ Then STOP — never guess or auto-pick a task.
41
+
42
+ ### 4. Missing-state bootstrap
43
+
44
+ When the only unmet prerequisite is the state file, use `question` — "No task exists at this path. Create a fresh standard migration task and start at `plan-created`?" with **Create task** / **Decline**.
45
+
46
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-plan (mid-pipeline bootstrap)"`, `orchestrator.started_phase: plan-created`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `implementation/spec.md` and the rollback plan still block, so bootstrapping never skips upstream work.
47
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
48
+
49
+ ### 5. Skip/resume — artifacts before state
50
+
51
+ - `implementation/implementation-plan.md` exists but `plan-created` is missing ⇒ **adopt**: append `plan-created`, backfill `phase_summaries.plan.summary` and `migration_outputs.implementation_plan` where still null.
52
+ - `plan-created` is present but `implementation/implementation-plan.md` is missing ⇒ **drop** `plan-created` from `completed_phases` and re-run.
53
+ - Both artifact and slug exist ⇒ report the existing plan summary and route to the Exit Gate.
54
+ - `analysis/rollback-plan.md` is missing while `strategy-specified` holds ⇒ route back to `/owflow:migration-spec <task-path>` to regenerate the extraction — never re-author it here.
55
+
56
+ ### 6. Conditional activation
57
+
58
+ Not applicable — `migration-plan` has no activation condition; it runs whenever its prerequisites are met.
59
+
60
+ ### 7. Recovery
61
+
62
+ | Step | Max Attempts | Strategy |
63
+ | -------------------------- | ------------ | ------------------------------------------------------------------------------------------------ |
64
+ | Implementation planning (`plan-created`) | 2 | Regenerate with the migration constraints restated: a rollback/checkpoint step in every task group and rollback content read from the strategies reference |
65
+
66
+ ## Execute
67
+
68
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), then read `../migration-spec/references/migration-strategies.md` for the rollback-step content (the rollback-plan structure and strategy patterns).
69
+
70
+ | Direction | Artifact | Producer |
71
+ | --------- | ----------------------------------- | --------------------------------------------------------------- |
72
+ | Consumed | `implementation/spec.md` | `migration-spec` (approved specification) |
73
+ | Consumed | `analysis/rollback-plan.md` | `migration-spec` (per-group rollback content) |
74
+ | Produced | `implementation/implementation-plan.md` | `implementation-planner` (**Task**, frozen contract) |
75
+
76
+ ### Delegated Planning with Per-Group Rollback (`plan-created`)
77
+
78
+ > **ANTI-PATTERN — never write `implementation-plan.md` yourself. "The groups are straightforward" is NOT a reason to skip delegation.**
79
+
80
+ 1. **Task tool — `implementation-planner`** (frozen contract). Pass: `task_path`, `task_description`, `migration_context.*` (type, strategy, risk level, breaking changes), `phase_summaries` (spec plus upstream), `implementation/spec.md`, and `analysis/rollback-plan.md` as the rollback source.
81
+ 2. **Injected requirement**: the delegation prompt **mandates** that every task group carries a rollback/checkpoint step, with rollback-step content read from `../migration-spec/references/migration-strategies.md`. Pass that path and the `analysis/rollback-plan.md` structures explicitly.
82
+ 3. **SELF-CHECK before the state write**: read `implementation/implementation-plan.md` and confirm every task group ends with a rollback/checkpoint step. If any group is missing one, re-invoke the planner with the requirement restated — do not append the rollback steps yourself.
83
+ 4. **Skill tool — `diagrams-mermaid`** (content-preserving) on `implementation/implementation-plan.md`: add one migration execution/state flow with rollback checkpoints. The written steps and rollback details remain authoritative; diagrams are explanatory. A skipped or failed refinement is not a failure — note it in `phase_summaries.plan.summary` and continue.
84
+ 5. **State write**: append `plan-created` to `completed_phases`; set `phase_summaries.plan.summary`, `migration_outputs.implementation_plan`; bump `orchestrator.updated`. On failure: append `plan-created` to `failed_phases`, increment `auto_fix_attempts["plan-created"]`. Then re-read state + run `verify_template`.
85
+
86
+ ## State Update Convention (per step)
87
+
88
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`plan-created`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
89
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
90
+ 3. **Failures** — a failed or abandoned step is NOT appended to `completed_phases`; append its slug to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
91
+ 4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-migration.yml`. Fix any reported issue immediately.
92
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
93
+
94
+ ## Exit Gate
95
+
96
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
97
+
98
+ ### Results box
99
+
100
+ ```markdown
101
+ ## ✅ MIGRATION PLAN COMPLETE — <task name>
102
+
103
+ **Task groups** — [N]
104
+ **Total steps** — [M]
105
+ **Rollback coverage** — ✅ every task group carries a rollback/checkpoint step
106
+ **Execution order** — [key dependencies, 1-2 lines]
107
+ **Diagram** — [added / skipped (optional)]
108
+
109
+ **Artifacts**
110
+
111
+ - `implementation/implementation-plan.md`
112
+ ```
113
+
114
+ ### Results-acceptance question
115
+
116
+ Use `question` — "Are these results correct?" with options:
117
+
118
+ - **Accept** — the plan is good; continue.
119
+ - **Adjust** — regenerate the plan with the user's corrections (grouping, ordering, rollback steps), update state, re-present the results box.
120
+ - **Discuss** — walk through the task groups, dependencies, or rollback/checkpoint design in more depth; then re-ask.
121
+ - **Stop here** — print the resume command (`/owflow:migration-plan <task-path>`) and end.
122
+
123
+ ### Next steps (after Accept)
124
+
125
+ - `→ /owflow:migration-implement <task-path>` — `required` next: executes the plan task group by task group with the per-group rollback/checkpoint steps and writes the work log. Remaining after: verify (→ fix when needed) → finalize.
126
+
127
+ **Other options**:
128
+
129
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs all remaining phases in one loop (implement → verify → fix when needed → finalize)
130
+
131
+ Then STOP.
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: owflow:migration-spec
3
+ description: Migration — gathers requirements, delegates the specification with mandated rollback/dual-run sections, extracts the standalone plans, then refines diagrams (strategy-specified).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Spec — Requirements, Specification & Rollback/Dual-Run Plans (strategy-specified)
9
+
10
+ Work phase of the migration workflow. Gathers migration requirements inline, delegates specification creation to the reused `specification-creator` agent with **mandated** rollback/dual-run sections, extracts those sections into standalone authoritative artifacts, then refines the spec with diagrams.
11
+
12
+ ## Entry Gate
13
+
14
+ ### 1. Argument resolution
15
+
16
+ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
17
+
18
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
19
+ - **Identifier** — exact directory name inside `.owflow/tasks/migrations/` (e.g., `2026-01-12-framework-upgrade`); resolve to its path.
20
+ - Missing argument, a path that does **not exist**, or no identifier match → print the blocked block (part 3), then STOP. Never guess or auto-pick a task.
21
+
22
+ ### 2. Prerequisites
23
+
24
+ | Required for this skill | Where verified | Produced by |
25
+ | ----------------------- | ------------------------------------------------------------------------- | ---------------------------------- |
26
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:migration <description>` (dispatcher init) or mid-pipeline bootstrap |
27
+ | Target state locked | `target-planned` in `completed_phases` **and** `analysis/target-state-plan.md` exists | `/owflow:migration-target <task-path>` |
28
+
29
+ ### 3. Blocked output
30
+
31
+ 1. Steps that must be completed first (in order), each with its command:
32
+ - Target state planning (`target-planned`) → `/owflow:migration-target <task-path>`
33
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>` (if also missing)
34
+ - State initialization → `/owflow:migration <description>` (new task)
35
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
36
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
37
+
38
+ Then STOP — never guess or auto-pick a task.
39
+
40
+ ### 4. Missing-state bootstrap
41
+
42
+ When the only unmet prerequisite is the state file, use `question` — "No task exists at this path. Create a fresh standard migration task and start at `strategy-specified`?" with **Create task** / **Decline**.
43
+
44
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-spec (mid-pipeline bootstrap)"`, `orchestrator.started_phase: strategy-specified`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `analysis/target-state-plan.md` still blocks, so bootstrapping never skips upstream work.
45
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
46
+
47
+ ### 5. Skip/resume — artifacts before state
48
+
49
+ - `implementation/spec.md` **and** `analysis/rollback-plan.md` exist but `strategy-specified` is missing ⇒ **adopt**: append `strategy-specified`, backfill `migration_context.{rollback_plan_created, dual_run_configured}`, `phase_summaries.spec.summary`, and the `migration_outputs` paths where still null; run only the missing parts.
50
+ - `strategy-specified` is present but `implementation/spec.md` is missing ⇒ **drop** `strategy-specified` from `completed_phases` and re-run.
51
+ - `analysis/requirements.md` exists ⇒ adopt it and skip the requirement-questions part when it already covers the topics; `analysis/dual-run-plan.md` exists ⇒ `dual_run_configured: true`.
52
+ - Settled `rollback_plan_created` / `dual_run_configured` values are reported, not re-asked.
53
+
54
+ ### 6. Conditional activation
55
+
56
+ Not applicable — `migration-spec` has no activation condition; the dual-run plan's presence is content-dependent (decided in the requirement questions), not an activation gate.
57
+
58
+ ### 7. Recovery
59
+
60
+ | Step | Max Attempts | Strategy |
61
+ | ----------------------------------- | ------------ | -------------------------------------------------------------------------------------------- |
62
+ | Requirements | 2 | Re-gather in one consolidated question round |
63
+ | Specification (`strategy-specified`) | 2 | Re-invoke `specification-creator` with the missing mandated section explicitly demanded |
64
+ | Rollback/dual-run extraction | 2 | Re-extract verbatim from `implementation/spec.md`; if a mandated section is absent, re-run the delegation step |
65
+
66
+ ## Execute
67
+
68
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), then **read `references/migration-strategies.md`** (rollback-plan and dual-run-plan structures, strategy selection).
69
+
70
+ | Direction | Artifact | Producer |
71
+ | --------- | ------------------------------- | --------------------------------------------------------------- |
72
+ | Consumed | `analysis/target-state-plan.md` | `migration-target` (locked target, type, strategy) |
73
+ | Produced | `analysis/requirements.md` | inline `question` round (3–5 questions) |
74
+ | Produced | `implementation/spec.md` | `specification-creator` (**Task**, frozen contract) |
75
+ | Produced | `analysis/rollback-plan.md` | post-delegation verbatim extraction (always) |
76
+ | Produced | `analysis/dual-run-plan.md` | post-delegation verbatim extraction (when dual-run applies) |
77
+
78
+ ### Requirements, Specification & Extraction (`strategy-specified`)
79
+
80
+ 1. **Requirements gathering (inline)** — use `question` for 3–5 migration-specific questions: scope boundaries, rollback expectations and downtime tolerance, data-migration specifics, dual-run requirements, existing code/config to preserve. Frame as confirmable assumptions. Save to `analysis/requirements.md`.
81
+ 2. **Project-doc discovery (nothing persisted)** — read `.owflow/docs/INDEX.md` if present, collect the Project Documentation paths as `project_context_paths`, and pass them directly to the delegate. There is no `project_context` state key; do not write one (assumption 8).
82
+ 3. **Task tool — `specification-creator`** (frozen contract). Pass: `task_path`, `task_description`, `requirements_path` (`analysis/requirements.md`), `project_context_paths`, `migration_context.*` (type, current/target system, risk level, breaking changes), and relevant `phase_summaries`. The prompt **mandates** a `## Rollback Plan` section (always) and a `## Dual-Run Configuration` section (when dual-run applies) inside `implementation/spec.md`.
83
+ 4. **Post-delegation extraction — before the diagrams step**: as soon as the delegation returns, extract those sections **verbatim** from `implementation/spec.md` into `analysis/rollback-plan.md` (always) and `analysis/dual-run-plan.md` (when present). The standalone artifact is authoritative; the spec section becomes its summary. Never let the diagrams step run first.
84
+ 5. **Skill tool — `diagrams-mermaid`** (content-preserving) on `implementation/spec.md`: add a target-architecture and transition/compatibility visual as a supplement, never a replacement for strategy prose. Missing context → record open gaps instead of inventing systems.
85
+ 6. **State write**: append `strategy-specified` to `completed_phases`; set `migration_context.rollback_plan_created: true`, `migration_context.dual_run_configured: true/false`, `phase_summaries.spec.summary`, `migration_outputs.requirements`, `migration_outputs.spec`, `migration_outputs.rollback_plan` (+ `migration_outputs.dual_run_plan` when produced); bump `orchestrator.updated`. On failure: append `strategy-specified` to `failed_phases`, increment `auto_fix_attempts["strategy-specified"]`. Then re-read state + run `verify_template`.
86
+
87
+ ## State Update Convention (per step)
88
+
89
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`strategy-specified`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
90
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
91
+ 3. **Failures** — a failed or abandoned step is NOT appended to `completed_phases`; append its slug to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
92
+ 4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-migration.yml`. Fix any reported issue immediately.
93
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
94
+
95
+ ## Exit Gate
96
+
97
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
98
+
99
+ ### Results box
100
+
101
+ ```markdown
102
+ ## ✅ MIGRATION SPEC COMPLETE — <task name>
103
+
104
+ **Strategy** — [strategy from the locked target / spec]
105
+ **Scope** — [N included / M excluded]
106
+ **Rollback plan** — ✅ `analysis/rollback-plan.md` (standalone, authoritative)
107
+ **Dual-run** — [configured → `analysis/dual-run-plan.md` / not applicable]
108
+ **Diagrams** — [added / skipped (optional)]
109
+
110
+ **Artifacts**
111
+
112
+ - `analysis/requirements.md`
113
+ - `implementation/spec.md` (mandates the Rollback Plan / Dual-Run Configuration sections)
114
+ - `analysis/rollback-plan.md`
115
+ - `analysis/dual-run-plan.md` [conditional]
116
+ ```
117
+
118
+ ### Results-acceptance question
119
+
120
+ Use `question` — "Are these results correct?" with options:
121
+
122
+ - **Accept** — the specification and extracted plans are correct; continue.
123
+ - **Adjust** — re-run only the affected part (requirements, spec delegation, extraction, diagrams), update state and artifacts, re-present the results box.
124
+ - **Discuss** — walk through scope boundaries, the rollback approach, or the dual-run decision in more depth; then re-ask.
125
+ - **Stop here** — print the resume command (`/owflow:migration-spec <task-path>`) and end.
126
+
127
+ ### Next steps (after Accept)
128
+
129
+ - `→ /owflow:migration-plan <task-path>` — `required` next: breaks the approved spec into task groups, mandating a rollback/checkpoint step in every group. Remaining after: implement → verify (→ fix when needed) → finalize.
130
+
131
+ **Other options**:
132
+
133
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs all remaining phases in one loop (plan → implement → verify → fix when needed → finalize)
134
+
135
+ Then STOP.
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Purpose:** Pattern guide for migration execution strategies (incremental, rollback, dual-run)
6
6
 
7
- This reference provides decision criteria and implementation patterns for the three core migration strategies supported by the migration orchestrator.
7
+ This reference provides decision criteria and implementation patterns for the three core migration strategies supported by the migration workflow.
8
8
 
9
9
  ---
10
10
 
@@ -21,7 +21,7 @@ This reference provides decision criteria and implementation patterns for the th
21
21
 
22
22
  ## Overview
23
23
 
24
- Migration strategies define **how** to execute the transition from current to target state. The migration orchestrator supports three core strategies, which can be combined:
24
+ Migration strategies define **how** to execute the transition from current to target state. The migration workflow supports three core strategies, which can be combined:
25
25
 
26
26
  | Strategy | Purpose | Risk Level | Use When |
27
27
  | --------------- | --------------------------------------- | ----------- | -------------------------------------------- |
@@ -155,7 +155,7 @@ If success: Continue to Phase 2
155
155
 
156
156
  ### Implementation Pattern
157
157
 
158
- **Rollback Plan Structure** (`planning/rollback-plan.md`):
158
+ **Rollback Plan Structure** (`analysis/rollback-plan.md`):
159
159
 
160
160
  ```markdown
161
161
  # Rollback Plan: [Migration Name]
@@ -273,7 +273,7 @@ Old System (100% traffic) → Dual-Run (Old + New in parallel) → New System (1
273
273
  - Keep old system running for 7-30 days (rollback safety net)
274
274
  - After validation period, decommission old system
275
275
 
276
- **Dual-Run Plan Structure** (`planning/dual-run-plan.md`):
276
+ **Dual-Run Plan Structure** (`analysis/dual-run-plan.md`):
277
277
 
278
278
  ```markdown
279
279
  # Dual-Run Plan: [Migration Name]
@@ -422,9 +422,9 @@ Phase 5: Decommission MySQL
422
422
  4. **Combine strategies** based on risk, scope, and requirements
423
423
  5. **Document procedures** before executing migration
424
424
 
425
- **References in SKILL.md**:
425
+ **Read by**:
426
426
 
427
- - Phase 2 (Specification): Select migration strategy
428
- - Phase 3 (Planning): Structure implementation plan by strategy
429
- - Phase 4 (Execution): Execute according to selected strategy
430
- - Phase 5 (Verification): Test rollback procedures (non-destructive)
427
+ - `migration-spec`: select the migration strategy and produce the rollback/dual-run plans
428
+ - `migration-plan`: structure the implementation plan by strategy (per-task-group rollback steps)
429
+ - `migration-implement`: execute according to the selected strategy
430
+ - `migration-verify`: test rollback procedures non-destructively and run the compatibility checks
@@ -0,0 +1,134 @@
1
+ ---
2
+ name: owflow:migration-target
3
+ description: Migration — plans the target state and gap inventory, classifies the migration type, recommends a strategy, and records external research. Owns the risk-lock boundary (target-planned).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Target — Target State, Type & Risk Lock (target-planned)
9
+
10
+ Work phase of the migration workflow. Delegates the gap inventory to the reused `gap-analyzer` agent, then authors type classification and strategy recommendation inline from `references/migration-types.md`. The Exit Gate locks target, type, strategy, and breaking changes for the rest of the pipeline — downstream skills treat them as frozen.
11
+
12
+ ## Entry Gate
13
+
14
+ ### 1. Argument resolution
15
+
16
+ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
17
+
18
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
19
+ - **Identifier** — exact directory name inside `.owflow/tasks/migrations/` (e.g., `2026-01-12-framework-upgrade`); resolve to its path.
20
+ - Missing argument, a path that does **not exist**, or no identifier match → print the blocked block (part 3), then STOP. Never guess or auto-pick a task.
21
+
22
+ ### 2. Prerequisites
23
+
24
+ | Required for this skill | Where verified | Produced by |
25
+ | ----------------------- | --------------------------------------------------------------------------- | ------------------------------------ |
26
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:migration <description>` (dispatcher init) or mid-pipeline bootstrap |
27
+ | Current state analysed | `state-analysed` in `completed_phases` **and** `analysis/current-state-analysis.md` exists | `/owflow:migration-analyze <task-path>` |
28
+
29
+ ### 3. Blocked output
30
+
31
+ 1. Steps that must be completed first (in order), each with its command:
32
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>`
33
+ - State initialization → `/owflow:migration <description>` (new task)
34
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
35
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
36
+
37
+ Then STOP — never guess or auto-pick a task.
38
+
39
+ ### 4. Missing-state bootstrap
40
+
41
+ When the only unmet prerequisite is the state file, use `question` — "No task exists at this path. Create a fresh standard migration task and start at `target-planned`?" with **Create task** / **Decline**.
42
+
43
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-target (mid-pipeline bootstrap)"`, `orchestrator.started_phase: target-planned`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `analysis/current-state-analysis.md` still blocks, so bootstrapping never skips upstream work.
44
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
45
+
46
+ ### 5. Skip/resume — artifacts before state
47
+
48
+ - `analysis/target-state-plan.md` exists but `target-planned` is missing ⇒ **adopt**: append `target-planned`, backfill `migration_context.{migration_type, target_system, risk_level, breaking_changes}`, `external_research.*`, `phase_summaries.target.summary`, and `migration_outputs.target_state_plan` where still null.
49
+ - `target-planned` is present but `analysis/target-state-plan.md` is missing ⇒ **drop** `target-planned` from `completed_phases` and re-run.
50
+ - Both artifact and slug exist ⇒ report the existing type/strategy/risk decision and route to the Exit Gate; do not re-ask a settled type.
51
+ - The template placeholder `"code | data | architecture | general"` is NOT a settled type — only a real classification or a dispatcher `--type` value is.
52
+
53
+ ### 6. Conditional activation
54
+
55
+ Not applicable — `migration-target` has no activation condition; it runs whenever its prerequisites are met.
56
+
57
+ ### 7. Recovery
58
+
59
+ | Step | Max Attempts | Strategy |
60
+ | ------------------------- | ------------ | ------------------------------------------------------------------------------------ |
61
+ | Target planning (`target-planned`) | 2 | Re-prompt for target details; re-run the gap inventory with the clarified target |
62
+ | Type confirmation | 1 | Present the detected type with its keyword evidence; fall back to the user's choice |
63
+ | External research | 1 | Retry with narrower queries; on failure record `external_research.performed: false` and continue — research never blocks |
64
+
65
+ ## Execute
66
+
67
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), then **read `references/migration-types.md`** (type detection with confidence, per-type research table, per-type verification focus).
68
+
69
+ **Flags** (documented here because `argument-hint` is not registered): `--type=code|data|architecture|general` is a **default, not an override** — detection still runs and low confidence still asks for confirmation; `--no-web-research` skips the research step and records `external_research.performed: false` truthfully.
70
+
71
+ | Direction | Artifact | Producer |
72
+ | --------- | ---------------------------- | --------------------------------------------------------------- |
73
+ | Consumed | `analysis/current-state-analysis.md` | `migration-analyze` |
74
+ | Produced | `analysis/target-state-plan.md` | `gap-analyzer` (**Task**) + inline path normalization and type/strategy content |
75
+
76
+ ### Target Planning, Type & Risk Lock (`target-planned`)
77
+
78
+ > **ANTI-PATTERN — never author the gap inventory inline. The gap analysis is delegated; the inline content is only type classification, strategy recommendation, and the research record.**
79
+
80
+ 1. **Task tool — `gap-analyzer`** (frozen contract, gap inventory only). Pass: `task_path`, current-state summary, target description (`task.description` + clarifications), and constraints. The agent hard-codes its output as `analysis/gap-analysis.md`.
81
+ 2. **Normalize the path**: after the agent returns, rename/move its output to the declared artifact `analysis/target-state-plan.md`.
82
+ 3. **Type classification** (inline): run the keyword/confidence algorithm from `references/migration-types.md` against the migration description. A dispatcher `--type` value is the starting default, never an override. When confidence < 100% (or the default is ambiguous), use `question` with the detected type and evidence to confirm/adjust. Write `migration_context.migration_type`.
83
+ 4. **Strategy recommendation** (inline): pick incremental / big-bang / dual-run / phased with the reference decision tree; the rationale belongs in `phase_summaries.target.summary` and the plan artifact — the vestigial `migration_strategy` block stays unwritten.
84
+ 5. **External research** (unless `--no-web-research`): WebSearch per the per-type research table. Record `external_research.performed`, `.category`, `.breaking_changes`, `.migration_guide_url` — `migration-target` is the declared single writer of the `external_research.*` block. On a deliberate skip record `performed: false` — never leave the block implying research that did not happen.
85
+ 6. **State write**: append `target-planned` to `completed_phases`; set `migration_context.target_system.description`, `migration_context.target_system.technologies`, `migration_context.risk_level`, `migration_context.breaking_changes`, `external_research.performed`, `external_research.category`, `external_research.breaking_changes`, `external_research.migration_guide_url`, `phase_summaries.target.summary`, `migration_outputs.target_state_plan`; bump `orchestrator.updated`. On failure: append `target-planned` to `failed_phases`, increment `auto_fix_attempts["target-planned"]`. Then re-read state + run `verify_template`.
86
+
87
+ ## State Update Convention (per step)
88
+
89
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`target-planned`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
90
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
91
+ 3. **Failures** — a failed or abandoned step is NOT appended to `completed_phases`; append its slug to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
92
+ 4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-migration.yml`. Fix any reported issue immediately.
93
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
94
+
95
+ ## Exit Gate
96
+
97
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
98
+
99
+ ### Results box
100
+
101
+ ```markdown
102
+ ## ✅ MIGRATION TARGET COMPLETE — <task name>
103
+
104
+ **Target system** — [1-line summary from state]
105
+ **Migration type** — [code / data / architecture / general] ([confidence] / user-confirmed / `--type` default)
106
+ **Strategy** — [incremental / big-bang / dual-run / phased] — [1-line rationale]
107
+ **Risk level** — [low / medium / high] ([N] breaking changes; ⚠ high requires rollback + compatibility testing)
108
+ **External research** — [performed: N queries / skipped (`--no-web-research`)]
109
+
110
+ 🔒 **Risk lock** — target system, migration type, strategy, and breaking changes are LOCKED at this gate; changing any of them routes back through `/owflow:migration-target`.
111
+
112
+ **Artifacts**
113
+
114
+ - `analysis/target-state-plan.md`
115
+ ```
116
+
117
+ ### Results-acceptance question
118
+
119
+ Use `question` — "Are these results correct?" with options:
120
+
121
+ - **Accept** — the locked target is correct; continue.
122
+ - **Adjust** — re-run only the affected part (gap inventory, type, strategy, or research), update state and artifact, re-present the results box.
123
+ - **Discuss** — walk through the type evidence, strategy rationale, or risk assessment in more depth; then re-ask.
124
+ - **Stop here** — print the resume command (`/owflow:migration-target <task-path>`) and end.
125
+
126
+ ### Next steps (after Accept)
127
+
128
+ - `→ /owflow:migration-spec <task-path>` — `required` next: gathers requirements, produces the specification with mandated rollback/dual-run sections, and extracts the standalone plans. Remaining after: plan → implement → verify (→ fix when needed) → finalize.
129
+
130
+ **Other options**:
131
+
132
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs all remaining phases in one loop (spec → plan → implement → verify → fix when needed → finalize)
133
+
134
+ Then STOP.
@@ -4,7 +4,7 @@
4
4
 
5
5
  **Purpose:** Pattern guide for the three migration types: Code, Data, and Architecture
6
6
 
7
- This reference provides characteristics, detection patterns, and workflow adaptations for each migration type supported by the migration orchestrator.
7
+ This reference provides characteristics, detection patterns, and workflow adaptations for each migration type supported by the migration workflow.
8
8
 
9
9
  ---
10
10
 
@@ -91,27 +91,27 @@ Different types require different:
91
91
 
92
92
  ### Workflow Adaptations
93
93
 
94
- **Phase 1 (Current State Analysis)**:
94
+ **`migration-analyze` (Current State Analysis)**:
95
95
 
96
96
  - Focus: Locate all source files using old framework/library
97
97
  - Analyze: Dependency tree, API usage patterns, deprecated features used
98
98
 
99
- **Phase 2 (Target State Planning)**:
99
+ **`migration-target` (Target State Planning)**:
100
100
 
101
101
  - Focus: Breaking changes between versions, API equivalents
102
102
  - Output: Breaking changes list, API migration map
103
103
 
104
- **Phase 3 (Specification)**:
104
+ **`migration-spec` (Specification)**:
105
105
 
106
106
  - Include: Compatibility shim requirements (if needed)
107
107
  - Rollback: Simple (revert code via git)
108
108
 
109
- **Phase 5 (Execution)**:
109
+ **`migration-implement` (Execution)**:
110
110
 
111
111
  - Strategy: Incremental (by module/component)
112
112
  - Testing: Functional tests per module
113
113
 
114
- **Phase 6 (Verification)**:
114
+ **`migration-verify` (Verification)**:
115
115
 
116
116
  - Focus: Functional equivalence (behavior unchanged)
117
117
  - Tests: Full test suite, manual testing of critical flows
@@ -176,28 +176,28 @@ Different types require different:
176
176
 
177
177
  ### Workflow Adaptations
178
178
 
179
- **Phase 1 (Current State Analysis)**:
179
+ **`migration-analyze` (Current State Analysis)**:
180
180
 
181
181
  - Focus: Database schema, row counts, data volume, stored procedures
182
182
  - Analyze: Data relationships, foreign keys, indexes, constraints
183
183
 
184
- **Phase 2 (Target State Planning)**:
184
+ **`migration-target` (Target State Planning)**:
185
185
 
186
186
  - Focus: Data transformation requirements, data mapping (old → new schema)
187
187
  - Output: Data transformation specification, estimated migration time
188
188
 
189
- **Phase 3 (Specification)**:
189
+ **`migration-spec` (Specification)**:
190
190
 
191
191
  - Include: Data validation procedures, integrity checks, rollback procedures
192
192
  - Rollback: Complex (requires backup/restore strategies)
193
193
  - Dual-Run: Often required (zero-downtime)
194
194
 
195
- **Phase 5 (Execution)**:
195
+ **`migration-implement` (Execution)**:
196
196
 
197
197
  - Strategy: Incremental + Dual-Run (high confidence in strategy choice)
198
198
  - Testing: Data integrity checks after each batch
199
199
 
200
- **Phase 6 (Verification)**:
200
+ **`migration-verify` (Verification)**:
201
201
 
202
202
  - Focus: Data integrity (100% row count match, checksums, data validation)
203
203
  - Tests: Full test suite + data integrity tests + performance benchmarks
@@ -271,28 +271,28 @@ Different types require different:
271
271
 
272
272
  ### Workflow Adaptations
273
273
 
274
- **Phase 1 (Current State Analysis)**:
274
+ **`migration-analyze` (Current State Analysis)**:
275
275
 
276
276
  - Focus: System components, communication patterns, dependencies between components
277
277
  - Analyze: Coupling/cohesion, service boundaries, data flow
278
278
 
279
- **Phase 2 (Target State Planning)**:
279
+ **`migration-target` (Target State Planning)**:
280
280
 
281
281
  - Focus: New architecture structure, component boundaries, communication patterns
282
282
  - Output: Architecture diagram, component mapping (old → new)
283
283
 
284
- **Phase 3 (Specification)**:
284
+ **`migration-spec` (Specification)**:
285
285
 
286
286
  - Include: Strangler fig pattern (if applicable), component interaction diagrams
287
287
  - Rollback: Moderate to complex (depends on dual-run feasibility)
288
288
  - Dual-Run: Often required (old and new architectures in parallel)
289
289
 
290
- **Phase 5 (Execution)**:
290
+ **`migration-implement` (Execution)**:
291
291
 
292
292
  - Strategy: Incremental (by component/service) + Dual-Run (if possible)
293
293
  - Testing: Integration tests, end-to-end tests, performance tests
294
294
 
295
- **Phase 6 (Verification)**:
295
+ **`migration-verify` (Verification)**:
296
296
 
297
297
  - Focus: System-level behavior (end-to-end flows work), performance comparison
298
298
  - Tests: Full test suite + integration tests + E2E tests
@@ -333,7 +333,7 @@ Different types require different:
333
333
 
334
334
  ### Workflow Adaptations
335
335
 
336
- **Phase 1-2 (Analysis + Planning)**:
336
+ **`migration-analyze` → `migration-target` (Analysis + Target Planning)**:
337
337
 
338
338
  - Spend extra time clarifying scope
339
339
  - Prompt user to specify what's changing (code, data, architecture, or all)
@@ -423,7 +423,7 @@ Terms: "refactor to", "architecture", "pattern", "system design", "restructure"
423
423
 
424
424
  ## Web Research Requirements by Type
425
425
 
426
- External research is automatically triggered by the gap-analyzer during Phase 2 (Target State Planning). The level of research depends on migration type.
426
+ External research runs inline in `migration-target` — the `gap-analyzer` agent performs the gap inventory only and has no web access. The level of research depends on migration type, and the outcome is recorded in `external_research.*` (including `performed: false` when skipped).
427
427
 
428
428
  | Migration Type | External Research | Query Focus | Priority Sources |
429
429
  | -------------------------- | ----------------- | ------------------------------------------------- | ------------------------------------------------- |
@@ -482,9 +482,8 @@ External research is automatically triggered by the gap-analyzer during Phase 2
482
482
  3. **Architecture**: Focus on system-level behavior, strangler fig pattern, high risk
483
483
  4. **General**: Conservative defaults, extra clarification with user
484
484
 
485
- **References in SKILL.md**:
485
+ **Read by**:
486
486
 
487
- - Initialization (Step 2): Type detection algorithm
488
- - Phase 1 (Analysis): Type-specific analysis focus
489
- - Phase 2 (Target Planning): Type-specific gap analysis + external research
490
- - Phase 6 (Verification): Type-specific verification requirements
487
+ - `migration-target`: type detection algorithm (with confidence scoring), type-specific gap analysis, external research requirements
488
+ - `migration-analyze`: type-specific analysis focus
489
+ - `migration-verify`: type-specific verification requirements