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.
@@ -1,60 +1,98 @@
1
1
  ---
2
2
  name: owflow:migration
3
- description: Orchestrates the complete migration workflow from current state analysis through implementation to compatibility verification. Handles technology migrations, platform changes, and architecture pattern transitions with adaptive risk assessment, incremental execution, and rollback planning. Use when migrating technologies, platforms, or architecture patterns.
4
- argument-hint: "[task description]"
3
+ description: Migration workflow dispatcher. Initializes/resumes migration tasks, derives the next step from state, and hands off to the matching /owflow:migration-* subskill. Handles technology migrations, platform changes, and architecture pattern transitions with adaptive risk assessment, incremental execution, rollback planning, dual-run support, and compatibility verification.
4
+ argument-hint: "[task description | task-path] [--from=<slug>] [--type=TYPE] [--no-web-research]"
5
5
  user-invocable: true
6
6
  ---
7
7
 
8
- # Migration Orchestrator
8
+ # Migration Dispatcher
9
9
 
10
- Systematic migration workflow from current state analysis to verified migration with rollback capabilities.
10
+ Entry point for migration tasks in **assisted mode**: initialize (or resume) the task, derive the next pending step from `orchestrator-state.yml`, print the matching subskill command, and STOP. Each `/owflow:migration-*` subskill runs its steps with fresh context — the explicit invocation IS the step gate.
11
11
 
12
- Gates follow the shared contract in [Gate Contract](../orchestrator-framework/references/gate-contract.md).
12
+ Migration state uses descriptive step slugs in `completed_phases` / `failed_phases` / `auto_fix_attempts`: `state-analysed`, `target-planned`, `strategy-specified`, `plan-created`, `migration-executed`, `options-chosen`, `verification-done`, `issues-resolved`, `docs-generated`, `task-completed`. The routing table below maps slugs to subskills.
13
+
14
+ For the all-in-one loop with in-session `question` gates, use `/owflow:goal-migration`.
15
+
16
+ Gates follow the shared contract in the [Gate Contract](../orchestrator-framework/references/gate-contract.md), with the [dispatcher exception](../orchestrator-framework/references/gate-contract.md).
17
+
18
+ ## Input / Output Artifacts
19
+
20
+ | Artifact | Behavior |
21
+ | ------------------------------------- | ----------------------------------------------------------------------------------------- |
22
+ | Argument (description / task path) | migration description (new task) or task path/identifier (resume); nothing provided → ask |
23
+ | `orchestrator-state.yml` | read on resume — artifact-validated against the marker table below |
24
+ | Task directory + state initialization | written once (Step 3, new task) — `entry_point: "migration"`, flags recorded |
25
+ | Slugs, artifacts, and step bodies | none — every task artifact is produced by the subskills (see [Task Structure](#task-structure)) |
26
+
27
+ The dispatcher writes nothing else — it owns 0 slugs and contains no step bodies.
13
28
 
14
29
  ## Entry Gate
15
30
 
16
- **BEFORE executing any phase, you MUST complete these steps:**
31
+ **BEFORE deriving the handoff, complete these steps:**
32
+
33
+ ### Step 1: Load Framework Patterns
34
+
35
+ **Read the framework reference files NOW using the Read tool:**
17
36
 
18
- ### Argument resolution
37
+ 1. The [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md) governs this skill.
38
+ 2. The [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) bound what subskills delegate.
39
+ 3. The [Orchestrator Patterns](../orchestrator-framework/references/orchestrator-patterns.md) define state schema, initialization, and context passing.
19
40
 
20
- - **Migration description provided** → use it as the task description.
21
- - **Task path / identifier** (directory under `.owflow/tasks/migrations/`) → resume mode: read `orchestrator-state.yml`, find the first incomplete phase (`--from=PHASE` overrides), validate existing artifacts, then continue from there.
22
- - **Nothing provided** → ask via `question`: "What technology, platform, or architecture should be migrated, and to what?" — capture source and target state before proceeding.
41
+ ### Step 2: Resolve the Argument
23
42
 
24
- ### Prerequisites
43
+ **If the argument is a task path or identifier** (a directory, or a directory name under `.owflow/tasks/migrations/`) → **resume mode**:
25
44
 
26
- | Required for this skill | Where verified | Produced by |
27
- | ----------------------- | ----------------------------------------------------- | -------------------------- |
28
- | State file exists | `<task-path>/orchestrator-state.yml` (resume mode) | prior `/owflow:migration` run |
45
+ 1. Read `orchestrator-state.yml`; artifact-validate `completed_phases` against the marker table below — **drop** any slug whose marker is missing, **adopt** any marker whose slug is missing (append the slug, backfill still-null fields it proves were produced).
46
+ 2. Find the resume point: the FIRST step slug not in `completed_phases` whose routing-table condition holds. **Compatibility re-verification fallback**: if **no routing-table step applies** and `verification-done` is complete and `verification_context.compatibility_status != passed` (failed or null/invalidated), the resume point is `/owflow:migration-verify <task-path>` (re-verification — the 4 checks re-run and the verdict is settled), overriding slug completeness; a recorded data-integrity HALT keeps the user-confirmed rollback path dominant. `--from=<slug>` overrides, but only after validating that slug's prerequisites (the upstream slug **and** marker artifacts) exist **and** its row's state facts hold (e.g. no Finalize jump while `compatibility_status != passed`) — otherwise use `question`, never a silent jump.
47
+ 3. Missing state file → print: `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
29
48
 
30
- On resume, if the state file is missing → print: `No migration task found at <path>. Run /owflow:migration <description> to start from scratch.` and STOP. Validate expected artifacts for completed phases (remove entries with missing artifacts).
49
+ **If the argument is a migration description** (any other free text) → new task.
31
50
 
32
- ### Execution steps
51
+ **If nothing is provided** → ask via `question`: "What technology, platform, or architecture should be migrated, and to what?" — capture source and target state, then WAIT. Never guess or auto-pick a task.
33
52
 
34
- 1. **Load framework patterns** — Read `../orchestrator-framework/references/orchestrator-patterns.md` NOW: delegation rules, interactive mode, state schema, initialization, context passing, issue resolution.
35
- 2. **Initialize workflow:**
36
- 1. **Create Task Items**: Use `TaskCreate` for all phases (see Phase Configuration), then set dependencies with `TaskUpdate addBlockedBy`
37
- 2. **Create Task Directory**: `.owflow/tasks/migrations/YYYY-MM-DD-task-name/`
38
- 3. **Initialize State**: Create `orchestrator-state.yml` with migration context
39
- - **CRITICAL**: Use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-migration.yml`.
40
- 4. **Discover project documentation**: Read `.owflow/docs/INDEX.md` (if exists), extract ALL file paths from the "Project Documentation" section — includes predefined docs AND any user-added project docs. Store as `project_context.project_doc_paths` in state.
53
+ #### Marker table (artifact-validated resume)
54
+
55
+ | Slug | Marker artifact / state fact |
56
+ | -------------------- | ------------------------------------------------------------ |
57
+ | `state-analysed` | `analysis/current-state-analysis.md` **and** `analysis/clarifications.md` |
58
+ | `target-planned` | `analysis/target-state-plan.md` |
59
+ | `strategy-specified` | `implementation/spec.md` |
60
+ | `plan-created` | `implementation/implementation-plan.md` |
61
+ | `migration-executed` | `implementation/work-log.md` |
62
+ | `options-chosen` | settled `options.*` values (state-resident — no artifact) |
63
+ | `verification-done` | `verification/implementation-verification.md` + `verification/compatibility-test-results.md` **and** non-null `verification_context.compatibility_status` |
64
+ | `issues-resolved` | non-empty `verification_context.fixes_applied` **or** a recorded approval in `verification_context.decisions_made` (state-resident — no artifact) |
65
+ | `docs-generated` | `documentation/migration-guide.md` |
66
+ | `task-completed` | `task.status: completed` (state-resident — no artifact) |
67
+
68
+ A settled options value, a completed fix phase (non-empty `fixes_applied` or a recorded approval/deliberate skip), or a `--from` decision is not re-asked on resume: report the existing decision and route from it.
69
+
70
+ ### Step 3: Initialize (new task)
71
+
72
+ 1. **Create Task Directory**: `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` (3–5 kebab-case words from the description)
73
+ 2. **Initialize State**: create `orchestrator-state.yml` from the migration template.
74
+ - `task.title` / `task.description` from the description; `task.status: in_progress`; `task.tags: []`; `task.priority: null` (template defaults)
75
+ - `orchestrator.started_phase: state-analysed`; `orchestrator.entry_point: "migration"`; `orchestrator.task_path`; `orchestrator.created` / `orchestrator.updated`
76
+ - Flags: `--type=code|data|architecture|general` → `migration_context.migration_type` (a **default, not an override** — `migration-target` still confirms on low confidence); `--no-web-research` is a per-subskill flag forwarded to `migration-target` (skips external research; `migration-target` records `external_research.performed: false`) — nothing is persisted for it at init
77
+ - **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-migration.yml`.
78
+ 3. **Create Task Items**: use `TaskCreate` for the migration steps (one item per subskill handoff: analyze → target → spec → plan → implement → verify → fix → finalize), then set the execution order with `TaskUpdate addBlockedBy`. Record the ids in `orchestrator.task_ids`. On resume, refresh the already-evidenced items instead of re-creating them.
79
+ 4. No project-documentation discovery at this layer — `migration-spec` reads `.owflow/docs/INDEX.md` when it gathers requirements (nothing is persisted to a `project_context` key).
41
80
 
42
81
  **Output**:
43
82
 
44
83
  ```
45
- 🚀 Migration Orchestrator Started
84
+ 🚀 Migration Dispatcher
46
85
 
47
86
  Task: [migration description]
48
87
  Directory: [task-path]
49
-
50
- Starting Phase 1: Analyze current state...
88
+ Next step: [step name]
51
89
  ```
52
90
 
53
91
  ---
54
92
 
55
93
  ## When to Use
56
94
 
57
- Use for:
95
+ Use when:
58
96
 
59
97
  - Migrating from one framework/library to another (e.g., Vue 2 → Vue 3, Express → Fastify)
60
98
  - Changing database platforms (e.g., MySQL → PostgreSQL, MongoDB → DynamoDB)
@@ -83,279 +121,78 @@ Use for:
83
121
  | **Data** | database, schema, data migration | Dual-run (zero downtime) | Data integrity, checksums |
84
122
  | **Architecture** | REST→GraphQL, monolith→microservices | Dual-run or phased | Compatibility, rollback |
85
123
 
86
- ---
87
-
88
- ## Phase Configuration
89
-
90
- | Phase | content | activeForm | Agent/Skill |
91
- | ----- | ------------------------------------------------- | ------------------------------------------------------ | ----------------------------------------- |
92
- | 1 | "Analyze current state" | "Analyzing current state" | codebase-analyzer |
93
- | 2 | "Plan target state and gaps" | "Planning target state and gaps" | gap-analyzer |
94
- | 3 | "Gather requirements & create migration strategy" | "Gathering requirements & creating migration strategy" | Direct + specification-creator (subagent) |
95
- | 4 | "Plan implementation" | "Planning implementation" | implementation-planner (subagent) |
96
- | 5 | "Execute migration" | "Executing migration" | implementation-plan-executor |
97
- | 6 | "Verify and test compatibility" | "Verifying and testing compatibility" | implementation-verifier |
98
- | 7 | "Resolve verification issues" | "Resolving verification issues" | Direct (conditional) |
99
- | 8 | "Generate documentation" | "Generating documentation" | user-docs-generator (optional) |
100
-
101
- ---
102
-
103
- ## Workflow Phases
104
-
105
- ### Phase 1: Current State Analysis & Clarifications
106
-
107
- **Purpose**: Comprehensive analysis of current system before migration, followed by scope/requirements clarification
108
- **Execute**:
109
-
110
- 1. Skill tool - `codebase-analyzer`
111
- 2. Update state with analysis results
112
- 3. Direct - use question for max 5 critical clarifying questions about migration scope, target system, and constraints
113
- 4. Save clarifications to `analysis/clarifications.md`
114
- **Output**: `analysis/current-state-analysis.md`, `analysis/clarifications.md`
115
- **State**: Update task_context with current system info, `task_context.clarifications_resolved`
116
-
117
- → **AUTO-CONTINUE** — Do NOT end turn, do NOT prompt user. Proceed immediately to Phase 2.
118
-
119
- ---
120
-
121
- ### Phase 2: Target State Planning & Gap Analysis
122
-
123
- **Purpose**: Define target system and identify migration gaps
124
- **Execute**: Task tool - `gap-analyzer` subagent
125
- **Output**: `analysis/target-state-plan.md`
126
- **State**: Update `migration_context.migration_type`, `target_system`, `risk_level`, `breaking_changes`
127
-
128
- **Gap Analyzer Tasks**:
129
-
130
- 1. Define target system from migration description
131
- 2. Identify gaps (features to migrate, APIs to adapt, data to transform)
132
- 3. Classify migration type (code/data/architecture)
133
- 4. Recommend migration strategy (incremental/big-bang/dual-run/phased)
134
- 5. External research via WebSearch for version upgrades
135
-
136
- → Pause
137
-
138
- question - Display executive summary before asking. Extract from gap analysis: current system overview, target system, migration type classified, number of gaps identified, recommended strategy, risk level. Format as brief overview then "Continue to migration strategy?"
124
+ The type-detection algorithm (with confidence scoring), per-type adaptations, and the external-research requirement table live in `migration-target/references/migration-types.md` — read there, not here.
139
125
 
140
126
  ---
141
127
 
142
- ### Phase 3: Migration Requirements & Strategy Specification
143
-
144
- > **Phase gate**: Requires `question` confirmation from Phase 2 before executing.
145
-
146
- **Purpose**: Gather migration requirements, then create detailed migration specification with rollback procedures
147
- **Execute**:
148
-
149
- **Part A — Migration Requirements Gathering (inline)**:
150
-
151
- 1. Direct - use question for migration-specific requirements (3-5 questions):
152
- - Migration scope and boundaries (what's in/out of migration)
153
- - Rollback expectations and downtime tolerance
154
- - Data migration specifics (if data migration type)
155
- - Dual-run requirements (if applicable)
156
- - Existing code/config to preserve
157
- - Frame as confirmable assumptions: "I assume X, is that correct?"
158
- 2. Save gathered requirements to `analysis/requirements.md`
128
+ ## Routing Table (completed_phases → next subskill)
159
129
 
160
- **Part B — Specification Creation (subagent)**: 3. Task tool - `specification-creator` subagent
130
+ Derive the FIRST step slug not in `completed_phases` whose condition holds, then print the matching command:
161
131
 
162
- **Context to pass to subagent**: task_path, task_type (migration), task_description, requirements_path (analysis/requirements.md), project_context_paths (INDEX.md + project_doc_paths from state — all discovered project docs), migration_type, current_system, target_system, risk_level, breaking_changes, phase_summaries (current_state_analysis, gap_analysis)
132
+ | Next step (slugs) | Condition (from state) | Handoff command | Produces |
133
+ | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------- | ------------------------------------------------------------------------------------------------- |
134
+ | Analyze (`state-analysed`) | Always (new task or partial foundation) | `/owflow:migration-analyze <task-path>` | `analysis/current-state-analysis.md`, `analysis/clarifications.md` |
135
+ | Target (`target-planned`) | `state-analysed` completed | `/owflow:migration-target <task-path>` | `analysis/target-state-plan.md` (type/strategy locked by the risk gate) |
136
+ | Spec (`strategy-specified`) | `target-planned` completed | `/owflow:migration-spec <task-path>` | `analysis/requirements.md`, `implementation/spec.md`, `analysis/rollback-plan.md` (+ `analysis/dual-run-plan.md` when dual-run applies) |
137
+ | Plan (`plan-created`) | `strategy-specified` completed | `/owflow:migration-plan <task-path>` | `implementation/implementation-plan.md` with per-group rollback/checkpoint steps |
138
+ | Implement (`migration-executed`) | `plan-created` completed | `/owflow:migration-implement <task-path>` | implemented migration changes, `implementation/work-log.md` |
139
+ | Verify (`options-chosen`, `verification-done`) | `migration-executed` completed | `/owflow:migration-verify <task-path>` | `verification/implementation-verification.md`, `verification/compatibility-test-results.md` |
140
+ | Fix (`issues-resolved`) | `verification-done` completed **and** (`verification_context.compatibility_status = failed` **or** (`verification_context.last_status != passed` **and** no recorded deliberate skip)) | `/owflow:migration-fix <task-path>` | fixes + updated `verification/implementation-verification.md`; data-integrity HALT stays with the user |
141
+ | Finalize (`docs-generated`, `task-completed`) | `verification-done` completed **and** `verification_context.compatibility_status = passed` **and** the fix phase is settled (`issues-resolved` present, or `last_status = passed`, or a recorded deliberate skip) | `/owflow:migration-finalize <task-path>` | `documentation/migration-guide.md` (when `options.docs_enabled` is true), `task.status: completed` |
163
142
 
164
- **Output**: `analysis/requirements.md`, `implementation/spec.md`, `analysis/rollback-plan.md`, optionally `analysis/dual-run-plan.md`
165
- **State**: Update `rollback_plan_created`, `dual_run_configured`
143
+ Notes:
166
144
 
167
- **Part C — Diagram Refinement (Skill, content-preserving)**:
168
-
169
- 4. Invoke Skill tool: `diagrams-mermaid` to refine `implementation/spec.md`
170
- 5. Add migration-focused visuals (target architecture and transition/compatibility flow) as supplements, not replacements for strategy prose.
171
- 6. If minimum context is missing, record open gaps instead of inventing systems, protocols, or migration paths.
172
-
173
- → Pause
174
-
175
- question - Display executive summary before asking. Read `implementation/spec.md` and extract: migration strategy chosen, scope boundaries, rollback approach, breaking changes identified, key constraints. Format as brief overview then "Continue to implementation planning?"
145
+ - Each row's condition is re-read from state, never inferred: the Fix row activates on a failed compatibility check unconditionally, or on verifier issues without a recorded deliberate skip; the Finalize row requires `compatibility_status = passed` **and** a settled fix phase — a failed compatibility check is never waived by a skip or approval, so `task-completed` cannot be reached over one.
146
+ - **Compatibility re-verification fallback**: when no routing-table row applies **and** `verification-done` ∈ `completed_phases` **and** `compatibility_status != passed`, hand off to `/owflow:migration-verify <task-path>` (the re-verification re-runs the 4 checks and settles the verdict). The Fix row stays primary whenever its condition holds — an ordinary pre-fix failure routes to `/owflow:migration-fix`, never to a redundant check re-run; a recorded data-integrity HALT keeps the user-confirmed rollback path dominant.
147
+ - `task-completed` already in `completed_phases` → the task is TERMINAL: no handoff.
148
+ - Slugs that are already in `completed_phases` but whose marker artifact is missing are dropped during Step 2 — never trust a bare slug.
176
149
 
177
150
  ---
178
151
 
179
- ### Phase 4: Implementation Planning
180
-
181
- > **Phase gate**: Requires `question` confirmation from Phase 3 before executing.
182
-
183
- **Purpose**: Break migration into task groups with rollback steps
184
- **Execute**: Task tool - `implementation-planner` subagent
185
- **Output**: `implementation/implementation-plan.md` with rollback procedures
186
- **State**: Update task groups and dependencies
187
-
188
- **Context to pass to subagent**: task_path, task_type (migration), migration_type, task_description, phase_summaries (current_state_analysis, gap_analysis, specification)
189
-
190
- **Post-plan diagram refinement (Skill, content-preserving)**:
191
-
192
- - Invoke Skill tool: `diagrams-mermaid` for `implementation/implementation-plan.md`
193
- - Add one migration execution/state flow with rollback checkpoints.
194
- - Preserve written task steps and rollback details as source of truth.
195
-
196
- → Pause
197
-
198
- question - Display executive summary before asking. Read `implementation/implementation-plan.md` and extract: number of task groups, total steps, rollback steps included, key dependencies, execution sequence. Format as brief overview then "Continue to execute migration?"
199
-
200
- ---
201
-
202
- ### Phase 5: Migration Execution
203
-
204
- > **Phase gate**: Requires `question` confirmation from Phase 4 before executing.
205
-
206
- **Purpose**: Execute migration steps with incremental verification
207
-
208
- **ANTI-PATTERN — DO NOT DO THIS:**
209
-
210
- - ❌ "Let me implement this directly..." — STOP. Delegate to implementation-plan-executor.
211
- - ❌ "This migration is simple enough to code inline..." — STOP. Simplicity is NOT a reason to skip delegation.
212
-
213
- **INVOKE NOW** — Skill tool call:
214
-
215
- **Execute**: Skill tool - `implementation-plan-executor`
216
- **Output**: Implemented migration changes, `implementation/work-log.md`
217
- **State**: Update implementation progress, extract phase_summaries.implementation
218
-
219
- 📋 **Standards Reminder**: Review `.owflow/docs/INDEX.md` before implementing.
152
+ ## Exit Gate (adapted for dispatch mode)
220
153
 
221
- **SELF-CHECK**: Did you just invoke the Skill tool with `implementation-plan-executor`? Or did you start writing migration code yourself? If the latter, STOP immediately and invoke the Skill tool instead.
154
+ After deriving the handoff, present the results box, ask how to proceed, then hand off accordingly (see the [dispatcher exception](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the subskill.
222
155
 
223
- **⚠️ POST-IMPLEMENTATION CONTINUATION** — After the skill completes and returns control:
156
+ ### Results box
224
157
 
225
- 1. Read `orchestrator-state.yml` to confirm you are the orchestrator
226
- 2. Update state: add Phase 5 to `completed_phases`
227
- 3. Proceed to Phase 6
228
-
229
- → Pause
230
-
231
- question - Display executive summary before asking. Extract from `phase_summaries.implementation` and `implementation/work-log.md`: migration steps completed, files changed, test results, rollback readiness status. Format as brief overview then "Continue to verification?"
232
-
233
- ---
234
-
235
- ### Phase 6: Verification + Compatibility Testing
236
-
237
- > **Phase gate**: Requires `question` confirmation from Phase 5 before executing.
238
-
239
- **Purpose**: Verify migration success with compatibility and rollback testing
240
- **Execute**: Skill tool - `implementation-verifier`
241
- **Output**: `verification/implementation-verification.md`, `verification/compatibility-test-results.md`
242
- **State**: Update verification results
243
-
244
- **Migration-Specific Checks**:
245
-
246
- - Verify old system still works (if dual-run)
247
- - Test rollback procedures (non-destructive)
248
- - Validate data integrity (for data migrations)
249
- - Check performance benchmarks (before/after)
250
-
251
- **⚠️ POST-VERIFICATION CONTINUATION** — After the skill completes and returns control:
252
-
253
- 1. Read `orchestrator-state.yml` to confirm you are the orchestrator
254
- 2. Update state: add Phase 6 to `completed_phases`
255
- 3. Evaluate verdict: if PASS → Phase 8, if fixable issues → Phase 7, otherwise stop workflow
256
-
257
- → Pause
258
-
259
- question - Display executive summary before asking. Extract from verification results: overall verdict, issue counts by severity, compatibility test results, data integrity status, rollback test results. Format as detailed overview then "Continue to Phase [7 or 8]?"
260
-
261
- ---
262
-
263
- ### Phase 7: Migration Issue Resolution (Conditional)
264
-
265
- > **Phase gate**: Requires `question` confirmation from Phase 6 before executing.
266
-
267
- **Purpose**: Fix verification issues through direct editing and re-verification
268
- **Execute**: Direct - apply fixes, re-verify
269
- **Output**: Updated code, `verification_context.fixes_applied`
270
- **State**: Update `reverify_count`, `decisions_made`
271
-
272
- **Skip if**: verdict = PASS
273
-
274
- **Process**:
275
-
276
- 1. Display detailed issue breakdown grouped by category and severity, listing location, description, and fixability
277
- 2. Present all critical + warning issues as a numbered list
278
- 3. question — "Which issues should I fix?" with options: "Fix all fixable issues" / "Let me choose specific issues" / "Skip fixes, proceed as-is"
279
- 4. Fix selected issues
280
- 5. question — "Re-run verification to check fixes?" with options: "Yes, re-run verification" / "No, proceed to next phase"
281
- 6. If re-run → re-invoke `implementation-verifier` → return to Step 1
282
- 7. Max 3 iterations
283
-
284
- **Data Safety Critical**: HALT on any data integrity issue - never auto-fix data problems. Always present data issues to user with rollback option.
285
-
286
- **Exit Conditions**:
287
-
288
- - ✅ No critical issues remain → Proceed to Phase 8
289
- - ⚠️ Max iterations (3) reached → Ask user: proceed with warnings or rollback
290
- - ❌ Data integrity issues → HALT immediately, recommend rollback
291
-
292
- → Pause
293
-
294
- question - Display executive summary: total issues found, issues fixed, issues remaining by severity. Then "Continue to documentation?"
295
-
296
- ---
297
-
298
- ### Phase 8: Documentation → Exit Gate (Optional)
299
-
300
- > **Phase gate**: Requires `question` confirmation from the preceding phase before executing.
158
+ ```markdown
159
+ ## ✅ MIGRATION TASK READY — <task name>
301
160
 
302
- **Purpose**: Create migration guide (optional) and run the Exit Gate
303
- **Execute**: Task tool - `user-docs-generator` subagent (conditional) + Direct (Exit Gate)
304
- **Output**: `documentation/migration-guide.md` (conditional)
305
- **State**: Set documentation complete, then `task.status: completed`
161
+ **Task** — [migration description]
162
+ **Directory** — `<task-path>`
163
+ **Next step** — [step name]
164
+ [Resume note: completed steps / fresh task]
306
165
 
307
- **Skip if**: `options.docs_enabled = false`
166
+ **Next ▸** `/owflow:migration-<subskill> <task-path>`
167
+ ```
308
168
 
309
- **Documentation Covers**:
169
+ For a terminal task (`task-completed` recorded), the results box reports the workflow as complete and carries no **Next ▸** handoff line.
310
170
 
311
- - Migration overview and goals
312
- - Prerequisites and preparation steps
313
- - Step-by-step migration procedure
314
- - Rollback procedures
315
- - Troubleshooting common issues
171
+ ### Acceptance question
316
172
 
317
- **Results box** (present regardless of whether docs ran):
173
+ Use `question` — "Task ready. How would you like to proceed?" with options:
318
174
 
319
- ```markdown
320
- ## ✅ MIGRATION COMPLETE — <task name>
321
-
322
- **Migration type** — [code / data / architecture]
323
- **Strategy** — [incremental / big-bang / dual-run / phased]
324
- **Verification** — [final verdict]
325
- **Rollback plan** — [path / status]
326
- **Migration guide** — [path] / not generated
327
-
328
- **Artifacts**
329
- - `analysis/current-state-analysis.md`
330
- - `analysis/target-state-plan.md`
331
- - `analysis/rollback-plan.md`
332
- - `implementation/work-log.md`
333
- - `verification/implementation-verification.md`
334
- - `documentation/migration-guide.md` [conditional]
335
- ```
336
-
337
- **Results-acceptance question** — use `question` — "Are these results correct?" with options:
338
-
339
- - **Accept** — migration is complete; print next steps below.
340
- - **Adjust** — re-run the affected phase (fixes, re-verification, docs) with the user's corrections, then re-present the results box.
341
- - **Discuss** — walk through specific results (verification verdicts, rollback readiness, guide contents) in more depth; then re-ask.
175
+ - **Hand off to /owflow:migration-<subskill>** — the user invokes the suggested command (the dispatcher copies it to chat for convenience). Execution starts in a fresh context.
176
+ - **Switch to autonomous mode** — illustrate with `/owflow:goal-migration <task-path>` to run remaining steps in one session with gates.
177
+ - **Adjust** — task set-up is wrong (wrong flags, wrong description, wrong task); re-run the affected initialization step, re-present the results box.
342
178
  - **Stop here** — print the resume command (`/owflow:migration <task-path>`) and end.
343
179
 
344
- **Next steps (after Accept)**:
345
-
346
- - `/owflow:reviews-pragmatic <task-path>` — post-migration over-engineering check
347
- - `/owflow:standards-update "<lesson learned>"` — capture migration learnings as standards
348
- - Commit the changes and open a PR using the migration guide's procedures
180
+ For a terminal task, omit the first option (there is nothing to hand off) and report the completed workflow.
349
181
 
350
- → End of workflow
182
+ ### Handoff message
351
183
 
352
- ---
184
+ On Accept (hand off choice), print, then STOP:
353
185
 
354
- ## Domain Context (State Extensions)
186
+ ```
187
+ ✓ Migration task ready at <task-path>
355
188
 
356
- Migration-specific fields in `orchestrator-state.yml`:
189
+ Next step:
190
+ → /owflow:migration-<subskill> <task-path>
357
191
 
358
- Refer to the template [src/templates/orchestrator-state-migration.yml](../../templates/orchestrator-state-migration.yml).
192
+ Other options:
193
+ /owflow:goal-migration <task-path> — run remaining steps in one loop
194
+ /owflow:migration --from=<slug> <task-path> — jump to a specific step
195
+ ```
359
196
 
360
197
  ---
361
198
 
@@ -365,35 +202,57 @@ Refer to the template [src/templates/orchestrator-state-migration.yml](../../tem
365
202
  .owflow/tasks/migrations/YYYY-MM-DD-migration-name/
366
203
  ├── orchestrator-state.yml
367
204
  ├── analysis/
368
- │ ├── current-state-analysis.md # Phase 1
369
- │ ├── target-state-plan.md # Phase 2
370
- │ ├── requirements.md # Phase 3
371
- │ ├── rollback-plan.md # Phase 3
372
- │ └── dual-run-plan.md # Phase 3 (if dual-run)
205
+ │ ├── current-state-analysis.md # migration-analyze
206
+ │ ├── clarifications.md # migration-analyze
207
+ │ ├── target-state-plan.md # migration-target
208
+ │ ├── requirements.md # migration-spec
209
+ │ ├── rollback-plan.md # migration-spec
210
+ │ └── dual-run-plan.md # migration-spec (if dual-run)
373
211
  ├── implementation/
374
- │ ├── spec.md # Phase 3
375
- │ ├── implementation-plan.md # Phase 4
376
- │ └── work-log.md # Phase 5
212
+ │ ├── spec.md # migration-spec
213
+ │ ├── implementation-plan.md # migration-plan
214
+ │ └── work-log.md # migration-implement
377
215
  ├── verification/
378
- │ ├── implementation-verification.md # Phase 6
379
- │ └── compatibility-test-results.md # Phase 6
216
+ │ ├── implementation-verification.md # migration-verify
217
+ │ └── compatibility-test-results.md # migration-verify
380
218
  └── documentation/
381
- └── migration-guide.md # Phase 8 (optional)
219
+ └── migration-guide.md # migration-finalize (optional)
382
220
  ```
383
221
 
384
222
  ---
385
223
 
224
+ ## Domain Context (State Extensions)
225
+
226
+ Migration-specific fields in `orchestrator-state.yml`: refer to the template [src/templates/orchestrator-state-migration.yml](../../templates/orchestrator-state-migration.yml).
227
+
228
+ ---
229
+
386
230
  ## Auto-Recovery
387
231
 
388
- | Phase | Max Attempts | Strategy |
389
- | ----- | ------------ | --------------------------------------------------------------------------------- |
390
- | 1 | 2 | Expand search patterns, prompt user for file paths |
391
- | 2 | 2 | Re-prompt for target details |
392
- | 3 | 2 | Re-gather requirements, re-invoke spec-creator subagent, regenerate rollback plan |
393
- | 4 | 2 | Regenerate with migration constraints |
394
- | 5 | 5 | Fix syntax errors, prompt user on repeated failure |
395
- | 6 | 3 | Fix-then-reverify. **HALT on data integrity issues** |
396
- | 8 | 1 | Generate text-only without screenshots |
232
+ Retries are owned by each subskill (max attempts per step):
233
+
234
+ | Subskill | Max Attempts | Strategy |
235
+ | ------------------- | ------------ | --------------------------------------------------------------------------------- |
236
+ | migration-analyze | 2 | Expand search patterns, prompt the user for file paths |
237
+ | migration-target | 2 | Re-prompt for target details |
238
+ | migration-spec | 2 | Re-gather requirements, re-invoke spec-creator, regenerate rollback plan |
239
+ | migration-plan | 2 | Regenerate with migration constraints |
240
+ | migration-implement | 5 | Fix syntax errors, prompt user on repeated failure |
241
+ | migration-verify | 3 | Fix-then-reverify. **HALT on data integrity issues** |
242
+ | migration-fix | 3 iterations | Contract, not a retry counter; data-integrity HALT is never auto-fixed |
243
+ | migration-finalize | 1 | Generate the operator guide text-only; state-only completion |
244
+
245
+ ---
246
+
247
+ ## Command Flags
248
+
249
+ Flags are restated here because `argument-hint` is not registered in the command object.
250
+
251
+ | Flag | Effect |
252
+ | --------------------------------- | ------------------------------------------------------------------------------------------------------------- |
253
+ | `--from=<slug>` | Hand off (resume mode) from a specific step slug; prerequisites are validated, otherwise `question` |
254
+ | `--type=code\|data\|architecture\|general` | Default classification → `migration_context.migration_type` (not an override — low confidence still confirms) |
255
+ | `--no-web-research` | Forwarded to `migration-target`: skips external research and records `external_research.performed: false` (no state key is written at init — the flag is per-invocation) |
397
256
 
398
257
  ---
399
258
 
@@ -401,7 +260,9 @@ Refer to the template [src/templates/orchestrator-state-migration.yml](../../tem
401
260
 
402
261
  Invoked via:
403
262
 
404
- - `/owflow:migration [description] [--type=TYPE]` (new)
405
- - `/owflow:migration [task-path] [--from=PHASE]` (resume)
263
+ - `/owflow:migration [description] [--type=TYPE] [--no-web-research]` (new)
264
+ - `/owflow:migration [task-path] [--from=<slug>]` (resume)
265
+
266
+ Alternative: `/owflow:goal-migration` — same task lifecycle, all subskills invoked in one session with `question` gates.
406
267
 
407
268
  Task directory: `.owflow/tasks/migrations/YYYY-MM-DD-task-name/`