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,112 +1,112 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: owflow:performance-plan
|
|
3
|
-
description: Performance — breaks the approved specification into a grouped, dependency-ordered implementation plan via delegation, then adds an execution-flow diagram. Continues with performance-implement.
|
|
4
|
-
argument-hint: "[task-path-or-identifier]"
|
|
5
|
-
user-invocable: true
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Performance Plan — Implementation Planning (plan-created)
|
|
9
|
-
|
|
10
|
-
Work step of the performance workflow. Breaks the approved optimization specification into grouped, dependency-ordered task groups via the `implementation-planner` agent, then adds an execution-flow diagram. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
|
|
11
|
-
|
|
12
|
-
## Entry Gate
|
|
13
|
-
|
|
14
|
-
Resolve the argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). The argument may be:
|
|
15
|
-
|
|
16
|
-
- **Path** (absolute or project-relative) to the task directory — use as-is.
|
|
17
|
-
- **Identifier** — exact directory name inside `.owflow/tasks/performance/` (e.g., `2026-10-02-api-latency`); resolve to its path.
|
|
18
|
-
- **Description** — anything else (free text) is treated as a new performance task description: ask via `question` whether to start a fresh standard task at this step (mid-pipeline bootstrap) or route through `/owflow:performance <description>`; on decline, print the blocked block and STOP.
|
|
19
|
-
- If the argument is **missing**, the path does **not exist**, or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
|
|
20
|
-
|
|
21
|
-
1. Steps that must be completed first (in order), each with its command:
|
|
22
|
-
- Codebase & bottleneck analysis (`codebase-analysed`, `bottlenecks-identified`) → `/owflow:performance-analyze <task-path>`
|
|
23
|
-
- Requirements, specification & conditional audit (`spec-written`, `spec-audited`) → `/owflow:performance-spec <task-path>`
|
|
24
|
-
2. List available performance-task identifiers (directories under `.owflow/tasks/performance/`) to resume from, if any.
|
|
25
|
-
3. Hint: `Run /owflow:performance <description> to start a task from scratch, or pass a task path/identifier to resume.`
|
|
26
|
-
|
|
27
|
-
### Prerequisites
|
|
28
|
-
|
|
29
|
-
| Required for this skill | Where verified | Produced by |
|
|
30
|
-
| ------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------- |
|
|
31
|
-
| State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:performance <desc>` |
|
|
32
|
-
| Specification approved | `spec-written` in `completed_phases` + `implementation/spec.md` exists | `/owflow:performance-spec <task-path>` |
|
|
33
|
-
| Audit decision settled | `options.spec_audit_enabled` non-null | `/owflow:performance-spec <task-path>` |
|
|
34
|
-
|
|
35
|
-
1. **Read `orchestrator-state.yml`** from the task path. If missing → mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `plan-created`): `question` — create a fresh standard performance task starting at this step, or decline → print `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
|
|
36
|
-
2. **Skip/resume (artifacts before state)**: if `plan-created` is complete and `implementation/implementation-plan.md` exists, report the existing plan summary and route to the Exit Gate. If the file exists but its slug is missing, adopt it (append `plan-created`, backfill `performance_context.phase_summaries.planning` when still null) instead of re-running. A slug whose artifact is missing → drop the slug and re-run that step.
|
|
37
|
-
3. **Prerequisite check (presence and content)**: `spec-written` in `completed_phases` AND `implementation/spec.md` exists — the spec must be user-approved before the planner is invoked — AND `options.spec_audit_enabled` is non-null (the audit decision is settled). If missing → print the blocked block, then STOP:
|
|
38
|
-
- Steps that must be completed first: specification and its audit decision (`spec-written`, audit settled).
|
|
39
|
-
- `Run /owflow:performance-spec <task-path> first` (or `/owflow:performance-analyze <task-path>` for the missing earlier step).
|
|
40
|
-
- If no task exists yet: `Run /owflow:performance <description> to start a task from scratch.`
|
|
41
|
-
|
|
42
|
-
## Execute
|
|
43
|
-
|
|
44
|
-
**Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) and the [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md).
|
|
45
|
-
|
|
46
|
-
### Implementation Planning (`plan-created`, delegated)
|
|
47
|
-
|
|
48
|
-
**Artifacts**: `implementation/implementation-plan.md`
|
|
49
|
-
|
|
50
|
-
> **ANTI-PATTERN — never write the implementation plan yourself. "The optimization list is short" is NOT a reason to skip delegation.**
|
|
51
|
-
>
|
|
52
|
-
> - ❌ "Let me create the implementation plan..." — STOP. Delegate to `implementation-planner`.
|
|
53
|
-
> - ❌ "I'll break this into optimization steps..." — STOP. Delegate to `implementation-planner`.
|
|
54
|
-
|
|
55
|
-
1. **INVOKE NOW** (Task tool — never the Skill tool; this is an agent): Task tool - `implementation-planner` subagent. Pass (Pattern 7 — accumulated context): task_path, task_type="performance", task_description, spec_path (`implementation/spec.md`), `performance_context.task_characteristics`, `performance_context.bottleneck_priorities`, and relevant `performance_context.phase_summaries` (specification, bottleneck_analysis, codebase_analysis). Output: `implementation/implementation-plan.md`.
|
|
56
|
-
2. **SELF-CHECK**: Did you just invoke the Task tool with `implementation-planner`? Or did you start writing the plan yourself? If the latter, STOP and invoke the Task tool.
|
|
57
|
-
3. **Post-plan diagram refinement** (Skill, optional, content-preserving): Skill tool - `diagrams-mermaid` on `implementation/implementation-plan.md` — add one compact optimization execution flow (task-group dependency or state flow). Keep plan steps authoritative; diagrams are explanatory additions only. A declined or failed refinement is not a failure — note it in `performance_context.phase_summaries.planning`.
|
|
58
|
-
4. **State write**: append `plan-created` to `completed_phases`; set `performance_context.phase_summaries.planning` (task-group count, step count, optimization sequence); bump `orchestrator.updated`. On failure: append `plan-created` to `failed_phases`, increment `auto_fix_attempts["plan-created"]`. Then re-read state + run `verify_template`.
|
|
59
|
-
|
|
60
|
-
## State Update Convention (per step)
|
|
61
|
-
|
|
62
|
-
Apply after EVERY step above:
|
|
63
|
-
|
|
64
|
-
1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`plan-created`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
|
|
65
|
-
2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
|
|
66
|
-
3. **Failures** — if the step fails or its retries are abandoned, do NOT append to `completed_phases`; instead append the step's slug to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
|
|
67
|
-
4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-performance.yml`. Fix any reported issue immediately before proceeding.
|
|
68
|
-
5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run to confirm the full state matches everything performed in this session.
|
|
69
|
-
|
|
70
|
-
## Recovery
|
|
71
|
-
|
|
72
|
-
| Step | Max Attempts | Strategy |
|
|
73
|
-
| ----------------------------- | ------------ | ------------------------------------------------- |
|
|
74
|
-
| Implementation Planning (`plan-created`) | 2 | Regenerate the plan with adjusted spec context |
|
|
75
|
-
|
|
76
|
-
## Exit Gate
|
|
77
|
-
|
|
78
|
-
Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
|
|
79
|
-
|
|
80
|
-
### Results box
|
|
81
|
-
|
|
82
|
-
```markdown
|
|
83
|
-
## ✅ PERFORMANCE PLAN COMPLETE — <task name>
|
|
84
|
-
|
|
85
|
-
**Task groups** — [N groups / M steps]
|
|
86
|
-
**Optimization sequence** — [key dependency order]
|
|
87
|
-
**Spec** — [approved spec summary in 1 line]
|
|
88
|
-
**Diagram** — [added / skipped]
|
|
89
|
-
|
|
90
|
-
**Artifacts**
|
|
91
|
-
|
|
92
|
-
- `implementation/implementation-plan.md`
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Results-acceptance question
|
|
96
|
-
|
|
97
|
-
Use `question` — "Are these results correct?" with options:
|
|
98
|
-
|
|
99
|
-
- **Accept** — the plan is good; continue.
|
|
100
|
-
- **Adjust** — regenerate the plan with the user's corrections, update state and artifacts, re-present the results box.
|
|
101
|
-
- **Discuss** — walk through the plan's task groups, dependencies, or test strategy in more depth; then re-ask.
|
|
102
|
-
- **Stop here** — print the resume command (`/owflow:performance-plan <task-path>`) and end.
|
|
103
|
-
|
|
104
|
-
### Next steps (after Accept)
|
|
105
|
-
|
|
106
|
-
- `→ /owflow:performance-implement <task-path>` — `required` next: executes the plan via `implementation-plan-executor` (its terminal full-suite run is what keeps `skip_test_suite: true` safe). Remaining after: verify → finalize.
|
|
107
|
-
|
|
108
|
-
**Other options**:
|
|
109
|
-
|
|
110
|
-
- `/owflow:goal-performance <task-path>` — `optional` shortcut: runs all remaining steps in one loop (implement → verify → finalize)
|
|
111
|
-
|
|
112
|
-
Then STOP.
|
|
1
|
+
---
|
|
2
|
+
name: owflow:performance-plan
|
|
3
|
+
description: Performance — breaks the approved specification into a grouped, dependency-ordered implementation plan via delegation, then adds an execution-flow diagram. Continues with performance-implement.
|
|
4
|
+
argument-hint: "[task-path-or-identifier]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Performance Plan — Implementation Planning (plan-created)
|
|
9
|
+
|
|
10
|
+
Work step of the performance workflow. Breaks the approved optimization specification into grouped, dependency-ordered task groups via the `implementation-planner` agent, then adds an execution-flow diagram. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
|
|
11
|
+
|
|
12
|
+
## Entry Gate
|
|
13
|
+
|
|
14
|
+
Resolve the argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). The argument may be:
|
|
15
|
+
|
|
16
|
+
- **Path** (absolute or project-relative) to the task directory — use as-is.
|
|
17
|
+
- **Identifier** — exact directory name inside `.owflow/tasks/performance/` (e.g., `2026-10-02-api-latency`); resolve to its path.
|
|
18
|
+
- **Description** — anything else (free text) is treated as a new performance task description: ask via `question` whether to start a fresh standard task at this step (mid-pipeline bootstrap) or route through `/owflow:performance <description>`; on decline, print the blocked block and STOP.
|
|
19
|
+
- If the argument is **missing**, the path does **not exist**, or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
|
|
20
|
+
|
|
21
|
+
1. Steps that must be completed first (in order), each with its command:
|
|
22
|
+
- Codebase & bottleneck analysis (`codebase-analysed`, `bottlenecks-identified`) → `/owflow:performance-analyze <task-path>`
|
|
23
|
+
- Requirements, specification & conditional audit (`spec-written`, `spec-audited`) → `/owflow:performance-spec <task-path>`
|
|
24
|
+
2. List available performance-task identifiers (directories under `.owflow/tasks/performance/`) to resume from, if any.
|
|
25
|
+
3. Hint: `Run /owflow:performance <description> to start a task from scratch, or pass a task path/identifier to resume.`
|
|
26
|
+
|
|
27
|
+
### Prerequisites
|
|
28
|
+
|
|
29
|
+
| Required for this skill | Where verified | Produced by |
|
|
30
|
+
| ------------------------- | ------------------------------------------------------------------------------------- | ---------------------------------------- |
|
|
31
|
+
| State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:performance <desc>` |
|
|
32
|
+
| Specification approved | `spec-written` in `completed_phases` + `implementation/spec.md` exists | `/owflow:performance-spec <task-path>` |
|
|
33
|
+
| Audit decision settled | `options.spec_audit_enabled` non-null | `/owflow:performance-spec <task-path>` |
|
|
34
|
+
|
|
35
|
+
1. **Read `orchestrator-state.yml`** from the task path. If missing → mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `plan-created`): `question` — create a fresh standard performance task starting at this step, or decline → print `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
|
|
36
|
+
2. **Skip/resume (artifacts before state)**: if `plan-created` is complete and `implementation/implementation-plan.md` exists, report the existing plan summary and route to the Exit Gate. If the file exists but its slug is missing, adopt it (append `plan-created`, backfill `performance_context.phase_summaries.planning` when still null) instead of re-running. A slug whose artifact is missing → drop the slug and re-run that step.
|
|
37
|
+
3. **Prerequisite check (presence and content)**: `spec-written` in `completed_phases` AND `implementation/spec.md` exists — the spec must be user-approved before the planner is invoked — AND `options.spec_audit_enabled` is non-null (the audit decision is settled). If missing → print the blocked block, then STOP:
|
|
38
|
+
- Steps that must be completed first: specification and its audit decision (`spec-written`, audit settled).
|
|
39
|
+
- `Run /owflow:performance-spec <task-path> first` (or `/owflow:performance-analyze <task-path>` for the missing earlier step).
|
|
40
|
+
- If no task exists yet: `Run /owflow:performance <description> to start a task from scratch.`
|
|
41
|
+
|
|
42
|
+
## Execute
|
|
43
|
+
|
|
44
|
+
**Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md) and the [Dispatcher & Handoff Pattern](../orchestrator-framework/references/dispatcher-handoff.md).
|
|
45
|
+
|
|
46
|
+
### Implementation Planning (`plan-created`, delegated)
|
|
47
|
+
|
|
48
|
+
**Artifacts**: `implementation/implementation-plan.md`
|
|
49
|
+
|
|
50
|
+
> **ANTI-PATTERN — never write the implementation plan yourself. "The optimization list is short" is NOT a reason to skip delegation.**
|
|
51
|
+
>
|
|
52
|
+
> - ❌ "Let me create the implementation plan..." — STOP. Delegate to `implementation-planner`.
|
|
53
|
+
> - ❌ "I'll break this into optimization steps..." — STOP. Delegate to `implementation-planner`.
|
|
54
|
+
|
|
55
|
+
1. **INVOKE NOW** (Task tool — never the Skill tool; this is an agent): Task tool - `implementation-planner` subagent. Pass (Pattern 7 — accumulated context): task_path, task_type="performance", task_description, spec_path (`implementation/spec.md`), `performance_context.task_characteristics`, `performance_context.bottleneck_priorities`, and relevant `performance_context.phase_summaries` (specification, bottleneck_analysis, codebase_analysis). Output: `implementation/implementation-plan.md`.
|
|
56
|
+
2. **SELF-CHECK**: Did you just invoke the Task tool with `implementation-planner`? Or did you start writing the plan yourself? If the latter, STOP and invoke the Task tool.
|
|
57
|
+
3. **Post-plan diagram refinement** (Skill, optional, content-preserving): Skill tool - `diagrams-mermaid` on `implementation/implementation-plan.md` — add one compact optimization execution flow (task-group dependency or state flow). Keep plan steps authoritative; diagrams are explanatory additions only. A declined or failed refinement is not a failure — note it in `performance_context.phase_summaries.planning`.
|
|
58
|
+
4. **State write**: append `plan-created` to `completed_phases`; set `performance_context.phase_summaries.planning` (task-group count, step count, optimization sequence); bump `orchestrator.updated`. On failure: append `plan-created` to `failed_phases`, increment `auto_fix_attempts["plan-created"]`. Then re-read state + run `verify_template`.
|
|
59
|
+
|
|
60
|
+
## State Update Convention (per step)
|
|
61
|
+
|
|
62
|
+
Apply after EVERY step above:
|
|
63
|
+
|
|
64
|
+
1. **Write immediately** — update `orchestrator-state.yml` as soon as the step completes, appending ONLY the step slug actually performed (`plan-created`) plus that step's fields. Never batch multiple steps into one end-of-skill write.
|
|
65
|
+
2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
|
|
66
|
+
3. **Failures** — if the step fails or its retries are abandoned, do NOT append to `completed_phases`; instead append the step's slug to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
|
|
67
|
+
4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-performance.yml`. Fix any reported issue immediately before proceeding.
|
|
68
|
+
5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run to confirm the full state matches everything performed in this session.
|
|
69
|
+
|
|
70
|
+
## Recovery
|
|
71
|
+
|
|
72
|
+
| Step | Max Attempts | Strategy |
|
|
73
|
+
| ----------------------------- | ------------ | ------------------------------------------------- |
|
|
74
|
+
| Implementation Planning (`plan-created`) | 2 | Regenerate the plan with adjusted spec context |
|
|
75
|
+
|
|
76
|
+
## Exit Gate
|
|
77
|
+
|
|
78
|
+
Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
|
|
79
|
+
|
|
80
|
+
### Results box
|
|
81
|
+
|
|
82
|
+
```markdown
|
|
83
|
+
## ✅ PERFORMANCE PLAN COMPLETE — <task name>
|
|
84
|
+
|
|
85
|
+
**Task groups** — [N groups / M steps]
|
|
86
|
+
**Optimization sequence** — [key dependency order]
|
|
87
|
+
**Spec** — [approved spec summary in 1 line]
|
|
88
|
+
**Diagram** — [added / skipped]
|
|
89
|
+
|
|
90
|
+
**Artifacts**
|
|
91
|
+
|
|
92
|
+
- `implementation/implementation-plan.md`
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Results-acceptance question
|
|
96
|
+
|
|
97
|
+
Use `question` — "Are these results correct?" with options:
|
|
98
|
+
|
|
99
|
+
- **Accept** — the plan is good; continue.
|
|
100
|
+
- **Adjust** — regenerate the plan with the user's corrections, update state and artifacts, re-present the results box.
|
|
101
|
+
- **Discuss** — walk through the plan's task groups, dependencies, or test strategy in more depth; then re-ask.
|
|
102
|
+
- **Stop here** — print the resume command (`/owflow:performance-plan <task-path>`) and end.
|
|
103
|
+
|
|
104
|
+
### Next steps (after Accept)
|
|
105
|
+
|
|
106
|
+
- `→ /owflow:performance-implement <task-path>` — `required` next: executes the plan via `implementation-plan-executor` (its terminal full-suite run is what keeps `skip_test_suite: true` safe). Remaining after: verify → finalize.
|
|
107
|
+
|
|
108
|
+
**Other options**:
|
|
109
|
+
|
|
110
|
+
- `/owflow:goal-performance <task-path>` — `optional` shortcut: runs all remaining steps in one loop (implement → verify → finalize)
|
|
111
|
+
|
|
112
|
+
Then STOP.
|
|
@@ -1,145 +1,145 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: owflow:performance-spec
|
|
3
|
-
description: Performance — requirements gathering, specification creation via delegation, diagram refinement, and conditional specification audit. Continues with performance-plan.
|
|
4
|
-
argument-hint: "[task-path-or-identifier]"
|
|
5
|
-
user-invocable: true
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Performance Spec — Requirements, Specification & Conditional Audit (spec-written, spec-audited)
|
|
9
|
-
|
|
10
|
-
Work step of the performance workflow. Presents the bottleneck analysis, gathers optimization priorities, constraints, and targets, creates the specification via delegation, refines it with diagrams, then offers an independent specification audit. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
|
|
11
|
-
|
|
12
|
-
## Entry Gate
|
|
13
|
-
|
|
14
|
-
Resolve the argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). The argument may be:
|
|
15
|
-
|
|
16
|
-
- **Path** (absolute or project-relative) to the task directory — use as-is.
|
|
17
|
-
- **Identifier** — exact directory name inside `.owflow/tasks/performance/` (e.g., `2026-10-02-api-latency`); resolve to its path.
|
|
18
|
-
- **Description** — anything else (free text) is treated as a new performance task description: ask via `question` whether to start a fresh standard task at this step (mid-pipeline bootstrap) or route through `/owflow:performance <description>`; on decline, print the blocked block and STOP.
|
|
19
|
-
- If the argument is **missing**, the path does **not exist**, or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
|
|
20
|
-
|
|
21
|
-
1. Steps that must be completed first (in order), each with its command:
|
|
22
|
-
- Codebase & bottleneck analysis (`codebase-analysed`, `bottlenecks-identified`) → `/owflow:performance-analyze <task-path>`
|
|
23
|
-
2. List available performance-task identifiers (directories under `.owflow/tasks/performance/`) to resume from, if any.
|
|
24
|
-
3. Hint: `Run /owflow:performance <description> to start a task from scratch, or pass a task path/identifier to resume.`
|
|
25
|
-
|
|
26
|
-
### Prerequisites
|
|
27
|
-
|
|
28
|
-
| Required for this skill | Where verified | Produced by |
|
|
29
|
-
| ------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
30
|
-
| State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:performance <desc>` |
|
|
31
|
-
| Bottleneck analysis done | `bottlenecks-identified` in `completed_phases` + `analysis/performance-analysis.md` exists | `/owflow:performance-analyze <task-path>` |
|
|
32
|
-
|
|
33
|
-
1. **Read `orchestrator-state.yml`** from the task path. If missing → mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `spec-written`): `question` — create a fresh standard performance task starting at this step, or decline → print `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
|
|
34
|
-
2. **Skip/resume (artifacts before state)**:
|
|
35
|
-
- If `spec-written` is complete but `implementation/spec.md` is missing → drop the slug and re-run the specification step.
|
|
36
|
-
- If `spec-written` and `spec-audited` are complete: validate `verification/spec-audit.md` exists; missing → drop `spec-audited` and run the audit sub-step; otherwise report existing results and route to the Exit Gate.
|
|
37
|
-
- If only `spec-written` is complete: `options.spec_audit_enabled: false` → report the spec summary and route to the Exit Gate (do not re-ask); otherwise (`null` or `true`) skip directly to the audit sub-step — never re-run Requirements Gathering or Specification Creation.
|
|
38
|
-
3. **Audit skip/resume rule (audit-decision guard)**: the audit question is asked while `options.spec_audit_enabled` is `null`, and only then; a resume with `true` and the audit artifact missing goes straight to the auditor without re-asking. On skip, write `options.spec_audit_enabled: false` and NO `spec-audited` entry; a later resume with `false` does not re-ask. The audit is the conditional activation of this skill's second slug.
|
|
39
|
-
4. **Prerequisite check (presence and content)**: `bottlenecks-identified` in `completed_phases` AND `analysis/performance-analysis.md` exists. If missing → print the blocked block, then STOP:
|
|
40
|
-
- Steps that must be completed first: codebase & bottleneck analysis (`codebase-analysed`, `bottlenecks-identified`).
|
|
41
|
-
- `Run /owflow:performance-analyze <task-path> first.`
|
|
42
|
-
- If no task exists yet: `Run /owflow:performance <description> to start a task from scratch.`
|
|
43
|
-
|
|
44
|
-
## Execute
|
|
45
|
-
|
|
46
|
-
**Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md).
|
|
47
|
-
|
|
48
|
-
### Requirements Gathering (part of `spec-written`, inline)
|
|
49
|
-
|
|
50
|
-
1. Present the bottleneck summary from `analysis/performance-analysis.md` (P0-P3 counts and top findings).
|
|
51
|
-
2. `question` for optimization requirements:
|
|
52
|
-
- Which bottleneck priorities to address? (All P0+P1 / P0 only / specific ones)
|
|
53
|
-
- Any constraints? (backward compatibility, memory limits, no new dependencies)
|
|
54
|
-
- Performance targets? (specific response-time or throughput goals, if known)
|
|
55
|
-
3. Save to `analysis/requirements.md`: performance issue description, bottleneck analysis summary, optimization priorities, constraints, targets.
|
|
56
|
-
4. **Standards discovery**: Read `.owflow/docs/INDEX.md` before creating the spec.
|
|
57
|
-
|
|
58
|
-
### Specification Creation (part of `spec-written`, subagent)
|
|
59
|
-
|
|
60
|
-
**ANTI-PATTERN — never write spec.md yourself. "The optimization is straightforward" is NOT a reason to skip delegation.**
|
|
61
|
-
|
|
62
|
-
- ❌ "Let me create the specification..." — STOP. Delegate to `specification-creator`.
|
|
63
|
-
- ❌ "I'll write the spec based on the analysis..." — STOP. Delegate to `specification-creator`.
|
|
64
|
-
|
|
65
|
-
**INVOKE NOW** (Task tool — never the Skill tool; this is an agent): Task tool - `specification-creator` subagent. Pass (Pattern 7 — accumulated context): task_path, task_type="performance", task_description, requirements_path (`analysis/requirements.md`), project_context_paths (INDEX.md + `performance_context.project_doc_paths` from state), `performance_context.task_characteristics`, `performance_context.bottleneck_priorities`, and relevant `performance_context.phase_summaries` (codebase_analysis, bottleneck_analysis, clarifications). Output: `implementation/spec.md`.
|
|
66
|
-
|
|
67
|
-
**SELF-CHECK**: Did you just invoke the Task tool with `specification-creator`? Or did you start writing spec.md yourself? If the latter, STOP and invoke the Task tool.
|
|
68
|
-
|
|
69
|
-
### Diagram Refinement (part of `spec-written`, Skill, content-preserving)
|
|
70
|
-
|
|
71
|
-
Skill tool - `diagrams-mermaid` on `implementation/spec.md`. Add diagrams that clarify bottleneck flows and optimization boundaries without replacing specification prose: `flowchart` (bottleneck → fix path), optional `sequenceDiagram` (key hot path). Missing context → add an explicit open-questions section instead of inventing entities.
|
|
72
|
-
|
|
73
|
-
### Specification Audit (`spec-audited`, conditional)
|
|
74
|
-
|
|
75
|
-
> **ANTI-PATTERN — never audit the specification yourself. "The spec is short" is NOT a reason to skip delegation.**
|
|
76
|
-
>
|
|
77
|
-
> - ❌ "Let me review the spec myself..." — STOP. Delegate to `spec-auditor`.
|
|
78
|
-
> - ❌ "I'll check the spec against the analysis..." — STOP. Delegate to `spec-auditor`.
|
|
79
|
-
|
|
80
|
-
1. If `options.spec_audit_enabled` is already `true` (resume with `verification/spec-audit.md` missing), skip the question and go to step 2. Otherwise `question` — "Run specification audit? (Recommended)" with "Yes, run audit (Recommended)" first. Pre-select the recommended option when the monolith threshold is met: more than 5 optimizations planned or the spec exceeds 50 lines. The user may skip.
|
|
81
|
-
2. If yes: **INVOKE NOW** (Task tool): Task tool - `spec-auditor` subagent. Pass (Pattern 7 — accumulated context): task_path, spec_path (`implementation/spec.md`), plus the bottleneck priorities and spec summary from `performance_context.phase_summaries.specification` for framing. Output: `verification/spec-audit.md`. Display the verdict (pass / pass-with-concerns / fail), issue counts by severity, and top critical findings.
|
|
82
|
-
3. **SELF-CHECK**: Did you just invoke the Task tool with `spec-auditor`? Or did you review the spec yourself? If the latter, STOP and invoke the Task tool.
|
|
83
|
-
|
|
84
|
-
**The audit verdict has no separate state slot** — it is recorded in `performance_context.phase_summaries.specification` (the same slot as the spec summary).
|
|
85
|
-
|
|
86
|
-
## State Update Convention (per step)
|
|
87
|
-
|
|
88
|
-
Apply after EVERY step above:
|
|
89
|
-
|
|
90
|
-
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 batch multiple steps into one end-of-skill write:
|
|
91
|
-
- After the specification step (`spec-written` complete): append `spec-written` to `completed_phases`; set `performance_context.phase_summaries.specification` (approach + scope summary); bump `orchestrator.updated`.
|
|
92
|
-
- After the audit sub-step (only when it ran): append `spec-audited` to `completed_phases`; set `options.spec_audit_enabled: true` and the audit verdict in `performance_context.phase_summaries.specification`; bump `orchestrator.updated`.
|
|
93
|
-
- When the user skips the audit: set `options.spec_audit_enabled: false` and note "audit skipped" in `performance_context.phase_summaries.specification` — **no `spec-audited` entry**.
|
|
94
|
-
2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
|
|
95
|
-
3. **Failures** — if the specification or audit fails and cannot be recovered, do NOT append to `completed_phases`; instead append the step's slug (`spec-written` or `spec-audited`) to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
|
|
96
|
-
4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-performance.yml`. Fix any reported issue immediately before proceeding.
|
|
97
|
-
5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run to confirm the full state matches everything performed in this session.
|
|
98
|
-
|
|
99
|
-
## Recovery
|
|
100
|
-
|
|
101
|
-
| Step | Max Attempts | Strategy |
|
|
102
|
-
| --------------------------------- | ------------ | ------------------------------------------------------------------------------- |
|
|
103
|
-
| Specification (`spec-written`) | 2 | Regenerate spec with adjusted requirements |
|
|
104
|
-
| Specification Audit (`spec-audited`) | 2 | Re-run the auditor; on repeated failure report the verdict and offer the skip path |
|
|
105
|
-
|
|
106
|
-
## Exit Gate
|
|
107
|
-
|
|
108
|
-
Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
|
|
109
|
-
|
|
110
|
-
### Results box
|
|
111
|
-
|
|
112
|
-
```markdown
|
|
113
|
-
## ✅ PERFORMANCE SPEC COMPLETE — <spec title>
|
|
114
|
-
|
|
115
|
-
**Approach** — [optimization approach in 1 line]
|
|
116
|
-
**Scope** — [N included / M excluded]
|
|
117
|
-
**Audit** — [✅ pass / ⚠ pass-with-concerns / ❌ fail / skipped]: [0 critical / N major / N minor]
|
|
118
|
-
**Priorities** — [P0/P1/P2/P3 addressed]
|
|
119
|
-
|
|
120
|
-
**Artifacts**
|
|
121
|
-
|
|
122
|
-
- `analysis/requirements.md`
|
|
123
|
-
- `implementation/spec.md`
|
|
124
|
-
- `verification/spec-audit.md` [conditional]
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Results-acceptance question
|
|
128
|
-
|
|
129
|
-
Use `question` — "Are these results correct?" with options:
|
|
130
|
-
|
|
131
|
-
- **Accept** — the specification is good; continue.
|
|
132
|
-
- **Adjust** — regenerate the spec with the user's corrections (priorities, constraints, targets), update state and artifacts, re-present the results box.
|
|
133
|
-
- **Discuss** — walk through a specific part of the spec (scope boundaries, optimization approach, audit findings) in more depth; then re-ask.
|
|
134
|
-
- **Stop here** — print the resume command (`/owflow:performance-spec <task-path>`) and end.
|
|
135
|
-
|
|
136
|
-
### Next steps (after Accept)
|
|
137
|
-
|
|
138
|
-
- `→ /owflow:performance-plan <task-path>` — `required` next: breaks the approved spec into grouped, dependency-ordered task groups. Remaining after: implement → verify → finalize.
|
|
139
|
-
|
|
140
|
-
**Other options**:
|
|
141
|
-
|
|
142
|
-
- `/owflow:reviews-spec-audit <task-path>` — `optional` — standalone spec re-audit; does not advance phases (verify results, then re-run `/owflow:performance-spec` adjustments if needed)
|
|
143
|
-
- `/owflow:goal-performance <task-path>` — `optional` shortcut: runs all remaining steps in one loop (plan → implement → verify → finalize)
|
|
144
|
-
|
|
145
|
-
Then STOP.
|
|
1
|
+
---
|
|
2
|
+
name: owflow:performance-spec
|
|
3
|
+
description: Performance — requirements gathering, specification creation via delegation, diagram refinement, and conditional specification audit. Continues with performance-plan.
|
|
4
|
+
argument-hint: "[task-path-or-identifier]"
|
|
5
|
+
user-invocable: true
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Performance Spec — Requirements, Specification & Conditional Audit (spec-written, spec-audited)
|
|
9
|
+
|
|
10
|
+
Work step of the performance workflow. Presents the bottleneck analysis, gathers optimization priorities, constraints, and targets, creates the specification via delegation, refines it with diagrams, then offers an independent specification audit. State lives in `orchestrator-state.yml` — this skill reads it on entry and writes results on exit.
|
|
11
|
+
|
|
12
|
+
## Entry Gate
|
|
13
|
+
|
|
14
|
+
Resolve the argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). The argument may be:
|
|
15
|
+
|
|
16
|
+
- **Path** (absolute or project-relative) to the task directory — use as-is.
|
|
17
|
+
- **Identifier** — exact directory name inside `.owflow/tasks/performance/` (e.g., `2026-10-02-api-latency`); resolve to its path.
|
|
18
|
+
- **Description** — anything else (free text) is treated as a new performance task description: ask via `question` whether to start a fresh standard task at this step (mid-pipeline bootstrap) or route through `/owflow:performance <description>`; on decline, print the blocked block and STOP.
|
|
19
|
+
- If the argument is **missing**, the path does **not exist**, or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
|
|
20
|
+
|
|
21
|
+
1. Steps that must be completed first (in order), each with its command:
|
|
22
|
+
- Codebase & bottleneck analysis (`codebase-analysed`, `bottlenecks-identified`) → `/owflow:performance-analyze <task-path>`
|
|
23
|
+
2. List available performance-task identifiers (directories under `.owflow/tasks/performance/`) to resume from, if any.
|
|
24
|
+
3. Hint: `Run /owflow:performance <description> to start a task from scratch, or pass a task path/identifier to resume.`
|
|
25
|
+
|
|
26
|
+
### Prerequisites
|
|
27
|
+
|
|
28
|
+
| Required for this skill | Where verified | Produced by |
|
|
29
|
+
| ------------------------------ | ------------------------------------------------------------------------------------------- | ------------------------------------ |
|
|
30
|
+
| State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:performance <desc>` |
|
|
31
|
+
| Bottleneck analysis done | `bottlenecks-identified` in `completed_phases` + `analysis/performance-analysis.md` exists | `/owflow:performance-analyze <task-path>` |
|
|
32
|
+
|
|
33
|
+
1. **Read `orchestrator-state.yml`** from the task path. If missing → mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `spec-written`): `question` — create a fresh standard performance task starting at this step, or decline → print `No performance task found at <path>. Run /owflow:performance <description> to start a task from scratch.` and STOP.
|
|
34
|
+
2. **Skip/resume (artifacts before state)**:
|
|
35
|
+
- If `spec-written` is complete but `implementation/spec.md` is missing → drop the slug and re-run the specification step.
|
|
36
|
+
- If `spec-written` and `spec-audited` are complete: validate `verification/spec-audit.md` exists; missing → drop `spec-audited` and run the audit sub-step; otherwise report existing results and route to the Exit Gate.
|
|
37
|
+
- If only `spec-written` is complete: `options.spec_audit_enabled: false` → report the spec summary and route to the Exit Gate (do not re-ask); otherwise (`null` or `true`) skip directly to the audit sub-step — never re-run Requirements Gathering or Specification Creation.
|
|
38
|
+
3. **Audit skip/resume rule (audit-decision guard)**: the audit question is asked while `options.spec_audit_enabled` is `null`, and only then; a resume with `true` and the audit artifact missing goes straight to the auditor without re-asking. On skip, write `options.spec_audit_enabled: false` and NO `spec-audited` entry; a later resume with `false` does not re-ask. The audit is the conditional activation of this skill's second slug.
|
|
39
|
+
4. **Prerequisite check (presence and content)**: `bottlenecks-identified` in `completed_phases` AND `analysis/performance-analysis.md` exists. If missing → print the blocked block, then STOP:
|
|
40
|
+
- Steps that must be completed first: codebase & bottleneck analysis (`codebase-analysed`, `bottlenecks-identified`).
|
|
41
|
+
- `Run /owflow:performance-analyze <task-path> first.`
|
|
42
|
+
- If no task exists yet: `Run /owflow:performance <description> to start a task from scratch.`
|
|
43
|
+
|
|
44
|
+
## Execute
|
|
45
|
+
|
|
46
|
+
**Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md).
|
|
47
|
+
|
|
48
|
+
### Requirements Gathering (part of `spec-written`, inline)
|
|
49
|
+
|
|
50
|
+
1. Present the bottleneck summary from `analysis/performance-analysis.md` (P0-P3 counts and top findings).
|
|
51
|
+
2. `question` for optimization requirements:
|
|
52
|
+
- Which bottleneck priorities to address? (All P0+P1 / P0 only / specific ones)
|
|
53
|
+
- Any constraints? (backward compatibility, memory limits, no new dependencies)
|
|
54
|
+
- Performance targets? (specific response-time or throughput goals, if known)
|
|
55
|
+
3. Save to `analysis/requirements.md`: performance issue description, bottleneck analysis summary, optimization priorities, constraints, targets.
|
|
56
|
+
4. **Standards discovery**: Read `.owflow/docs/INDEX.md` before creating the spec.
|
|
57
|
+
|
|
58
|
+
### Specification Creation (part of `spec-written`, subagent)
|
|
59
|
+
|
|
60
|
+
**ANTI-PATTERN — never write spec.md yourself. "The optimization is straightforward" is NOT a reason to skip delegation.**
|
|
61
|
+
|
|
62
|
+
- ❌ "Let me create the specification..." — STOP. Delegate to `specification-creator`.
|
|
63
|
+
- ❌ "I'll write the spec based on the analysis..." — STOP. Delegate to `specification-creator`.
|
|
64
|
+
|
|
65
|
+
**INVOKE NOW** (Task tool — never the Skill tool; this is an agent): Task tool - `specification-creator` subagent. Pass (Pattern 7 — accumulated context): task_path, task_type="performance", task_description, requirements_path (`analysis/requirements.md`), project_context_paths (INDEX.md + `performance_context.project_doc_paths` from state), `performance_context.task_characteristics`, `performance_context.bottleneck_priorities`, and relevant `performance_context.phase_summaries` (codebase_analysis, bottleneck_analysis, clarifications). Output: `implementation/spec.md`.
|
|
66
|
+
|
|
67
|
+
**SELF-CHECK**: Did you just invoke the Task tool with `specification-creator`? Or did you start writing spec.md yourself? If the latter, STOP and invoke the Task tool.
|
|
68
|
+
|
|
69
|
+
### Diagram Refinement (part of `spec-written`, Skill, content-preserving)
|
|
70
|
+
|
|
71
|
+
Skill tool - `diagrams-mermaid` on `implementation/spec.md`. Add diagrams that clarify bottleneck flows and optimization boundaries without replacing specification prose: `flowchart` (bottleneck → fix path), optional `sequenceDiagram` (key hot path). Missing context → add an explicit open-questions section instead of inventing entities.
|
|
72
|
+
|
|
73
|
+
### Specification Audit (`spec-audited`, conditional)
|
|
74
|
+
|
|
75
|
+
> **ANTI-PATTERN — never audit the specification yourself. "The spec is short" is NOT a reason to skip delegation.**
|
|
76
|
+
>
|
|
77
|
+
> - ❌ "Let me review the spec myself..." — STOP. Delegate to `spec-auditor`.
|
|
78
|
+
> - ❌ "I'll check the spec against the analysis..." — STOP. Delegate to `spec-auditor`.
|
|
79
|
+
|
|
80
|
+
1. If `options.spec_audit_enabled` is already `true` (resume with `verification/spec-audit.md` missing), skip the question and go to step 2. Otherwise `question` — "Run specification audit? (Recommended)" with "Yes, run audit (Recommended)" first. Pre-select the recommended option when the monolith threshold is met: more than 5 optimizations planned or the spec exceeds 50 lines. The user may skip.
|
|
81
|
+
2. If yes: **INVOKE NOW** (Task tool): Task tool - `spec-auditor` subagent. Pass (Pattern 7 — accumulated context): task_path, spec_path (`implementation/spec.md`), plus the bottleneck priorities and spec summary from `performance_context.phase_summaries.specification` for framing. Output: `verification/spec-audit.md`. Display the verdict (pass / pass-with-concerns / fail), issue counts by severity, and top critical findings.
|
|
82
|
+
3. **SELF-CHECK**: Did you just invoke the Task tool with `spec-auditor`? Or did you review the spec yourself? If the latter, STOP and invoke the Task tool.
|
|
83
|
+
|
|
84
|
+
**The audit verdict has no separate state slot** — it is recorded in `performance_context.phase_summaries.specification` (the same slot as the spec summary).
|
|
85
|
+
|
|
86
|
+
## State Update Convention (per step)
|
|
87
|
+
|
|
88
|
+
Apply after EVERY step above:
|
|
89
|
+
|
|
90
|
+
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 batch multiple steps into one end-of-skill write:
|
|
91
|
+
- After the specification step (`spec-written` complete): append `spec-written` to `completed_phases`; set `performance_context.phase_summaries.specification` (approach + scope summary); bump `orchestrator.updated`.
|
|
92
|
+
- After the audit sub-step (only when it ran): append `spec-audited` to `completed_phases`; set `options.spec_audit_enabled: true` and the audit verdict in `performance_context.phase_summaries.specification`; bump `orchestrator.updated`.
|
|
93
|
+
- When the user skips the audit: set `options.spec_audit_enabled: false` and note "audit skipped" in `performance_context.phase_summaries.specification` — **no `spec-audited` entry**.
|
|
94
|
+
2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
|
|
95
|
+
3. **Failures** — if the specification or audit fails and cannot be recovered, do NOT append to `completed_phases`; instead append the step's slug (`spec-written` or `spec-audited`) to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
|
|
96
|
+
4. **Validate** — after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-performance.yml`. Fix any reported issue immediately before proceeding.
|
|
97
|
+
5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run to confirm the full state matches everything performed in this session.
|
|
98
|
+
|
|
99
|
+
## Recovery
|
|
100
|
+
|
|
101
|
+
| Step | Max Attempts | Strategy |
|
|
102
|
+
| --------------------------------- | ------------ | ------------------------------------------------------------------------------- |
|
|
103
|
+
| Specification (`spec-written`) | 2 | Regenerate spec with adjusted requirements |
|
|
104
|
+
| Specification Audit (`spec-audited`) | 2 | Re-run the auditor; on repeated failure report the verdict and offer the skip path |
|
|
105
|
+
|
|
106
|
+
## Exit Gate
|
|
107
|
+
|
|
108
|
+
Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
|
|
109
|
+
|
|
110
|
+
### Results box
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
## ✅ PERFORMANCE SPEC COMPLETE — <spec title>
|
|
114
|
+
|
|
115
|
+
**Approach** — [optimization approach in 1 line]
|
|
116
|
+
**Scope** — [N included / M excluded]
|
|
117
|
+
**Audit** — [✅ pass / ⚠ pass-with-concerns / ❌ fail / skipped]: [0 critical / N major / N minor]
|
|
118
|
+
**Priorities** — [P0/P1/P2/P3 addressed]
|
|
119
|
+
|
|
120
|
+
**Artifacts**
|
|
121
|
+
|
|
122
|
+
- `analysis/requirements.md`
|
|
123
|
+
- `implementation/spec.md`
|
|
124
|
+
- `verification/spec-audit.md` [conditional]
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Results-acceptance question
|
|
128
|
+
|
|
129
|
+
Use `question` — "Are these results correct?" with options:
|
|
130
|
+
|
|
131
|
+
- **Accept** — the specification is good; continue.
|
|
132
|
+
- **Adjust** — regenerate the spec with the user's corrections (priorities, constraints, targets), update state and artifacts, re-present the results box.
|
|
133
|
+
- **Discuss** — walk through a specific part of the spec (scope boundaries, optimization approach, audit findings) in more depth; then re-ask.
|
|
134
|
+
- **Stop here** — print the resume command (`/owflow:performance-spec <task-path>`) and end.
|
|
135
|
+
|
|
136
|
+
### Next steps (after Accept)
|
|
137
|
+
|
|
138
|
+
- `→ /owflow:performance-plan <task-path>` — `required` next: breaks the approved spec into grouped, dependency-ordered task groups. Remaining after: implement → verify → finalize.
|
|
139
|
+
|
|
140
|
+
**Other options**:
|
|
141
|
+
|
|
142
|
+
- `/owflow:reviews-spec-audit <task-path>` — `optional` — standalone spec re-audit; does not advance phases (verify results, then re-run `/owflow:performance-spec` adjustments if needed)
|
|
143
|
+
- `/owflow:goal-performance <task-path>` — `optional` shortcut: runs all remaining steps in one loop (plan → implement → verify → finalize)
|
|
144
|
+
|
|
145
|
+
Then STOP.
|