owflow 0.6.0 → 0.7.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.
- package/LICENSE +21 -21
- package/README.md +448 -283
- package/dist/agents/bottleneck-analyzer.md +332 -333
- package/dist/agents/code-quality-pragmatist.md +353 -354
- package/dist/agents/code-reviewer.md +238 -239
- package/dist/agents/codebase-analysis-reporter.md +245 -246
- package/dist/agents/docs-operator.md +22 -23
- package/dist/agents/e2e-test-verifier.md +447 -448
- package/dist/agents/gap-analyzer.md +501 -502
- package/dist/agents/implementation-completeness-checker.md +219 -220
- package/dist/agents/implementation-planner.md +308 -309
- package/dist/agents/information-gatherer.md +690 -691
- package/dist/agents/production-readiness-checker.md +278 -279
- package/dist/agents/project-analyzer.md +403 -403
- package/dist/agents/reality-assessor.md +365 -366
- package/dist/agents/research-planner.md +449 -450
- package/dist/agents/research-synthesizer.md +402 -403
- package/dist/agents/solution-brainstormer.md +256 -257
- package/dist/agents/solution-designer.md +371 -372
- package/dist/agents/spec-auditor.md +297 -298
- package/dist/agents/specification-creator.md +333 -334
- package/dist/agents/task-classifier.md +449 -450
- package/dist/agents/task-group-implementer.md +283 -284
- package/dist/agents/test-suite-runner.md +194 -195
- package/dist/agents/user-docs-generator.md +508 -509
- package/dist/commands/reviews-code.md +90 -90
- package/dist/commands/reviews-pragmatic.md +99 -99
- package/dist/commands/reviews-production-readiness.md +113 -113
- package/dist/commands/reviews-reality-check.md +110 -110
- package/dist/commands/reviews-spec-audit.md +114 -114
- package/dist/commands/work.md +280 -280
- package/dist/configuration/agents-config.d.ts +2 -0
- package/dist/configuration/agents-config.js +8 -44
- package/dist/configuration/commands-config.d.ts +23 -0
- package/dist/configuration/commands-config.js +17 -17
- package/dist/configuration/skills-config.d.ts +2 -0
- package/dist/configuration/skills-config.js +3 -3
- package/dist/hooks/hooks-diagnostics.d.ts +3 -0
- package/dist/hooks/hooks-diagnostics.js +21 -0
- package/dist/hooks/hooks-persistence.d.ts +17 -0
- package/dist/hooks/hooks-persistence.js +207 -0
- package/dist/hooks/hooks-registry.d.ts +6 -0
- package/dist/hooks/hooks-registry.js +104 -0
- package/dist/hooks/hooks-wrapper.d.ts +25 -0
- package/dist/hooks/hooks-wrapper.js +318 -0
- package/dist/hooks/internal/before-tool.d.ts +6 -0
- package/dist/hooks/internal/before-tool.js +13 -0
- package/dist/hooks/internal/session-compaction.d.ts +9 -0
- package/dist/hooks/{session-compaction.js → internal/session-compaction.js} +9 -7
- package/dist/hooks/runtime/circuit-breaker.d.ts +23 -0
- package/dist/hooks/runtime/circuit-breaker.js +39 -0
- package/dist/hooks/runtime/failure-policy.d.ts +15 -0
- package/dist/hooks/runtime/failure-policy.js +49 -0
- package/dist/hooks/runtime/process-executor.d.ts +33 -0
- package/dist/hooks/runtime/process-executor.js +147 -0
- package/dist/hooks/runtime/status-recorder.d.ts +27 -0
- package/dist/hooks/runtime/status-recorder.js +111 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +111 -40
- package/dist/skills/agents-md-generator/SKILL.md +223 -223
- package/dist/skills/codebase-analyzer/SKILL.md +162 -162
- package/dist/skills/codebase-analyzer/references/code-analysis.md +63 -63
- package/dist/skills/codebase-analyzer/references/combined.md +31 -31
- package/dist/skills/codebase-analyzer/references/context-discovery.md +63 -63
- package/dist/skills/codebase-analyzer/references/file-discovery.md +51 -51
- package/dist/skills/codebase-analyzer/references/migration-target.md +23 -23
- package/dist/skills/codebase-analyzer/references/pattern-mining.md +22 -22
- package/dist/skills/dev-analyze/SKILL.md +115 -115
- package/dist/skills/dev-bugfix/SKILL.md +452 -452
- package/dist/skills/dev-finalize/SKILL.md +118 -118
- package/dist/skills/dev-implement/SKILL.md +167 -167
- package/dist/skills/dev-plan/SKILL.md +147 -147
- package/dist/skills/dev-spec/SKILL.md +182 -182
- package/dist/skills/dev-tdd-red/SKILL.md +94 -94
- package/dist/skills/dev-verify/SKILL.md +153 -153
- package/dist/skills/development/SKILL.md +260 -260
- package/dist/skills/diagrams-mermaid/SKILL.md +183 -159
- package/dist/skills/diagrams-mermaid/references/reference.md +220 -148
- package/dist/skills/docs-manager/SKILL.md +379 -379
- package/dist/skills/docs-manager/docs/INDEX.md +199 -199
- package/dist/skills/docs-manager/docs/standards/backend/api.md +25 -25
- package/dist/skills/docs-manager/docs/standards/backend/migrations.md +22 -22
- package/dist/skills/docs-manager/docs/standards/backend/models.md +25 -25
- package/dist/skills/docs-manager/docs/standards/backend/queries.md +22 -22
- package/dist/skills/docs-manager/docs/standards/frontend/accessibility.md +25 -25
- package/dist/skills/docs-manager/docs/standards/frontend/components.md +28 -28
- package/dist/skills/docs-manager/docs/standards/frontend/css.md +16 -16
- package/dist/skills/docs-manager/docs/standards/frontend/responsive.md +28 -28
- package/dist/skills/docs-manager/docs/standards/global/coding-style.md +25 -25
- package/dist/skills/docs-manager/docs/standards/global/commenting.md +10 -10
- package/dist/skills/docs-manager/docs/standards/global/conventions.md +31 -31
- package/dist/skills/docs-manager/docs/standards/global/error-handling.md +22 -22
- package/dist/skills/docs-manager/docs/standards/global/minimal-implementation.md +22 -22
- package/dist/skills/docs-manager/docs/standards/global/validation.md +28 -28
- package/dist/skills/docs-manager/docs/standards/testing/test-writing.md +25 -25
- package/dist/skills/docs-manager/references/agents-md-template.md +29 -29
- package/dist/skills/docs-manager/references/index-md-template.md +73 -73
- package/dist/skills/flow-init/SKILL.md +234 -234
- package/dist/skills/flow-init/references/architecture-template.md +45 -45
- package/dist/skills/flow-init/references/roadmap-templates.md +93 -93
- package/dist/skills/flow-init/references/tech-stack-template.md +70 -70
- package/dist/skills/flow-init/references/vision-templates.md +75 -75
- package/dist/skills/goal-development/SKILL.md +96 -96
- package/dist/skills/goal-migration/SKILL.md +114 -114
- package/dist/skills/goal-performance/SKILL.md +126 -126
- package/dist/skills/goal-research/SKILL.md +118 -118
- package/dist/skills/html-renderer/SKILL.md +173 -173
- package/dist/skills/html-renderer/references/index.html +318 -318
- package/dist/skills/html-renderer/references/styles.css +388 -388
- package/dist/skills/html-renderer/references/tokens.json +104 -104
- package/dist/skills/implementation-plan-executor/SKILL.md +378 -378
- package/dist/skills/implementation-verifier/SKILL.md +307 -307
- package/dist/skills/migration/SKILL.md +268 -268
- package/dist/skills/migration-analyze/SKILL.md +126 -126
- package/dist/skills/migration-finalize/SKILL.md +161 -161
- package/dist/skills/migration-fix/SKILL.md +155 -155
- package/dist/skills/migration-implement/SKILL.md +131 -131
- package/dist/skills/migration-plan/SKILL.md +131 -131
- package/dist/skills/migration-spec/SKILL.md +135 -135
- package/dist/skills/migration-spec/references/migration-strategies.md +430 -430
- package/dist/skills/migration-target/SKILL.md +134 -134
- package/dist/skills/migration-target/references/migration-types.md +489 -489
- package/dist/skills/migration-verify/SKILL.md +184 -184
- package/dist/skills/orchestrator-framework/SKILL.md +65 -65
- package/dist/skills/orchestrator-framework/references/command-namespacing.md +7 -7
- package/dist/skills/orchestrator-framework/references/confirm-or-revise-exception.md +20 -20
- package/dist/skills/orchestrator-framework/references/delegation-rules.md +54 -54
- package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +27 -27
- package/dist/skills/orchestrator-framework/references/fix-loop-contract.md +65 -65
- package/dist/skills/orchestrator-framework/references/gate-contract.md +122 -122
- package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +51 -51
- package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +235 -235
- package/dist/skills/performance/SKILL.md +267 -267
- package/dist/skills/performance-analyze/SKILL.md +129 -129
- package/dist/skills/performance-analyze/references/performance-optimization-guide.md +271 -271
- package/dist/skills/performance-finalize/SKILL.md +117 -117
- package/dist/skills/performance-implement/SKILL.md +114 -114
- package/dist/skills/performance-plan/SKILL.md +112 -112
- package/dist/skills/performance-spec/SKILL.md +145 -145
- package/dist/skills/performance-verify/SKILL.md +164 -164
- package/dist/skills/research/SKILL.md +249 -249
- package/dist/skills/research-brainstorm/SKILL.md +120 -120
- package/dist/skills/research-brainstorm/references/brainstorming-techniques.md +84 -84
- package/dist/skills/research-converge/SKILL.md +130 -130
- package/dist/skills/research-design/SKILL.md +146 -146
- package/dist/skills/research-design/references/design-techniques.md +40 -40
- package/dist/skills/research-finalize/SKILL.md +125 -125
- package/dist/skills/research-fork/SKILL.md +190 -190
- package/dist/skills/research-gather/SKILL.md +133 -133
- package/dist/skills/research-plan/SKILL.md +141 -141
- package/dist/skills/research-plan/references/research-methodologies.md +710 -710
- package/dist/skills/research-quick/SKILL.md +139 -139
- package/dist/skills/research-synthesize/SKILL.md +127 -127
- package/dist/skills/rule-reviewer/SKILL.md +334 -334
- package/dist/skills/standards-discover/SKILL.md +260 -260
- package/dist/skills/standards-discover/references/aggregation-strategy.md +76 -76
- package/dist/skills/standards-discover/references/code-pattern-prompt.md +68 -68
- package/dist/skills/standards-discover/references/config-analyzer-prompt.md +67 -67
- package/dist/skills/standards-discover/references/docs-extractor-prompt.md +65 -65
- package/dist/skills/standards-discover/references/external-analyzer-prompt.md +75 -75
- package/dist/skills/standards-update/SKILL.md +207 -207
- package/dist/templates/orchestrator-state-base.yml +17 -17
- package/dist/templates/orchestrator-state-development.yml +95 -95
- package/dist/templates/orchestrator-state-migration.yml +95 -95
- package/dist/templates/orchestrator-state-performance.yml +64 -64
- package/dist/templates/orchestrator-state-research.yml +67 -67
- package/dist/tools/fork_task.d.ts +17 -0
- package/dist/tools/fork_task.js +21 -11
- package/dist/tools/verify_template.d.ts +11 -0
- package/dist/tools/verify_template.js +32 -17
- package/dist/tui/hooks-dialogs.d.ts +20 -0
- package/dist/tui/hooks-dialogs.js +181 -0
- package/dist/tui/hooks-presenter.d.ts +15 -0
- package/dist/tui/hooks-presenter.js +70 -0
- package/dist/tui/hooks-sidebar.d.ts +10 -0
- package/dist/tui/hooks-sidebar.js +104 -0
- package/dist/tui/primitives.d.ts +21 -0
- package/dist/tui/primitives.js +47 -0
- package/dist/tui.d.ts +12 -0
- package/dist/tui.js +129 -0
- package/dist/types/hook-types.d.ts +125 -0
- package/dist/types/hook-types.js +76 -0
- package/dist/types/opencode-types.d.ts +13 -0
- package/dist/utils/file-util.d.ts +2 -0
- package/dist/utils/file-util.js +6 -6
- package/dist/utils/fork-task.d.ts +27 -0
- package/dist/utils/fork-task.js +18 -23
- package/dist/utils/plugin-info.d.ts +3 -0
- package/dist/utils/plugin-info.js +8 -10
- package/dist/utils/workflow-paths.d.ts +17 -0
- package/dist/utils/workflow-paths.js +18 -0
- package/dist/utils/yaml-structure.d.ts +7 -0
- package/dist/utils/yaml-structure.js +7 -11
- package/package.json +68 -48
- package/dist/hooks/before-tool.js +0 -19
|
@@ -1,267 +1,267 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: owflow:performance
|
|
3
|
-
description: Performance workflow dispatcher. Initializes/resumes performance tasks, derives the next step from state, and hands off to the matching /owflow:performance-* subskill. Static-analysis-first bottleneck identification (N+1 queries, missing indexes, O(n^2) algorithms, blocking I/O, memory leaks) with optional user-provided profiling data.
|
|
4
|
-
argument-hint: "[task description | task-path] [--from=<step-slug>]"
|
|
5
|
-
user-invocable: true
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Performance Dispatcher
|
|
9
|
-
|
|
10
|
-
Entry point for performance tasks in **assisted mode**: initialize (or resume) the task, derive the next pending step from `orchestrator-state.yml`, print the matching subskill command, and STOP. Each `/owflow:performance-*` subskill runs its steps with fresh context — the explicit invocation IS the step gate. The dispatcher owns only initialization (task directory, state, six task items) and the drop-only resume trim; every task artifact is produced by the subskills (see [Task Structure](#task-structure)).
|
|
11
|
-
|
|
12
|
-
Performance state uses descriptive step slugs in `completed_phases` / `failed_phases` / `auto_fix_attempts`: `codebase-analysed`, `bottlenecks-identified`, `spec-written`, `spec-audited` (conditional), `plan-created`, `implementation-done`, `options-chosen`, `verification-done`, `task-completed`. The routing table below maps slugs to subskills.
|
|
13
|
-
|
|
14
|
-
For the all-in-one loop with in-session `question` gates, use `/owflow:goal-performance`.
|
|
15
|
-
|
|
16
|
-
Gates follow the shared contract in the [Gate Contract](../orchestrator-framework/references/gate-contract.md), with the [dispatcher exception](../orchestrator-framework/references/gate-contract.md#exceptions).
|
|
17
|
-
|
|
18
|
-
## Entry Gate
|
|
19
|
-
|
|
20
|
-
**BEFORE deriving the handoff, complete these steps:**
|
|
21
|
-
|
|
22
|
-
### Step 1: Load Framework Patterns
|
|
23
|
-
|
|
24
|
-
**Read the framework reference files NOW using the Read tool:**
|
|
25
|
-
|
|
26
|
-
1. The [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md) governs this skill.
|
|
27
|
-
2. The [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) bound what subskills delegate.
|
|
28
|
-
3. The [Orchestrator Patterns](../orchestrator-framework/references/orchestrator-patterns.md) define state schema, initialization, and context passing.
|
|
29
|
-
|
|
30
|
-
### Step 2: Resolve the Argument
|
|
31
|
-
|
|
32
|
-
**If the argument is a task path or identifier** (a directory, or a directory name under `.owflow/tasks/performance/`) → **resume mode**:
|
|
33
|
-
|
|
34
|
-
1. Read `orchestrator-state.yml`.
|
|
35
|
-
2. **Resume validation (drop-only)** — before `completed_phases` is trusted, validate every entry against the two-kind resume table below; an entry whose marker is missing is DROPPED. The path never repairs or re-keys state.
|
|
36
|
-
3. Derive the next handoff with the Routing Table below.
|
|
37
|
-
4. `--from=<step-slug>` overrides the derived step — validate the target's upstream conditions exist (per the routing table and the target subskill's Entry Gate), else use `question` to confirm or cancel. An unknown slug → print the 9 accepted slugs and STOP.
|
|
38
|
-
5. Missing state file → print: `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
|
|
39
|
-
|
|
40
|
-
**If the argument is a performance issue description** (any other free text) → new task.
|
|
41
|
-
|
|
42
|
-
**If nothing is 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." — collect the description, plus optional profiling data paths, then WAIT. Never guess or auto-pick a task.
|
|
43
|
-
|
|
44
|
-
### Step 3: Initialize (new task)
|
|
45
|
-
|
|
46
|
-
1. **Create Task Directory**: `.owflow/tasks/performance/YYYY-MM-DD-task-name/` (3-5 kebab-case words from the description)
|
|
47
|
-
2. **Create Subdirectories**: `analysis/`, `analysis/user-profiling-data/`, `implementation/`, `verification/`
|
|
48
|
-
3. **Initialize State**: create `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"` (template/bootstrap mechanic). Discover project documentation: read `.owflow/docs/INDEX.md` (if exists), extract ALL file paths from the "Project Documentation" section, and store them as `performance_context.project_doc_paths` in state.
|
|
49
|
-
- **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-performance.yml`.
|
|
50
|
-
4. **Create Task Items**: use `TaskCreate` for the six subskill handoffs (one item each, per the Task Configuration table), then set the execution order with `TaskUpdate addBlockedBy` (analyze → spec → plan → implement → verify → finalize). Record every created item's id in `orchestrator.task_ids` — the `goal-performance` wrapper updates these same ids at each hop instead of creating its own. On resume, refresh the already-evidenced items instead of re-creating them.
|
|
51
|
-
|
|
52
|
-
**Output**:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
🚀 Performance Dispatcher
|
|
56
|
-
|
|
57
|
-
Task: [performance issue description]
|
|
58
|
-
Directory: [task-path]
|
|
59
|
-
Next step: [step name]
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## When to Use
|
|
65
|
-
|
|
66
|
-
Use for:
|
|
67
|
-
|
|
68
|
-
- Application slow (response time issues, high latency)
|
|
69
|
-
- Need systematic bottleneck identification and resolution
|
|
70
|
-
- Want static code analysis for performance anti-patterns
|
|
71
|
-
- Have user-provided profiling data to act on
|
|
72
|
-
- Database query optimization needed
|
|
73
|
-
- Algorithm or I/O inefficiencies suspected
|
|
74
|
-
|
|
75
|
-
**DO NOT use for**: New features, bug fixes, refactoring without performance goals.
|
|
76
|
-
|
|
77
|
-
---
|
|
78
|
-
|
|
79
|
-
## Core Principles
|
|
80
|
-
|
|
81
|
-
1. **Static Analysis First**: Read code to detect patterns. Don't try to run profiling tools.
|
|
82
|
-
2. **User Data Welcome**: Incorporate user-provided profiling data when available
|
|
83
|
-
3. **Subskill Pipeline**: The optimization pipeline is the six `/owflow:performance-*` subskills — analyze → spec → plan → implement → verify → finalize — not inline phases; this dispatcher only routes.
|
|
84
|
-
4. **Conservative Estimates**: Provide improvement ranges, not false precision
|
|
85
|
-
5. **Practical Optimizations**: Focus on patterns the agent CAN detect and fix
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Task Configuration
|
|
90
|
-
|
|
91
|
-
One task item per subskill handoff (`TaskCreate` at init; ordered with `addBlockedBy`):
|
|
92
|
-
|
|
93
|
-
| Subskill | Slugs owned (frozen) | Task item content | Engine(s) |
|
|
94
|
-
| --- | --- | --- | --- |
|
|
95
|
-
| `performance-analyze` | `codebase-analysed`, `bottlenecks-identified` | "Analyze codebase & bottlenecks" | Skill `codebase-analyzer`; Task `bottleneck-analyzer` |
|
|
96
|
-
| `performance-spec` | `spec-written`, `spec-audited` (conditional) | "Gather requirements & create specification" | Task `specification-creator`; Task `spec-auditor`; Skill `diagrams-mermaid` |
|
|
97
|
-
| `performance-plan` | `plan-created` | "Plan implementation" | Task `implementation-planner`; Skill `diagrams-mermaid` |
|
|
98
|
-
| `performance-implement` | `implementation-done` | "Execute implementation" | Skill `implementation-plan-executor` |
|
|
99
|
-
| `performance-verify` | `options-chosen`, `verification-done` | "Verify implementation & resolve issues" | Skill `implementation-verifier` |
|
|
100
|
-
| `performance-finalize` | `task-completed` | "Finalize workflow" | Direct (inline-legal) |
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Routing Table (completed_phases → next subskill)
|
|
105
|
-
|
|
106
|
-
Every row is evaluated in order; the first matching row wins. **Every condition includes the absence of its own slug(s)** (the absence clause), the evaluation order is **total** (a fallback row closes it), and **the first-missing-slug heuristic is retired** for this table — see the routing rules below.
|
|
107
|
-
|
|
108
|
-
| # | Subskill (slugs owned) | Routes here when | Handoff command |
|
|
109
|
-
| --- | --- | --- | --- |
|
|
110
|
-
| 1 | `performance-analyze` (`codebase-analysed`, `bottlenecks-identified`) | new task, OR `codebase-analysed` absent, OR (`codebase-analysed` present AND `bottlenecks-identified` absent) | `/owflow:performance-analyze <task-path>` |
|
|
111
|
-
| 2 | `performance-spec` (`spec-written`, `spec-audited`) | `bottlenecks-identified` complete AND [ (`spec-written` absent) OR (`spec-audited` absent AND (`options.spec_audit_enabled` is **null OR `true`**)) ] | `/owflow:performance-spec <task-path>` |
|
|
112
|
-
| 3 | **`performance-plan`** (`plan-created`) | **`spec-written` complete AND `options.spec_audit_enabled` is non-null — the audit decision is settled — AND `plan-created` absent.** Never `spec-audited`. | `/owflow:performance-plan <task-path>` |
|
|
113
|
-
| 4 | `performance-implement` (`implementation-done`) | `plan-created` complete AND `implementation-done` absent | `/owflow:performance-implement <task-path>` |
|
|
114
|
-
| 5 | `performance-verify` (`options-chosen`, `verification-done`) | `implementation-done` complete AND [ `options-chosen` absent OR `verification-done` absent ] | `/owflow:performance-verify <task-path>` |
|
|
115
|
-
| 6 | `performance-finalize` (`task-completed`) | `verification-done` complete AND `task-completed` absent | `/owflow:performance-finalize <task-path>` |
|
|
116
|
-
| T | terminal | `task-completed` complete (validated by `task.status: completed`) → **no handoff**; report the task as done | — |
|
|
117
|
-
| F | **fallback** | **no row above matched** (anomalous state — e.g. `SW ∧ SA ∧ spec_audit_enabled: null`, or slugs present out of order after a hand-edited state). Report the state that failed to route, then route to `/owflow:performance-analyze <task-path>` | `/owflow:performance-analyze <task-path>` |
|
|
118
|
-
|
|
119
|
-
**Routing rules, normative.** These four sentences ship verbatim in the dispatcher; they are the guard's defense against its own simplification:
|
|
120
|
-
|
|
121
|
-
1. **Absence clause** — each row that *advances* the pipeline requires its own slugs to be absent from `completed_phases` (rows 1, 2, 3, 4, 6; row 5 is a re-entry row and requires only the sub-step it owns to be outstanding). No row ever fires on the strength of its own slug already being present.
|
|
122
|
-
2. **Row 2 re-enters `performance-spec` while the audit decision is undecided** (`spec_audit_enabled` null) *and* when it is decided-yes with no `spec-audited` slug; `performance-spec`'s own skip/resume rule settles it — re-ask only while the decision is `null`, never once it is non-null.
|
|
123
|
-
3. **Row 3 requires a settled decision** (`spec_audit_enabled` non-null), never the `spec-audited` slug. Audit-skipped therefore falls through to row 3 instead of looping.
|
|
124
|
-
4. **The first-missing-slug heuristic used by both shipped dispatchers is retired for this table** (`development/SKILL.md:87`, `research/SKILL.md:100`) and must not be reintroduced — the conditional audit makes row 2 a three-way disjunction. Any edit that collapses rows 2–3 back to a single "first missing slug" rule reintroduces the audit-skip resume loop.
|
|
125
|
-
|
|
126
|
-
**Why the fallback exists, stated honestly.** Its purpose is **totality**: a total routing function never leaves the user without a command. Its destination is row 1's destination, and that destination is **not** guaranteed to block — row 1 can only fail when `codebase-analysed` ∧ `bottlenecks-identified` are both recorded, which means both analyze marker artifacts exist, so `performance-analyze`'s Entry Gate would *pass*. F therefore guarantees a defined, reported destination; it does not itself guarantee that a prerequisite check will stop the flow. The states F actually catches are the unreachable-by-design ones (`spec-written` ∧ `spec-audited` with the decision `null`) and hand-edited states — in both cases re-running analyze is the safe, reversible move.
|
|
127
|
-
|
|
128
|
-
Every reachable state routes to exactly one handoff:
|
|
129
|
-
|
|
130
|
-
| Reachable state | Matching row | Handoff |
|
|
131
|
-
| --- | --- | --- |
|
|
132
|
-
| new task, or analyze step 1 done (`codebase-analysed` absent) | 1 | `performance-analyze` |
|
|
133
|
-
| analyze done, `bottlenecks-identified` absent | 1 | `performance-analyze` |
|
|
134
|
-
| **spec step 1 done, audit decision still `null`** | **2** | **`performance-spec` (asks the audit decision)** |
|
|
135
|
-
| audit decided `true`, `spec-audited` absent | 2 | `performance-spec` (audit sub-step) |
|
|
136
|
-
| audit ran (`spec-audited` present, decision `true`) | 3 | `performance-plan` |
|
|
137
|
-
| audit skipped (decision `false`, no `spec-audited`) | 3 | `performance-plan` |
|
|
138
|
-
| `plan-created` present, `implementation-done` absent | 4 | `performance-implement` |
|
|
139
|
-
| `implementation-done` present, `options-chosen` absent | 5 | `performance-verify` (asks options) |
|
|
140
|
-
| `options-chosen` present, `verification-done` absent | 5 | `performance-verify` (idempotence rule) |
|
|
141
|
-
| `verification-done` present, `task-completed` absent | 6 | `performance-finalize` |
|
|
142
|
-
| all 9 slugs, `task.status: completed` | T | none — done |
|
|
143
|
-
| anomalous (unreachable-by-design, e.g. `SW ∧ SA` with decision `null`; or slugs out of order) | F | `performance-analyze`, with the failing state reported |
|
|
144
|
-
|
|
145
|
-
Row 2's two-part condition is what makes the audit a first-class routable outcome in **all three** directions: `null` → stays in `performance-spec` to settle the decision; `true` + `spec-audited` missing → routes into the audit sub-step; `false`, or `true` + `spec-audited` present → falls through to row 3.
|
|
146
|
-
|
|
147
|
-
### Resume Validation — the two-kind table
|
|
148
|
-
|
|
149
|
-
Applied on every resume, before `completed_phases` is trusted (`gate-contract.md:28`). An entry whose marker is missing is dropped; artifacts beat state.
|
|
150
|
-
|
|
151
|
-
| Slug | Validated against | Kind |
|
|
152
|
-
| --- | --- | --- |
|
|
153
|
-
| `codebase-analysed` | `analysis/codebase-analysis.md` | file |
|
|
154
|
-
| `bottlenecks-identified` | `analysis/performance-analysis.md` | file |
|
|
155
|
-
| `spec-written` | `implementation/spec.md` | file |
|
|
156
|
-
| `spec-audited` | `verification/spec-audit.md` | file (conditional) |
|
|
157
|
-
| `plan-created` | `implementation/implementation-plan.md` | file |
|
|
158
|
-
| `implementation-done` | `implementation/work-log.md` | file |
|
|
159
|
-
| `options-chosen` | at least one non-null `orchestrator.options.*` review flag | **state predicate — vacuous, see note** |
|
|
160
|
-
| `verification-done` | `verification/implementation-verification.md` | file |
|
|
161
|
-
| `task-completed` | `task.status: completed` | **state predicate** |
|
|
162
|
-
|
|
163
|
-
**The `options-chosen` predicate is vacuous against this template — recorded, not fixed (Known Limitation #11).** The template ships `code_review_enabled: true`, `pragmatic_review_enabled: true` and `reality_check_enabled: true`, so "at least one non-null `options.*` review flag" is true on a **brand-new** state, before the user has chosen anything. The predicate therefore never drops a stale `options-chosen` entry, and the safeguard is delivered by other means: `performance-verify` owns the slug, its Entry Gate routes on the slug itself, and its idempotence rule governs the re-entry. Narrowing the predicate to a value the template cannot pre-satisfy would require a dedicated marker artifact — new scope, and D1 is settled, so it is **recorded as Known Limitation #11** instead. `task-completed`'s predicate (`task.status: completed` against a `pending` default) *does* discriminate and is sound.
|
|
164
|
-
|
|
165
|
-
---
|
|
166
|
-
|
|
167
|
-
## Checklist Waivers (routing-only dispatcher)
|
|
168
|
-
|
|
169
|
-
This dispatcher records explicit, named waivers against [Orchestrator Creation Checklist](../orchestrator-framework/references/orchestrator-creation-checklist.md) items written for a monolith-shaped orchestrator with inline phases; a routing-only dispatcher cannot satisfy them because it executes no phase bodies and delegates nothing:
|
|
170
|
-
|
|
171
|
-
| Checklist item | Disposition | Why |
|
|
172
|
-
| --- | --- | --- |
|
|
173
|
-
| `:16` Phase structure (Purpose / Execute / Output / State / Transition per phase) | Waived | No phase bodies here — the 6 subskills own Execute/Output/State, and Entry/Exit Gates own transitions. |
|
|
174
|
-
| `:17` Delegation enforcement (ANTI-PATTERN / INVOKE NOW / SELF-CHECK per delegated phase) | Waived | The dispatcher spawns no subagents; delegation blocks live in the subskills that delegate. |
|
|
175
|
-
| `:18` POST-CONTINUATION blocks | Waived | No Skill-tool phase runs here; each subskill appends its own slugs. |
|
|
176
|
-
| `:19` Context passing (accumulated context in subagent prompts) | Waived by the same clause as `:17` | Unsatisfiable for the same reason: no subagents are spawned here. |
|
|
177
|
-
| `:20` Context extraction (per-phase `phase_summaries`) | Waived | Extraction happens per step inside the subskills. |
|
|
178
|
-
| `:21` Decision gates (`decisions_needed` presented via `question`) | Waived | The dispatcher receives none; the subskills own their decision questions. |
|
|
179
|
-
| `:22` `question` at every `→ Pause` | Waived | No `→ Pause` transitions exist — routing prints one command and STOPS; the explicit invocation is the gate. |
|
|
180
|
-
| `:25` Auto-recovery table | Waived | Retries are owned per subskill (each `performance-*` SKILL.md carries its own `## Recovery` table). |
|
|
181
|
-
| `:24` TaskCreate initialization | **Satisfied, not waived** | The dispatcher creates the six task items with `addBlockedBy` at init and records their ids in `orchestrator.task_ids`; the wrapper only updates those ids. |
|
|
182
|
-
|
|
183
|
-
---
|
|
184
|
-
|
|
185
|
-
## Exit Gate (adapted for dispatch mode)
|
|
186
|
-
|
|
187
|
-
After deriving the handoff, present the results box, ask how to proceed, then hand off accordingly (see the [dispatcher exception](../orchestrator-framework/references/gate-contract.md)). The results box IS the handoff block. Never auto-invoke the subskill.
|
|
188
|
-
|
|
189
|
-
### Results box
|
|
190
|
-
|
|
191
|
-
```markdown
|
|
192
|
-
## ✅ PERFORMANCE TASK READY — <task name>
|
|
193
|
-
|
|
194
|
-
**Task** — [performance issue description]
|
|
195
|
-
**Directory** — `<task-path>`
|
|
196
|
-
**Next step** — [subskill + slug(s)]
|
|
197
|
-
[Resume note: completed steps / fresh task]
|
|
198
|
-
|
|
199
|
-
**Next ▸** `/owflow:performance-<subskill> <task-path>`
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Acceptance question
|
|
203
|
-
|
|
204
|
-
Use `question` — "Task ready. How would you like to proceed?" with options:
|
|
205
|
-
|
|
206
|
-
- **Hand off to /owflow:performance-<subskill>** — the user invokes the suggested command (the dispatcher copies it to chat for convenience). Execution starts in a fresh context.
|
|
207
|
-
- **Switch to autonomous mode** — run the remaining steps in one session: `/owflow:goal-performance <task-path>`.
|
|
208
|
-
- **Adjust** — task set-up or derivation is wrong (wrong description, wrong task, wrong `--from`); re-run the affected step, re-present the results box.
|
|
209
|
-
- **Stop here** — print the resume command (`/owflow:performance <task-path>`) and end.
|
|
210
|
-
|
|
211
|
-
### Handoff message
|
|
212
|
-
|
|
213
|
-
On Accept (hand off choice), print, then STOP:
|
|
214
|
-
|
|
215
|
-
```
|
|
216
|
-
✓ Performance task ready at <task-path>
|
|
217
|
-
|
|
218
|
-
Next step:
|
|
219
|
-
→ /owflow:performance-<subskill> <task-path>
|
|
220
|
-
|
|
221
|
-
Other options:
|
|
222
|
-
/owflow:goal-performance <task-path> — run remaining steps in one loop
|
|
223
|
-
/owflow:performance --from=<step-slug> <task-path> — jump to a specific step
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
## Task Structure
|
|
229
|
-
|
|
230
|
-
The dispatcher creates the directory skeleton at init; every artifact below is produced by the subskill named in the comments:
|
|
231
|
-
|
|
232
|
-
```
|
|
233
|
-
.owflow/tasks/performance/YYYY-MM-DD-task-name/
|
|
234
|
-
├── orchestrator-state.yml # dispatcher (init) + every subskill (per-step writes)
|
|
235
|
-
├── analysis/
|
|
236
|
-
│ ├── codebase-analysis.md # performance-analyze (codebase-analysed)
|
|
237
|
-
│ ├── clarifications.md # performance-analyze
|
|
238
|
-
│ ├── performance-analysis.md # performance-analyze (bottlenecks-identified)
|
|
239
|
-
│ ├── requirements.md # performance-spec
|
|
240
|
-
│ └── user-profiling-data/ # optional user-provided data
|
|
241
|
-
├── implementation/
|
|
242
|
-
│ ├── spec.md # performance-spec (spec-written)
|
|
243
|
-
│ ├── implementation-plan.md # performance-plan (plan-created)
|
|
244
|
-
│ └── work-log.md # performance-implement (implementation-done)
|
|
245
|
-
└── verification/
|
|
246
|
-
├── spec-audit.md # performance-spec (spec-audited, conditional)
|
|
247
|
-
└── implementation-verification.md # performance-verify (verification-done)
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Auto-Recovery
|
|
253
|
-
|
|
254
|
-
Retries are owned by each subskill (each `/owflow:performance-*` SKILL.md carries its own `## Recovery` table).
|
|
255
|
-
|
|
256
|
-
---
|
|
257
|
-
|
|
258
|
-
## Command Integration
|
|
259
|
-
|
|
260
|
-
Invoked via:
|
|
261
|
-
|
|
262
|
-
- `/owflow:performance [description]` (new)
|
|
263
|
-
- `/owflow:performance [task-path] [--from=<step-slug>]` (resume)
|
|
264
|
-
|
|
265
|
-
Alternative: `/owflow:goal-performance <task-path>` — same task lifecycle, all subskills invoked in one session with `question` gates.
|
|
266
|
-
|
|
267
|
-
Task directory: `.owflow/tasks/performance/YYYY-MM-DD-task-name/`
|
|
1
|
+
---
|
|
2
|
+
name: owflow:performance
|
|
3
|
+
description: Performance workflow dispatcher. Initializes/resumes performance tasks, derives the next step from state, and hands off to the matching /owflow:performance-* subskill. Static-analysis-first bottleneck identification (N+1 queries, missing indexes, O(n^2) algorithms, blocking I/O, memory leaks) with optional user-provided profiling data.
|
|
4
|
+
argument-hint: "[task description | task-path] [--from=<step-slug>]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Performance Dispatcher
|
|
9
|
+
|
|
10
|
+
Entry point for performance tasks in **assisted mode**: initialize (or resume) the task, derive the next pending step from `orchestrator-state.yml`, print the matching subskill command, and STOP. Each `/owflow:performance-*` subskill runs its steps with fresh context — the explicit invocation IS the step gate. The dispatcher owns only initialization (task directory, state, six task items) and the drop-only resume trim; every task artifact is produced by the subskills (see [Task Structure](#task-structure)).
|
|
11
|
+
|
|
12
|
+
Performance state uses descriptive step slugs in `completed_phases` / `failed_phases` / `auto_fix_attempts`: `codebase-analysed`, `bottlenecks-identified`, `spec-written`, `spec-audited` (conditional), `plan-created`, `implementation-done`, `options-chosen`, `verification-done`, `task-completed`. The routing table below maps slugs to subskills.
|
|
13
|
+
|
|
14
|
+
For the all-in-one loop with in-session `question` gates, use `/owflow:goal-performance`.
|
|
15
|
+
|
|
16
|
+
Gates follow the shared contract in the [Gate Contract](../orchestrator-framework/references/gate-contract.md), with the [dispatcher exception](../orchestrator-framework/references/gate-contract.md#exceptions).
|
|
17
|
+
|
|
18
|
+
## Entry Gate
|
|
19
|
+
|
|
20
|
+
**BEFORE deriving the handoff, complete these steps:**
|
|
21
|
+
|
|
22
|
+
### Step 1: Load Framework Patterns
|
|
23
|
+
|
|
24
|
+
**Read the framework reference files NOW using the Read tool:**
|
|
25
|
+
|
|
26
|
+
1. The [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md) governs this skill.
|
|
27
|
+
2. The [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) bound what subskills delegate.
|
|
28
|
+
3. The [Orchestrator Patterns](../orchestrator-framework/references/orchestrator-patterns.md) define state schema, initialization, and context passing.
|
|
29
|
+
|
|
30
|
+
### Step 2: Resolve the Argument
|
|
31
|
+
|
|
32
|
+
**If the argument is a task path or identifier** (a directory, or a directory name under `.owflow/tasks/performance/`) → **resume mode**:
|
|
33
|
+
|
|
34
|
+
1. Read `orchestrator-state.yml`.
|
|
35
|
+
2. **Resume validation (drop-only)** — before `completed_phases` is trusted, validate every entry against the two-kind resume table below; an entry whose marker is missing is DROPPED. The path never repairs or re-keys state.
|
|
36
|
+
3. Derive the next handoff with the Routing Table below.
|
|
37
|
+
4. `--from=<step-slug>` overrides the derived step — validate the target's upstream conditions exist (per the routing table and the target subskill's Entry Gate), else use `question` to confirm or cancel. An unknown slug → print the 9 accepted slugs and STOP.
|
|
38
|
+
5. Missing state file → print: `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
|
|
39
|
+
|
|
40
|
+
**If the argument is a performance issue description** (any other free text) → new task.
|
|
41
|
+
|
|
42
|
+
**If nothing is 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." — collect the description, plus optional profiling data paths, then WAIT. Never guess or auto-pick a task.
|
|
43
|
+
|
|
44
|
+
### Step 3: Initialize (new task)
|
|
45
|
+
|
|
46
|
+
1. **Create Task Directory**: `.owflow/tasks/performance/YYYY-MM-DD-task-name/` (3-5 kebab-case words from the description)
|
|
47
|
+
2. **Create Subdirectories**: `analysis/`, `analysis/user-profiling-data/`, `implementation/`, `verification/`
|
|
48
|
+
3. **Initialize State**: create `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"` (template/bootstrap mechanic). Discover project documentation: read `.owflow/docs/INDEX.md` (if exists), extract ALL file paths from the "Project Documentation" section, and store them as `performance_context.project_doc_paths` in state.
|
|
49
|
+
- **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-performance.yml`.
|
|
50
|
+
4. **Create Task Items**: use `TaskCreate` for the six subskill handoffs (one item each, per the Task Configuration table), then set the execution order with `TaskUpdate addBlockedBy` (analyze → spec → plan → implement → verify → finalize). Record every created item's id in `orchestrator.task_ids` — the `goal-performance` wrapper updates these same ids at each hop instead of creating its own. On resume, refresh the already-evidenced items instead of re-creating them.
|
|
51
|
+
|
|
52
|
+
**Output**:
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
🚀 Performance Dispatcher
|
|
56
|
+
|
|
57
|
+
Task: [performance issue description]
|
|
58
|
+
Directory: [task-path]
|
|
59
|
+
Next step: [step name]
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## When to Use
|
|
65
|
+
|
|
66
|
+
Use for:
|
|
67
|
+
|
|
68
|
+
- Application slow (response time issues, high latency)
|
|
69
|
+
- Need systematic bottleneck identification and resolution
|
|
70
|
+
- Want static code analysis for performance anti-patterns
|
|
71
|
+
- Have user-provided profiling data to act on
|
|
72
|
+
- Database query optimization needed
|
|
73
|
+
- Algorithm or I/O inefficiencies suspected
|
|
74
|
+
|
|
75
|
+
**DO NOT use for**: New features, bug fixes, refactoring without performance goals.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Core Principles
|
|
80
|
+
|
|
81
|
+
1. **Static Analysis First**: Read code to detect patterns. Don't try to run profiling tools.
|
|
82
|
+
2. **User Data Welcome**: Incorporate user-provided profiling data when available
|
|
83
|
+
3. **Subskill Pipeline**: The optimization pipeline is the six `/owflow:performance-*` subskills — analyze → spec → plan → implement → verify → finalize — not inline phases; this dispatcher only routes.
|
|
84
|
+
4. **Conservative Estimates**: Provide improvement ranges, not false precision
|
|
85
|
+
5. **Practical Optimizations**: Focus on patterns the agent CAN detect and fix
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Task Configuration
|
|
90
|
+
|
|
91
|
+
One task item per subskill handoff (`TaskCreate` at init; ordered with `addBlockedBy`):
|
|
92
|
+
|
|
93
|
+
| Subskill | Slugs owned (frozen) | Task item content | Engine(s) |
|
|
94
|
+
| --- | --- | --- | --- |
|
|
95
|
+
| `performance-analyze` | `codebase-analysed`, `bottlenecks-identified` | "Analyze codebase & bottlenecks" | Skill `codebase-analyzer`; Task `bottleneck-analyzer` |
|
|
96
|
+
| `performance-spec` | `spec-written`, `spec-audited` (conditional) | "Gather requirements & create specification" | Task `specification-creator`; Task `spec-auditor`; Skill `diagrams-mermaid` |
|
|
97
|
+
| `performance-plan` | `plan-created` | "Plan implementation" | Task `implementation-planner`; Skill `diagrams-mermaid` |
|
|
98
|
+
| `performance-implement` | `implementation-done` | "Execute implementation" | Skill `implementation-plan-executor` |
|
|
99
|
+
| `performance-verify` | `options-chosen`, `verification-done` | "Verify implementation & resolve issues" | Skill `implementation-verifier` |
|
|
100
|
+
| `performance-finalize` | `task-completed` | "Finalize workflow" | Direct (inline-legal) |
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Routing Table (completed_phases → next subskill)
|
|
105
|
+
|
|
106
|
+
Every row is evaluated in order; the first matching row wins. **Every condition includes the absence of its own slug(s)** (the absence clause), the evaluation order is **total** (a fallback row closes it), and **the first-missing-slug heuristic is retired** for this table — see the routing rules below.
|
|
107
|
+
|
|
108
|
+
| # | Subskill (slugs owned) | Routes here when | Handoff command |
|
|
109
|
+
| --- | --- | --- | --- |
|
|
110
|
+
| 1 | `performance-analyze` (`codebase-analysed`, `bottlenecks-identified`) | new task, OR `codebase-analysed` absent, OR (`codebase-analysed` present AND `bottlenecks-identified` absent) | `/owflow:performance-analyze <task-path>` |
|
|
111
|
+
| 2 | `performance-spec` (`spec-written`, `spec-audited`) | `bottlenecks-identified` complete AND [ (`spec-written` absent) OR (`spec-audited` absent AND (`options.spec_audit_enabled` is **null OR `true`**)) ] | `/owflow:performance-spec <task-path>` |
|
|
112
|
+
| 3 | **`performance-plan`** (`plan-created`) | **`spec-written` complete AND `options.spec_audit_enabled` is non-null — the audit decision is settled — AND `plan-created` absent.** Never `spec-audited`. | `/owflow:performance-plan <task-path>` |
|
|
113
|
+
| 4 | `performance-implement` (`implementation-done`) | `plan-created` complete AND `implementation-done` absent | `/owflow:performance-implement <task-path>` |
|
|
114
|
+
| 5 | `performance-verify` (`options-chosen`, `verification-done`) | `implementation-done` complete AND [ `options-chosen` absent OR `verification-done` absent ] | `/owflow:performance-verify <task-path>` |
|
|
115
|
+
| 6 | `performance-finalize` (`task-completed`) | `verification-done` complete AND `task-completed` absent | `/owflow:performance-finalize <task-path>` |
|
|
116
|
+
| T | terminal | `task-completed` complete (validated by `task.status: completed`) → **no handoff**; report the task as done | — |
|
|
117
|
+
| F | **fallback** | **no row above matched** (anomalous state — e.g. `SW ∧ SA ∧ spec_audit_enabled: null`, or slugs present out of order after a hand-edited state). Report the state that failed to route, then route to `/owflow:performance-analyze <task-path>` | `/owflow:performance-analyze <task-path>` |
|
|
118
|
+
|
|
119
|
+
**Routing rules, normative.** These four sentences ship verbatim in the dispatcher; they are the guard's defense against its own simplification:
|
|
120
|
+
|
|
121
|
+
1. **Absence clause** — each row that *advances* the pipeline requires its own slugs to be absent from `completed_phases` (rows 1, 2, 3, 4, 6; row 5 is a re-entry row and requires only the sub-step it owns to be outstanding). No row ever fires on the strength of its own slug already being present.
|
|
122
|
+
2. **Row 2 re-enters `performance-spec` while the audit decision is undecided** (`spec_audit_enabled` null) *and* when it is decided-yes with no `spec-audited` slug; `performance-spec`'s own skip/resume rule settles it — re-ask only while the decision is `null`, never once it is non-null.
|
|
123
|
+
3. **Row 3 requires a settled decision** (`spec_audit_enabled` non-null), never the `spec-audited` slug. Audit-skipped therefore falls through to row 3 instead of looping.
|
|
124
|
+
4. **The first-missing-slug heuristic used by both shipped dispatchers is retired for this table** (`development/SKILL.md:87`, `research/SKILL.md:100`) and must not be reintroduced — the conditional audit makes row 2 a three-way disjunction. Any edit that collapses rows 2–3 back to a single "first missing slug" rule reintroduces the audit-skip resume loop.
|
|
125
|
+
|
|
126
|
+
**Why the fallback exists, stated honestly.** Its purpose is **totality**: a total routing function never leaves the user without a command. Its destination is row 1's destination, and that destination is **not** guaranteed to block — row 1 can only fail when `codebase-analysed` ∧ `bottlenecks-identified` are both recorded, which means both analyze marker artifacts exist, so `performance-analyze`'s Entry Gate would *pass*. F therefore guarantees a defined, reported destination; it does not itself guarantee that a prerequisite check will stop the flow. The states F actually catches are the unreachable-by-design ones (`spec-written` ∧ `spec-audited` with the decision `null`) and hand-edited states — in both cases re-running analyze is the safe, reversible move.
|
|
127
|
+
|
|
128
|
+
Every reachable state routes to exactly one handoff:
|
|
129
|
+
|
|
130
|
+
| Reachable state | Matching row | Handoff |
|
|
131
|
+
| --- | --- | --- |
|
|
132
|
+
| new task, or analyze step 1 done (`codebase-analysed` absent) | 1 | `performance-analyze` |
|
|
133
|
+
| analyze done, `bottlenecks-identified` absent | 1 | `performance-analyze` |
|
|
134
|
+
| **spec step 1 done, audit decision still `null`** | **2** | **`performance-spec` (asks the audit decision)** |
|
|
135
|
+
| audit decided `true`, `spec-audited` absent | 2 | `performance-spec` (audit sub-step) |
|
|
136
|
+
| audit ran (`spec-audited` present, decision `true`) | 3 | `performance-plan` |
|
|
137
|
+
| audit skipped (decision `false`, no `spec-audited`) | 3 | `performance-plan` |
|
|
138
|
+
| `plan-created` present, `implementation-done` absent | 4 | `performance-implement` |
|
|
139
|
+
| `implementation-done` present, `options-chosen` absent | 5 | `performance-verify` (asks options) |
|
|
140
|
+
| `options-chosen` present, `verification-done` absent | 5 | `performance-verify` (idempotence rule) |
|
|
141
|
+
| `verification-done` present, `task-completed` absent | 6 | `performance-finalize` |
|
|
142
|
+
| all 9 slugs, `task.status: completed` | T | none — done |
|
|
143
|
+
| anomalous (unreachable-by-design, e.g. `SW ∧ SA` with decision `null`; or slugs out of order) | F | `performance-analyze`, with the failing state reported |
|
|
144
|
+
|
|
145
|
+
Row 2's two-part condition is what makes the audit a first-class routable outcome in **all three** directions: `null` → stays in `performance-spec` to settle the decision; `true` + `spec-audited` missing → routes into the audit sub-step; `false`, or `true` + `spec-audited` present → falls through to row 3.
|
|
146
|
+
|
|
147
|
+
### Resume Validation — the two-kind table
|
|
148
|
+
|
|
149
|
+
Applied on every resume, before `completed_phases` is trusted (`gate-contract.md:28`). An entry whose marker is missing is dropped; artifacts beat state.
|
|
150
|
+
|
|
151
|
+
| Slug | Validated against | Kind |
|
|
152
|
+
| --- | --- | --- |
|
|
153
|
+
| `codebase-analysed` | `analysis/codebase-analysis.md` | file |
|
|
154
|
+
| `bottlenecks-identified` | `analysis/performance-analysis.md` | file |
|
|
155
|
+
| `spec-written` | `implementation/spec.md` | file |
|
|
156
|
+
| `spec-audited` | `verification/spec-audit.md` | file (conditional) |
|
|
157
|
+
| `plan-created` | `implementation/implementation-plan.md` | file |
|
|
158
|
+
| `implementation-done` | `implementation/work-log.md` | file |
|
|
159
|
+
| `options-chosen` | at least one non-null `orchestrator.options.*` review flag | **state predicate — vacuous, see note** |
|
|
160
|
+
| `verification-done` | `verification/implementation-verification.md` | file |
|
|
161
|
+
| `task-completed` | `task.status: completed` | **state predicate** |
|
|
162
|
+
|
|
163
|
+
**The `options-chosen` predicate is vacuous against this template — recorded, not fixed (Known Limitation #11).** The template ships `code_review_enabled: true`, `pragmatic_review_enabled: true` and `reality_check_enabled: true`, so "at least one non-null `options.*` review flag" is true on a **brand-new** state, before the user has chosen anything. The predicate therefore never drops a stale `options-chosen` entry, and the safeguard is delivered by other means: `performance-verify` owns the slug, its Entry Gate routes on the slug itself, and its idempotence rule governs the re-entry. Narrowing the predicate to a value the template cannot pre-satisfy would require a dedicated marker artifact — new scope, and D1 is settled, so it is **recorded as Known Limitation #11** instead. `task-completed`'s predicate (`task.status: completed` against a `pending` default) *does* discriminate and is sound.
|
|
164
|
+
|
|
165
|
+
---
|
|
166
|
+
|
|
167
|
+
## Checklist Waivers (routing-only dispatcher)
|
|
168
|
+
|
|
169
|
+
This dispatcher records explicit, named waivers against [Orchestrator Creation Checklist](../orchestrator-framework/references/orchestrator-creation-checklist.md) items written for a monolith-shaped orchestrator with inline phases; a routing-only dispatcher cannot satisfy them because it executes no phase bodies and delegates nothing:
|
|
170
|
+
|
|
171
|
+
| Checklist item | Disposition | Why |
|
|
172
|
+
| --- | --- | --- |
|
|
173
|
+
| `:16` Phase structure (Purpose / Execute / Output / State / Transition per phase) | Waived | No phase bodies here — the 6 subskills own Execute/Output/State, and Entry/Exit Gates own transitions. |
|
|
174
|
+
| `:17` Delegation enforcement (ANTI-PATTERN / INVOKE NOW / SELF-CHECK per delegated phase) | Waived | The dispatcher spawns no subagents; delegation blocks live in the subskills that delegate. |
|
|
175
|
+
| `:18` POST-CONTINUATION blocks | Waived | No Skill-tool phase runs here; each subskill appends its own slugs. |
|
|
176
|
+
| `:19` Context passing (accumulated context in subagent prompts) | Waived by the same clause as `:17` | Unsatisfiable for the same reason: no subagents are spawned here. |
|
|
177
|
+
| `:20` Context extraction (per-phase `phase_summaries`) | Waived | Extraction happens per step inside the subskills. |
|
|
178
|
+
| `:21` Decision gates (`decisions_needed` presented via `question`) | Waived | The dispatcher receives none; the subskills own their decision questions. |
|
|
179
|
+
| `:22` `question` at every `→ Pause` | Waived | No `→ Pause` transitions exist — routing prints one command and STOPS; the explicit invocation is the gate. |
|
|
180
|
+
| `:25` Auto-recovery table | Waived | Retries are owned per subskill (each `performance-*` SKILL.md carries its own `## Recovery` table). |
|
|
181
|
+
| `:24` TaskCreate initialization | **Satisfied, not waived** | The dispatcher creates the six task items with `addBlockedBy` at init and records their ids in `orchestrator.task_ids`; the wrapper only updates those ids. |
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Exit Gate (adapted for dispatch mode)
|
|
186
|
+
|
|
187
|
+
After deriving the handoff, present the results box, ask how to proceed, then hand off accordingly (see the [dispatcher exception](../orchestrator-framework/references/gate-contract.md)). The results box IS the handoff block. Never auto-invoke the subskill.
|
|
188
|
+
|
|
189
|
+
### Results box
|
|
190
|
+
|
|
191
|
+
```markdown
|
|
192
|
+
## ✅ PERFORMANCE TASK READY — <task name>
|
|
193
|
+
|
|
194
|
+
**Task** — [performance issue description]
|
|
195
|
+
**Directory** — `<task-path>`
|
|
196
|
+
**Next step** — [subskill + slug(s)]
|
|
197
|
+
[Resume note: completed steps / fresh task]
|
|
198
|
+
|
|
199
|
+
**Next ▸** `/owflow:performance-<subskill> <task-path>`
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Acceptance question
|
|
203
|
+
|
|
204
|
+
Use `question` — "Task ready. How would you like to proceed?" with options:
|
|
205
|
+
|
|
206
|
+
- **Hand off to /owflow:performance-<subskill>** — the user invokes the suggested command (the dispatcher copies it to chat for convenience). Execution starts in a fresh context.
|
|
207
|
+
- **Switch to autonomous mode** — run the remaining steps in one session: `/owflow:goal-performance <task-path>`.
|
|
208
|
+
- **Adjust** — task set-up or derivation is wrong (wrong description, wrong task, wrong `--from`); re-run the affected step, re-present the results box.
|
|
209
|
+
- **Stop here** — print the resume command (`/owflow:performance <task-path>`) and end.
|
|
210
|
+
|
|
211
|
+
### Handoff message
|
|
212
|
+
|
|
213
|
+
On Accept (hand off choice), print, then STOP:
|
|
214
|
+
|
|
215
|
+
```
|
|
216
|
+
✓ Performance task ready at <task-path>
|
|
217
|
+
|
|
218
|
+
Next step:
|
|
219
|
+
→ /owflow:performance-<subskill> <task-path>
|
|
220
|
+
|
|
221
|
+
Other options:
|
|
222
|
+
/owflow:goal-performance <task-path> — run remaining steps in one loop
|
|
223
|
+
/owflow:performance --from=<step-slug> <task-path> — jump to a specific step
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## Task Structure
|
|
229
|
+
|
|
230
|
+
The dispatcher creates the directory skeleton at init; every artifact below is produced by the subskill named in the comments:
|
|
231
|
+
|
|
232
|
+
```
|
|
233
|
+
.owflow/tasks/performance/YYYY-MM-DD-task-name/
|
|
234
|
+
├── orchestrator-state.yml # dispatcher (init) + every subskill (per-step writes)
|
|
235
|
+
├── analysis/
|
|
236
|
+
│ ├── codebase-analysis.md # performance-analyze (codebase-analysed)
|
|
237
|
+
│ ├── clarifications.md # performance-analyze
|
|
238
|
+
│ ├── performance-analysis.md # performance-analyze (bottlenecks-identified)
|
|
239
|
+
│ ├── requirements.md # performance-spec
|
|
240
|
+
│ └── user-profiling-data/ # optional user-provided data
|
|
241
|
+
├── implementation/
|
|
242
|
+
│ ├── spec.md # performance-spec (spec-written)
|
|
243
|
+
│ ├── implementation-plan.md # performance-plan (plan-created)
|
|
244
|
+
│ └── work-log.md # performance-implement (implementation-done)
|
|
245
|
+
└── verification/
|
|
246
|
+
├── spec-audit.md # performance-spec (spec-audited, conditional)
|
|
247
|
+
└── implementation-verification.md # performance-verify (verification-done)
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Auto-Recovery
|
|
253
|
+
|
|
254
|
+
Retries are owned by each subskill (each `/owflow:performance-*` SKILL.md carries its own `## Recovery` table).
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## Command Integration
|
|
259
|
+
|
|
260
|
+
Invoked via:
|
|
261
|
+
|
|
262
|
+
- `/owflow:performance [description]` (new)
|
|
263
|
+
- `/owflow:performance [task-path] [--from=<step-slug>]` (resume)
|
|
264
|
+
|
|
265
|
+
Alternative: `/owflow:goal-performance <task-path>` — same task lifecycle, all subskills invoked in one session with `question` gates.
|
|
266
|
+
|
|
267
|
+
Task directory: `.owflow/tasks/performance/YYYY-MM-DD-task-name/`
|