owflow 0.4.2 → 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.
Files changed (79) hide show
  1. package/README.md +6 -2
  2. package/dist/agents/implementation-planner.md +1 -1
  3. package/dist/agents/information-gatherer.md +691 -691
  4. package/dist/agents/research-planner.md +450 -450
  5. package/dist/agents/research-synthesizer.md +403 -403
  6. package/dist/agents/solution-brainstormer.md +257 -257
  7. package/dist/agents/solution-designer.md +372 -372
  8. package/dist/agents/specification-creator.md +1 -1
  9. package/dist/commands/work.md +9 -9
  10. package/dist/configuration/commands-config.js +57 -0
  11. package/dist/skills/codebase-analyzer/SKILL.md +4 -4
  12. package/dist/skills/dev-verify/SKILL.md +3 -10
  13. package/dist/skills/diagrams-mermaid/SKILL.md +1 -0
  14. package/dist/skills/diagrams-mermaid/references/reference.md +4 -4
  15. package/dist/skills/flow-init/SKILL.md +1 -1
  16. package/dist/skills/goal-migration/SKILL.md +114 -0
  17. package/dist/skills/goal-research/SKILL.md +118 -118
  18. package/dist/skills/html-renderer/SKILL.md +1 -0
  19. package/dist/skills/migration/SKILL.md +157 -295
  20. package/dist/skills/migration-analyze/SKILL.md +126 -0
  21. package/dist/skills/migration-finalize/SKILL.md +161 -0
  22. package/dist/skills/migration-fix/SKILL.md +155 -0
  23. package/dist/skills/migration-implement/SKILL.md +131 -0
  24. package/dist/skills/migration-plan/SKILL.md +131 -0
  25. package/dist/skills/migration-spec/SKILL.md +135 -0
  26. package/dist/skills/{migration → migration-spec}/references/migration-strategies.md +9 -9
  27. package/dist/skills/migration-target/SKILL.md +134 -0
  28. package/dist/skills/{migration → migration-target}/references/migration-types.md +22 -23
  29. package/dist/skills/migration-verify/SKILL.md +184 -0
  30. package/dist/skills/orchestrator-framework/references/command-namespacing.md +1 -1
  31. package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +1 -1
  32. package/dist/skills/orchestrator-framework/references/fix-loop-contract.md +65 -0
  33. package/dist/skills/orchestrator-framework/references/gate-contract.md +117 -112
  34. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +4 -1
  35. package/dist/skills/performance/SKILL.md +1 -0
  36. package/dist/skills/research/SKILL.md +249 -249
  37. package/dist/skills/research-brainstorm/SKILL.md +120 -120
  38. package/dist/skills/research-converge/SKILL.md +130 -130
  39. package/dist/skills/research-design/SKILL.md +146 -146
  40. package/dist/skills/research-finalize/SKILL.md +125 -125
  41. package/dist/skills/research-fork/SKILL.md +190 -190
  42. package/dist/skills/research-gather/SKILL.md +133 -133
  43. package/dist/skills/research-plan/SKILL.md +141 -141
  44. package/dist/skills/research-quick/SKILL.md +139 -139
  45. package/dist/skills/research-synthesize/SKILL.md +127 -127
  46. package/dist/skills/rule-reviewer/SKILL.md +1 -1
  47. package/dist/skills/standards-discover/SKILL.md +1 -0
  48. package/dist/templates/orchestrator-state-migration.yml +49 -9
  49. package/package.json +1 -1
  50. package/dist/commands/agents-md-generator.md +0 -36
  51. package/dist/commands/dev-analyze.md +0 -33
  52. package/dist/commands/dev-bugfix.md +0 -37
  53. package/dist/commands/dev-finalize.md +0 -33
  54. package/dist/commands/dev-implement.md +0 -34
  55. package/dist/commands/dev-plan.md +0 -37
  56. package/dist/commands/dev-spec.md +0 -37
  57. package/dist/commands/dev-tdd-red.md +0 -33
  58. package/dist/commands/dev-verify.md +0 -33
  59. package/dist/commands/development.md +0 -36
  60. package/dist/commands/diagrams-mermaid.md +0 -36
  61. package/dist/commands/flow-init.md +0 -36
  62. package/dist/commands/goal-development.md +0 -32
  63. package/dist/commands/goal-research.md +0 -33
  64. package/dist/commands/html-renderer.md +0 -36
  65. package/dist/commands/migration.md +0 -36
  66. package/dist/commands/performance.md +0 -36
  67. package/dist/commands/research-brainstorm.md +0 -33
  68. package/dist/commands/research-converge.md +0 -33
  69. package/dist/commands/research-design.md +0 -33
  70. package/dist/commands/research-finalize.md +0 -33
  71. package/dist/commands/research-fork.md +0 -40
  72. package/dist/commands/research-gather.md +0 -33
  73. package/dist/commands/research-plan.md +0 -37
  74. package/dist/commands/research-quick.md +0 -37
  75. package/dist/commands/research-synthesize.md +0 -33
  76. package/dist/commands/research.md +0 -55
  77. package/dist/commands/rule-reviewer.md +0 -38
  78. package/dist/commands/standards-discover.md +0 -36
  79. package/dist/commands/standards-update.md +0 -36
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: owflow:migration-analyze
3
+ description: Migration — analyzes the current system and resolves migration-scoped clarifications. First work phase of the migration workflow (state-analysed).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Analyze — Current State & Clarifications (state-analysed)
9
+
10
+ Work phase of the migration workflow. Runs current-system analysis via the reused `codebase-analyzer` engine, then resolves migration-scoped clarifications. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
11
+
12
+ Assisted entry point: `/owflow:migration` (dispatcher). Autonomous: `/owflow:goal-migration` (wrapper). Both produce the same state; the modes can be mixed freely.
13
+
14
+ ## Entry Gate
15
+
16
+ ### 1. Argument resolution
17
+
18
+ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
19
+
20
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
21
+ - **Identifier** — exact directory name inside `.owflow/tasks/migrations/` (e.g., `2026-01-12-framework-upgrade`); resolve to its path.
22
+ - 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.
23
+
24
+ ### 2. Prerequisites
25
+
26
+ | Required for this skill | Where verified | Produced by |
27
+ | ----------------------- | ---------------------------------- | ------------------------------------------------------------ |
28
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:migration <description>` (dispatcher init) or mid-pipeline bootstrap |
29
+
30
+ No upstream migration slug is required — this is the pipeline's first work phase.
31
+
32
+ ### 3. Blocked output
33
+
34
+ 1. Steps that must be completed first (in order): **none** — `migration-analyze` is the first work phase. If no task exists yet, initialize one with `/owflow:migration <description>`.
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 `state-analysed`?" 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-analyze (mid-pipeline bootstrap)"`, `orchestrator.started_phase: state-analysed`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — never upstream artifacts.
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
+ - `analysis/current-state-analysis.md` exists but `state-analysed` is missing ⇒ **adopt**: append `state-analysed`, backfill `migration_context.current_system`, `migration_context.clarifications_resolved`, `phase_summaries.analyze.summary`, and both `migration_outputs` paths where still null; run only the missing clarifications part.
50
+ - `state-analysed` is present but `analysis/current-state-analysis.md` **or** `analysis/clarifications.md` is missing ⇒ **drop** `state-analysed` from `completed_phases` and re-run only the missing part (re-adopt the existing analysis when it is present; never redo the analysis needlessly).
51
+ - Both artifacts exist and the slug is present ⇒ report the existing results and route to the Exit Gate.
52
+ - `migration_context.clarifications_resolved` is already non-null ⇒ report the existing clarifications instead of re-asking.
53
+
54
+ ### 6. Conditional activation
55
+
56
+ Not applicable — `migration-analyze` has no activation condition; it runs whenever its state-file prerequisite is met.
57
+
58
+ ### 7. Recovery
59
+
60
+ | Step | Max Attempts | Strategy |
61
+ | ------------------------ | ------------ | ------------------------------------------------------------------------------------------------- |
62
+ | Analysis (`state-analysed`) | 2 | Expand search patterns across the repository; prompt the user for specific file paths |
63
+ | Clarifications | 1 | Ask remaining questions in one consolidated round; record unresolved points as explicit assumptions |
64
+
65
+ ## Execute
66
+
67
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) and the [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md).
68
+
69
+ | Direction | Artifact | Producer |
70
+ | --------- | ----------------------------------- | --------------------------------------------------------------- |
71
+ | Consumed | `orchestrator-state.yml` | dispatcher init / mid-pipeline bootstrap |
72
+ | Produced | `analysis/current-state-analysis.md` | `codebase-analyzer` (**Skill**, reused 0 changes) — pass `artifact_name` |
73
+ | Produced | `analysis/clarifications.md` | inline `question` round (≤5 questions) |
74
+
75
+ ### Current-State Analysis & Clarifications (`state-analysed`)
76
+
77
+ 1. **Skill tool — `codebase-analyzer`** (never inline). Pass: `task_path`, `task_description`, and `artifact_name: "current-state-analysis.md"` (the engine derives the `analysis/` prefix — do not pass a path). The engine's migration-target role is documented in its own mapping — do not restate it here.
78
+ 2. **Inline clarifications** — use `question` for up to 5 migration-scoped questions: migration scope/boundaries, current vs target system, constraints, data involvement, downtime tolerance. Frame as confirmable assumptions ("I assume X — is that correct?"). Save to `analysis/clarifications.md`.
79
+ 3. **State write**: append `state-analysed` to `completed_phases`; set `migration_context.current_system.description`, `migration_context.current_system.technologies` (**corrected write** — the monolith wrote the undeclared `task_context`), `migration_context.clarifications_resolved: true`, `phase_summaries.analyze.summary`, `migration_outputs.current_state_analysis`, `migration_outputs.clarifications`; bump `orchestrator.updated`. On failure: append `state-analysed` to `failed_phases`, increment `auto_fix_attempts["state-analysed"]`. Then re-read state + run `verify_template`.
80
+
81
+ ## State Update Convention (per step)
82
+
83
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`state-analysed`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
84
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
85
+ 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>"]`.
86
+ 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.
87
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
88
+
89
+ ## Exit Gate
90
+
91
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
92
+
93
+ ### Results box
94
+
95
+ ```markdown
96
+ ## ✅ MIGRATION ANALYZE COMPLETE — <task name>
97
+
98
+ **Current system** — [1-line summary from state]
99
+ **Migration scope** — [included / excluded summary]
100
+ **Clarifications** — [N resolved / open assumptions]
101
+ **Analysis confidence** — ✅ solid / ⚠ open gaps recorded
102
+
103
+ **Artifacts**
104
+
105
+ - `analysis/current-state-analysis.md`
106
+ - `analysis/clarifications.md`
107
+ ```
108
+
109
+ ### Results-acceptance question
110
+
111
+ Use `question` — "Are these results correct?" with options:
112
+
113
+ - **Accept** — the analysis is good; continue.
114
+ - **Adjust** — re-run only the affected part (analysis or clarifications), update state and artifacts, re-present the results box.
115
+ - **Discuss** — walk through the current-system findings or scope assumptions in more depth; then re-ask.
116
+ - **Stop here** — print the resume command (`/owflow:migration-analyze <task-path>`) and end.
117
+
118
+ ### Next steps (after Accept)
119
+
120
+ - `→ /owflow:migration-target <task-path>` — `required` next: locks the target state, classifies the migration type, recommends a strategy, and produces the risk-locked target-state plan. Remaining after: spec → plan → implement → verify (→ fix when needed) → finalize.
121
+
122
+ **Other options**:
123
+
124
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs all remaining phases in one loop (target → spec → plan → implement → verify → fix when needed → finalize)
125
+
126
+ Then STOP.
@@ -0,0 +1,161 @@
1
+ ---
2
+ name: owflow:migration-finalize
3
+ description: Migration — authors the operator migration guide inline when enabled, then completes the task. Workflow-terminal (docs-generated optional, task-completed always).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Finalize — Operator Guide & Task Completion (docs-generated, task-completed)
9
+
10
+ Terminal work phase of the migration workflow. When `options.docs_enabled` resolves true it authors `documentation/migration-guide.md` **inline** (operator audience, text-first — no `user-docs-generator`, no Playwright, no agent edits); then it always finalizes: workflow summary, `task.status: completed`, and the `task-completed` slug.
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
+ | Verification done | `verification-done` in `completed_phases` **and** `verification/implementation-verification.md` exists | `/owflow:migration-verify <task-path>` |
28
+ | Fix phase settled | `verification_context.compatibility_status = passed` **and** (`issues-resolved` present with non-empty `fixes_applied` or a recorded approval, **or** `verification_context.last_status = passed`, **or** `phase_summaries.fix.summary` records a deliberate skip) | `/owflow:migration-fix`, `/owflow:migration-verify` |
29
+ | Docs toggle known (conditional step) | `options.docs_enabled` in state (`true`/`false`; `null` ⇒ the options gate never ran — treated as not enabled) | `/owflow:migration-verify` (options step) |
30
+
31
+ ### 3. Blocked output
32
+
33
+ 1. Steps that must be completed first (in order), each with its command:
34
+ - Issue resolution (`issues-resolved`) → `/owflow:migration-fix <task-path>` (only when verification left fixable issues)
35
+ - Verification (`verification-done`) → `/owflow:migration-verify <task-path>`
36
+ - Migration execution (`migration-executed`) → `/owflow:migration-implement <task-path>` (if also missing)
37
+ - Implementation planning (`plan-created`) → `/owflow:migration-plan <task-path>` (if also missing)
38
+ - Strategy specification (`strategy-specified`) → `/owflow:migration-spec <task-path>` (if also missing)
39
+ - Target state planning (`target-planned`) → `/owflow:migration-target <task-path>` (if also missing)
40
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>` (if also missing)
41
+ - State initialization → `/owflow:migration <description>` (new task)
42
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
43
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
44
+
45
+ Then STOP — never guess or auto-pick a task.
46
+
47
+ ### 4. Missing-state bootstrap
48
+
49
+ 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 `task-completed`?" with **Create task** / **Decline**.
50
+
51
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-finalize (mid-pipeline bootstrap)"`, `orchestrator.started_phase: task-completed`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `verification/implementation-verification.md` still blocks, so bootstrapping never skips upstream work.
52
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
53
+
54
+ ### 5. Skip/resume — artifacts before state
55
+
56
+ - `task.status: completed` or `task-completed` in `completed_phases` ⇒ report the existing finalization and STOP — the workflow is terminal; never re-run it.
57
+ - `documentation/migration-guide.md` exists but `docs-generated` is missing ⇒ **adopt**: append `docs-generated`, backfill `migration_outputs.migration_guide`, continue to finalization.
58
+ - `docs-generated` is present but the guide is missing ⇒ **drop** `docs-generated` and re-author (only when enabled).
59
+ - Fix phase unsettled (`compatibility_status != passed` — failed or never written — **or** no `issues-resolved`/approval/skip **and** `last_status != passed`) ⇒ route back to `/owflow:migration-verify <task-path>` (or `/owflow:migration-fix <task-path>` when issues remain) — never finalize unfinished verification. A failed compatibility check is **never waived by a deliberate skip or approval**: re-verify after fixes, or use user-confirmed rollback.
60
+ - A settled `options.docs_enabled` is reported, not re-asked.
61
+
62
+ ### 6. Conditional activation
63
+
64
+ Read `options.docs_enabled` (tri-state). `true` ⇒ run the Documentation step below. `false` **or** `null` (the options gate never settled it) ⇒ report `Operator guide disabled — skipping documentation.` and skip straight to Finalization: **no `docs-generated` slug, no failure entry** — a docs skip is an option value, not a failure. Do not prompt for the toggle here; its setter is `migration-verify`'s options step.
65
+
66
+ ### 7. Recovery
67
+
68
+ | Step | Max Attempts | Strategy |
69
+ | ------------------------------- | ------------ | ------------------------------------------------------------------------------ |
70
+ | Documentation (`docs-generated`) | 1 | Generate text-only — inline markdown, no screenshots or tooling |
71
+ | Finalization (`task-completed`) | 1 | Compose the summary and set `task.status: completed`; state-only — repeat once, then report |
72
+
73
+ ## Execute
74
+
75
+ **Read first**: no delegation is used in this skill. **Inline authoring by design**: `user-docs-generator` (hard-codes `documentation/user-guide.md` + Playwright) is explicitly out of scope — never invoke it, Playwright, or any agent for the guide.
76
+
77
+ | Direction | Artifact | Producer |
78
+ | --------- | ------------------------------------- | ----------------------------------------------------------- |
79
+ | Consumed | all `migration_outputs.*` paths | upstream phases (analysis → verification) |
80
+ | Consumed | `verification_context.last_status`, `verification_context.compatibility_status` | `migration-verify` (ownership), `migration-fix` (re-verify refresh) |
81
+ | Consumed | `options.docs_enabled` | `migration-verify` options step |
82
+ | Produced | `documentation/migration-guide.md` (conditional) | inline authoring (this skill) |
83
+ | Produced | workflow summary + `task.status: completed` | inline authoring (this skill) |
84
+
85
+ ### Operator Migration Guide (`docs-generated`, conditional)
86
+
87
+ **Skip if** `options.docs_enabled` is not `true` (see part 6 — report and skip; no slug, no failure entry).
88
+
89
+ Author `documentation/migration-guide.md` directly in the main agent — **operator audience, text-first**. Cover exactly:
90
+
91
+ 1. **Migration overview and goals** — what changed, why, current → target.
92
+ 2. **Prerequisites and preparation** — access, backups, environment readiness.
93
+ 3. **Step-by-step procedure** — ordered operator steps from the implementation plan / work log, with the per-group checkpoints.
94
+ 4. **Rollback procedures** — from `analysis/rollback-plan.md` (authoritative) and `analysis/dual-run-plan.md` when present.
95
+ 5. **Troubleshooting** — known issues from verification, the compatibility checks, and fix decisions.
96
+
97
+ **State write**: append `docs-generated`; set `migration_outputs.migration_guide: "documentation/migration-guide.md"`; bump `orchestrator.updated`; re-read + `verify_template`.
98
+
99
+ ### Finalization (`task-completed`, always)
100
+
101
+ 1. **Compose the workflow summary** from state + artifacts: migration type/strategy, steps completed, verification + compatibility outcomes, fixes, guide status. There is no `finalize` key in `phase_summaries` — the omission is deliberate (state-only terminal step); do not add one.
102
+ 2. **State write**: set `task.status: completed`; append `task-completed`; bump `orchestrator.updated`; re-read + `verify_template`.
103
+ 3. **Workflow-end handoff**: no further owflow phase is required; list the artifacts for the user's own review and commit (the workflow performs no commits).
104
+
105
+ ## State Update Convention (per step)
106
+
107
+ 1. **Write immediately** — append `docs-generated` only when documentation actually ran, then `task-completed` at finalization; never batch and never append `docs-generated` on a skip or failure.
108
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
109
+ 3. **Failures** — if the guide ultimately fails after the one text-only retry, do NOT append `docs-generated`; append it to `orchestrator.failed_phases` and increment `auto_fix_attempts["docs-generated"]`; ask the user whether to continue to finalization without docs. A disabled guide is NOT a failure (no entry at all).
110
+ 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.
111
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
112
+
113
+ ## Exit Gate
114
+
115
+ Present results, get user confirmation, then close the workflow (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
116
+
117
+ ### Results box
118
+
119
+ ```markdown
120
+ ## ✅ MIGRATION WORKFLOW COMPLETE — <task name>
121
+
122
+ **Migration** — [current → target, type]
123
+ **Strategy** — [incremental / big-bang / dual-run / phased]
124
+ **Verification** — [final verifier verdict + overall compatibility verdict]
125
+ **Fixes** — [N applied / none required / deliberately skipped]
126
+ **Operator guide** — [✅ `documentation/migration-guide.md` / skipped (`docs_enabled` not enabled)]
127
+ **Rollback plan** — ✅ `analysis/rollback-plan.md` (user-confirmed rollback only)
128
+
129
+ **Artifacts**
130
+
131
+ - `analysis/current-state-analysis.md`
132
+ - `analysis/target-state-plan.md`
133
+ - `analysis/requirements.md`
134
+ - `analysis/rollback-plan.md`
135
+ - `analysis/dual-run-plan.md` [conditional]
136
+ - `implementation/spec.md`
137
+ - `implementation/implementation-plan.md`
138
+ - `implementation/work-log.md`
139
+ - `verification/implementation-verification.md`
140
+ - `verification/compatibility-test-results.md`
141
+ - `documentation/migration-guide.md` [conditional]
142
+ ```
143
+
144
+ ### Results-acceptance question
145
+
146
+ Use `question` — "Are these results correct?" with options:
147
+
148
+ - **Accept** — the migration is complete; show the workflow-end handoff.
149
+ - **Adjust** — re-run the affected part (operator guide and/or finalization) with the user's corrections, update state, re-present the results box.
150
+ - **Discuss** — walk through the workflow summary, verification outcome, guide contents, or rollback readiness in more depth; then re-ask.
151
+ - **Stop here** — print the resume command (`/owflow:migration-finalize <task-path>`) and end.
152
+
153
+ ### Next steps (after Accept)
154
+
155
+ **Workflow-end handoff (terminal)** — the migration workflow is finished; no further owflow phase command is required and this skill advances nothing. Remaining: none.
156
+
157
+ - Review the artifacts above, then commit and open a PR using the operator guide's rollback procedures as the safety reference — `optional` manual step outside owflow (the workflow performs no commits).
158
+ - `/owflow:reviews-pragmatic <task-path>` — `optional` — post-migration over-engineering check; does not advance phases.
159
+ - `/owflow:standards-update "<lesson learned>"` — `optional` — captures migration learnings as project standards; does not advance phases.
160
+
161
+ Then STOP.
@@ -0,0 +1,155 @@
1
+ ---
2
+ name: owflow:migration-fix
3
+ description: Migration — conditional verification-issue resolution with a max-3 fix-then-reverify loop and a data-integrity HALT that is never auto-fixed (issues-resolved).
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Fix — Conditional Issue Resolution (issues-resolved)
9
+
10
+ Conditional work phase of the migration workflow. Activates only when the verification state fact says fixable issues remain. Runs the shared [Fix Loop Contract](../orchestrator-framework/references/fix-loop-contract.md) — max 3 iterations, re-invoke `implementation-verifier`, `fixes_applied` written immediately per iteration — with the migration deltas (compatibility verdict invalidation, data-integrity HALT). **Data-integrity problems are NEVER auto-fixed.**
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
+ | Verification done | `verification-done` in `completed_phases` **and** `verification/implementation-verification.md` exists | `/owflow:migration-verify <task-path>` |
28
+ | Fixable issues exist | `verification_context.compatibility_status = failed` **or** (`verification_context.last_status != passed` and no recorded deliberate skip); the verification/compatibility reports list fixable critical/warning issues, **or** a deliberate skip is already recorded with `compatibility_status = passed` (settled — route forward) | `/owflow:migration-verify <task-path>` |
29
+
30
+ ### 3. Blocked output
31
+
32
+ 1. Steps that must be completed first (in order), each with its command:
33
+ - Verification (`verification-done`) → `/owflow:migration-verify <task-path>`
34
+ - Migration execution (`migration-executed`) → `/owflow:migration-implement <task-path>` (if also missing)
35
+ - Implementation planning (`plan-created`) → `/owflow:migration-plan <task-path>` (if also missing)
36
+ - Strategy specification (`strategy-specified`) → `/owflow:migration-spec <task-path>` (if also missing)
37
+ - Target state planning (`target-planned`) → `/owflow:migration-target <task-path>` (if also missing)
38
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>` (if also missing)
39
+ - State initialization → `/owflow:migration <description>` (new task)
40
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
41
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
42
+
43
+ Then STOP — never guess or auto-pick a task.
44
+
45
+ ### 4. Missing-state bootstrap
46
+
47
+ 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 `issues-resolved`?" with **Create task** / **Decline**.
48
+
49
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-fix (mid-pipeline bootstrap)"`, `orchestrator.started_phase: issues-resolved`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `verification/implementation-verification.md` still blocks, so bootstrapping never skips upstream work.
50
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
51
+
52
+ ### 5. Skip/resume — artifacts before state
53
+
54
+ - `issues-resolved` is present with **non-empty** `verification_context.fixes_applied` **or a recorded approval in `verification_context.decisions_made`** (its state-resident marker) ⇒ report the existing fixes/decision and route to the Exit Gate — **except** when `compatibility_status != passed`, where part 6 activation keeps the failed check active and routes to `/owflow:migration-verify <task-path>`.
55
+ - `issues-resolved` is present with neither a non-empty `fixes_applied` nor a recorded approval ⇒ **drop** the slug and re-run — never trust a bare slug.
56
+ - A deliberate skip recorded in `phase_summaries.fix.summary` + `decisions_made` ⇒ **settled for verifier issues**: report it and route to `/owflow:migration-finalize <task-path>` **only when `compatibility_status = passed`**; when `compatibility_status = failed`, the skip does not waive the failed check — present the compatibility failure (data-integrity ⇒ HALT/rollback) and route to `/owflow:migration-verify <task-path>`; never re-open verifier issues.
57
+ - `issues-resolved` is absent while `verification/implementation-verification.md` + `verification-done` hold ⇒ normal entry; when `fixes_applied` is already non-empty from an interrupted run, report those fixes and resume the loop without re-applying them.
58
+ - Settled `verification_context.decisions_made` entries are reported, not re-asked.
59
+
60
+ ### 6. Conditional activation
61
+
62
+ Read the **state facts** `verification_context.last_status` + `verification_context.compatibility_status` and the verification/compatibility reports. A recorded deliberate skip deactivates with `Fix deliberately skipped — issue resolution settled.` **only when `compatibility_status = passed`**; otherwise, when inactive — `last_status = passed` **and** `compatibility_status = passed`, and the reports list no fixable critical/warning issues — print exactly:
63
+
64
+ `No fixable issues — issue resolution not required.`
65
+
66
+ and route to `/owflow:migration-finalize <task-path>` (required next: operator guide when enabled, then task completion), then STOP. **No flag, no user choice** — the state facts decide activation.
67
+
68
+ ### 7. Recovery
69
+
70
+ | Step | Max Attempts | Strategy |
71
+ | -------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------- |
72
+ | Fix loop (`issues-resolved`) | 3 iterations | Contract, not a retry counter: fix-then-reverify; at 3 ask proceed-with-warnings or rollback. **Data integrity: HALT — never auto-fixed** |
73
+
74
+ ## Execute
75
+
76
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), the [Fix Loop Contract](../orchestrator-framework/references/fix-loop-contract.md), and [Issue Resolution](../orchestrator-framework/references/orchestrator-patterns.md) (Section 6).
77
+
78
+ | Direction | Artifact | Producer |
79
+ | --------- | ----------------------------------------------- | --------------------------------------------------------------------- |
80
+ | Consumed | `verification/implementation-verification.md` | `implementation-verifier` via `migration-verify` |
81
+ | Consumed | `verification/compatibility-test-results.md` | `migration-verify` (data-integrity and rollback evidence) |
82
+ | Produced | migrated code fixes + state `fixes_applied` | direct execution (this skill) |
83
+ | Produced | updated `verification/implementation-verification.md` | re-invoked `implementation-verifier` (**Skill**) |
84
+
85
+ ### User-Driven Fix Loop (`issues-resolved`)
86
+
87
+ 1. **Display the detailed issue breakdown** grouped by category and severity (location, description, fixability).
88
+ 2. **Present critical + warning issues as a numbered list.**
89
+ 3. `question` per the [Fix Loop Contract](../orchestrator-framework/references/fix-loop-contract.md) — "Which issues should I fix?" with exactly three options: **"Fix all fixable issues"** / **"Let me choose specific issues"** / **"Skip fixes, proceed as-is"**.
90
+ 4. **Fix the selected issues directly** (the migrated code is this skill's artifact). **Immediately** after each fix, append it to `verification_context.fixes_applied` in state — never deferred to the end; bump `orchestrator.updated`; re-read + `verify_template`. After fixes set `options.skip_test_suite: false` (code changed — the suite must re-run on re-verification) **and invalidate the stale compatibility verdict: `verification_context.compatibility_status: null`** (field-level fail-closed exception — the 4 checks ran against pre-fix code; only `migration-verify` may set a new verdict).
91
+ 5. `question` — "Re-run verification to check fixes?" → **"Yes, re-run verification"** / **"No, proceed to next phase"**. On yes: Skill tool — `implementation-verifier`; then **immediately** update `verification_context.reverify_count` **and refresh `verification_context.last_status` + `issues_found` from the verifier's structured return** (field-level re-verify exception — the fix loop replaces the verification result), then return to step 1 (max 3 iterations). `compatibility_status` stays `null` (invalidated by the fixes) or `failed` and remains owned by `migration-verify`: when it is not `passed`, the loop's required next step is `/owflow:migration-verify <task-path>` (its re-verification re-runs the compatibility checks and settles the verdict) — never route a non-passed compatibility status to finalize. On "No", exit the loop to the Exit Gate, where the same required-next rule applies. Single-writer split: `migration-verify` owns `last_status`/`issues_found`/`compatibility_status`; this skill owns `fixes_applied`, `reverify_count`, `decisions_made`, plus the re-verify refresh of `last_status`/`issues_found` and the fail-closed invalidation of `compatibility_status`.
92
+ 6. **Record each user decision** (specific selection, proceed-with-warnings, deliberate skip) in `verification_context.decisions_made`.
93
+
94
+ **Data Safety — HALT**: any data-integrity issue (from the verification report, a compatibility result, or discovered while fixing) → HALT: never auto-fix data problems, never run a destructive data repair. Present the issue with the rollback option. **Rollback happens only on explicit user confirmation — no automatic rollback or revert ever.** A deliberate skip cannot waive a data-integrity failure or any non-passed compatibility check.
95
+
96
+ **Exit conditions (surfaced as results-box glyphs — never Exit-Gate state mutations)**:
97
+
98
+ - ✅ no critical issues remain → append `issues-resolved` and proceed.
99
+ - ⚠ max 3 iterations reached → `question` — "Proceed with known issues?" / "Rollback": proceed ⇒ append `issues-resolved` with the approval recorded in `decisions_made`; rollback ⇒ do NOT append, record the decision, and HALT for user-confirmed rollback.
100
+ - ❌ data integrity → HALT immediately, recommend user-confirmed rollback; do NOT append `issues-resolved`; record `failed_phases` + increment `auto_fix_attempts["issues-resolved"]`.
101
+ - Deliberate skip ("Skip fixes, proceed as-is") → a user-chosen skip, not a failure: no `issues-resolved` slug, no failure entry; record the reason in `phase_summaries.fix.summary` + `decisions_made`. `migration-finalize` accepts this settled skip **only when `compatibility_status = passed`**; `compatibility_status = failed` remains an absolute finalize blocker (re-verify after fixes, or user-confirmed rollback).
102
+
103
+ ## State Update Convention (per step)
104
+
105
+ 1. **Write immediately** — `fixes_applied` after every fix (never batched); `reverify_count`/`decisions_made` **and the `last_status`/`issues_found` refresh** right after each verifier run or decision; `issues-resolved` only when the loop settles successfully (✅, or an approved ⚠). Never defer and never append on a deliberate skip.
106
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
107
+ 3. **Failures** — a HALT or failed fix iteration is NOT appended to `completed_phases`; append `issues-resolved` to `orchestrator.failed_phases` and increment `auto_fix_attempts["issues-resolved"]`.
108
+ 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.
109
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
110
+
111
+ ## Exit Gate
112
+
113
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
114
+
115
+ ### Results box
116
+
117
+ ```markdown
118
+ ## ✅ MIGRATION FIX COMPLETE — <task name>
119
+
120
+ **Iterations** — [N of max 3]
121
+ **Fixes applied** — [count + 1-line list]
122
+ **Remaining issues** — [by severity / none]
123
+ **Re-verification** — [✅ passed / ⚠ passed_with_issues / ❌ failed — N re-runs]
124
+ **Data integrity** — [✅ no data issues / ❌ HALT — rollback recommended (user confirmation required)]
125
+ **Decisions** — [proceed-with-warnings / deliberate skip / specific selection]
126
+
127
+ **Artifacts**
128
+
129
+ - migrated code fixes
130
+ - `verification/implementation-verification.md` (updated by re-verification runs)
131
+ - state `verification_context.fixes_applied`
132
+ ```
133
+
134
+ ### Results-acceptance question
135
+
136
+ Use `question` — "Are these results correct?" with options:
137
+
138
+ - **Accept** — the fixes (or the approved proceed-with-warnings / deliberate skip) are good; continue.
139
+ - **Adjust** — fix additional selected issues and/or run another verification round within the max-3 contract, update state and the report, re-present the results box.
140
+ - **Discuss** — walk through specific fixes, remaining issues, or the data-integrity HALT in more depth; then re-ask.
141
+ - **Stop here** — print the resume command (`/owflow:migration-fix <task-path>`) and end.
142
+
143
+ ### Next steps (after Accept)
144
+
145
+ Render ONLY the row whose condition matches the state:
146
+
147
+ - `→ /owflow:migration-verify <task-path>` — `required` — only when `verification_context.compatibility_status != passed` (failed, or invalidated to null by applied fixes — a verifier-only re-run cannot settle compatibility): re-verification re-runs the 4 checks and owns `compatibility_status`. Remaining after: finalize.
148
+ - `→ /owflow:migration-finalize <task-path>` — `required` — only when `compatibility_status = passed` (after a ✅ loop, an approved ⚠, or a deliberate skip): closes the workflow (authors the operator guide when `options.docs_enabled` is true, then completes the task). Remaining after: none — workflow ends.
149
+
150
+ **Other options**:
151
+
152
+ - After a ❌ data-integrity HALT with **user-confirmed rollback only**: restore to the last known-good state per `analysis/rollback-plan.md`, then re-enter `/owflow:migration-verify <task-path>` — `optional`, manual, never automatic.
153
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs the remaining phases in one loop (finalize)
154
+
155
+ Then STOP.
@@ -0,0 +1,131 @@
1
+ ---
2
+ name: owflow:migration-implement
3
+ description: Migration — executes the approved implementation plan via isolated per-group delegation (normal lane only), producing the work log and the migration-executed slug.
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Implement — Plan Execution & Work Log (migration-executed)
9
+
10
+ Work phase of the migration workflow. Executes `implementation/implementation-plan.md` task group by task group through isolated per-group delegation — **normal lane only, no quick lane** — and records the execution in state. The delegation owns checkboxes, the work log, incremental tests, standards discovery, and its own user-confirmed failure handling; this shell owns the state write.
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
+ | Plan created | `plan-created` in `completed_phases` **and** `implementation/implementation-plan.md` exists | `/owflow:migration-plan <task-path>` |
28
+ | Spec present | `implementation/spec.md` exists (the executor's input contract) | `/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
+ - Implementation planning (`plan-created`) → `/owflow:migration-plan <task-path>`
34
+ - Strategy specification (`strategy-specified`) → `/owflow:migration-spec <task-path>` (if also missing)
35
+ - Target state planning (`target-planned`) → `/owflow:migration-target <task-path>` (if also missing)
36
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>` (if also missing)
37
+ - State initialization → `/owflow:migration <description>` (new task)
38
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
39
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
40
+
41
+ Then STOP — never guess or auto-pick a task.
42
+
43
+ ### 4. Missing-state bootstrap
44
+
45
+ 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 `migration-executed`?" with **Create task** / **Decline**.
46
+
47
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-implement (mid-pipeline bootstrap)"`, `orchestrator.started_phase: migration-executed`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `implementation/implementation-plan.md` still blocks, so bootstrapping never skips upstream work.
48
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
49
+
50
+ ### 5. Skip/resume — artifacts before state
51
+
52
+ - `implementation/work-log.md` exists but `migration-executed` is missing ⇒ **adopt**: append `migration-executed`, backfill `phase_summaries.implement.summary` and `migration_outputs.work_log` where still null.
53
+ - `migration-executed` is present but `implementation/work-log.md` is missing ⇒ **drop** `migration-executed` from `completed_phases` and re-run.
54
+ - Both artifact and slug exist ⇒ report the existing execution summary and route to the Exit Gate.
55
+ - A partially executed plan (unchecked groups remain) is NOT complete: resume with `/owflow:migration-implement <task-path>` so the per-group execution picks up the uncompleted groups.
56
+
57
+ ### 6. Conditional activation
58
+
59
+ Not applicable — `migration-implement` has no activation condition; it runs whenever its prerequisites are met.
60
+
61
+ ### 7. Recovery
62
+
63
+ | Step | Max Attempts | Strategy |
64
+ | ----------------------------- | ------------ | --------------------------------------------------------------------------------------------------------------- |
65
+ | Plan execution (`migration-executed`) | 5 | Fix syntax/import errors and re-run the failed group's tests; prompt the user on repeated failure. **Never auto-rollback — rollback requires explicit user confirmation** |
66
+
67
+ ## Execute
68
+
69
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md). The per-group execution applies its own test-driven order and continuous standards discovery.
70
+
71
+ | Direction | Artifact | Producer |
72
+ | --------- | ----------------------------------- | -------------------------------------------------------------------- |
73
+ | Consumed | `implementation/implementation-plan.md` | `migration-plan` (approved plan with per-group rollback steps) |
74
+ | Consumed | `implementation/spec.md` | `migration-spec` (approved specification) |
75
+ | Produced | `implementation/work-log.md` | per-group delegation to `task-group-implementer` (**Task tool**, normal lane only) |
76
+
77
+ ### Plan Execution (`migration-executed`)
78
+
79
+ > **ANTI-PATTERN — never execute the plan's task groups inline. "The groups are straightforward" is NOT a reason to skip delegation.**
80
+
81
+ 1. **Execute the plan — per-group delegation** (normal lane only; migration has no quick lane). For each task group in order: prepare context (task path, task description, the `implementation/spec.md` + `implementation/implementation-plan.md` paths, `migration_context.*` — type, strategy, risk level, breaking changes — and accumulated `phase_summaries` from analyze → plan), delegate the group via the **Task tool** to `task-group-implementer`, then process its report: mark the group's checkboxes in `implementation/implementation-plan.md`, append the work-log entry to `implementation/work-log.md`, and run the group's incremental tests before moving on. Apply lazy standards loading per group; after the last group, run the full test suite once.
82
+ 2. **No post-continuation glue block** — the per-group execution's return is not a handoff to be glued: do NOT "re-read state to confirm you are the orchestrator", do NOT add a numbered phase marker, do NOT auto-proceed to verification. The monolith's post-continuation block existed only because the monolith owned the state writes; here the per-step write below is the only continuation.
83
+ 3. **State write**: append `migration-executed` to `completed_phases`; set `phase_summaries.implement.summary`, `migration_outputs.work_log: "implementation/work-log.md"`; bump `orchestrator.updated`. On failure (per-group execution fails after its retries, user stops): do NOT append; append `migration-executed` to `failed_phases` and increment `auto_fix_attempts["migration-executed"]`; partial progress stays in `implementation/work-log.md`. Then re-read state + run `verify_template`.
84
+
85
+ ## State Update Convention (per step)
86
+
87
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`migration-executed`) plus that step's fields. Never batch or defer to the end of the skill.
88
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
89
+ 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>"]`.
90
+ 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.
91
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
92
+
93
+ ## Exit Gate
94
+
95
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
96
+
97
+ ### Results box
98
+
99
+ ```markdown
100
+ ## ✅ MIGRATION IMPLEMENT COMPLETE — <task name>
101
+
102
+ **Task groups** — [completed / total]
103
+ **Files changed** — [count + key files, 1-2 lines]
104
+ **Tests** — [incremental results + full-suite status from the executor]
105
+ **Work log** — ✅ `implementation/work-log.md`
106
+ **Rollback readiness** — [per-group checkpoints completed / deferred items]
107
+
108
+ **Artifacts**
109
+
110
+ - implemented migration changes
111
+ - `implementation/work-log.md`
112
+ ```
113
+
114
+ ### Results-acceptance question
115
+
116
+ Use `question` — "Are these results correct?" with options:
117
+
118
+ - **Accept** — the implementation matches the plan; continue.
119
+ - **Adjust** — re-work the affected task groups (fix code, re-run their tests), update state and the work log, re-present the results box.
120
+ - **Discuss** — walk through implementation decisions, files changed, or deferred items in more depth; then re-ask.
121
+ - **Stop here** — print the resume command (`/owflow:migration-implement <task-path>`) and end.
122
+
123
+ ### Next steps (after Accept)
124
+
125
+ - `→ /owflow:migration-verify <task-path>` — `required` next: runs the verification options gate, the reused verifier, and the 4 migration compatibility checks. Remaining after: fix (only when verification finds issues) → finalize.
126
+
127
+ **Other options**:
128
+
129
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs all remaining phases in one loop (verify → fix when needed → finalize)
130
+
131
+ Then STOP.