owflow 0.5.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.
Files changed (195) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +448 -261
  3. package/dist/agents/bottleneck-analyzer.md +332 -329
  4. package/dist/agents/code-quality-pragmatist.md +353 -354
  5. package/dist/agents/code-reviewer.md +238 -239
  6. package/dist/agents/codebase-analysis-reporter.md +245 -246
  7. package/dist/agents/docs-operator.md +22 -23
  8. package/dist/agents/e2e-test-verifier.md +447 -448
  9. package/dist/agents/gap-analyzer.md +501 -502
  10. package/dist/agents/implementation-completeness-checker.md +219 -220
  11. package/dist/agents/implementation-planner.md +308 -309
  12. package/dist/agents/information-gatherer.md +690 -691
  13. package/dist/agents/production-readiness-checker.md +278 -279
  14. package/dist/agents/project-analyzer.md +403 -403
  15. package/dist/agents/reality-assessor.md +365 -366
  16. package/dist/agents/research-planner.md +449 -450
  17. package/dist/agents/research-synthesizer.md +402 -403
  18. package/dist/agents/solution-brainstormer.md +256 -257
  19. package/dist/agents/solution-designer.md +371 -372
  20. package/dist/agents/spec-auditor.md +297 -298
  21. package/dist/agents/specification-creator.md +333 -334
  22. package/dist/agents/task-classifier.md +449 -450
  23. package/dist/agents/task-group-implementer.md +283 -284
  24. package/dist/agents/test-suite-runner.md +194 -195
  25. package/dist/agents/user-docs-generator.md +508 -509
  26. package/dist/commands/reviews-code.md +90 -90
  27. package/dist/commands/reviews-pragmatic.md +99 -99
  28. package/dist/commands/reviews-production-readiness.md +113 -113
  29. package/dist/commands/reviews-reality-check.md +110 -110
  30. package/dist/commands/reviews-spec-audit.md +114 -114
  31. package/dist/commands/work.md +280 -280
  32. package/dist/configuration/agents-config.d.ts +2 -0
  33. package/dist/configuration/agents-config.js +8 -44
  34. package/dist/configuration/commands-config.d.ts +23 -0
  35. package/dist/configuration/commands-config.js +17 -17
  36. package/dist/configuration/skills-config.d.ts +2 -0
  37. package/dist/configuration/skills-config.js +3 -3
  38. package/dist/hooks/hooks-diagnostics.d.ts +3 -0
  39. package/dist/hooks/hooks-diagnostics.js +21 -0
  40. package/dist/hooks/hooks-persistence.d.ts +17 -0
  41. package/dist/hooks/hooks-persistence.js +207 -0
  42. package/dist/hooks/hooks-registry.d.ts +6 -0
  43. package/dist/hooks/hooks-registry.js +104 -0
  44. package/dist/hooks/hooks-wrapper.d.ts +25 -0
  45. package/dist/hooks/hooks-wrapper.js +318 -0
  46. package/dist/hooks/internal/before-tool.d.ts +6 -0
  47. package/dist/hooks/internal/before-tool.js +13 -0
  48. package/dist/hooks/internal/session-compaction.d.ts +9 -0
  49. package/dist/hooks/{session-compaction.js → internal/session-compaction.js} +9 -7
  50. package/dist/hooks/runtime/circuit-breaker.d.ts +23 -0
  51. package/dist/hooks/runtime/circuit-breaker.js +39 -0
  52. package/dist/hooks/runtime/failure-policy.d.ts +15 -0
  53. package/dist/hooks/runtime/failure-policy.js +49 -0
  54. package/dist/hooks/runtime/process-executor.d.ts +33 -0
  55. package/dist/hooks/runtime/process-executor.js +147 -0
  56. package/dist/hooks/runtime/status-recorder.d.ts +27 -0
  57. package/dist/hooks/runtime/status-recorder.js +111 -0
  58. package/dist/index.d.ts +7 -0
  59. package/dist/index.js +111 -40
  60. package/dist/skills/agents-md-generator/SKILL.md +223 -223
  61. package/dist/skills/codebase-analyzer/SKILL.md +162 -162
  62. package/dist/skills/codebase-analyzer/references/code-analysis.md +63 -63
  63. package/dist/skills/codebase-analyzer/references/combined.md +31 -31
  64. package/dist/skills/codebase-analyzer/references/context-discovery.md +63 -63
  65. package/dist/skills/codebase-analyzer/references/file-discovery.md +51 -51
  66. package/dist/skills/codebase-analyzer/references/migration-target.md +23 -23
  67. package/dist/skills/codebase-analyzer/references/pattern-mining.md +22 -22
  68. package/dist/skills/dev-analyze/SKILL.md +115 -115
  69. package/dist/skills/dev-bugfix/SKILL.md +452 -452
  70. package/dist/skills/dev-finalize/SKILL.md +118 -118
  71. package/dist/skills/dev-implement/SKILL.md +167 -167
  72. package/dist/skills/dev-plan/SKILL.md +147 -147
  73. package/dist/skills/dev-spec/SKILL.md +182 -182
  74. package/dist/skills/dev-tdd-red/SKILL.md +94 -94
  75. package/dist/skills/dev-verify/SKILL.md +153 -153
  76. package/dist/skills/development/SKILL.md +260 -260
  77. package/dist/skills/diagrams-mermaid/SKILL.md +183 -159
  78. package/dist/skills/diagrams-mermaid/references/reference.md +220 -148
  79. package/dist/skills/docs-manager/SKILL.md +379 -379
  80. package/dist/skills/docs-manager/docs/INDEX.md +199 -199
  81. package/dist/skills/docs-manager/docs/standards/backend/api.md +25 -25
  82. package/dist/skills/docs-manager/docs/standards/backend/migrations.md +22 -22
  83. package/dist/skills/docs-manager/docs/standards/backend/models.md +25 -25
  84. package/dist/skills/docs-manager/docs/standards/backend/queries.md +22 -22
  85. package/dist/skills/docs-manager/docs/standards/frontend/accessibility.md +25 -25
  86. package/dist/skills/docs-manager/docs/standards/frontend/components.md +28 -28
  87. package/dist/skills/docs-manager/docs/standards/frontend/css.md +16 -16
  88. package/dist/skills/docs-manager/docs/standards/frontend/responsive.md +28 -28
  89. package/dist/skills/docs-manager/docs/standards/global/coding-style.md +25 -25
  90. package/dist/skills/docs-manager/docs/standards/global/commenting.md +10 -10
  91. package/dist/skills/docs-manager/docs/standards/global/conventions.md +31 -31
  92. package/dist/skills/docs-manager/docs/standards/global/error-handling.md +22 -22
  93. package/dist/skills/docs-manager/docs/standards/global/minimal-implementation.md +22 -22
  94. package/dist/skills/docs-manager/docs/standards/global/validation.md +28 -28
  95. package/dist/skills/docs-manager/docs/standards/testing/test-writing.md +25 -25
  96. package/dist/skills/docs-manager/references/agents-md-template.md +29 -29
  97. package/dist/skills/docs-manager/references/index-md-template.md +73 -73
  98. package/dist/skills/flow-init/SKILL.md +234 -234
  99. package/dist/skills/flow-init/references/architecture-template.md +45 -45
  100. package/dist/skills/flow-init/references/roadmap-templates.md +93 -93
  101. package/dist/skills/flow-init/references/tech-stack-template.md +70 -70
  102. package/dist/skills/flow-init/references/vision-templates.md +75 -75
  103. package/dist/skills/goal-development/SKILL.md +96 -96
  104. package/dist/skills/goal-migration/SKILL.md +114 -114
  105. package/dist/skills/goal-performance/SKILL.md +126 -0
  106. package/dist/skills/goal-research/SKILL.md +118 -118
  107. package/dist/skills/html-renderer/SKILL.md +173 -173
  108. package/dist/skills/html-renderer/references/index.html +318 -318
  109. package/dist/skills/html-renderer/references/styles.css +388 -388
  110. package/dist/skills/html-renderer/references/tokens.json +104 -104
  111. package/dist/skills/implementation-plan-executor/SKILL.md +378 -378
  112. package/dist/skills/implementation-verifier/SKILL.md +307 -307
  113. package/dist/skills/migration/SKILL.md +268 -268
  114. package/dist/skills/migration-analyze/SKILL.md +126 -126
  115. package/dist/skills/migration-finalize/SKILL.md +161 -161
  116. package/dist/skills/migration-fix/SKILL.md +155 -155
  117. package/dist/skills/migration-implement/SKILL.md +131 -131
  118. package/dist/skills/migration-plan/SKILL.md +131 -131
  119. package/dist/skills/migration-spec/SKILL.md +135 -135
  120. package/dist/skills/migration-spec/references/migration-strategies.md +430 -430
  121. package/dist/skills/migration-target/SKILL.md +134 -134
  122. package/dist/skills/migration-target/references/migration-types.md +489 -489
  123. package/dist/skills/migration-verify/SKILL.md +184 -184
  124. package/dist/skills/orchestrator-framework/SKILL.md +65 -65
  125. package/dist/skills/orchestrator-framework/references/command-namespacing.md +7 -7
  126. package/dist/skills/orchestrator-framework/references/confirm-or-revise-exception.md +20 -20
  127. package/dist/skills/orchestrator-framework/references/delegation-rules.md +54 -54
  128. package/dist/skills/orchestrator-framework/references/dispatcher-handoff.md +27 -27
  129. package/dist/skills/orchestrator-framework/references/fix-loop-contract.md +65 -65
  130. package/dist/skills/orchestrator-framework/references/gate-contract.md +122 -117
  131. package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +51 -51
  132. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +235 -235
  133. package/dist/skills/performance/SKILL.md +267 -437
  134. package/dist/skills/performance-analyze/SKILL.md +129 -0
  135. package/dist/skills/{performance → performance-analyze}/references/performance-optimization-guide.md +271 -365
  136. package/dist/skills/performance-finalize/SKILL.md +117 -0
  137. package/dist/skills/performance-implement/SKILL.md +114 -0
  138. package/dist/skills/performance-plan/SKILL.md +112 -0
  139. package/dist/skills/performance-spec/SKILL.md +145 -0
  140. package/dist/skills/performance-verify/SKILL.md +164 -0
  141. package/dist/skills/research/SKILL.md +249 -249
  142. package/dist/skills/research-brainstorm/SKILL.md +120 -120
  143. package/dist/skills/research-brainstorm/references/brainstorming-techniques.md +84 -84
  144. package/dist/skills/research-converge/SKILL.md +130 -130
  145. package/dist/skills/research-design/SKILL.md +146 -146
  146. package/dist/skills/research-design/references/design-techniques.md +40 -40
  147. package/dist/skills/research-finalize/SKILL.md +125 -125
  148. package/dist/skills/research-fork/SKILL.md +190 -190
  149. package/dist/skills/research-gather/SKILL.md +133 -133
  150. package/dist/skills/research-plan/SKILL.md +141 -141
  151. package/dist/skills/research-plan/references/research-methodologies.md +710 -710
  152. package/dist/skills/research-quick/SKILL.md +139 -139
  153. package/dist/skills/research-synthesize/SKILL.md +127 -127
  154. package/dist/skills/rule-reviewer/SKILL.md +334 -334
  155. package/dist/skills/standards-discover/SKILL.md +260 -260
  156. package/dist/skills/standards-discover/references/aggregation-strategy.md +76 -76
  157. package/dist/skills/standards-discover/references/code-pattern-prompt.md +68 -68
  158. package/dist/skills/standards-discover/references/config-analyzer-prompt.md +67 -67
  159. package/dist/skills/standards-discover/references/docs-extractor-prompt.md +65 -65
  160. package/dist/skills/standards-discover/references/external-analyzer-prompt.md +75 -75
  161. package/dist/skills/standards-update/SKILL.md +207 -207
  162. package/dist/templates/orchestrator-state-base.yml +17 -17
  163. package/dist/templates/orchestrator-state-development.yml +95 -95
  164. package/dist/templates/orchestrator-state-migration.yml +95 -95
  165. package/dist/templates/orchestrator-state-performance.yml +64 -53
  166. package/dist/templates/orchestrator-state-research.yml +67 -67
  167. package/dist/tools/fork_task.d.ts +17 -0
  168. package/dist/tools/fork_task.js +21 -11
  169. package/dist/tools/verify_template.d.ts +11 -0
  170. package/dist/tools/verify_template.js +32 -17
  171. package/dist/tui/hooks-dialogs.d.ts +20 -0
  172. package/dist/tui/hooks-dialogs.js +181 -0
  173. package/dist/tui/hooks-presenter.d.ts +15 -0
  174. package/dist/tui/hooks-presenter.js +70 -0
  175. package/dist/tui/hooks-sidebar.d.ts +10 -0
  176. package/dist/tui/hooks-sidebar.js +104 -0
  177. package/dist/tui/primitives.d.ts +21 -0
  178. package/dist/tui/primitives.js +47 -0
  179. package/dist/tui.d.ts +12 -0
  180. package/dist/tui.js +129 -0
  181. package/dist/types/hook-types.d.ts +125 -0
  182. package/dist/types/hook-types.js +76 -0
  183. package/dist/types/opencode-types.d.ts +13 -0
  184. package/dist/utils/file-util.d.ts +2 -0
  185. package/dist/utils/file-util.js +6 -6
  186. package/dist/utils/fork-task.d.ts +27 -0
  187. package/dist/utils/fork-task.js +18 -23
  188. package/dist/utils/plugin-info.d.ts +3 -0
  189. package/dist/utils/plugin-info.js +8 -10
  190. package/dist/utils/workflow-paths.d.ts +17 -0
  191. package/dist/utils/workflow-paths.js +18 -0
  192. package/dist/utils/yaml-structure.d.ts +7 -0
  193. package/dist/utils/yaml-structure.js +7 -11
  194. package/package.json +68 -48
  195. package/dist/hooks/before-tool.js +0 -19
@@ -1,182 +1,182 @@
1
- ---
2
- name: owflow:dev-spec
3
- description: Development — technical approach, requirements gathering, specification creation, and optional specification audit. --quick starts a condensed spec task here when no state file exists (condensing the missing pieces on an existing task).
4
- argument-hint: "[task-path-or-identifier | \"description\"] [--quick]"
5
- user-invocable: true
6
- ---
7
-
8
- # Dev Spec — Requirements, Specification & Audit (spec-written, spec-audited)
9
-
10
- Work phase of the development workflow. Resolves technical decisions, gathers requirements, creates the specification via delegation, refines it with diagrams, then offers an independent specification audit.
11
-
12
- Supports a **quick mode** (`--quick`, or any description argument with no existing task): a condensed prelude that bootstraps a standard development task (state file, standards discovery, quick analysis) and then writes the condensed specification directly on the fly — no specification-creator subagent. After the Exit Gate, the pipeline continues with `/owflow:dev-plan` (normal or `--quick`). The task is a regular development task, resumable by any dev-* subskill.
13
-
14
- ## Entry Gate
15
-
16
- Resolve the argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). The argument may be:
17
-
18
- - **Path** (absolute or project-relative) to the task directory — use as-is.
19
- - **Identifier** — exact directory name inside `.owflow/tasks/development/` (e.g., `2026-01-12-my-task`); resolve to its path.
20
- - **Description** — anything else (quoted free text, e.g. `"Add a logout button to the navbar"`) is treated as a new task description for quick bootstrap.
21
-
22
- Route by argument kind and flags:
23
-
24
- | Situation | Route |
25
- | ------------------------------------------------------------- | ---------------------------------------------------------------------------- |
26
- | Task path/identifier, no `--quick`, state + analysis exist | Normal specification below |
27
- | Task path/identifier, `--quick`, analysis done (spec missing) | Quick prelude step 3 only (condensed spec), then audit offer / Exit Gate |
28
- | Task path/identifier, `--quick`, analysis missing | Quick bootstrap/prelude for the missing pieces, then condensed spec |
29
- | Description argument, `--quick` (or no argument after prompt) | Quick bootstrap (create task + condensed prelude + condensed spec) |
30
- | Description argument, no `--quick` | Ask via `question`: quick spec-only task / full pipeline (blocked block below) / cancel |
31
- | Missing argument | Prompt for input (path, identifier, or description), then re-route |
32
-
33
- If the path does **not exist** or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
34
-
35
- 1. Steps that must be completed first (in order), each with its command:
36
- - Codebase & gap analysis (`codebase-analysed`, `gap-analysed`) → `/owflow:dev-analyze <task-path>`
37
- - TDD red gate (`tdd-red-proven`) — only when a reproducible defect was detected during analysis → `/owflow:dev-tdd-red <task-path>`
38
- 2. List available dev-task identifiers (directories under `.owflow/tasks/development/`) to resume from, if any.
39
- 3. Hint: `Run /owflow:development <description> to start a task from scratch, /owflow:dev-spec --quick "<description>" for a quick spec-only task, or pass a task path/identifier to resume.`
40
-
41
- ### Prerequisites
42
-
43
- | Required for this skill | Where verified | Produced by |
44
- | -------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------- |
45
- | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` or quick bootstrap |
46
- | Analysis done | `gap-analysed` in `completed_phases` + `analysis/gap-analysis.md` exists | `/owflow:dev-analyze <task-path>` or quick prelude |
47
- | TDD red gate (conditional) | `tdd-red-proven` in `completed_phases` — required only when `has_reproducible_defect: true` | `/owflow:dev-tdd-red <task-path>` |
48
-
49
- 1. **Read `orchestrator-state.yml`** from the task path. If missing → quick bootstrap when invoked with `--quick` or a description argument (see Quick Mode), otherwise mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `spec-written`): `question` — create a fresh standard development task starting at this step, or decline → print `No development task found at <path>. Run /owflow:development <description> to start a task from scratch, or /owflow:dev-spec --quick "<description>" for a quick spec-only task.` and STOP.
50
- 2. **Skip/resume**: if both `spec-written` and `spec-audited` are in `completed_phases`, report existing results and route to the Exit Gate. If only `spec-written` is complete: when `options.spec_audit_enabled: false` (quick task — audit skipped by design), report the existing spec summary and route to the Exit Gate; otherwise skip to the spec audit.
51
- 3. **Conditional activation (routing guard — both modes)**: if `task_context.task_characteristics.has_reproducible_defect` is `true` AND `tdd-red-proven` is NOT in `completed_phases` → print the blocked block, then STOP (quick mode does NOT bypass a proven-defect red gate; the quick TDD lane for bug-shaped work is `/owflow:dev-bugfix`):
52
- - Steps that must be completed first: TDD red gate (`tdd-red-proven` — required because a reproducible defect was detected); if analysis (`codebase-analysed`, `gap-analysed`) is also missing, start there.
53
- - `Run /owflow:dev-tdd-red <task-path> first (or /owflow:dev-analyze <task-path> if analysis is also missing).`
54
- 4. **Prerequisite check**: `gap-analysed` in `completed_phases` and `analysis/gap-analysis.md` exists. If missing → run the Quick prelude for the missing pieces (when `--quick` or the user chooses quick), otherwise print the blocked block, then STOP:
55
- - Steps that must be completed first: codebase & gap analysis (`codebase-analysed`, `gap-analysed`).
56
- - `Run /owflow:dev-analyze <task-path> first.`
57
- - If no task exists yet: `Run /owflow:development <description> to start a task from scratch, or /owflow:dev-spec --quick "<description>" for a quick spec-only task.`
58
-
59
- ## Quick Mode (condensed prelude → spec on the fly)
60
-
61
- Quick mode produces the same artifacts as the early pipeline phases — just condensed into one pass inside this skill. It does NOT introduce a second state format: the task gets a standard `orchestrator-state.yml` and standard artifacts, so every other dev-* subskill can pick it up afterwards.
62
-
63
- ### Quick bootstrap (no state file, description argument)
64
-
65
- 1. **Create Task Directory**: `.owflow/tasks/development/YYYY-MM-DD-task-name/` (3–5 kebab-case words from the description).
66
- 2. **Initialize State**: create `orchestrator-state.yml` from the development template with `task.title` / `task.description` from the description, `task.status: in_progress`, and `orchestrator.entry_point: "dev-spec --quick"`. Bug-shaped descriptions (symptom + expected vs actual) → suggest `/owflow:dev-bugfix "<description>"` instead (TDD red gate discipline, same standard state) — unless the user insists on proceeding here.
67
- - **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-development.yml`.
68
- 3. **Discover project documentation**: read `.owflow/docs/INDEX.md` (if exists) and extract the Project Documentation file paths into `project_context.project_doc_paths` (matching the development dispatcher's initialization).
69
- 4. If `.owflow/docs/` does not exist, proceed without standards and note the graceful-fallback hint in the completion message: `"No AI SDLC standards found. Consider running /owflow:flow-init to initialize project documentation and coding standards."`
70
-
71
- ### Quick prelude (one condensed pass)
72
-
73
- **MANDATORY order — standards before analysis, analysis before spec:**
74
-
75
- 1. **Standards discovery** (skip when `project_context.standards_applied` already lists the applicable standards): identify applicable standards from INDEX.md by task keywords (e.g., "API" → api/error-handling, "form" → validation/accessibility) and **READ each applicable standard file** with the Read tool — reading INDEX.md alone is NOT sufficient. Record the paths in `project_context.standards_applied` (extra state field).
76
- 2. **Brief codebase analysis** (skip when `gap-analysed` is already in `completed_phases`): explore the affected areas (Glob, Grep, Read) — enough to identify affected files/modules, existing patterns, and constraints that inform the spec. Write `analysis/quick-analysis.md` (affected files, approach sketch, standards referenced). Extract a 1–2 sentence summary into `phase_summaries.quick_analysis`.
77
- 3. **Condensed requirements pass (gap-driven — no fixed question rounds)**: extract the REQUIRED spec topics from evidence first — **User Journey** (discovery/access, personas, workflow fit), **Existing Code Reuse** (similar features, UI components, backend patterns — found during the brief analysis), **Visual Assets** (check `analysis/visuals/` regardless of the answer; skip visual processing for non-UI tasks when none found). On an existing task, reuse the analysis clarifications (`analysis/clarifications.md`, gap-analysis scope decisions) as already-gathered evidence. Only where a genuine gap or ambiguity would change the spec's scope or architecture, ask ONE consolidated `question` round (2–4 targeted questions, confirmable-assumption framing "I assume X — is that correct?", multi-select where positions co-exist); when multiple valid architectural approaches surface, present them in the same round and record the choice in `task_context.architecture_decision`. Never write TBDs or open questions into the condensed spec — decide, or ask; anything unresolvable is recorded as an explicit assumption in the spec's scope section. Save the gathered context to `analysis/requirements.md` (condensed: description, evidence-based journey/reuse/visuals findings, any Q&A, requirements, scope boundaries, standards referenced).
78
- 4. **Condensed spec — written directly, NO delegation**: write `implementation/spec.md` — goal, scope (in/out), requirements, applicable standards with key guidelines, verification criteria. Then run the Quick diagram gate below. This REPLACES the `specification-creator` delegation in Execute below (quick mode is the only exception to the delegation anti-pattern). Mark `spec-written` complete (`phase_summaries.specification` summary).
79
-
80
- ### Quick diagram gate (optional — part of the condensed spec)
81
-
82
- 1. Use `question`: "Add diagrams to the condensed spec?" Options:
83
- - **Add diagrams** — Skill tool - `diagrams-mermaid` on `implementation/spec.md` (content-preserving, same rules as the normal Diagram Refinement).
84
- - **Skip** — the spec stays prose-only.
85
- 2. A declined or failed diagram refinement is NOT a failure — note it in `phase_summaries.specification` and continue.
86
-
87
- The TDD red gate is NOT bypassed by quick mode: when `has_reproducible_defect: true` and `tdd-red-proven` is missing, the routing guard in the Entry Gate fires in both modes — the quick TDD lane for bug-shaped work is `/owflow:dev-bugfix`, not a silent skip. `spec-audited` is SKIPPED in quick mode — set `options.spec_audit_enabled: false`; Exit Gate acceptance substitutes for the audit, and `/owflow:reviews-spec-audit <task-path>` remains available as a standalone later option.
88
-
89
- Then continue with the **Exit Gate** below.
90
-
91
- ## Execute (normal runs — delegated specification)
92
-
93
- **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md).
94
-
95
- **Scope**: normal runs only — quick mode writes the condensed spec directly (see Quick Mode) and skips this section.
96
-
97
- ### Technical & Architecture Clarification (before `spec-written`, inline, conditional)
98
-
99
- - Complex task with multiple approaches → `question` for 3-5 technical questions.
100
- - Multiple valid architectural approaches → present 2-3 via `question`; the chosen approach is passed to specification-creator.
101
- - Save to `analysis/technical-clarifications.md` (conditional).
102
- - Skip if: simple task, `risk_level: low`, no multiple approaches detected.
103
-
104
- ### Requirements Gathering (part of `spec-written`, inline)
105
-
106
- 1. `question` for specification requirements — adaptive count based on description length: brief (<30 words) 6-8; standard (30-100 words) 4-6; detailed (>100 words) 2-3. Frame as confirmable assumptions ("I assume X, is that correct?").
107
- 2. REQUIRED questions (always include): **User Journey** (discovery/access, personas, workflow fit), **Existing Code Reuse** (similar features, UI components, backend patterns), **Visual Assets** (mockups/wireframes → `analysis/visuals/`).
108
- 3. Check `analysis/visuals/` for assets regardless of the answer; note findings for subagent context (skip visual processing for non-UI tasks when none found).
109
- 4. Save to `analysis/requirements.md`: initial description, all Q&A rounds, similar features, visual insights, functional requirements, reusability opportunities, scope boundaries, technical considerations.
110
-
111
- ### Specification Creation (part of `spec-written`, subagent)
112
-
113
- **ANTI-PATTERN — never write spec.md yourself in a normal run. "The task is simple" is NOT a reason to skip delegation. (Quick mode is the ONLY exception — its prelude step 4 writes the condensed spec directly and skips this section.)**
114
-
115
- Task tool - `specification-creator`. Pass: task_path, task_description, task_characteristics, requirements_path (`analysis/requirements.md`), project_context_paths (INDEX.md + `project_doc_paths` from state), risk_level, relevant `phase_summaries`, research/quick context if present in state. Output: `implementation/spec.md`.
116
-
117
- ### Diagram Refinement (part of `spec-written`, Skill, content-preserving)
118
-
119
- Skill tool - `diagrams-mermaid` on `implementation/spec.md`. Add diagrams that clarify scope and communication without replacing prose: `flowchart` (primary functional path), `sequenceDiagram` (key interaction), optional `C4Component` (if module structure is in scope). Missing context → add an explicit open questions section instead of inventing entities.
120
-
121
- ### Specification Audit (`spec-audited`, recommended)
122
-
123
- 1. `question` — "Run specification audit? (Recommended)" with "Yes, run audit (Recommended)" first. User may skip.
124
- 2. If yes: Task tool - `spec-auditor`. Pass: task_path, spec_path. Output: `verification/spec-audit.md`. Display verdict (pass/pass-with-concerns/fail), issue counts by severity, top critical findings.
125
-
126
- ## State Update Convention (per step)
127
-
128
- Apply after EVERY phase/step above:
129
-
130
- 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:
131
- - After Part A (if it ran): set `task_context.tech_clarified`, `task_context.architecture_decision`.
132
- - After Parts B–D (`spec-written` complete): append `spec-written` to `completed_phases`; set `phase_summaries.specification`; bump `orchestrator.updated`.
133
- - After Part E (only when the audit ran): append `spec-audited` to `completed_phases`; set `options.spec_audit_enabled: true` and the audit verdict in `phase_summaries.specification`; bump `orchestrator.updated`. When the user skipped the audit, set `options.spec_audit_enabled: false` — no `spec-audited` entry.
134
- - In quick mode, ALSO append the prelude slugs on their individual completions (never batched): `codebase-analysed` and `gap-analysed` after the quick analysis (quick analysis covers both; note the condensation in `phase_summaries.codebase_analysis` / `phase_summaries.gap_analysis`), then `spec-written` after the condensed spec (summary in `phase_summaries.specification`). The audit skip sets `options.spec_audit_enabled: false` — no `spec-audited` entry.
135
- 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
136
- 3. **Failures** — if the spec creation or audit fails and cannot be recovered, do NOT append to `completed_phases`; append the corresponding step slug (`spec-written` or `spec-audited`) to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
137
- 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-development.yml`. Fix any reported issue immediately before proceeding.
138
- 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.
139
-
140
- ## Exit Gate
141
-
142
- Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
143
-
144
- ### Results box
145
-
146
- ```markdown
147
- ## ✅ DEV SPEC COMPLETE — <spec title>
148
-
149
- **Approach** — [architecture approach in 1 line]
150
- **Scope** — [N included / M excluded]
151
- **Audit** — [✅ pass / ⚠ pass-with-concerns / ❌ fail / skipped]: [0 critical / N major / N minor]
152
- **Entry point** — [quick bootstrap (`--quick`) / full pipeline]
153
-
154
- **Artifacts**
155
-
156
- - `analysis/requirements.md`
157
- - `implementation/spec.md`
158
- - `verification/spec-audit.md` [conditional]
159
- ```
160
-
161
- In quick mode the audit line reads `skipped (quick mode)` and `/owflow:reviews-spec-audit <task-path>` is the standalone later option.
162
-
163
- ### Results-acceptance question
164
-
165
- Use `question` — "Are these results correct?" with options:
166
-
167
- - **Accept** — the specification is good; continue.
168
- - **Adjust** — regenerate the spec with the user's corrections (clarifications, scope boundaries, requirements), update state, re-present the results box.
169
- - **Discuss** — walk through a specific part of the spec (scope boundaries, architecture approach, audit findings) in more depth; then re-ask.
170
- - **Stop here** — print the resume command (`/owflow:dev-spec <task-path>`) and end.
171
-
172
- ### Next steps (after Accept)
173
-
174
- - `→ /owflow:dev-plan <task-path>` — `required` next: breaks the approved spec into grouped, dependency-ordered task groups with test-driven steps. Remaining after: implement → verify → finalize.
175
- - `/owflow:dev-plan --quick <task-path>` — `optional` condensed alternative: writes the implementation plan directly on the fly instead of delegating to the planner subagent.
176
-
177
- **Other options**:
178
-
179
- - `/owflow:reviews-spec-audit <task-path>` — `optional` — standalone spec re-audit; does not advance phases (verify results, then re-run `/owflow:dev-spec` adjustments if needed)
180
- - `/owflow:goal-development <task-path>` — `optional` shortcut: runs all remaining phases in one loop (plan → implement → verify → finalize)
181
-
182
- Then STOP.
1
+ ---
2
+ name: owflow:dev-spec
3
+ description: Development — technical approach, requirements gathering, specification creation, and optional specification audit. --quick starts a condensed spec task here when no state file exists (condensing the missing pieces on an existing task).
4
+ argument-hint: "[task-path-or-identifier | \"description\"] [--quick]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Dev Spec — Requirements, Specification & Audit (spec-written, spec-audited)
9
+
10
+ Work phase of the development workflow. Resolves technical decisions, gathers requirements, creates the specification via delegation, refines it with diagrams, then offers an independent specification audit.
11
+
12
+ Supports a **quick mode** (`--quick`, or any description argument with no existing task): a condensed prelude that bootstraps a standard development task (state file, standards discovery, quick analysis) and then writes the condensed specification directly on the fly — no specification-creator subagent. After the Exit Gate, the pipeline continues with `/owflow:dev-plan` (normal or `--quick`). The task is a regular development task, resumable by any dev-* subskill.
13
+
14
+ ## Entry Gate
15
+
16
+ Resolve the argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). The argument may be:
17
+
18
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
19
+ - **Identifier** — exact directory name inside `.owflow/tasks/development/` (e.g., `2026-01-12-my-task`); resolve to its path.
20
+ - **Description** — anything else (quoted free text, e.g. `"Add a logout button to the navbar"`) is treated as a new task description for quick bootstrap.
21
+
22
+ Route by argument kind and flags:
23
+
24
+ | Situation | Route |
25
+ | ------------------------------------------------------------- | ---------------------------------------------------------------------------- |
26
+ | Task path/identifier, no `--quick`, state + analysis exist | Normal specification below |
27
+ | Task path/identifier, `--quick`, analysis done (spec missing) | Quick prelude step 3 only (condensed spec), then audit offer / Exit Gate |
28
+ | Task path/identifier, `--quick`, analysis missing | Quick bootstrap/prelude for the missing pieces, then condensed spec |
29
+ | Description argument, `--quick` (or no argument after prompt) | Quick bootstrap (create task + condensed prelude + condensed spec) |
30
+ | Description argument, no `--quick` | Ask via `question`: quick spec-only task / full pipeline (blocked block below) / cancel |
31
+ | Missing argument | Prompt for input (path, identifier, or description), then re-route |
32
+
33
+ If the path does **not exist** or matches **no identifier** → print the blocked block, then STOP (never guess or auto-pick a task):
34
+
35
+ 1. Steps that must be completed first (in order), each with its command:
36
+ - Codebase & gap analysis (`codebase-analysed`, `gap-analysed`) → `/owflow:dev-analyze <task-path>`
37
+ - TDD red gate (`tdd-red-proven`) — only when a reproducible defect was detected during analysis → `/owflow:dev-tdd-red <task-path>`
38
+ 2. List available dev-task identifiers (directories under `.owflow/tasks/development/`) to resume from, if any.
39
+ 3. Hint: `Run /owflow:development <description> to start a task from scratch, /owflow:dev-spec --quick "<description>" for a quick spec-only task, or pass a task path/identifier to resume.`
40
+
41
+ ### Prerequisites
42
+
43
+ | Required for this skill | Where verified | Produced by |
44
+ | -------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------- |
45
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` or quick bootstrap |
46
+ | Analysis done | `gap-analysed` in `completed_phases` + `analysis/gap-analysis.md` exists | `/owflow:dev-analyze <task-path>` or quick prelude |
47
+ | TDD red gate (conditional) | `tdd-red-proven` in `completed_phases` — required only when `has_reproducible_defect: true` | `/owflow:dev-tdd-red <task-path>` |
48
+
49
+ 1. **Read `orchestrator-state.yml`** from the task path. If missing → quick bootstrap when invoked with `--quick` or a description argument (see Quick Mode), otherwise mid-pipeline bootstrap ([Missing-state Bootstrap](../orchestrator-framework/references/gate-contract.md), starting slug `spec-written`): `question` — create a fresh standard development task starting at this step, or decline → print `No development task found at <path>. Run /owflow:development <description> to start a task from scratch, or /owflow:dev-spec --quick "<description>" for a quick spec-only task.` and STOP.
50
+ 2. **Skip/resume**: if both `spec-written` and `spec-audited` are in `completed_phases`, report existing results and route to the Exit Gate. If only `spec-written` is complete: when `options.spec_audit_enabled: false` (quick task — audit skipped by design), report the existing spec summary and route to the Exit Gate; otherwise skip to the spec audit.
51
+ 3. **Conditional activation (routing guard — both modes)**: if `task_context.task_characteristics.has_reproducible_defect` is `true` AND `tdd-red-proven` is NOT in `completed_phases` → print the blocked block, then STOP (quick mode does NOT bypass a proven-defect red gate; the quick TDD lane for bug-shaped work is `/owflow:dev-bugfix`):
52
+ - Steps that must be completed first: TDD red gate (`tdd-red-proven` — required because a reproducible defect was detected); if analysis (`codebase-analysed`, `gap-analysed`) is also missing, start there.
53
+ - `Run /owflow:dev-tdd-red <task-path> first (or /owflow:dev-analyze <task-path> if analysis is also missing).`
54
+ 4. **Prerequisite check**: `gap-analysed` in `completed_phases` and `analysis/gap-analysis.md` exists. If missing → run the Quick prelude for the missing pieces (when `--quick` or the user chooses quick), otherwise print the blocked block, then STOP:
55
+ - Steps that must be completed first: codebase & gap analysis (`codebase-analysed`, `gap-analysed`).
56
+ - `Run /owflow:dev-analyze <task-path> first.`
57
+ - If no task exists yet: `Run /owflow:development <description> to start a task from scratch, or /owflow:dev-spec --quick "<description>" for a quick spec-only task.`
58
+
59
+ ## Quick Mode (condensed prelude → spec on the fly)
60
+
61
+ Quick mode produces the same artifacts as the early pipeline phases — just condensed into one pass inside this skill. It does NOT introduce a second state format: the task gets a standard `orchestrator-state.yml` and standard artifacts, so every other dev-* subskill can pick it up afterwards.
62
+
63
+ ### Quick bootstrap (no state file, description argument)
64
+
65
+ 1. **Create Task Directory**: `.owflow/tasks/development/YYYY-MM-DD-task-name/` (3–5 kebab-case words from the description).
66
+ 2. **Initialize State**: create `orchestrator-state.yml` from the development template with `task.title` / `task.description` from the description, `task.status: in_progress`, and `orchestrator.entry_point: "dev-spec --quick"`. Bug-shaped descriptions (symptom + expected vs actual) → suggest `/owflow:dev-bugfix "<description>"` instead (TDD red gate discipline, same standard state) — unless the user insists on proceeding here.
67
+ - **CRITICAL**: use the `verify_template` tool immediately after creation to check YAML validity against `orchestrator-state-development.yml`.
68
+ 3. **Discover project documentation**: read `.owflow/docs/INDEX.md` (if exists) and extract the Project Documentation file paths into `project_context.project_doc_paths` (matching the development dispatcher's initialization).
69
+ 4. If `.owflow/docs/` does not exist, proceed without standards and note the graceful-fallback hint in the completion message: `"No AI SDLC standards found. Consider running /owflow:flow-init to initialize project documentation and coding standards."`
70
+
71
+ ### Quick prelude (one condensed pass)
72
+
73
+ **MANDATORY order — standards before analysis, analysis before spec:**
74
+
75
+ 1. **Standards discovery** (skip when `project_context.standards_applied` already lists the applicable standards): identify applicable standards from INDEX.md by task keywords (e.g., "API" → api/error-handling, "form" → validation/accessibility) and **READ each applicable standard file** with the Read tool — reading INDEX.md alone is NOT sufficient. Record the paths in `project_context.standards_applied` (extra state field).
76
+ 2. **Brief codebase analysis** (skip when `gap-analysed` is already in `completed_phases`): explore the affected areas (Glob, Grep, Read) — enough to identify affected files/modules, existing patterns, and constraints that inform the spec. Write `analysis/quick-analysis.md` (affected files, approach sketch, standards referenced). Extract a 1–2 sentence summary into `phase_summaries.quick_analysis`.
77
+ 3. **Condensed requirements pass (gap-driven — no fixed question rounds)**: extract the REQUIRED spec topics from evidence first — **User Journey** (discovery/access, personas, workflow fit), **Existing Code Reuse** (similar features, UI components, backend patterns — found during the brief analysis), **Visual Assets** (check `analysis/visuals/` regardless of the answer; skip visual processing for non-UI tasks when none found). On an existing task, reuse the analysis clarifications (`analysis/clarifications.md`, gap-analysis scope decisions) as already-gathered evidence. Only where a genuine gap or ambiguity would change the spec's scope or architecture, ask ONE consolidated `question` round (2–4 targeted questions, confirmable-assumption framing "I assume X — is that correct?", multi-select where positions co-exist); when multiple valid architectural approaches surface, present them in the same round and record the choice in `task_context.architecture_decision`. Never write TBDs or open questions into the condensed spec — decide, or ask; anything unresolvable is recorded as an explicit assumption in the spec's scope section. Save the gathered context to `analysis/requirements.md` (condensed: description, evidence-based journey/reuse/visuals findings, any Q&A, requirements, scope boundaries, standards referenced).
78
+ 4. **Condensed spec — written directly, NO delegation**: write `implementation/spec.md` — goal, scope (in/out), requirements, applicable standards with key guidelines, verification criteria. Then run the Quick diagram gate below. This REPLACES the `specification-creator` delegation in Execute below (quick mode is the only exception to the delegation anti-pattern). Mark `spec-written` complete (`phase_summaries.specification` summary).
79
+
80
+ ### Quick diagram gate (optional — part of the condensed spec)
81
+
82
+ 1. Use `question`: "Add diagrams to the condensed spec?" Options:
83
+ - **Add diagrams** — Skill tool - `diagrams-mermaid` on `implementation/spec.md` (content-preserving, same rules as the normal Diagram Refinement).
84
+ - **Skip** — the spec stays prose-only.
85
+ 2. A declined or failed diagram refinement is NOT a failure — note it in `phase_summaries.specification` and continue.
86
+
87
+ The TDD red gate is NOT bypassed by quick mode: when `has_reproducible_defect: true` and `tdd-red-proven` is missing, the routing guard in the Entry Gate fires in both modes — the quick TDD lane for bug-shaped work is `/owflow:dev-bugfix`, not a silent skip. `spec-audited` is SKIPPED in quick mode — set `options.spec_audit_enabled: false`; Exit Gate acceptance substitutes for the audit, and `/owflow:reviews-spec-audit <task-path>` remains available as a standalone later option.
88
+
89
+ Then continue with the **Exit Gate** below.
90
+
91
+ ## Execute (normal runs — delegated specification)
92
+
93
+ **Read first**: the [Delegation Rules](../orchestrator-framework/references/delegation-rules.md).
94
+
95
+ **Scope**: normal runs only — quick mode writes the condensed spec directly (see Quick Mode) and skips this section.
96
+
97
+ ### Technical & Architecture Clarification (before `spec-written`, inline, conditional)
98
+
99
+ - Complex task with multiple approaches → `question` for 3-5 technical questions.
100
+ - Multiple valid architectural approaches → present 2-3 via `question`; the chosen approach is passed to specification-creator.
101
+ - Save to `analysis/technical-clarifications.md` (conditional).
102
+ - Skip if: simple task, `risk_level: low`, no multiple approaches detected.
103
+
104
+ ### Requirements Gathering (part of `spec-written`, inline)
105
+
106
+ 1. `question` for specification requirements — adaptive count based on description length: brief (<30 words) 6-8; standard (30-100 words) 4-6; detailed (>100 words) 2-3. Frame as confirmable assumptions ("I assume X, is that correct?").
107
+ 2. REQUIRED questions (always include): **User Journey** (discovery/access, personas, workflow fit), **Existing Code Reuse** (similar features, UI components, backend patterns), **Visual Assets** (mockups/wireframes → `analysis/visuals/`).
108
+ 3. Check `analysis/visuals/` for assets regardless of the answer; note findings for subagent context (skip visual processing for non-UI tasks when none found).
109
+ 4. Save to `analysis/requirements.md`: initial description, all Q&A rounds, similar features, visual insights, functional requirements, reusability opportunities, scope boundaries, technical considerations.
110
+
111
+ ### Specification Creation (part of `spec-written`, subagent)
112
+
113
+ **ANTI-PATTERN — never write spec.md yourself in a normal run. "The task is simple" is NOT a reason to skip delegation. (Quick mode is the ONLY exception — its prelude step 4 writes the condensed spec directly and skips this section.)**
114
+
115
+ Task tool - `specification-creator`. Pass: task_path, task_description, task_characteristics, requirements_path (`analysis/requirements.md`), project_context_paths (INDEX.md + `project_doc_paths` from state), risk_level, relevant `phase_summaries`, research/quick context if present in state. Output: `implementation/spec.md`.
116
+
117
+ ### Diagram Refinement (part of `spec-written`, Skill, content-preserving)
118
+
119
+ Skill tool - `diagrams-mermaid` on `implementation/spec.md` (the skill writes the diagrams into the file and themes them github-dark by default). Add diagrams that clarify scope and communication without replacing prose: `flowchart` (primary functional path), `sequenceDiagram` (key interaction), optional architecture view (`flowchart` with subgraphs, if module structure is in scope). Missing context → add an explicit open questions section instead of inventing entities.
120
+
121
+ ### Specification Audit (`spec-audited`, recommended)
122
+
123
+ 1. `question` — "Run specification audit? (Recommended)" with "Yes, run audit (Recommended)" first. User may skip.
124
+ 2. If yes: Task tool - `spec-auditor`. Pass: task_path, spec_path. Output: `verification/spec-audit.md`. Display verdict (pass/pass-with-concerns/fail), issue counts by severity, top critical findings.
125
+
126
+ ## State Update Convention (per step)
127
+
128
+ Apply after EVERY phase/step above:
129
+
130
+ 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:
131
+ - After Part A (if it ran): set `task_context.tech_clarified`, `task_context.architecture_decision`.
132
+ - After Parts B–D (`spec-written` complete): append `spec-written` to `completed_phases`; set `phase_summaries.specification`; bump `orchestrator.updated`.
133
+ - After Part E (only when the audit ran): append `spec-audited` to `completed_phases`; set `options.spec_audit_enabled: true` and the audit verdict in `phase_summaries.specification`; bump `orchestrator.updated`. When the user skipped the audit, set `options.spec_audit_enabled: false` — no `spec-audited` entry.
134
+ - In quick mode, ALSO append the prelude slugs on their individual completions (never batched): `codebase-analysed` and `gap-analysed` after the quick analysis (quick analysis covers both; note the condensation in `phase_summaries.codebase_analysis` / `phase_summaries.gap_analysis`), then `spec-written` after the condensed spec (summary in `phase_summaries.specification`). The audit skip sets `options.spec_audit_enabled: false` — no `spec-audited` entry.
135
+ 2. **Timestamp** — set `orchestrator.updated` to the current UTC timestamp on every write.
136
+ 3. **Failures** — if the spec creation or audit fails and cannot be recovered, do NOT append to `completed_phases`; append the corresponding step slug (`spec-written` or `spec-audited`) to `orchestrator.failed_phases` and increment `auto_fix_attempts["<slug>"]`.
137
+ 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-development.yml`. Fix any reported issue immediately before proceeding.
138
+ 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.
139
+
140
+ ## Exit Gate
141
+
142
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
143
+
144
+ ### Results box
145
+
146
+ ```markdown
147
+ ## ✅ DEV SPEC COMPLETE — <spec title>
148
+
149
+ **Approach** — [architecture approach in 1 line]
150
+ **Scope** — [N included / M excluded]
151
+ **Audit** — [✅ pass / ⚠ pass-with-concerns / ❌ fail / skipped]: [0 critical / N major / N minor]
152
+ **Entry point** — [quick bootstrap (`--quick`) / full pipeline]
153
+
154
+ **Artifacts**
155
+
156
+ - `analysis/requirements.md`
157
+ - `implementation/spec.md`
158
+ - `verification/spec-audit.md` [conditional]
159
+ ```
160
+
161
+ In quick mode the audit line reads `skipped (quick mode)` and `/owflow:reviews-spec-audit <task-path>` is the standalone later option.
162
+
163
+ ### Results-acceptance question
164
+
165
+ Use `question` — "Are these results correct?" with options:
166
+
167
+ - **Accept** — the specification is good; continue.
168
+ - **Adjust** — regenerate the spec with the user's corrections (clarifications, scope boundaries, requirements), update state, re-present the results box.
169
+ - **Discuss** — walk through a specific part of the spec (scope boundaries, architecture approach, audit findings) in more depth; then re-ask.
170
+ - **Stop here** — print the resume command (`/owflow:dev-spec <task-path>`) and end.
171
+
172
+ ### Next steps (after Accept)
173
+
174
+ - `→ /owflow:dev-plan <task-path>` — `required` next: breaks the approved spec into grouped, dependency-ordered task groups with test-driven steps. Remaining after: implement → verify → finalize.
175
+ - `/owflow:dev-plan --quick <task-path>` — `optional` condensed alternative: writes the implementation plan directly on the fly instead of delegating to the planner subagent.
176
+
177
+ **Other options**:
178
+
179
+ - `/owflow:reviews-spec-audit <task-path>` — `optional` — standalone spec re-audit; does not advance phases (verify results, then re-run `/owflow:dev-spec` adjustments if needed)
180
+ - `/owflow:goal-development <task-path>` — `optional` shortcut: runs all remaining phases in one loop (plan → implement → verify → finalize)
181
+
182
+ Then STOP.
@@ -1,94 +1,94 @@
1
- ---
2
- name: owflow:dev-tdd-red
3
- description: Development — TDD Red Gate. Write a failing test that reproduces the defect before any implementation work.
4
- argument-hint: "[task-path-or-identifier]"
5
- user-invocable: true
6
- ---
7
-
8
- # Dev TDD Red — TDD Red Gate (tdd-red-proven)
9
-
10
- Work phase of the development workflow. Writes a failing test proving the defect exists, before any implementation. Only runs when the gap analysis detected a reproducible defect.
11
-
12
- ## Entry Gate
13
-
14
- Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
15
-
16
- - **Path** (absolute or project-relative) to the task directory — use as-is.
17
- - **Identifier** — exact directory name inside `.owflow/tasks/development/` (e.g., `2026-01-12-my-task`); resolve to its path.
18
- - 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):
19
- 1. Steps that must be completed first (in order), each with its command:
20
- - Codebase & gap analysis (`codebase-analysed`, `gap-analysed`) → `/owflow:dev-analyze <task-path>`
21
- 2. List available dev-task identifiers (directories under `.owflow/tasks/development/`) to resume from, if any.
22
- 3. Hint: `Run /owflow:development <description> to start a task from scratch, or pass a task path/identifier to resume.`
23
-
24
- ### Prerequisites
25
-
26
- | Required for this skill | Where verified | Produced by |
27
- | ------------------------------ | ------------------------------------------------------------------------------------------------------ | -------------------------------- |
28
- | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` |
29
- | Analysis done | `gap-analysed` in `completed_phases` | `/owflow:dev-analyze <task-path>`|
30
- | Defect is reproducible | `task_context.task_characteristics.has_reproducible_defect: true` | `/owflow:dev-analyze <task-path>`|
31
-
32
- 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 `tdd-red-proven`): `question` — create a fresh standard development task starting at this step, or decline → print `No development task found at <path>. Run /owflow:development <description> to start a task from scratch.` and STOP.
33
- 2. **Skip/resume**: if `tdd-red-proven` is in `completed_phases`, report the existing `implementation/tdd-red-gate.md` results and route to the Exit Gate.
34
- 3. **Conditional activation**: read `task_context.task_characteristics.has_reproducible_defect`. If `false` → print `No reproducible defect detected — TDD red gate not required.` and suggest `→ /owflow:dev-spec <task-path>` (required next phase: turns analysis into a user-approved specification; remaining plan plan → implement → verify → finalize), then STOP.
35
- 4. **Prerequisite check**: `gap-analysed` must be in `completed_phases`. If not → print the blocked block, then STOP:
36
- - Steps that must be completed first: codebase & gap analysis (`codebase-analysed`, `gap-analysed`).
37
- - Run `/owflow:dev-analyze <task-path> first.`
38
- - If no task exists yet: `Run /owflow:development <description> to start a task from scratch.`
39
-
40
- ## Execute
41
-
42
- Direct execution (no delegation — this is a targeted, single-test task):
43
-
44
- 1. Read `analysis/clarifications.md`, `analysis/gap-analysis.md`, and the affected files identified by the analysis to understand the defect.
45
- 2. Write ONE focused test that reproduces the defect (correct test framework for the project — check existing test setup).
46
- 3. Run the test. **It MUST fail** — a failing result proves the defect exists. If it passes unexpectedly, the defect is not reproduced: revise the test or report the mismatch via `question`.
47
-
48
- **Critical**: Do NOT fix anything. Do NOT write implementation code. The test failing is the deliverable.
49
-
50
- ## State Update Convention (per step)
51
-
52
- 1. **On success** (test fails as expected, red gate proven): immediately append `tdd-red-proven` to `completed_phases` and set `task_context.tdd_red_passed: true`; bump `orchestrator.updated`.
53
- 2. **On failure or abandoned retries** (test framework issues, imports that could not be resolved): do NOT append to `completed_phases`; append `tdd-red-proven` to `orchestrator.failed_phases` and increment `auto_fix_attempts["tdd-red-proven"]`; document the blocker in `task_context.gaps`.
54
- 3. **On user-chosen skip** (via `question` after repeated failures): record the skip with the failure reason in `task_context.gaps` and set `task_context.tdd_red_passed: false` — no `completed_phases` entry, no `failed_phases` entry (it was a deliberate decision, not a failure).
55
- 4. **Timestamp + validate** — set `orchestrator.updated` on every write; after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-development.yml`. Fix any reported issue immediately.
56
- 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
57
-
58
- Retry rule: on repeated failures (test framework issues, imports) retry up to 2 times (rewrite test, fix setup). Still failing → `question`: continue trying, or skip TDD with the failure documented in state (per rule 3).
59
-
60
- ## Exit Gate
61
-
62
- Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
63
-
64
- ### Results box
65
-
66
- ```markdown
67
- ## ✅ TDD RED GATE COMPLETE — <task name>
68
-
69
- **Test** — <test name> (`<test file path>`)
70
- **Result** — ❌ FAILED as expected — defect reproduced
71
- **Failure** — <1-line key failure output proving the defect>
72
-
73
- **Artifacts**
74
- - `implementation/tdd-red-gate.md`
75
- ```
76
-
77
- ### Results-acceptance question
78
-
79
- Use `question` — "Are these results correct?" with options:
80
-
81
- - **Accept** — the failing test faithfully reproduces the defect; continue.
82
- - **Adjust** — revise the test (different conditions, better assertion), re-run, re-present the results box.
83
- - **Discuss** — walk through the reproduction reasoning (defect path, why the test fails) in more depth; then re-ask.
84
- - **Stop here** — print the resume command (`/owflow:dev-tdd-red <task-path>`) and end.
85
-
86
- ### Next steps (after Accept)
87
-
88
- - `→ /owflow:dev-spec <task-path>` — `required` next: turns analysis plus this red test into a user-approved specification (the test becomes the acceptance criterion for the fix). Remaining after: plan → implement → verify → finalize.
89
-
90
- **Other options**:
91
-
92
- - `/owflow:goal-development <task-path>` — `optional` shortcut: runs all remaining phases in one loop (spec → plan → implement → verify → finalize)
93
-
94
- Then STOP.
1
+ ---
2
+ name: owflow:dev-tdd-red
3
+ description: Development — TDD Red Gate. Write a failing test that reproduces the defect before any implementation work.
4
+ argument-hint: "[task-path-or-identifier]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ # Dev TDD Red — TDD Red Gate (tdd-red-proven)
9
+
10
+ Work phase of the development workflow. Writes a failing test proving the defect exists, before any implementation. Only runs when the gap analysis detected a reproducible defect.
11
+
12
+ ## Entry Gate
13
+
14
+ Resolve the `task-path-or-identifier` argument BEFORE anything else (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)):
15
+
16
+ - **Path** (absolute or project-relative) to the task directory — use as-is.
17
+ - **Identifier** — exact directory name inside `.owflow/tasks/development/` (e.g., `2026-01-12-my-task`); resolve to its path.
18
+ - 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):
19
+ 1. Steps that must be completed first (in order), each with its command:
20
+ - Codebase & gap analysis (`codebase-analysed`, `gap-analysed`) → `/owflow:dev-analyze <task-path>`
21
+ 2. List available dev-task identifiers (directories under `.owflow/tasks/development/`) to resume from, if any.
22
+ 3. Hint: `Run /owflow:development <description> to start a task from scratch, or pass a task path/identifier to resume.`
23
+
24
+ ### Prerequisites
25
+
26
+ | Required for this skill | Where verified | Produced by |
27
+ | ------------------------------ | ------------------------------------------------------------------------------------------------------ | -------------------------------- |
28
+ | State file exists | `<task-path>/orchestrator-state.yml` | `/owflow:development <desc>` |
29
+ | Analysis done | `gap-analysed` in `completed_phases` | `/owflow:dev-analyze <task-path>`|
30
+ | Defect is reproducible | `task_context.task_characteristics.has_reproducible_defect: true` | `/owflow:dev-analyze <task-path>`|
31
+
32
+ 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 `tdd-red-proven`): `question` — create a fresh standard development task starting at this step, or decline → print `No development task found at <path>. Run /owflow:development <description> to start a task from scratch.` and STOP.
33
+ 2. **Skip/resume**: if `tdd-red-proven` is in `completed_phases`, report the existing `implementation/tdd-red-gate.md` results and route to the Exit Gate.
34
+ 3. **Conditional activation**: read `task_context.task_characteristics.has_reproducible_defect`. If `false` → print `No reproducible defect detected — TDD red gate not required.` and suggest `→ /owflow:dev-spec <task-path>` (required next phase: turns analysis into a user-approved specification; remaining plan plan → implement → verify → finalize), then STOP.
35
+ 4. **Prerequisite check**: `gap-analysed` must be in `completed_phases`. If not → print the blocked block, then STOP:
36
+ - Steps that must be completed first: codebase & gap analysis (`codebase-analysed`, `gap-analysed`).
37
+ - Run `/owflow:dev-analyze <task-path> first.`
38
+ - If no task exists yet: `Run /owflow:development <description> to start a task from scratch.`
39
+
40
+ ## Execute
41
+
42
+ Direct execution (no delegation — this is a targeted, single-test task):
43
+
44
+ 1. Read `analysis/clarifications.md`, `analysis/gap-analysis.md`, and the affected files identified by the analysis to understand the defect.
45
+ 2. Write ONE focused test that reproduces the defect (correct test framework for the project — check existing test setup).
46
+ 3. Run the test. **It MUST fail** — a failing result proves the defect exists. If it passes unexpectedly, the defect is not reproduced: revise the test or report the mismatch via `question`.
47
+
48
+ **Critical**: Do NOT fix anything. Do NOT write implementation code. The test failing is the deliverable.
49
+
50
+ ## State Update Convention (per step)
51
+
52
+ 1. **On success** (test fails as expected, red gate proven): immediately append `tdd-red-proven` to `completed_phases` and set `task_context.tdd_red_passed: true`; bump `orchestrator.updated`.
53
+ 2. **On failure or abandoned retries** (test framework issues, imports that could not be resolved): do NOT append to `completed_phases`; append `tdd-red-proven` to `orchestrator.failed_phases` and increment `auto_fix_attempts["tdd-red-proven"]`; document the blocker in `task_context.gaps`.
54
+ 3. **On user-chosen skip** (via `question` after repeated failures): record the skip with the failure reason in `task_context.gaps` and set `task_context.tdd_red_passed: false` — no `completed_phases` entry, no `failed_phases` entry (it was a deliberate decision, not a failure).
55
+ 4. **Timestamp + validate** — set `orchestrator.updated` on every write; after every write, re-read the file to confirm values, then run the `verify_template` tool with `filePath: <task-path>/orchestrator-state.yml`, `templateName: orchestrator-state-development.yml`. Fix any reported issue immediately.
56
+ 5. **Final check** — before the Exit Gate, one consolidated re-read + `verify_template` run.
57
+
58
+ Retry rule: on repeated failures (test framework issues, imports) retry up to 2 times (rewrite test, fix setup). Still failing → `question`: continue trying, or skip TDD with the failure documented in state (per rule 3).
59
+
60
+ ## Exit Gate
61
+
62
+ Present results, get user confirmation, then hand off (see [Gate Contract](../orchestrator-framework/references/gate-contract.md)). Never auto-invoke the next skill.
63
+
64
+ ### Results box
65
+
66
+ ```markdown
67
+ ## ✅ TDD RED GATE COMPLETE — <task name>
68
+
69
+ **Test** — <test name> (`<test file path>`)
70
+ **Result** — ❌ FAILED as expected — defect reproduced
71
+ **Failure** — <1-line key failure output proving the defect>
72
+
73
+ **Artifacts**
74
+ - `implementation/tdd-red-gate.md`
75
+ ```
76
+
77
+ ### Results-acceptance question
78
+
79
+ Use `question` — "Are these results correct?" with options:
80
+
81
+ - **Accept** — the failing test faithfully reproduces the defect; continue.
82
+ - **Adjust** — revise the test (different conditions, better assertion), re-run, re-present the results box.
83
+ - **Discuss** — walk through the reproduction reasoning (defect path, why the test fails) in more depth; then re-ask.
84
+ - **Stop here** — print the resume command (`/owflow:dev-tdd-red <task-path>`) and end.
85
+
86
+ ### Next steps (after Accept)
87
+
88
+ - `→ /owflow:dev-spec <task-path>` — `required` next: turns analysis plus this red test into a user-approved specification (the test becomes the acceptance criterion for the fix). Remaining after: plan → implement → verify → finalize.
89
+
90
+ **Other options**:
91
+
92
+ - `/owflow:goal-development <task-path>` — `optional` shortcut: runs all remaining phases in one loop (spec → plan → implement → verify → finalize)
93
+
94
+ Then STOP.