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
package/README.md CHANGED
@@ -130,15 +130,26 @@ You can always be explicit when you prefer - arguments and flags simply override
130
130
 
131
131
  ## Supported Workflows
132
132
 
133
- | Command | Use When |
134
- | ---------------------- | ------------------------------------------- |
135
- | `/owflow:development` | Features, bug fixes, enhancements |
136
- | `/owflow:research` | Research with synthesis and solution design |
137
- | `/owflow:performance` | Optimizing speed or resource usage |
138
- | `/owflow:migration` | Changing technologies or patterns |
133
+ | Command | Use When |
134
+ | -------------------------- | ---------------------------------------------- |
135
+ | `/owflow:development` | Features, bug fixes, enhancements |
136
+ | `/owflow:research` | Research with synthesis and solution design |
137
+ | `/owflow:performance` | Optimizing speed or resource usage |
138
+ | `/owflow:migration` | Changing technologies or patterns |
139
139
 
140
140
  Use `/owflow:work` as a single entry point — it classifies the task with the `task-classifier` subagent and routes to the right workflow.
141
141
 
142
+ ### Autonomous Workflows
143
+
144
+ Each workflow has a `/owflow:goal-*` equivalent that runs the same pipeline back-to-back in one session, pausing at decision gates between steps. Both modes share one task state, so you can mix them freely on a single task.
145
+
146
+ | Command | Runs |
147
+ | -------------------------- | ----------------------------- |
148
+ | `/owflow:goal-development` | The full development pipeline |
149
+ | `/owflow:goal-research` | The full research pipeline |
150
+ | `/owflow:goal-performance` | The full performance pipeline |
151
+ | `/owflow:goal-migration` | The full migration pipeline |
152
+
142
153
  ### Research Utility
143
154
 
144
155
  | Command | Use When |
@@ -146,6 +157,10 @@ Use `/owflow:work` as a single entry point — it classifies the task with the `
146
157
  | `/owflow:research-quick "<description>"` | Condensed research: brief → plan → gather → synthesis in one pass |
147
158
  | `/owflow:research-fork <task-path> ["<what this fork should explore>"]` | Branch a research task and re-run from the fork point with different choices |
148
159
 
160
+ ### Migration Subskills
161
+
162
+ Migration runs as a pipeline of eight standalone subskills — `/owflow:migration-analyze`, `/owflow:migration-target`, `/owflow:migration-spec`, `/owflow:migration-plan`, `/owflow:migration-implement`, `/owflow:migration-verify`, `/owflow:migration-fix`, `/owflow:migration-finalize` — with `/owflow:migration` as the dispatcher and `/owflow:goal-migration` running the whole pipeline in one session. Flags: `--from=<slug>`, `--type=code|data|architecture|general`, `--no-web-research`.
163
+
149
164
  ### Quick Commands
150
165
 
151
166
  For smaller tasks that don't need a full workflow:
@@ -191,6 +206,17 @@ The full `/owflow:development` workflow consists of standalone subskills — `/o
191
206
 
192
207
  If a subskill is invoked too early in the workflow (prerequisite phases not yet complete), it stops and tells you exactly which steps to run first, in order. If the workflow state doesn't exist yet, use `/owflow:development <description>` to start from scratch.
193
208
 
209
+ ### Fine-Grained Control: Performance Subskills
210
+
211
+ The full `/owflow:performance` workflow consists of standalone subskills — `/owflow:performance-analyze`, `/owflow:performance-spec`, `/owflow:performance-plan`, `/owflow:performance-implement`, `/owflow:performance-verify`, `/owflow:performance-finalize` — which you can also invoke individually. Each accepts a task path, or just a task-directory identifier:
212
+
213
+ ```bash
214
+ /owflow:performance-analyze 2026-01-12-dashboard-queries
215
+ /owflow:performance-verify .owflow/tasks/performance/2026-01-12-dashboard-queries
216
+ ```
217
+
218
+ If a subskill is invoked too early in the workflow (prerequisite steps not yet complete), it stops and tells you exactly which steps to run first, in order. If the workflow state doesn't exist yet, use `/owflow:performance <description>` to start from scratch.
219
+
194
220
  ## Standards-Aware Development
195
221
 
196
222
  This is the key differentiator. Owflow doesn't just run workflows - it learns your project's conventions and enforces them:
@@ -74,9 +74,11 @@ Detect ORM calls inside iteration constructs:
74
74
  - **Django**: Attribute access on queryset (lazy loading) inside template/view loops
75
75
  - **Rails**: Association method calls without `.includes()` or `.preload()`
76
76
  - **SQLAlchemy**: Relationship access without `joinedload()` or `subqueryload()`
77
+ - **Hibernate**: `@ManyToOne` lazy access in loop → `@Fetch(FetchMode.JOIN)` or JPQL `JOIN FETCH`
77
78
 
78
79
  **Missing Index Detection** (read schema/migrations, don't run EXPLAIN):
79
80
  - Read migration files and schema definitions to catalog existing indexes
81
+ - Per-framework index locations: Rails `add_index`, Django `db_index` / Meta `indexes`, Sequelize `indexes`, Prisma `@@index`/`@@unique`, TypeORM `@Index`, SQL migrations `CREATE INDEX`
80
82
  - Grep for query patterns (WHERE, ORDER BY, JOIN columns)
81
83
  - Cross-reference: columns filtered/sorted on without corresponding indexes
82
84
  - Flag composite conditions without composite indexes
@@ -85,7 +87,9 @@ Detect ORM calls inside iteration constructs:
85
87
  - `SELECT *` when only a few columns are needed
86
88
  - Missing `LIMIT` on queries against large tables
87
89
  - String operations in WHERE clauses (`LIKE '%...'`)
90
+ - `OR` conditions on different columns (prevents single index use)
88
91
  - Subqueries that could be JOINs
92
+ - `DISTINCT` masking a JOIN issue
89
93
  - Unbounded queries without pagination
90
94
 
91
95
  **Output**: List of database bottlenecks with file:line references and fix approach
@@ -281,7 +281,7 @@ groups:
281
281
 
282
282
  ## Integration
283
283
 
284
- **Invoked by**: development orchestrator (Phase 7), migration orchestrator (Phase 3)
284
+ **Invoked by**: dev-plan, migration-plan
285
285
 
286
286
  **Prerequisites**:
287
287
 
@@ -268,7 +268,7 @@ issue_counts:
268
268
 
269
269
  ## Integration
270
270
 
271
- **Invoked by**: implementation-verifier (Phase 3), performance orchestrator (Phase 4), standalone via `/owflow:reviews-production-readiness` command
271
+ **Invoked by**: implementation-verifier (Phase 3; inside `performance-verify` for performance tasks), standalone via `/owflow:reviews-production-readiness` command
272
272
 
273
273
  **Prerequisites**:
274
274
 
@@ -303,7 +303,7 @@ warnings: ["any non-critical observations"]
303
303
 
304
304
  ## Integration
305
305
 
306
- **Invoked by**: development orchestrator (Phase 5), migration orchestrator (Phase 2)
306
+ **Invoked by**: dev-spec, migration-spec
307
307
 
308
308
  **Prerequisites**:
309
309
 
@@ -146,8 +146,8 @@ Use Skill tool:
146
146
  Examples:
147
147
 
148
148
  - Resume development: `skill: "owflow:development"` with `args: "--resume .owflow/tasks/development/2025-10-23-fix"`
149
- - Restart from step: `skill: "owflow:development"` with `args: "--resume .owflow/tasks/development/2025-10-26-auth --from=verification-done"` (dev tasks use descriptive step slugs in `completed_phases`; performance and migration are the remaining `phase-N` holdouts — research uses the descriptive slugs in `templates/orchestrator-state-research.yml`)
150
- - Fresh attempts: `skill: "owflow:migration"` with `args: "--resume .owflow/tasks/migrations/2025-10-20-redux --reset-attempts"`
149
+ - Restart from step: `skill: "owflow:development"` with `args: "--resume .owflow/tasks/development/2025-10-26-auth --from=verification-done"` (development, research, performance, and migration tasks use descriptive step slugs in `completed_phases`)
150
+ - Fresh attempts: `skill: "owflow:development"` with `args: "--resume .owflow/tasks/development/2025-10-23-fix --reset-attempts"`
151
151
 
152
152
  ### Step 3: Classify & Route New Task
153
153
 
@@ -236,8 +236,8 @@ Display:
236
236
  | Workflow Type | Skill | Args |
237
237
  | ------------- | ------------- | --------------------------------------------------- |
238
238
  | development | `development` | `--resume [path] [--from=<slug>] [--reset-attempts]` |
239
- | performance | `performance` | `--resume [path] [--from=PHASE]` |
240
- | migration | `migration` | `--resume [path] [--from=PHASE]` |
239
+ | performance | `performance` | `--resume [path] [--from=<slug>]` |
240
+ | migration | `migration` | `--resume [path] [--from=<slug>]` |
241
241
  | research | `research` | `--resume [path] [--from=<slug>]` |
242
242
 
243
243
  ---
@@ -155,8 +155,8 @@ risk_level: low|low-medium|medium|medium-high|high
155
155
 
156
156
  ## Integration
157
157
 
158
- | Orchestrator | Phase | artifact_name |
158
+ | Orchestrator | Step (slug) | artifact_name |
159
159
  |-------------|-------|---------------|
160
- | development orchestrator | Phase 1 | `codebase-analysis.md` (default) |
161
- | migration orchestrator | Phase 1 | `current-state-analysis.md` |
162
- | performance orchestrator | Phase 1 | `codebase-analysis.md` (default) |
160
+ | development orchestrator | `codebase-analysed` | `codebase-analysis.md` (default) |
161
+ | migration-analyze | `state-analysed` | `current-state-analysis.md` |
162
+ | performance-analyze | `codebase-analysed` | `codebase-analysis.md` (default) |
@@ -43,7 +43,7 @@ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate C
43
43
 
44
44
  ## Execute
45
45
 
46
- **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) and [Issue Resolution](../orchestrator-framework/references/orchestrator-patterns.md) (Section 6).
46
+ **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).
47
47
 
48
48
  ### Verification Options Prompt (`options-chosen`, inline)
49
49
 
@@ -94,14 +94,7 @@ Verification Results:
94
94
 
95
95
  **Step 3**: Gate on status — `passed` → skip to State Update. `passed_with_issues` or `failed` → fix loop (Step 4).
96
96
 
97
- **Step 4**: User-driven fix loop (max 3 iterations):
98
-
99
- 1. Present critical + warning issues as a numbered list.
100
- 2. `question` — "Which issues should I fix?" Options: "Fix all fixable issues" / "Let me choose specific issues" / "Skip fixes, proceed as-is".
101
- 3. Fix selected issues; **immediately** log each to `verification_context.fixes_applied` in state (not deferred to the end).
102
- 4. After fixes: set `skip_test_suite: false` (code changed, tests must re-run).
103
- 5. `question` — "Re-run verification to check fixes?" → re-invoke `implementation-verifier` → back to Step 2, or "No, proceed to next phase".
104
- 6. **Immediately** update `verification_context.reverify_count` and `verification_context.last_status` in state after each verifier run.
97
+ **Step 4**: User-driven fix loop (max 3 iterations) — follow the [Fix Loop Contract](../orchestrator-framework/references/fix-loop-contract.md): the three-option question wording, immediate `fixes_applied` writes, `skip_test_suite: false` after fixes, re-invoking `implementation-verifier` on request, and refreshing `reverify_count` / `last_status` / `issues_found` right after each verifier run.
105
98
 
106
99
  **Exit conditions**: no critical issues remain → proceed; user explicitly chooses to proceed with issues → proceed with issues logged; max 3 iterations → `question` "Proceed with known issues?" / "Stop workflow". **MUST NOT proceed with unresolved critical issues unless the user explicitly approves.**
107
100
 
@@ -111,7 +104,7 @@ Apply after EVERY phase/step above:
111
104
 
112
105
  1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed plus that step's fields. Never defer writes to the end of the skill.
113
106
  2. **Options prompt** — append `options-chosen` to `completed_phases` with the chosen `options.*` and `skip_test_suite` (written right after the options prompt, before verification starts).
114
- 3. **Per verifier run** — update `verification_context.last_status`, `issues_found`, `fixes_applied`, and `reverify_count` immediately after each `implementation-verifier` run and after each fix-loop iteration (per steps 3/6 above), so an interruption loses nothing.
107
+ 3. **Per verifier run** — update `verification_context.last_status`, `issues_found`, `fixes_applied`, and `reverify_count` immediately after each `implementation-verifier` run and after each fix-loop iteration (per the [Fix Loop Contract](../orchestrator-framework/references/fix-loop-contract.md)'s immediate-write cadence), so an interruption loses nothing.
115
108
  4. **Completion** — append `verification-done` to `completed_phases` only at skill exit: status `passed`, or user-approved proceed with issues logged. Bump `orchestrator.updated` on every write.
116
109
  5. **Failures** — if `implementation-verifier` itself fails or the workflow stops with unresolved critical issues, do NOT append `verification-done` to `completed_phases`; append it to `orchestrator.failed_phases` and increment `auto_fix_attempts["verification-done"]`.
117
110
  6. **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-development.yml`. Fix any reported issue immediately before proceeding.
@@ -138,10 +138,10 @@ Better:
138
138
 
139
139
  Integrated into:
140
140
  - `src/skills/flow-init/SKILL.md` - Phase 6 (architecture and tech-stack doc refinement)
141
- - `src/skills/development/SKILL.md` - Phase 5 (spec refinement), Phase 7 (plan refinement)
142
- - `src/skills/research/SKILL.md` - Phase 5 (high-level design refinement)
143
- - `src/skills/performance/SKILL.md` - Phase 3 (spec refinement), Phase 5 (plan refinement)
144
- - `src/skills/migration/SKILL.md` - Phase 3 (spec refinement), Phase 4 (plan refinement)
141
+ - `src/skills/dev-spec/SKILL.md` - `spec-written` (spec refinement); `src/skills/dev-plan/SKILL.md` - `plan-created` (plan refinement)
142
+ - `src/skills/research-design/SKILL.md` - `design-generated` (high-level design refinement)
143
+ - `src/skills/performance-spec/SKILL.md` - `spec-written` (spec refinement); `src/skills/performance-plan/SKILL.md` - `plan-created` (plan refinement)
144
+ - `src/skills/migration-spec/SKILL.md` - `strategy-specified` (spec refinement); `src/skills/migration-plan/SKILL.md` - `plan-created` (plan refinement)
145
145
 
146
146
  Reference files:
147
147
  - `src/skills/flow-init/references/architecture-template.md`
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: owflow:goal-migration
3
+ description: Full orchestrated migration wrapper — runs ALL migration steps in one session by invoking every migration-* subskill in sequence with question gates between them. Use /owflow:migration for the same lifecycle in assisted mode — tasks can mix both modes freely.
4
+ argument-hint: "[task description | task-path] [--from=<slug>] [--type=TYPE] [--no-web-research]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Orchestrated Migration Wrapper
9
+
10
+ Autonomous mode for migration tasks. Initializes (or resumes) the task, then invokes every required `migration-*` subskill back-to-back via the Skill tool, pausing at gates between subskills. Shares `orchestrator-state.yml` with assisted mode (`/owflow:migration`) — tasks can mix both modes freely. There is no migration quick lane.
11
+
12
+ Gates follow the shared contract in [Gate Contract](../orchestrator-framework/references/gate-contract.md) — orchestrated mode exception: each subskill's own Exit Gate acceptance question IS the loop gate (Accept = continue to the next subskill).
13
+
14
+ ## Input / Output Artifacts
15
+
16
+ | Artifact | Behavior (this wrapper) |
17
+ | ------------------------------------ | ---------------------------------------------------------------------------------------------- |
18
+ | Consumed: argument (description / path) | migration description (new task) or task path/identifier (resume) |
19
+ | Consumed/produced: all task artifacts | owned entirely by the invoked subskills (none here — delegate, never inline) |
20
+ | State write | `orchestrator.task_ids` (task items) + `orchestrator.updated` only; first-time initialization per the dispatcher's Step 3 is the one permitted write outside the loop |
21
+
22
+ ## Entry Gate
23
+
24
+ Identical to the migration dispatcher — complete ALL of its entry-gate steps first (see `../migration/SKILL.md` Entry Gate):
25
+
26
+ 1. Read the framework reference files NOW, exactly as the migration dispatcher's Step 1: the [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md), the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), and the [Orchestrator Patterns](../orchestrator-framework/references/orchestrator-patterns.md).
27
+ 2. Resolve the argument the same way the migration dispatcher does: task path or identifier (a directory, or a directory name under `.owflow/tasks/migrations/`) → **resume mode** (read `orchestrator-state.yml`, artifact-validate `completed_phases` against the dispatcher's marker table; find the first step slug NOT in `completed_phases` whose condition holds, with `--from=<slug>` overriding after prerequisite validation); a migration description (free text) → new task; nothing provided → ask via `question` — "What technology, platform, or architecture should be migrated, and to what?" — then WAIT. Missing state file → print `No migration task found at <path>. Run /owflow:migration <description> to start a migration task from scratch.` and STOP.
28
+ 3. Initialize (new task) exactly as the dispatcher's Step 3: create `.owflow/tasks/migrations/YYYY-MM-DD-task-name/` + `orchestrator-state.yml` from the migration template — `task.title` / `task.description` from the description, `task.status: in_progress`, `orchestrator.started_phase: state-analysed`, `orchestrator.entry_point: "migration"`, `orchestrator.task_path`, flags recorded (`--type` → `migration_context.migration_type`; `--no-web-research` is forwarded to `migration-target` per invocation — nothing is persisted for it). **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-migration.yml`. First-time initialization is the one permitted write outside the loop.
29
+ 4. Create ONE task item via `TaskCreate` per subskill in the upcoming loop (subject: `"<step name>: <subskill>"`, e.g. `"Spec: migration-spec"`), then set the execution order with `TaskUpdate addBlockedBy` (analyze → target → spec → plan → implement → verify → fix → finalize). Record the ids in `orchestrator.task_ids`. On resume, refresh the already-evidenced items instead of re-creating them. Update statuses as the loop progresses.
30
+
31
+ **Output**:
32
+
33
+ ```
34
+ 🚀 Orchestrated Migration
35
+
36
+ Task: [migration description]
37
+ Directory: [task-path]
38
+ Loop: migration-analyze → migration-target → migration-spec → migration-plan → migration-implement → migration-verify → [migration-fix] → migration-finalize
39
+ ```
40
+
41
+ ---
42
+
43
+ ## The Loop
44
+
45
+ For each subskill in sequence, execute — skipping any row whose condition is not met (a row whose slug is already in `completed_phases` counts as done). **Compatibility re-verification fallback**: when the loop finds no runnable row and `verification-done` is complete with `verification_context.compatibility_status != passed` (failed or null/invalidated), invoke `migration-verify` once (re-verification, overriding slug completeness), then re-read state and continue from the first row whose condition holds; it does not re-fire while the Fix row is runnable; a recorded data-integrity HALT keeps the user-confirmed rollback path dominant.
46
+
47
+ 1. **Announce**: 1-line step banner.
48
+ 2. **Invoke**: Skill tool with `name: "owflow:<subskill>"` and `prompt: "<task-path> [flags relevant to that subskill]"`. The subskill owns its Entry Gate, delegation, and state updates. Flags forwarded per subskill: `--type` and `--no-web-research` to `migration-target`.
49
+ 3. **Verify handback**: after the skill returns, re-read `orchestrator-state.yml` — confirm the expected step slug(s) were appended to `completed_phases` per the Sequence and Conditionals table. If a subskill stopped early (its Entry Gate failed), STOP the loop and relay its routing message to the user verbatim.
50
+ 4. **Gate (subskill's Exit Gate is the loop gate)**: each subskill presents its results box and fires its own results-acceptance `question` before its handoff hint (Orchestrated-mode exception, [Gate Contract](../orchestrator-framework/references/gate-contract.md)). [Rule 5 of the Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md) — "subskills only SUGGEST the next command" — is superseded for Accept: when the user answers **Accept** to the subskill's Exit Gate question pointing at the next subskill in this loop, treat that as "continue to the next subskill" and invoke it. Any other answer (Adjust / Discuss / Stop / other options picked) ends the loop: print the standard handoff block (next command + `/owflow:migration <task-path>` resume hint) and end.
51
+ - **Non-loop-gate questions**: the in-phase questions inside subskills (analyze clarifiers, spec requirement questions, verify's options step, fix's per-iteration questions) are part of that subskill's own decision flow — they are NOT the loop gate and are NEVER auto-accepted or answered by this wrapper. There is exactly ONE gate definition per subskill hop; the wrapper adds NO second consecutive `question`.
52
+ - **No quick lane**: migration has no quick lane — every row runs at full fidelity.
53
+
54
+ ### Sequence and Conditionals
55
+
56
+ | Order | Subskill | Run when (re-read from state) |
57
+ | ----- | ------------------ | ----------------------------------------------------------------------------------------------------------------------- |
58
+ | 1 | migration-analyze | Always (new task or partial foundation) |
59
+ | 2 | migration-target | `state-analysed` in `completed_phases` |
60
+ | 3 | migration-spec | `target-planned` completed |
61
+ | 4 | migration-plan | `strategy-specified` completed |
62
+ | 5 | migration-implement | `plan-created` completed |
63
+ | 6 | migration-verify | `migration-executed` completed |
64
+ | 7 | migration-fix | `verification-done` completed **and** (`verification_context.compatibility_status = failed` **or** (`verification_context.last_status != passed` **and** no recorded deliberate skip)); otherwise the row is skipped and `migration-finalize`'s own Entry Gate routes forward |
65
+ | 8 | migration-finalize | `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) |
66
+
67
+ `task-completed` already in `completed_phases` → the task is TERMINAL: skip the loop and present the wrapper Exit Gate.
68
+
69
+ **Interruptible**: at any gate the user may answer "stop" — print the standard handoff block (next command + `/owflow:migration <task-path>` resume hint) and end the session. The task resumes later in either mode; a fresh invocation of this wrapper resumes from state, never from loop memory.
70
+
71
+ ---
72
+
73
+ ## Exit Gate
74
+
75
+ When migration-finalize completes (`task.status: completed`):
76
+
77
+ 1. Mark the final task item completed via `TaskUpdate`.
78
+ 2. Present the workflow results box:
79
+
80
+ ```markdown
81
+ ## ✅ MIGRATION WORKFLOW COMPLETE — <task name>
82
+
83
+ **Migration** — [current → target, type]
84
+ **Strategy** — [incremental / big-bang / dual-run / phased]
85
+ **Steps** — [executed step slugs, e.g. state-analysed → target-planned → strategy-specified → plan-created → migration-executed → options-chosen → verification-done → issues-resolved → docs-generated → task-completed]
86
+ **Verification** — [final verifier verdict + overall compatibility verdict]
87
+ **Fixes** — [N applied / none required / deliberately skipped]
88
+ **Operator guide** — [generated / skipped (`docs_enabled` not enabled)]
89
+
90
+ **Artifacts** — [artifact inventory: `analysis/current-state-analysis.md`, `analysis/target-state-plan.md`, `analysis/requirements.md`, `analysis/rollback-plan.md`, `implementation/spec.md`, `implementation/implementation-plan.md`, `implementation/work-log.md`, `verification/implementation-verification.md`, `verification/compatibility-test-results.md`, `documentation/migration-guide.md` (conditional)]
91
+ ```
92
+
93
+ 3. Use `question` — "Are these results correct?" with options: **Accept** (print follow-up suggestions: review the artifacts, commit personally — the workflow performs no commits; `/owflow:reviews-pragmatic <task-path>` if desired; then end) / **Adjust** (re-open the relevant `/owflow:migration-*` skill with the corrections) / **Discuss** (walk through the migration summary) / **Stop here** (print the resume command `/owflow:migration <task-path>` and end).
94
+
95
+ Then end. No further owflow phase commands are required.
96
+
97
+ ---
98
+
99
+ ## Loop Rules
100
+
101
+ - **Delegate, never inline**: the wrapper only sequences — all step work happens inside subskills. If you catch yourself analyzing/migrating outside a subskill, STOP and invoke the subskill instead.
102
+ - **State is the truth**: gates and routing read `orchestrator-state.yml`, not memory. Re-read after every subskill returns.
103
+ - **Same state schema as assisted mode**: `completed_phases` step slugs (`state-analysed` … `task-completed`) are identical; resume works across modes.
104
+ - **Wrapper writes almost nothing**: step slugs, summaries, and outputs belong to the subskills — this wrapper writes ONLY `orchestrator.task_ids` (task items) and `orchestrator.updated` (timestamps); the sole exception is first-time initialization per the dispatcher's Step 3.
105
+ - **Zero added pause points**: one full pass asks at most the 8 subskill Exit Gates + this terminal gate = 9 — fewer when the conditional `migration-fix` row is skipped; the same asks as assisted mode. There is no per-hop back-to-back `question` exception: the wrapper adds no question inside the loop, and its only wrapper-level `question` is this terminal gate (the finalize gate and the wrapper gate are the one legitimate consecutive pair).
106
+
107
+ ## Command Integration
108
+
109
+ Invoked via:
110
+
111
+ - `/owflow:goal-migration [description] [--type=TYPE] [--no-web-research]` (new)
112
+ - `/owflow:goal-migration [task-path] [--from=<slug>]` (resume)
113
+
114
+ Alternative: `/owflow:migration` — same task in assisted mode (one subskill per invocation, fresh context each step).
@@ -0,0 +1,126 @@
1
+ ---
2
+ name: owflow:goal-performance
3
+ description: Full orchestrated performance wrapper — runs ALL performance steps in one session by invoking every performance-* subskill in sequence with question gates between them. Use /owflow:performance for the same lifecycle in assisted mode — tasks can mix both modes freely.
4
+ argument-hint: "[task description | task-path] [--from=<step-slug>]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Orchestrated Performance Wrapper
9
+
10
+ Autonomous mode for performance tasks. Initializes (or resumes) the task, then invokes every required `performance-*` subskill back-to-back via the Skill tool, pausing at gates between subskills. Shares `orchestrator-state.yml` with assisted mode (`/owflow:performance`) — tasks can mix both modes freely.
11
+
12
+ Gates follow the shared contract in [Gate Contract](../orchestrator-framework/references/gate-contract.md) — orchestrated mode exception: each subskill's own Exit Gate acceptance question IS the loop gate (Accept = continue to the next subskill). **At intermediate hops the wrapper MUST NOT add a second consecutive `question`**; after the final hop, the wrapper Exit Gate below fires exactly one workflow-closure confirmation.
13
+
14
+ ## Input / Output Artifacts
15
+
16
+ | Artifact | This wrapper | Assisted mode (`/owflow:performance`) |
17
+ | --- | --- | --- |
18
+ | Consumed: argument (description / path) | performance issue description (new task) or task path/identifier (resume) | same |
19
+ | Consumed/produced: all task artifacts | owned entirely by the invoked subskills (none here — delegate, never inline) | same |
20
+ | State write | init as the dispatcher; during the loop ONLY `orchestrator.task_ids` + `orchestrator.updated` | init + drop-only resume trim |
21
+
22
+ ## Entry Gate
23
+
24
+ Identical to the performance dispatcher — complete ALL of its entry-gate steps first (see `../performance/SKILL.md` Entry Gate):
25
+
26
+ 1. Read the framework reference files NOW, exactly as the performance dispatcher's Step 1: the [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md), the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md), and the [Orchestrator Patterns](../orchestrator-framework/references/orchestrator-patterns.md).
27
+ 2. Resolve the argument the same way the performance dispatcher does: task path or identifier (a directory, or a directory name under `.owflow/tasks/performance/`) → **resume mode** (read `orchestrator-state.yml`, run the dispatcher's drop-only resume validation, derive the next step from the dispatcher's routing table, with `--from=<step-slug>` overriding); a performance issue description (free text) → new task; nothing provided → ask via `question` — "What is slow or performance-constrained? Describe the symptom (endpoint, page, job), expected vs actual behavior, and any profiling data you have." — then WAIT. Missing state file → print `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
28
+ 3. Initialize (new task) exactly as the dispatcher: create `.owflow/tasks/performance/YYYY-MM-DD-task-name/` with `analysis/`, `analysis/user-profiling-data/`, `implementation/`, `verification/`, then `orchestrator-state.yml` from the performance template — `task.title` / `task.description` from the description, `task.status: in_progress`, `orchestrator.task_path`, `orchestrator.entry_point: "performance"`, and project docs into `performance_context.project_doc_paths`. **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-performance.yml`.
29
+ 4. Create the six task items via `TaskCreate` exactly as the dispatcher does (one per subskill), set `addBlockedBy` chains, and record their ids in `orchestrator.task_ids`. On resume, refresh the already-evidenced items instead of re-creating them. Update item statuses as the loop progresses.
30
+
31
+ **Output**:
32
+
33
+ ```
34
+ 🚀 Orchestrated Performance
35
+
36
+ Task: [performance issue description]
37
+ Directory: [task-path]
38
+ Loop: performance-analyze → performance-spec → performance-plan → performance-implement → performance-verify → performance-finalize
39
+ ```
40
+
41
+ ---
42
+
43
+ ## The Loop
44
+
45
+ For each subskill in the Sequence table below, execute — skipping any row whose **Runs when** condition is not met. The condition is authoritative: a multi-slug row (row 2) still runs when one of its slugs is complete but the other is pending (the audit re-entry case).
46
+
47
+ 1. **Announce**: 1-line step banner.
48
+ 2. **Invoke**: Skill tool with `name: "<subskill>"` and `prompt: "<task-path> [flags relevant to that subskill]"`. The subskill owns its Entry Gate, delegation, and state updates. Never run a subskill's or an agent's work inline.
49
+ 3. **Verify handback**: after the skill returns, re-read `orchestrator-state.yml` — confirm the row's expected slug(s) are present in `completed_phases`. A re-entered row may add only its pending slug, and an audit skip records `options.spec_audit_enabled: false` with no new slug — those are legitimate completions, not early stops. A subskill that stopped at its entry check (missing prerequisites, no task) ENDS the loop and its routing/blocked message is relayed to the user.
50
+ 4. **Gate (the subskill's Exit Gate IS the loop gate)**: each subskill presents its results box and fires its own results-acceptance `question` before its handoff hint (orchestrated-mode exception, [Gate Contract](../orchestrator-framework/references/gate-contract.md)). When the user answers **Accept**, treat it as "continue to the next subskill" and invoke it. Any other answer (Adjust / Discuss / Stop here) ends the loop exactly like a rejected gate. There is exactly ONE gate per hop — **the wrapper adds NO second consecutive `question` at intermediate hops**; the terminal wrapper Exit Gate (below) is the single workflow-closure confirmation after the final hop.
51
+
52
+ ### Sequence
53
+
54
+ | Order | Subskill | Runs when (from state) | Slugs verified after |
55
+ | --- | --- | --- | --- |
56
+ | 1 | `performance-analyze` | new task, OR `codebase-analysed` absent, OR (`codebase-analysed` present AND `bottlenecks-identified` absent) | `codebase-analysed`, `bottlenecks-identified` |
57
+ | 2 | `performance-spec` | `bottlenecks-identified` complete AND [ (`spec-written` absent) OR (`spec-audited` absent AND (`options.spec_audit_enabled` is null OR `true`)) ] | `spec-written` (+ `spec-audited` when the audit ran) |
58
+ | 3 | `performance-plan` | `spec-written` complete AND `options.spec_audit_enabled` non-null — settled, NEVER `spec-audited` — AND `plan-created` absent | `plan-created` |
59
+ | 4 | `performance-implement` | `plan-created` complete AND `implementation-done` absent | `implementation-done` |
60
+ | 5 | `performance-verify` | `implementation-done` complete AND [ `options-chosen` absent OR `verification-done` absent ] | `options-chosen`, `verification-done` |
61
+ | 6 | `performance-finalize` | `verification-done` complete AND `task-completed` absent | `task-completed` + `task.status: completed` |
62
+
63
+ Six rows, ZERO user-choice rows: every performance conditional is an in-skill `question` owned by a subskill, never a chain decision this wrapper makes.
64
+
65
+ ### Decisions the wrapper never answers
66
+
67
+ The six in-skill decision questions below belong to the subskill that owns them — they are NEVER auto-accepted, pre-answered, or skipped by this wrapper (decisions are never silently accepted):
68
+
69
+ | Subskill | In-skill decision questions |
70
+ | --- | --- |
71
+ | `performance-analyze` | performance concerns / hotspots / goals (max 5); profiling-data offer |
72
+ | `performance-spec` | bottleneck priorities / constraints / targets; run the specification audit? |
73
+ | `performance-verify` | which additional verification checks; fix-set selection + re-run verification |
74
+
75
+ `performance-plan`, `performance-implement`, and `performance-finalize` have no in-skill decision questions — their only gates are their Exit Gates (the loop gate above).
76
+
77
+ **Interruptible**: at any gate the user may answer "stop" — print the standard handoff block (`/owflow:performance <task-path>` resume hint + the next command) and end the session. The task resumes later in either mode.
78
+
79
+ `task-completed` already in `completed_phases` (with `task.status: completed`) → the task is TERMINAL: skip the Loop and present the wrapper Exit Gate.
80
+
81
+ ---
82
+
83
+ ## Exit Gate
84
+
85
+ When `performance-finalize`'s own Exit Gate is accepted (`task-completed` recorded, `task.status: completed`):
86
+
87
+ 1. Mark the final task item completed via `TaskUpdate`.
88
+ 2. Present the wrapper terminal results box:
89
+
90
+ ```markdown
91
+ ## ✅ PERFORMANCE WORKFLOW COMPLETE — <task name>
92
+
93
+ **Steps** — [executed step slugs, e.g. codebase-analysed → bottlenecks-identified → … → task-completed]
94
+ **Bottlenecks found** — [P0/P1/P2/P3 counts]
95
+ **Optimizations applied** — [count + key ones]
96
+ **Verification** — [final verdict]
97
+ **Estimated improvement** — [range from the analysis]
98
+
99
+ **Artifacts**
100
+
101
+ - `analysis/performance-analysis.md`
102
+ - `implementation/work-log.md`
103
+ - `verification/implementation-verification.md`
104
+ ```
105
+
106
+ 3. Use `question` — "Are these results correct?" with options: **Accept** (print the follow-up suggestions: measure the improvement, consider runtime profiling, `/owflow:standards-update "<lesson>"`, then end) / **Adjust** (re-open the affected `/owflow:performance-*` skill with the corrections) / **Discuss** (walk through the optimization summary, evidence, and measurement caveats) / **Stop here** (print the resume command `/owflow:performance <task-path>` and end).
107
+
108
+ Then end. No further owflow commands are required.
109
+
110
+ ---
111
+
112
+ ## Loop Rules
113
+
114
+ - **Delegate, never inline**: the wrapper only sequences — all step work happens inside subskills. If you catch yourself analyzing or implementing outside a subskill, STOP and invoke the subskill instead.
115
+ - **State is the truth**: gates and routing read `orchestrator-state.yml`, not memory. Re-read after every subskill returns.
116
+ - **Same state schema as assisted mode**: `completed_phases` step slugs (`codebase-analysed` … `task-completed`) are identical; resume works across modes.
117
+ - **Wrapper writes almost nothing**: step slugs, summaries, and artifacts belong to the subskills — during the loop this wrapper writes ONLY `orchestrator.task_ids` (task items) and `orchestrator.updated` (timestamps).
118
+
119
+ ## Command Integration
120
+
121
+ Invoked via:
122
+
123
+ - `/owflow:goal-performance [description]` (new)
124
+ - `/owflow:goal-performance [task-path] [--from=<step-slug>]` (resume)
125
+
126
+ Alternative: `/owflow:performance` — same task in assisted mode (one subskill per invocation, fresh context each step).