owflow 0.4.3 → 0.6.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 (37) hide show
  1. package/README.md +32 -6
  2. package/dist/agents/bottleneck-analyzer.md +4 -0
  3. package/dist/agents/implementation-planner.md +1 -1
  4. package/dist/agents/production-readiness-checker.md +1 -1
  5. package/dist/agents/specification-creator.md +1 -1
  6. package/dist/commands/work.md +4 -4
  7. package/dist/skills/codebase-analyzer/SKILL.md +4 -4
  8. package/dist/skills/dev-verify/SKILL.md +3 -10
  9. package/dist/skills/diagrams-mermaid/references/reference.md +4 -4
  10. package/dist/skills/goal-migration/SKILL.md +114 -0
  11. package/dist/skills/goal-performance/SKILL.md +126 -0
  12. package/dist/skills/migration/SKILL.md +157 -296
  13. package/dist/skills/migration-analyze/SKILL.md +126 -0
  14. package/dist/skills/migration-finalize/SKILL.md +161 -0
  15. package/dist/skills/migration-fix/SKILL.md +155 -0
  16. package/dist/skills/migration-implement/SKILL.md +131 -0
  17. package/dist/skills/migration-plan/SKILL.md +131 -0
  18. package/dist/skills/migration-spec/SKILL.md +135 -0
  19. package/dist/skills/{migration → migration-spec}/references/migration-strategies.md +9 -9
  20. package/dist/skills/migration-target/SKILL.md +134 -0
  21. package/dist/skills/{migration → migration-target}/references/migration-types.md +22 -23
  22. package/dist/skills/migration-verify/SKILL.md +184 -0
  23. package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +2 -2
  24. package/dist/skills/orchestrator-framework/references/fix-loop-contract.md +65 -0
  25. package/dist/skills/orchestrator-framework/references/gate-contract.md +12 -2
  26. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +6 -3
  27. package/dist/skills/performance/SKILL.md +162 -332
  28. package/dist/skills/performance-analyze/SKILL.md +129 -0
  29. package/dist/skills/{performance → performance-analyze}/references/performance-optimization-guide.md +1 -95
  30. package/dist/skills/performance-finalize/SKILL.md +117 -0
  31. package/dist/skills/performance-implement/SKILL.md +114 -0
  32. package/dist/skills/performance-plan/SKILL.md +112 -0
  33. package/dist/skills/performance-spec/SKILL.md +145 -0
  34. package/dist/skills/performance-verify/SKILL.md +164 -0
  35. package/dist/templates/orchestrator-state-migration.yml +49 -9
  36. package/dist/templates/orchestrator-state-performance.yml +20 -9
  37. package/package.json +1 -1
@@ -0,0 +1,184 @@
1
+ ---
2
+ name: owflow:migration-verify
3
+ description: Migration — settles all verification options in one gate, delegates the reused verifier, runs the 4 migration compatibility checks, and owns options-chosen then verification-done.
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Migration Verify — Options, Verification & Compatibility Checks (options-chosen, verification-done)
9
+
10
+ Work phase of the migration workflow. Runs in a **fixed order**: options gate → reused `implementation-verifier` → the 4 migration compatibility checks → `verification-done`. Compatibility checks run **after** the verifier so they consume its verified baseline. Compatibility outcomes are persisted as the `verification_context.compatibility_status` state fact; the Exit Gate itself never mutates phase state.
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
+ | Migration executed | `migration-executed` in `completed_phases` **and** `implementation/work-log.md` exists | `/owflow:migration-implement <task-path>` |
28
+ | Verifier inputs present | `implementation/implementation-plan.md`, `implementation/spec.md`, **and** `implementation/work-log.md` exist (the reused verifier's required inputs) | `/owflow:migration-plan`, `/owflow:migration-spec`, `/owflow:migration-implement` |
29
+
30
+ ### 3. Blocked output
31
+
32
+ 1. Steps that must be completed first (in order), each with its command:
33
+ - Migration execution (`migration-executed`) → `/owflow:migration-implement <task-path>`
34
+ - Implementation planning (`plan-created`) → `/owflow:migration-plan <task-path>` (if also missing)
35
+ - Strategy specification (`strategy-specified`) → `/owflow:migration-spec <task-path>` (if also missing)
36
+ - Target state planning (`target-planned`) → `/owflow:migration-target <task-path>` (if also missing)
37
+ - Current-state analysis (`state-analysed`) → `/owflow:migration-analyze <task-path>` (if also missing)
38
+ - State initialization → `/owflow:migration <description>` (new task)
39
+ 2. List available migration-task identifiers (directories under `.owflow/tasks/migrations/`) to resume from, if any.
40
+ 3. Hint: `Run /owflow:migration <description> to start a migration task from scratch, or pass a task path/identifier to resume.`
41
+
42
+ Then STOP — never guess or auto-pick a task.
43
+
44
+ ### 4. Missing-state bootstrap
45
+
46
+ 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 `options-chosen`?" with **Create task** / **Decline**.
47
+
48
+ - **On confirm**: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template with `orchestrator.entry_point: "migration-verify (mid-pipeline bootstrap)"`, `orchestrator.started_phase: options-chosen`, `completed_phases: []`, `task.title`/`task.description` from the argument. Run `verify_template` (`orchestrator-state-migration.yml`) immediately. Creates state ONLY — `implementation/work-log.md` still blocks, so bootstrapping never skips upstream work.
49
+ - **On decline**: print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
50
+
51
+ ### 5. Skip/resume — artifacts before state
52
+
53
+ - `verification/implementation-verification.md` exists but `verification-done` is missing ⇒ **adopt**: do not re-run the verifier; backfill `verification_context.last_status` and `verification_context.issues_found` from the report summary, continue at the compatibility checks, then append `verification-done`.
54
+ - `verification-done` is present but `verification/implementation-verification.md` is missing ⇒ **drop** `verification-done` from `completed_phases` and re-run.
55
+ - `options-chosen` is present with settled `options.*` values ⇒ never re-ask; report the existing decision and continue at the verifier step (or route to the Exit Gate when `verification-done` is also present).
56
+ - Re-verification (`options-chosen` + `verification-done` already complete, invoked after fixes) ⇒ confirm scope via `question` — full re-run vs only failed checks.
57
+ - A `null` option key is unsettled — include it in the options gate; a `null` tri-state `docs_enabled` means the options gate has not run yet.
58
+
59
+ ### 6. Conditional activation
60
+
61
+ Not applicable — `migration-verify` runs whenever its prerequisites are met. (Its own outputs activate the downstream conditionals: `migration-fix` and `migration-finalize`.)
62
+
63
+ ### 7. Recovery
64
+
65
+ | Step | Max Attempts | Strategy |
66
+ | ------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------- |
67
+ | Options gate (`options-chosen`) | 1 | Re-present one consolidated gate; all 7 keys settle together |
68
+ | Verification (`verification-done`) | 3 | Fix-then-reverify (max 3 cycles). **HALT on data integrity**: a failed data-integrity check is never auto-fixed — record ❌ with evidence and recommend rollback (explicit user confirmation required) |
69
+
70
+ ## Execute
71
+
72
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), then read `../migration-spec/references/migration-strategies.md` (compatibility and rollback/dual-run testing content) and `../migration-target/references/migration-types.md` (per-type verification focus).
73
+
74
+ | Direction | Artifact | Producer |
75
+ | --------- | ------------------------------------------- | ----------------------------------------------------------------- |
76
+ | Consumed | `implementation/implementation-plan.md`, `implementation/work-log.md` | `migration-plan`, `implementation-plan-executor` |
77
+ | Consumed | `analysis/rollback-plan.md`, `analysis/dual-run-plan.md` (conditional) | `migration-spec` |
78
+ | Produced | `verification/implementation-verification.md` | `implementation-verifier` (**Skill**, reused 0 changes) |
79
+ | Produced | `verification/compatibility-test-results.md` | inline compatibility checks (direct, no delegation) |
80
+
81
+ **Fixed order — do not reorder: (1) options gate → (2) `implementation-verifier` → (3) compatibility checks → (4) `verification-done`.**
82
+
83
+ ### 1. Verification Options (`options-chosen`, inline)
84
+
85
+ **Step 1** — display the plan:
86
+
87
+ ```
88
+ Verification Plan:
89
+ Obligatory (always run):
90
+ ✓ Completeness check
91
+ ✓ Test suite (skipped — passed during implementation; re-enabled after fixes)
92
+ Recommended (adjustable):
93
+ ✓ Code review — quality and security analysis
94
+ ✓ Pragmatic review — detects over-engineering
95
+ ✓ Reality check — validates the migration solves the problem
96
+ ✓ Production readiness — deployment readiness checks
97
+ Conditional:
98
+ [✓/—] Operator migration guide — [reason]
99
+ ```
100
+
101
+ **Step 2 — one consolidated gate** (2 `question`s, all 7 keys settle together):
102
+
103
+ - **Q1** (always): `question` (multi-select) — "Which standard verifications to run?" Options: "Code review (Recommended)", "Pragmatic review (Recommended)", "Reality check (Recommended)", "Production readiness (Recommended)". All pre-selected.
104
+ - **Q2** (always): "Generate the operator migration guide in `migration-finalize`?" — "Yes" / "No, skip".
105
+
106
+ Set **all 7** `options.*` keys in one state write: `code_review_enabled`, `pragmatic_review_enabled`, `reality_check_enabled`, `production_check_enabled` from Q1; `code_review_scope: "all"` when code review is enabled, else `null`; `skip_test_suite: true` (**auto-set** — the full suite passed during implementation; `migration-fix` resets it to `false` after code changes); `docs_enabled` from Q2 (tri-state: `null` only before this gate; never left `null` afterwards).
107
+
108
+ **State write**: append `options-chosen`; write all 7 `options.*` keys; bump `orchestrator.updated`; re-read + `verify_template`. **This write happens BEFORE the verifier runs** — the verifier reads its flags from state, and `null` keys make it warn-and-prompt once per key.
109
+
110
+ ### 2. Delegate Verification (first `verification-done` step)
111
+
112
+ Skill tool — `implementation-verifier` (reused, 0 changes). Pass: `task_path`, `task_description`, the chosen options, and `verification_context` when re-verifying. It is read-only (reports, never fixes) and writes `verification/implementation-verification.md`; capture its structured output (`status`, `issues[]`, `issue_counts`).
113
+
114
+ **Write immediately**: `verification_context.last_status` (`passed` / `passed_with_issues` / `failed`), `verification_context.issues_found` (aggregate counts), `migration_outputs.implementation_verification`; bump `orchestrator.updated`; re-read + `verify_template`. **Do not run the compatibility checks before this write** — they consume this verified baseline.
115
+
116
+ ### 3. Migration Compatibility Checks (`compatibility-test-results.md`, inline)
117
+
118
+ Author the 4 checks directly (no delegation). Record each check's **Status (Pass / Fail / Not-applicable)**, **Evidence**, and notes; a not-applicable check is recorded explicitly, never silently omitted; close with an overall compatibility verdict.
119
+
120
+ 1. **Dual-run liveness** — the old system still works while dual-run is configured. Read `migration_context.dual_run_configured`; `false` ⇒ **Not-applicable** (recorded explicitly). `true` ⇒ verify both systems stay live and synchronized per `analysis/dual-run-plan.md`.
121
+ 2. **Non-destructive rollback test** — exercise the `analysis/rollback-plan.md` procedures in a non-production or isolated context **without destroying current state**; verify the documented validation criteria and time estimate.
122
+ 3. **Data integrity** — for data migrations (and any migration that moves/transforms data): 100% row-count, checksum, and business-rule validation against the verified baseline (per-type focus: data). Failure is a **HALT-class result**: record ❌ with evidence, never auto-fix, never retry into a pass; recommend rollback (explicit user confirmation required).
123
+ 4. **Before/after performance** — baseline comparison of key metrics before vs after; for code/architecture types this also carries the per-type focus (functional equivalence / system-level behavior).
124
+
125
+ Write `verification/compatibility-test-results.md`; then write `migration_outputs.compatibility_test_results`, `phase_summaries.verify.summary`, and `verification_context.compatibility_status` — `passed` when no check is ❌, `failed` when any check is ❌ (⚠ concerns do not block) — bump `orchestrator.updated`; re-read + `verify_template`. `compatibility_status` is the persisted overall check verdict consumed by the `migration-fix` / `migration-finalize` gates; it is a check result written during Execute, never an Exit-Gate mutation.
126
+
127
+ ### 4. Complete Verification (`verification-done`)
128
+
129
+ Append `verification-done` only once the verifier AND all 4 compatibility checks have run. ⚠/❌ verdicts are results shown in the results box; they are **never Exit-Gate state mutations** — the state facts are `verification_context.last_status`, `issues_found`, `compatibility_status`, and the compatibility report. If the verifier itself cannot run or report, do NOT append; use `failed_phases` + `auto_fix_attempts["verification-done"]`.
130
+
131
+ ## State Update Convention (per step)
132
+
133
+ 1. **Write immediately** — update `orchestrator-state.yml` as soon as each step completes: options after the options gate (before the verifier); `last_status`/`issues_found` right after the verifier (before the checks); `compatibility_status` + the compatibility paths after the checks; `verification-done` last. Never batch.
134
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
135
+ 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>"]`.
136
+ 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.
137
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
138
+
139
+ ## Exit Gate
140
+
141
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
142
+
143
+ ### Results box
144
+
145
+ ```markdown
146
+ ## ✅ MIGRATION VERIFY COMPLETE — <task name>
147
+
148
+ **Verifier status** — [✅ passed / ⚠ passed_with_issues / ❌ failed]
149
+ **Issues found** — [N] ([C] critical / [W] warning / [I] info)
150
+ **Compatibility checks** — dual-run [✅ / — N/A] · rollback [✅ / ❌] · data integrity [✅ / ❌ / N/A] · performance [✅ / ⚠ / ❌]
151
+ **Overall compatibility** — [✅ compatible / ⚠ compatible with concerns / ❌ not compatible]
152
+ **Data integrity** — [✅ verified / ❌ HALT — recommend user-confirmed rollback]
153
+ **Options** — code review [on/off] · pragmatic [on/off] · production [on/off] · reality [on/off] · operator guide [yes/no]
154
+
155
+ **Artifacts**
156
+
157
+ - `verification/implementation-verification.md`
158
+ - `verification/compatibility-test-results.md`
159
+ - `verification/code-review-report.md`, `verification/pragmatic-review.md`, `verification/production-readiness-report.md`, `verification/reality-check.md` [each if run]
160
+ ```
161
+
162
+ ### Results-acceptance question
163
+
164
+ Use `question` — "Are these results correct?" with options:
165
+
166
+ - **Accept** — the verification outcome is good (including an approved proceed-with-warnings); continue.
167
+ - **Adjust** — run additional fixes and/or another verification round within the max-3 contract, update state and artifacts, re-present the results box.
168
+ - **Discuss** — walk through specific findings (issue details, compatibility evidence, data-integrity status) in more depth; then re-ask.
169
+ - **Stop here** — print the resume command (`/owflow:migration-verify <task-path>`) and end.
170
+
171
+ ### Next steps (after Accept)
172
+
173
+ Render ONLY the row whose condition matches the state; list the other branch under Other options:
174
+
175
+ - `→ /owflow:migration-fix <task-path>` — `required` — only when `verification_context.compatibility_status = failed` **or** (`verification_context.last_status != passed` and no recorded deliberate skip): resolves issues with the data-integrity HALT and re-verifies (max 3 iterations). Remaining after: finalize.
176
+ - `→ /owflow:migration-finalize <task-path>` — `required` — only when `compatibility_status = passed` **and** the fix phase is settled (`last_status = passed`, or `issues-resolved`/approval, or a recorded deliberate skip): author the operator guide when enabled, then complete the task. Remaining after: none — workflow ends.
177
+
178
+ **Other options**:
179
+
180
+ - The branch not rendered above (`migration-fix` when the finalize condition holds, or `migration-finalize` when fix is required)
181
+ - `/owflow:migration-verify <task-path>` — `optional` — re-verification after fixes: re-runs the verifier and the 4 compatibility checks (settles `last_status` and `compatibility_status`; confirm full re-run vs only failed checks)
182
+ - `/owflow:goal-migration <task-path>` — `optional` shortcut: runs all remaining phases in one loop (fix when needed → finalize)
183
+
184
+ Then STOP.
@@ -18,8 +18,8 @@ Orchestrators MAY delegate phase bodies to user-invocable **subskills** instead
18
18
  | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- | ---------------------------------------------- |
19
19
  | development | `codebase-analysed`, `gap-analysed`, `tdd-red-proven`, `spec-written`, `spec-audited`, `plan-created`, `implementation-done`, `tdd-green-proven`, `options-chosen`, `verification-done`, `e2e-run`, `docs-generated`, `task-completed` | `skills/development/SKILL.md` | `templates/orchestrator-state-development.yml` |
20
20
  | research | `brief-written`, `plan-created`, `findings-gathered`, `synthesis-complete`, `alternatives-generated`, `approaches-chosen`, `design-generated`, `research-completed` | `skills/research/SKILL.md` | `templates/orchestrator-state-research.yml` |
21
- | performance | `phase-N` (legacy holdout — kept internally consistent) | `skills/performance/SKILL.md` | `templates/orchestrator-state-performance.yml` |
22
- | migration | `phase-N` (legacy holdout — kept internally consistent) | `skills/migration/SKILL.md` | `templates/orchestrator-state-migration.yml` |
21
+ | performance | `codebase-analysed`, `bottlenecks-identified`, `spec-written`, `spec-audited`, `plan-created`, `implementation-done`, `options-chosen`, `verification-done`, `task-completed` | `skills/performance/SKILL.md` | `templates/orchestrator-state-performance.yml` |
22
+ | migration | `state-analysed`, `target-planned`, `strategy-specified`, `plan-created`, `migration-executed`, `options-chosen`, `verification-done`, `issues-resolved`, `docs-generated`, `task-completed` | `skills/migration/SKILL.md` | `templates/orchestrator-state-migration.yml` |
23
23
  2. **Subskills are self-contained.** Each has: an entry check (validate state + prerequisite artifacts), an execute section (delegation via Skill/Task tools per the [Delegation Rules](delegation-rules.md)), and an exit (state update + closing ritual). **State updates are per-step**: a subskill writes `orchestrator-state.yml` immediately after each of its steps completes — appending only the step slug actually performed, bumping `orchestrator.updated`, recording failures in `failed_phases`/`auto_fix_attempts`, and validating with `verify_template` — never as a single end-of-skill write.
24
24
  3. **Closing ritual (handoff) → Exit Gate.** Every subskill ends with the **Exit Gate** contract, see [Gate Contract](gate-contract.md) (results box → results-acceptance question → next-step hint on accept → STOP).
25
25
  4. **Entry checks replace phase gates in assisted mode.** A subskill invoked directly must validate the same prerequisites a phase gate would (e.g., spec exists before audit) and route to the prerequisite's command if missing — via its **Entry Gate** ([Gate Contract](gate-contract.md)).
@@ -0,0 +1,65 @@
1
+ # Fix Loop Contract — User-Driven Fix-Then-Reverify
2
+
3
+ Shared contract for skills that resolve verification issues together with the user. It pins the option wording, iteration budget, state-write cadence, and exit conditions so each applying skill describes only its workflow-specific deltas instead of restating the loop.
4
+
5
+ **Applies to**:
6
+
7
+ - `dev-verify` — the `verification-done` step after `implementation-verifier` returns `passed_with_issues` or `failed`
8
+ - `migration-fix` — when the verification state facts say fixable issues remain (`issues-resolved`)
9
+
10
+ Skills that use the loop MUST reference this file and document only their deltas in the "Workflow-Specific Deltas" section.
11
+
12
+ ---
13
+
14
+ ## Loop (max 3 iterations)
15
+
16
+ 1. **Display the detailed issue breakdown** grouped by category and severity, with location, description, and fixability.
17
+ 2. **Present critical + warning issues as a numbered list.** Info issues are listed for awareness, not actionable.
18
+ 3. **Ask via `question`** — "Which issues should I fix?" with exactly three options:
19
+ - **"Fix all fixable issues"**
20
+ - **"Let me choose specific issues"**
21
+ - **"Skip fixes, proceed as-is"**
22
+ 4. **Fix the selected issues directly.** Immediately after each fix, append it to `verification_context.fixes_applied` in state — never defer to the end of the loop. Bump `orchestrator.updated`; re-read the state file + run `verify_template`.
23
+ 5. **After fixes, set `options.skip_test_suite: false`** (code changed — the suite must re-run on re-verification).
24
+ 6. **Ask via `question`** — "Re-run verification to check fixes?" with options:
25
+ - **"Yes, re-run verification"** → re-invoke `implementation-verifier` (Skill tool), then **immediately** update `verification_context.reverify_count` and refresh `verification_context.last_status` + `issues_found` from the verifier's structured return; return to step 1.
26
+ - **"No, proceed to next phase"** → exit the loop to the Exit Gate.
27
+ 7. **Record each user decision** (specific selection, proceed-with-warnings, deliberate skip) in `verification_context.decisions_made`.
28
+
29
+ The loop is capped at **3 iterations**; at the cap, the question in "Exit Conditions" decides the outcome.
30
+
31
+ ---
32
+
33
+ ## Exit Conditions
34
+
35
+ | Condition | Action |
36
+ | --------- | ------ |
37
+ | ✅ No critical issues remain | Append the skill's success slug and proceed. |
38
+ | ⚠ Max 3 iterations reached | `question` — "Proceed with known issues?" / stop-or-rollback option. Proceed ⇒ append the success slug with the approval recorded in `decisions_made`; stop/rollback ⇒ do NOT append, record the decision. |
39
+ | Deliberate skip ("Skip fixes, proceed as-is") | A user-chosen skip, not a failure: no success slug, no failure entry; record the reason in `phase_summaries.<fix>.summary` + `decisions_made`. |
40
+ | ❌ Critical issues remain unresolved | **MUST NOT proceed without explicit user approval.** |
41
+ | Verifier itself fails | Do NOT append the success slug; append it to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`. |
42
+
43
+ ---
44
+
45
+ ## State Writes (per iteration, never batched)
46
+
47
+ - `fixes_applied` — after every fix.
48
+ - `reverify_count` + refreshed `last_status` / `issues_found` — right after each verifier run.
49
+ - `decisions_made` — after each user decision.
50
+ - The success slug — only when the loop settles (✅, or an approved ⚠); never on a deliberate skip or a failure.
51
+
52
+ **Single-writer split**: the verification step owns the initial `last_status` / `issues_found`; the fix loop owns `fixes_applied`, `reverify_count`, `decisions_made`, plus the re-verify refresh of `last_status` / `issues_found`.
53
+
54
+ ---
55
+
56
+ ## Workflow-Specific Deltas
57
+
58
+ ### Development (`dev-verify`)
59
+
60
+ None beyond this contract.
61
+
62
+ ### Migration (`migration-fix`)
63
+
64
+ - **Compatibility verdict invalidation**: after fixes, set `verification_context.compatibility_status: null` (field-level fail-closed exception — the compatibility checks ran against pre-fix code). Only `migration-verify` may set a new verdict; when it is not `passed`, the required next step is `/owflow:migration-verify <task-path>`, never finalize.
65
+ - **Data-integrity HALT**: data-integrity issues are NEVER auto-fixed. HALT, present the rollback option with the issue, and append the failure entry; 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.
@@ -50,6 +50,16 @@ When a subskill is invoked with a task path/identifier whose `orchestrator-state
50
50
  - Task directory under `.owflow/tasks/research/`; template `orchestrator-state-research.yml`; fresh-start hint: `Run /owflow:research <question> to start a task from scratch.`
51
51
  - Skill starting points (used for the bootstrap question and `started_phase`): research-plan → `brief-written`; research-gather → `findings-gathered`; research-synthesize → `synthesis-complete`; research-brainstorm → `alternatives-generated`; research-converge → `approaches-chosen`; research-design → `design-generated`; research-finalize → `research-completed`.
52
52
 
53
+ #### migration-* bootstrap
54
+
55
+ - Task directory under `.owflow/tasks/migrations/`; template `orchestrator-state-migration.yml`; fresh-start hint: `Run /owflow:migration <description> to start a migration task from scratch.`
56
+ - Skill starting points (used for the bootstrap question and `started_phase`): migration-analyze → `state-analysed`; migration-target → `target-planned`; migration-spec → `strategy-specified`; migration-plan → `plan-created`; migration-implement → `migration-executed`; migration-verify → `options-chosen`; migration-fix → `issues-resolved`; migration-finalize → `task-completed`.
57
+
58
+ #### performance-* bootstrap
59
+
60
+ - Task directory under `.owflow/tasks/performance/`; template `orchestrator-state-performance.yml`; fresh-start hint: `Run /owflow:performance <description> to start a task from scratch.`
61
+ - Skill starting points (used for the bootstrap question and `started_phase`): performance-analyze → `codebase-analysed`; performance-spec → `spec-written`; performance-plan → `plan-created`; performance-implement → `implementation-done`; performance-verify → `options-chosen`; performance-finalize → `task-completed`.
62
+
53
63
  ### Deterministic entry checks (future)
54
64
 
55
65
  Entry-gate checks above are currently executed by the agent reading state. For more deterministic routing, future work considers (a) a small script that checks whether `orchestrator-state.yml` exists, parses it, and answers slug/next-step queries, and (b) an OpenCode lifecycle hook that automates these entry-gate checks for dev-* skills before they run. Until then, follow the rules above exactly as written.
@@ -107,6 +117,6 @@ The Exit Gate runs after all phase work and state updates are final. It presents
107
117
 
108
118
  ## Exceptions
109
119
 
110
- - **Dispatchers** (`development`, `research`): the Exit Gate's acceptance question is adapted — the results box is the handoff block, and the question asks how to proceed (hand off to the suggested subskill / switch to autonomous mode / adjust / stop).
120
+ - **Dispatchers** (`development`, `research`, `performance`, `migration`): the Exit Gate's acceptance question is adapted — the results box is the handoff block, and the question asks how to proceed (hand off to the suggested subskill / switch to autonomous mode / adjust / stop).
111
121
  - **Utility skills with explicit no-follow-up contracts** (`agents-md-generator`, `rule-reviewer`): the acceptance question is confirm-or-revise only; follow-up suggestions stay prohibited unless the user asks. See [confirm-or-revise exception](confirm-or-revise-exception.md).
112
- - **Orchestrated mode** (`goal-development`, `goal-research`): the subskill's own Exit Gate acceptance question IS the loop gate — Accept means "continue to the next subskill". The wrapper MUST NOT add a second consecutive `question`.
122
+ - **Orchestrated mode** (`goal-development`, `goal-research`, `goal-performance`, `goal-migration`): the subskill's own Exit Gate acceptance question IS the loop gate — Accept means "continue to the next subskill". The wrapper MUST NOT add a second consecutive `question`.
@@ -8,6 +8,7 @@ Some heavily cross-referenced sections live in their own reference files:
8
8
  - [Dispatcher & Handoff Pattern](dispatcher-handoff.md) — subskill loop, mode table, per-step state writes (was Section 7)
9
9
  - [Command Namespacing](command-namespacing.md) — `owflow:` prefix rules (was Section 8)
10
10
  - [Gate Contract](gate-contract.md) — Entry Gate & Exit Gate skill contract, incl. exceptions (was Section 9)
11
+ - [Fix Loop Contract](fix-loop-contract.md) — user-driven fix-then-reverify contract: option wording, iteration budget, exit conditions, per-iteration state writes
11
12
 
12
13
  Section numbering below is kept as-is so existing cross-references stay valid.
13
14
 
@@ -128,11 +129,11 @@ Orchestrators add domain-specific fields using `[domain]_context`:
128
129
  | Domain | Context Field | Example Fields |
129
130
  | ----------- | --------------------- | -------------------------------------------------- |
130
131
  | Development | `task_context` | risk_level, ui_heavy, architecture_decision |
131
- | Performance | `performance_context` | baseline_p95, target_p95, optimizations_completed |
132
- | Migration | `migration_context` | migration_type, steps_completed |
132
+ | Performance | `performance_context` | bottlenecks_identified, user_data_available, bottleneck_priorities, task_characteristics, phase_summaries |
133
+ | Migration | `migration_context` | migration_type, target_system, risk_level |
133
134
  | Research | `research_context` | research_type, research_question, confidence_level |
134
135
 
135
- See each orchestrator's SKILL.md "Domain Context" section for full schema.
136
+ See each workflow's state template under `src/templates/` for the full extension schema.
136
137
 
137
138
  ### Shared: research_reference
138
139
 
@@ -205,6 +206,8 @@ If prerequisites missing, use question: "Start from Phase 1", "Specify different
205
206
 
206
207
  ### Fix-Then-Reverify Loop
207
208
 
209
+ The canonical user-driven contract — option wording, iteration budget, exit conditions, and per-iteration state writes — lives in [Fix Loop Contract](fix-loop-contract.md); skills with a fix phase reference it and document only their deltas. The generic shape:
210
+
208
211
  1. Read verification results (structured issues)
209
212
  2. For each issue: trivial/auto-fixable → fix silently, log action; non-trivial → question
210
213
  3. If fixes applied → set `skip_test_suite: false` (code changed) → re-run verification