owflow 0.1.1 → 0.1.2

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 (103) hide show
  1. package/README.md +8 -1
  2. package/dist/agents/bottleneck-analyzer.md +329 -0
  3. package/dist/agents/code-quality-pragmatist.md +354 -0
  4. package/dist/agents/code-reviewer.md +239 -0
  5. package/dist/agents/codebase-analysis-reporter.md +246 -0
  6. package/dist/agents/docs-operator.md +23 -0
  7. package/dist/agents/e2e-test-verifier.md +448 -0
  8. package/dist/agents/gap-analyzer.md +502 -0
  9. package/dist/agents/implementation-completeness-checker.md +220 -0
  10. package/dist/agents/implementation-planner.md +309 -0
  11. package/dist/agents/information-gatherer.md +691 -0
  12. package/dist/agents/production-readiness-checker.md +279 -0
  13. package/dist/agents/project-analyzer.md +404 -0
  14. package/dist/agents/reality-assessor.md +366 -0
  15. package/dist/agents/research-planner.md +447 -0
  16. package/dist/agents/research-synthesizer.md +401 -0
  17. package/dist/agents/solution-brainstormer.md +257 -0
  18. package/dist/agents/solution-designer.md +372 -0
  19. package/dist/agents/spec-auditor.md +298 -0
  20. package/dist/agents/specification-creator.md +334 -0
  21. package/dist/agents/task-classifier.md +462 -0
  22. package/dist/agents/task-group-implementer.md +284 -0
  23. package/dist/agents/test-suite-runner.md +195 -0
  24. package/dist/agents/ui-mockup-generator.md +369 -0
  25. package/dist/agents/user-docs-generator.md +509 -0
  26. package/dist/commands/development.md +37 -0
  27. package/dist/commands/flow-init.md +37 -0
  28. package/dist/commands/migration.md +37 -0
  29. package/dist/commands/performance.md +37 -0
  30. package/dist/commands/product-design.md +37 -0
  31. package/dist/commands/quick-bugfix.md +37 -0
  32. package/dist/commands/quick-dev.md +140 -0
  33. package/dist/commands/quick-plan.md +132 -0
  34. package/dist/commands/research.md +37 -0
  35. package/dist/commands/reviews-code.md +90 -0
  36. package/dist/commands/reviews-pragmatic.md +99 -0
  37. package/dist/commands/reviews-production-readiness.md +113 -0
  38. package/dist/commands/reviews-reality-check.md +110 -0
  39. package/dist/commands/reviews-spec-audit.md +114 -0
  40. package/dist/commands/standards-discover.md +37 -0
  41. package/dist/commands/standards-update.md +37 -0
  42. package/dist/commands/work.md +284 -0
  43. package/dist/skills/codebase-analyzer/SKILL.md +162 -0
  44. package/dist/skills/codebase-analyzer/references/code-analysis.md +63 -0
  45. package/dist/skills/codebase-analyzer/references/combined.md +31 -0
  46. package/dist/skills/codebase-analyzer/references/context-discovery.md +63 -0
  47. package/dist/skills/codebase-analyzer/references/file-discovery.md +51 -0
  48. package/dist/skills/codebase-analyzer/references/migration-target.md +23 -0
  49. package/dist/skills/codebase-analyzer/references/pattern-mining.md +22 -0
  50. package/dist/skills/development/SKILL.md +669 -0
  51. package/dist/skills/docs-manager/SKILL.md +379 -0
  52. package/dist/skills/docs-manager/docs/INDEX.md +199 -0
  53. package/dist/skills/docs-manager/docs/standards/backend/api.md +25 -0
  54. package/dist/skills/docs-manager/docs/standards/backend/migrations.md +22 -0
  55. package/dist/skills/docs-manager/docs/standards/backend/models.md +25 -0
  56. package/dist/skills/docs-manager/docs/standards/backend/queries.md +22 -0
  57. package/dist/skills/docs-manager/docs/standards/frontend/accessibility.md +25 -0
  58. package/dist/skills/docs-manager/docs/standards/frontend/components.md +28 -0
  59. package/dist/skills/docs-manager/docs/standards/frontend/css.md +16 -0
  60. package/dist/skills/docs-manager/docs/standards/frontend/responsive.md +28 -0
  61. package/dist/skills/docs-manager/docs/standards/global/coding-style.md +25 -0
  62. package/dist/skills/docs-manager/docs/standards/global/commenting.md +10 -0
  63. package/dist/skills/docs-manager/docs/standards/global/conventions.md +31 -0
  64. package/dist/skills/docs-manager/docs/standards/global/error-handling.md +22 -0
  65. package/dist/skills/docs-manager/docs/standards/global/minimal-implementation.md +22 -0
  66. package/dist/skills/docs-manager/docs/standards/global/validation.md +28 -0
  67. package/dist/skills/docs-manager/docs/standards/testing/test-writing.md +25 -0
  68. package/dist/skills/docs-manager/references/claude-md-template.md +29 -0
  69. package/dist/skills/docs-manager/references/index-md-template.md +73 -0
  70. package/dist/skills/flow-init/SKILL.md +198 -0
  71. package/dist/skills/flow-init/references/architecture-template.md +45 -0
  72. package/dist/skills/flow-init/references/roadmap-templates.md +93 -0
  73. package/dist/skills/flow-init/references/tech-stack-template.md +70 -0
  74. package/dist/skills/flow-init/references/vision-templates.md +75 -0
  75. package/dist/skills/implementation-plan-executor/SKILL.md +378 -0
  76. package/dist/skills/implementation-verifier/SKILL.md +307 -0
  77. package/dist/skills/migration/SKILL.md +380 -0
  78. package/dist/skills/migration/references/migration-strategies.md +397 -0
  79. package/dist/skills/migration/references/migration-types.md +437 -0
  80. package/dist/skills/orchestrator-framework/SKILL.md +65 -0
  81. package/dist/skills/orchestrator-framework/references/orchestrator-creation-checklist.md +47 -0
  82. package/dist/skills/orchestrator-framework/references/orchestrator-patterns.md +329 -0
  83. package/dist/skills/performance/SKILL.md +418 -0
  84. package/dist/skills/performance/references/performance-optimization-guide.md +365 -0
  85. package/dist/skills/product-design/SKILL.md +843 -0
  86. package/dist/skills/product-design/references/characteristic-detection.md +92 -0
  87. package/dist/skills/product-design/references/interaction-patterns.md +206 -0
  88. package/dist/skills/product-design/references/visual-companion.md +190 -0
  89. package/dist/skills/product-design/server/index.ts +359 -0
  90. package/dist/skills/product-design/server/template.html +256 -0
  91. package/dist/skills/quick-bugfix/SKILL.md +241 -0
  92. package/dist/skills/research/SKILL.md +493 -0
  93. package/dist/skills/research/references/brainstorming-techniques.md +84 -0
  94. package/dist/skills/research/references/design-techniques.md +40 -0
  95. package/dist/skills/research/references/research-methodologies.md +710 -0
  96. package/dist/skills/standards-discover/SKILL.md +236 -0
  97. package/dist/skills/standards-discover/references/aggregation-strategy.md +76 -0
  98. package/dist/skills/standards-discover/references/code-pattern-prompt.md +68 -0
  99. package/dist/skills/standards-discover/references/config-analyzer-prompt.md +67 -0
  100. package/dist/skills/standards-discover/references/docs-extractor-prompt.md +65 -0
  101. package/dist/skills/standards-discover/references/external-analyzer-prompt.md +75 -0
  102. package/dist/skills/standards-update/SKILL.md +159 -0
  103. package/package.json +7 -6
@@ -0,0 +1,669 @@
1
+ ---
2
+ name: development
3
+ description: Unified orchestrator for all development tasks. ALWAYS execute when invoked — never skip for 'straightforward' tasks. Phases adapt based on detected task characteristics rather than predetermined types. Use for any development work that modifies code.
4
+ user-invocable: true
5
+ ---
6
+
7
+ # Development Orchestrator
8
+
9
+ Unified workflow for all development tasks — bug fixes, enhancements, and new features. Phases activate based on context and analysis findings, not predetermined task types.
10
+
11
+ ## Initialization
12
+
13
+ **BEFORE executing any phase, you MUST complete these steps:**
14
+
15
+ ### Step 1: Load Framework Patterns
16
+
17
+ **Read the framework reference file NOW using the Read tool:**
18
+
19
+ 1. `../orchestrator-framework/references/orchestrator-patterns.md` - Delegation rules, interactive mode, state schema, initialization, context passing, issue resolution
20
+
21
+ ### Step 2: Detect Research Context
22
+
23
+ **If argument is a research folder path** (matches `.owflow/tasks/research/*`):
24
+
25
+ - Auto-detect research folder, extract task description from `research_context.research_question`
26
+ - Read research artifacts (see Research-Based Development section below)
27
+ - Set `research_reference` in state automatically
28
+
29
+ **If `--research=<path>` flag provided**:
30
+
31
+ - Read research artifacts from specified path
32
+ - Copy to `analysis/research-context/`
33
+ - Set `research_reference` in state
34
+
35
+ ### Step 3: Initialize Workflow
36
+
37
+ 1. **Create Task Items**: Use `TaskCreate` for all phases (see Phase Configuration), then set dependencies with `TaskUpdate addBlockedBy`
38
+ 2. **Create Task Directory**: `.owflow/tasks/development/YYYY-MM-DD-task-name/`
39
+ 3. **Initialize State**: Create `orchestrator-state.yml` with task info and research reference
40
+ 4. **Discover project documentation**: Read `.owflow/docs/INDEX.md` (if exists), extract ALL file paths from the "Project Documentation" section. This includes predefined docs (vision, roadmap, tech-stack, architecture) AND any user-added project docs (e.g., deployment.md, api-strategy.md). Store complete list as `project_context.project_doc_paths` in state.
41
+
42
+ **Output**:
43
+
44
+ ```
45
+ 🚀 Development Orchestrator Started
46
+
47
+ Task: [description]
48
+ Directory: [task-path]
49
+
50
+ Starting Phase 1: Codebase Analysis...
51
+ ```
52
+
53
+ ---
54
+
55
+ ## When to Use
56
+
57
+ Use for **all development tasks**: bug fixes, enhancements, new features, and any work that modifies code.
58
+
59
+ **DO NOT use for**: Performance optimization, security remediation, migrations, documentation-only, pure refactoring (use specialized orchestrators).
60
+
61
+ ---
62
+
63
+ ## Phase Configuration
64
+
65
+ | Phase | content | activeForm | Activation |
66
+ | ----- | -------------------------------------------- | ------------------------------------------------- | ------------------------------ |
67
+ | 1 | "Analyze codebase & clarify requirements" | "Analyzing codebase & clarifying" | Always |
68
+ | 2 | "Analyze gaps & clarify scope" | "Analyzing gaps & clarifying scope" | Always |
69
+ | 3 | "Write failing test (TDD Red)" | "Writing failing test" | When `has_reproducible_defect` |
70
+ | 4 | "Generate UI mockups" | "Generating UI mockups" | When `ui_heavy` |
71
+ | 5 | "Gather requirements & create specification" | "Gathering requirements & creating specification" | Always |
72
+ | 6 | "Audit specification" | "Auditing specification" | Always (conditional) |
73
+ | 7 | "Plan implementation" | "Planning implementation" | Always |
74
+ | 8 | "Execute implementation" | "Executing implementation" | Always |
75
+ | 9 | "Verify test passes (TDD Green)" | "Verifying test passes" | When Phase 3 was executed |
76
+ | 10 | "Prompt verification options" | "Prompting verification options" | Always |
77
+ | 11 | "Verify implementation & resolve issues" | "Verifying implementation" | Always |
78
+ | 12 | "Run E2E tests" | "Running E2E tests" | When `e2e_enabled` |
79
+ | 13 | "Generate user documentation" | "Generating user documentation" | When `user_docs_enabled` |
80
+ | 14 | "Finalize workflow" | "Finalizing workflow" | Always |
81
+
82
+ ---
83
+
84
+ ## Workflow Phases
85
+
86
+ ### Phase 1: Codebase Analysis & Clarifications
87
+
88
+ **Purpose**: Comprehensive codebase exploration followed by scope/requirements clarification
89
+ **Execute**:
90
+
91
+ 1. Skill tool - `codebase-analyzer`
92
+ 2. Update state with analysis results
93
+ 3. Direct - use question for max 5 critical clarifying questions
94
+ 4. Save clarifications to `analysis/clarifications.md`
95
+ **Output**: `analysis/codebase-analysis.md`, `analysis/clarifications.md`
96
+ **State**: Update `task_context.risk_level`, `phase_summaries.codebase_analysis`, `task_context.clarifications_resolved`
97
+
98
+ → **AUTO-CONTINUE** — Do NOT end turn, do NOT prompt user. Proceed immediately to Phase 2.
99
+
100
+ ---
101
+
102
+ ### Phase 2: Gap Analysis & Scope Clarification
103
+
104
+ **Purpose**: Compare current vs desired state, detect task characteristics, then resolve scope/approach decisions
105
+ **Execute**:
106
+
107
+ 1. Task tool - `gap-analyzer` subagent
108
+ 2. **Extract and store structured data from gap-analyzer result**:
109
+ a. Read `task_characteristics` from gap-analyzer output — 5 fields: `has_reproducible_defect`, `modifies_existing_code`, `creates_new_entities`, `involves_data_operations`, `ui_heavy`
110
+ b. Write all 5 fields to `orchestrator-state.yml` at `task_context.task_characteristics`
111
+ c. Read `risk_level` from output and write to `task_context.risk_level`
112
+ d. Extract phase summary (1-2 sentences) and write to `phase_summaries.gap_analysis`
113
+ e. **SELF-CHECK**: "Did I read the 5 task_characteristics from the gap-analyzer output and write them to state? Let me re-read `orchestrator-state.yml` to verify the values match the gap-analyzer output."
114
+
115
+ **⛔ DECISION GATE** (mandatory — do NOT skip):
116
+
117
+ - Parse `decisions_needed` from gap-analyzer output
118
+ - If `decisions_needed.critical` OR `decisions_needed.important` is non-empty:
119
+ - MUST use `question` — one question per critical decision, batch important decisions into a single multi-select question
120
+ - If both are empty: Note "No scope decisions needed" in state
121
+
122
+ **SELF-CHECK** before continuing: "Did the gap-analyzer return `decisions_needed` items? If yes, did I invoke `question`? If I skipped this, STOP and go back."
123
+
124
+ 3. Save scope clarifications to `analysis/scope-clarifications.md`
125
+ 4. **Set optional phase defaults** based on detected characteristics:
126
+ - If `task_characteristics.ui_heavy: true` → set `options.e2e_enabled: true`, `options.user_docs_enabled: true`
127
+ - If `task_characteristics.creates_new_entities: true` → set `options.user_docs_enabled: true`
128
+ - Command flags (`--e2e`, `--no-e2e`, `--user-docs`, `--no-user-docs`) override these defaults
129
+
130
+ **Output**: `analysis/gap-analysis.md`, `analysis/scope-clarifications.md` (conditional)
131
+ **State**: Update `task_context.task_characteristics`, `task_context.scope_expanded`, `options.e2e_enabled`, `options.user_docs_enabled`, `phase_summaries.gap_analysis`
132
+
133
+ **Context to pass**: Risk level, codebase summary, key files, clarifications, project_doc_paths (from state)
134
+
135
+ → Pause (when decisions exist), otherwise Conditional
136
+
137
+ **ANTI-PATTERN — DO NOT DO THIS:**
138
+
139
+ - ❌ "The UI change is small/simple, skipping Phase 4..." — STOP. If `ui_heavy` is true, Phase 4 runs. The gap-analyzer made this assessment, not you.
140
+ - ❌ "No new screens needed, just a component..." — STOP. `ui_heavy` is a signal from the gap-analyzer. Do NOT override it with your own complexity judgment.
141
+
142
+ question - Display executive summary before asking. Read `analysis/gap-analysis.md` and extract: task type detected, risk level, key characteristics enabled (TDD gates, UI mockups, E2E, user docs), scope decisions made (if any). Then read `task_context.task_characteristics` from `orchestrator-state.yml` and determine the next phase:
143
+
144
+ - If `has_reproducible_defect` is true → ask "Continue to Phase 3: TDD Red Gate?"
145
+ - If `ui_heavy` is true → ask "Continue to Phase 4: UI Mockup Generation?"
146
+ - Otherwise → ask "Continue to Phase 5: Technical Approach, Requirements & Specification?"
147
+
148
+ ---
149
+
150
+ ### Phase 3: TDD Red Gate (Conditional)
151
+
152
+ > **Phase gate**: Requires `question` confirmation from Phase 2 before executing.
153
+
154
+ **Purpose**: Write a failing test that reproduces the defect
155
+ **Execute**: Direct - write test, verify it FAILS
156
+ **Output**: `implementation/tdd-red-gate.md`, failing test file
157
+ **State**: Update `tdd_red_passed: true`
158
+
159
+ **Skip if**: `task_characteristics.has_reproducible_defect` is false (not set by gap-analyzer)
160
+
161
+ **Critical**: Test MUST fail before implementation (proves defect exists)
162
+
163
+ → Pause
164
+
165
+ question - "TDD red gate complete. Continue to Phase 4?"
166
+
167
+ ---
168
+
169
+ ### Phase 4: UI Mockup Generation (Conditional)
170
+
171
+ > **Phase gate**: Requires `question` confirmation from the preceding phase before executing.
172
+
173
+ **Purpose**: Generate ASCII mockups showing UI integration
174
+ **Execute**: Task tool - `ui-mockup-generator` subagent
175
+ **Output**: `analysis/ui-mockups.md`
176
+ **State**: Update `phase_summaries.ui_mockups`
177
+
178
+ **Skip if**: `task_characteristics.ui_heavy` is false
179
+
180
+ **Context to pass**: Gap analysis, scope decisions, component choices
181
+
182
+ → Pause
183
+
184
+ question - "UI mockups complete. Continue to Phase 5?"
185
+
186
+ ---
187
+
188
+ ### Phase 5: Technical Approach, Requirements & Specification
189
+
190
+ > **Phase gate**: Requires `question` confirmation from the preceding phase before executing.
191
+
192
+ **⛔ ROUTING GUARD**: Read `task_context.task_characteristics` from `orchestrator-state.yml`. If `has_reproducible_defect` is true and Phase 3 is NOT in `completed_phases` → STOP, execute Phase 3 first. If `ui_heavy` is true and Phase 4 is NOT in `completed_phases` → STOP, execute Phase 4 first.
193
+
194
+ **Purpose**: Resolve technical decisions, gather specification requirements, then create comprehensive specification
195
+ **Execute**:
196
+
197
+ **Part A — Technical & Architecture Clarification (inline, conditional)**:
198
+
199
+ 1. If complex task with multiple approaches: Direct - use question for 3-5 technical questions
200
+ 2. If multiple valid architectural approaches exist: Present 2-3 approaches via question. The chosen approach is passed to specification-creator so the spec is written with the decided architecture.
201
+ 3. Save to `analysis/technical-clarifications.md` (conditional)
202
+
203
+ **Skip technical clarification if**: Simple task, risk_level = low, no multiple approaches detected
204
+
205
+ **Part B — Requirements Gathering (inline)**: 3. Direct - use question for specification requirements:
206
+
207
+ - Adaptive question count based on description length:
208
+ - Brief (<30 words): 6-8 questions
209
+ - Standard (30-100 words): 4-6 questions
210
+ - Detailed (>100 words): 2-3 focused questions
211
+ - Frame as confirmable assumptions: "I assume X, is that correct?"
212
+ - REQUIRED questions (always include):
213
+ 1. **User Journey**: How will users discover/access this? Which personas? How fits existing workflows?
214
+ 2. **Existing Code Reuse**: Similar features, UI components, backend patterns to reference?
215
+ 3. **Visual Assets**: Any mockups, wireframes, screenshots? Place in `analysis/visuals/`
216
+
217
+ 4. Check for visual assets in `analysis/visuals/` (even if user says none)
218
+ - If found: note for subagent context
219
+ - If not found and non-UI task: skip visual asset processing
220
+ 5. Save gathered requirements to `analysis/requirements.md` with: initial description, Q&A from all rounds, similar features identified, visual assets and insights, functional requirements summary, reusability opportunities, scope boundaries, technical considerations
221
+
222
+ **Part C — Specification Creation (subagent)**:
223
+
224
+ **ANTI-PATTERN — DO NOT DO THIS:**
225
+
226
+ - ❌ "Let me create the specification..." — STOP. Delegate to specification-creator.
227
+ - ❌ "I'll write the spec based on requirements..." — STOP. Delegate to specification-creator.
228
+ - ❌ "The task is simple enough to spec inline..." — STOP. Simplicity is NOT a reason to skip delegation.
229
+
230
+ **INVOKE NOW** — Task tool call:
231
+
232
+ 6. Task tool - `specification-creator` subagent
233
+
234
+ **Context to pass to subagent**: task_path, task_description, task_characteristics, requirements_path (analysis/requirements.md), project_context_paths (INDEX.md + project_doc_paths from state — all discovered project docs), risk_level, phase_summaries (codebase_analysis, gap_analysis, clarifications, scope_clarifications, ui_mockups), research_context (if any)
235
+
236
+ **SELF-CHECK**: Did you just invoke the Task tool with `specification-creator`? Or did you start writing spec.md yourself? If the latter, STOP immediately and invoke the Task tool instead.
237
+
238
+ **Output**: `analysis/technical-clarifications.md` (conditional), `analysis/requirements.md`, `implementation/spec.md`
239
+ **State**: Update `task_context.tech_clarified`, `task_context.architecture_decision`, `phase_summaries.specification`
240
+
241
+ → Pause
242
+
243
+ question - Display executive summary before asking. Read `implementation/spec.md` and extract: spec title, scope boundaries (what's included and excluded), number of key requirements, architecture approach chosen (if any), assumptions made. Format as brief overview then "Continue to specification audit?"
244
+
245
+ ---
246
+
247
+ ### Phase 6: Specification Audit (Recommended)
248
+
249
+ > **Phase gate**: Requires `question` confirmation from Phase 5 before executing.
250
+
251
+ **Purpose**: Independent review of specification before implementation
252
+ **Execute**: Task tool - `spec-auditor` subagent
253
+ **Output**: `verification/spec-audit.md`
254
+ **State**: Update `options.spec_audit_enabled`
255
+
256
+ **Recommended**: Always. Present spec audit as the recommended default. User can skip if they choose.
257
+
258
+ question - "Run specification audit? (Recommended)" with "Yes, run audit (Recommended)" as first option
259
+
260
+ → Pause
261
+
262
+ question - Display executive summary before asking. Read `verification/spec-audit.md` and extract: overall verdict (pass/pass-with-concerns/fail), issue counts by severity, top 1-2 critical findings if any. Format as brief overview then "Continue to implementation planning?"
263
+
264
+ ---
265
+
266
+ ### Phase 7: Implementation Planning
267
+
268
+ > **Phase gate**: Requires `question` confirmation from Phase 6 before executing.
269
+
270
+ **Purpose**: Break specification into implementation steps
271
+
272
+ **ANTI-PATTERN — DO NOT DO THIS:**
273
+
274
+ - ❌ "Let me create the implementation plan..." — STOP. Delegate to implementation-planner.
275
+ - ❌ "I'll break this into steps..." — STOP. Delegate to implementation-planner.
276
+ - ❌ "This is simple enough to plan inline..." — STOP. Simplicity is NOT a reason to skip delegation.
277
+
278
+ **INVOKE NOW** — Task tool call:
279
+
280
+ **Execute**: Task tool - `implementation-planner` subagent
281
+ **Output**: `implementation/implementation-plan.md`
282
+ **State**: Update task groups and dependencies
283
+
284
+ **Context to pass to subagent**: task_path, task_description, task_characteristics, phase_summaries (specification, gap_analysis, codebase_analysis), research_context (if any)
285
+
286
+ **SELF-CHECK**: Did you just invoke the Task tool with `implementation-planner`? Or did you start writing implementation-plan.md yourself? If the latter, STOP immediately and invoke the Task tool instead.
287
+
288
+ → Pause
289
+
290
+ question - Display executive summary before asking. Read `implementation/implementation-plan.md` and extract: number of task groups, total implementation steps, key dependencies between groups, estimated complexity. Format as brief overview then "Continue to implementation?"
291
+
292
+ ---
293
+
294
+ ### Phase 8: Implementation
295
+
296
+ > **Phase gate**: Requires `question` confirmation from Phase 7 before executing.
297
+
298
+ **Purpose**: Execute the implementation plan
299
+
300
+ **ANTI-PATTERN — DO NOT DO THIS:**
301
+
302
+ - ❌ "Let me implement this directly..." — STOP. Delegate to implementation-plan-executor.
303
+ - ❌ "This is simple enough to code inline..." — STOP. Simplicity is NOT a reason to skip delegation.
304
+
305
+ **INVOKE NOW** — Skill tool call:
306
+
307
+ **Execute**: Skill tool - `implementation-plan-executor`
308
+ **Output**: Implemented code, `implementation/work-log.md`
309
+ **State**: Update implementation progress, extract phase_summaries.implementation
310
+
311
+ **SELF-CHECK**: Did you just invoke the Skill tool with `implementation-plan-executor`? Or did you start writing code yourself? If the latter, STOP immediately and invoke the Skill tool instead.
312
+
313
+ **⚠️ POST-IMPLEMENTATION CONTINUATION** — After the skill completes and returns control:
314
+
315
+ 1. Read `orchestrator-state.yml` to confirm you are the orchestrator
316
+ 2. Update state: add Phase 8 to `completed_phases`
317
+ 3. Evaluate conditional: if `task_characteristics.has_reproducible_defect` AND Phase 3 in `completed_phases` → Phase 9, else → Phase 10
318
+
319
+ → Pause
320
+
321
+ question - Display executive summary before asking. Extract from `phase_summaries.implementation` and `implementation/work-log.md`: task groups completed, files changed, test results from incremental runs, any known issues or deferred items. Format as brief overview then "Continue to verification?"
322
+
323
+ ---
324
+
325
+ ### Phase 9: TDD Green Gate (Conditional)
326
+
327
+ > **Phase gate**: Requires `question` confirmation from Phase 8 before executing.
328
+
329
+ **Purpose**: Verify the failing test now passes
330
+ **Execute**: Direct - run the test written in Phase 3
331
+ **Output**: `implementation/tdd-green-gate.md`
332
+ **State**: Update `tdd_green_passed: true`
333
+
334
+ **Skip if**: Phase 3 was not executed
335
+
336
+ **Critical**: Test MUST pass (proves defect is fixed)
337
+
338
+ → Pause
339
+
340
+ question - "TDD gate passed. Continue to Phase 10?"
341
+
342
+ ---
343
+
344
+ ### Phase 10: Verification Options Prompt
345
+
346
+ > **Phase gate**: Requires `question` confirmation from the preceding phase before executing.
347
+
348
+ **Purpose**: Determine which verification checks to run using tiered decision matrix
349
+ **Execute**: Direct - display plan, confirm/adjust via question
350
+ **Output**: Updated state with all verification options
351
+ **State**: Set `options.code_review_enabled`, `options.pragmatic_review_enabled`, `options.reality_check_enabled`, `options.production_check_enabled`, `options.e2e_enabled`, `options.user_docs_enabled`
352
+ **Auto-set**: `skip_test_suite: true` (full test suite already passed during implementation phase; cleared before re-verification if fixes are applied)
353
+
354
+ **Step 1**: Display the verification plan:
355
+
356
+ ```
357
+ Verification Plan:
358
+ Obligatory (always run):
359
+ ✓ Completeness check
360
+ ✓ Test suite (skipped — passed during implementation; re-enabled after fixes)
361
+
362
+ Recommended (adjustable):
363
+ ✓ Code review — quality and security analysis
364
+ ✓ Pragmatic review — detects over-engineering
365
+ ✓ Reality check — validates work solves the problem
366
+ ✓ Production readiness — deployment readiness checks
367
+
368
+ Conditional:
369
+ [✓/—] E2E browser testing — [reason]
370
+ [✓/—] User documentation — [reason]
371
+ ```
372
+
373
+ **Step 2** (3 questions):
374
+
375
+ **Q1** (always): question (multi-select) — "Which standard verifications to run?"
376
+ Options: "Code review (Recommended)", "Pragmatic review (Recommended)", "Reality check (Recommended)", "Production readiness (Recommended)". All pre-selected.
377
+
378
+ **Q2** (SKIP if `options.e2e_enabled: false` and no `--e2e` flag): question — "Enable E2E browser verification?" Options: "Yes (Recommended)", "No, skip".
379
+
380
+ **Q3** (SKIP if `options.user_docs_enabled: false` and no `--user-docs` flag): question — "Generate user documentation?" Options: "Yes (Recommended)", "No, skip".
381
+
382
+ → Pause
383
+
384
+ ---
385
+
386
+ ### Phase 11: Verification & Issue Resolution
387
+
388
+ > **Phase gate**: Requires `question` confirmation from Phase 10 before executing.
389
+
390
+ **Purpose**: Comprehensive implementation verification with fix-then-reverify cycles
391
+ **Output**: `verification/implementation-verification.md`, optional code-review/pragmatic/reality reports, updated `implementation/work-log.md`
392
+ **State**: Update verification results, `verification_context`
393
+
394
+ **Execute**:
395
+
396
+ **Step 1**: Invoke Skill tool - `implementation-verifier`
397
+
398
+ **Step 2**: Display detailed issue breakdown grouped by category and severity:
399
+
400
+ ```
401
+ Verification Results:
402
+ Critical ([N]):
403
+ - [category]: [description] — [file:line] [fixable/manual]
404
+ ...
405
+ Warning ([N]):
406
+ - [category]: [description] — [file:line] [fixable/manual]
407
+ ...
408
+ Info ([N]):
409
+ - [description] (listed for awareness, not actionable)
410
+ ```
411
+
412
+ **Step 3**: Gate on verification status:
413
+
414
+ - `status: passed` → skip to Post-Verification Continuation
415
+ - `status: passed_with_issues` or `failed` → enter user-driven fix loop (Step 4)
416
+
417
+ **Step 4**: User-driven fix loop (max 3 iterations):
418
+
419
+ 1. Present all critical + warning issues as a numbered list
420
+ 2. question — "Which issues should I fix?" with options:
421
+ - "Fix all fixable issues" (convenience default)
422
+ - "Let me choose specific issues" (user picks by number)
423
+ - "Skip fixes, proceed as-is"
424
+ 3. Fix selected issues, log each to `verification_context.fixes_applied`
425
+ 4. After fixes applied: set `skip_test_suite: false` (code changed, tests must re-run)
426
+ 5. question — "Re-run verification to check fixes?" with options:
427
+ - "Yes, re-run verification" → re-invoke `implementation-verifier` → return to Step 2
428
+ - "No, proceed to next phase"
429
+ 6. Update `verification_context.reverify_count`
430
+
431
+ **Exit conditions**:
432
+
433
+ - No critical issues remain → proceed
434
+ - User explicitly chooses "Skip fixes, proceed as-is" or "No, proceed to next phase" → proceed with issues logged
435
+ - Max 3 iterations reached → question: "Proceed with known issues?" / "Stop workflow"
436
+ - **MUST NOT proceed with unresolved critical issues unless user explicitly approves**
437
+
438
+ **⚠️ POST-VERIFICATION CONTINUATION** — After issue resolution completes:
439
+
440
+ 1. Read `orchestrator-state.yml` to confirm you are the orchestrator
441
+ 2. Update state: add Phase 11 to `completed_phases`
442
+ 3. Proceed to Phase 12
443
+
444
+ → Pause
445
+
446
+ question - Display executive summary: total issues found, issues fixed, issues remaining by severity. Then "Continue to Phase 12?"
447
+
448
+ ---
449
+
450
+ ### Phase 12: E2E Testing (Optional)
451
+
452
+ > **Phase gate**: Requires `question` confirmation from Phase 11 before executing.
453
+
454
+ **Purpose**: Runtime browser verification with screenshots (via Playwright MCP tools, not test file generation)
455
+ **Execute**: Task tool - `e2e-test-verifier` subagent
456
+ **Prompt must include**: task_path (absolute), spec_path, base_url. Report saves to `{task_path}/verification/e2e-verification-report.md`.
457
+ **Output**: `verification/e2e-verification-report.md`, screenshots
458
+ **State**: Update E2E results
459
+
460
+ **Skip if**: `options.e2e_enabled = false`
461
+
462
+ → Pause
463
+
464
+ question - "E2E complete. Continue to Phase 13?"
465
+
466
+ ---
467
+
468
+ ### Phase 13: User Documentation (Optional)
469
+
470
+ > **Phase gate**: Requires `question` confirmation from the preceding phase before executing.
471
+
472
+ **Purpose**: Generate user-facing documentation with screenshots
473
+ **Execute**: Task tool - `user-docs-generator` subagent
474
+ **Prompt must include**: task_path (absolute), spec_path, base_url. Guide saves to `{task_path}/documentation/user-guide.md`.
475
+ **Output**: `documentation/user-guide.md`, screenshots
476
+ **State**: Update docs generation status
477
+
478
+ **Skip if**: `options.user_docs_enabled = false`
479
+
480
+ → Pause
481
+
482
+ question - "Documentation complete. Continue to Phase 14?"
483
+
484
+ ---
485
+
486
+ ### Phase 14: Finalization
487
+
488
+ > **Phase gate**: Requires `question` confirmation from the preceding phase before executing.
489
+
490
+ **Purpose**: Complete workflow and provide next steps
491
+ **Execute**: Direct - create summary, update state, guide commit
492
+ **Output**: Workflow summary
493
+ **State**: Set `task.status: completed`
494
+
495
+ **Process**:
496
+
497
+ 1. Create workflow summary
498
+ 2. Update task status to "completed"
499
+ 3. Provide commit message template
500
+ 4. Guide next steps (code review, PR, deployment)
501
+
502
+ → End of workflow
503
+
504
+ ---
505
+
506
+ ## Domain Context (State Extensions)
507
+
508
+ Development-specific fields in `orchestrator-state.yml`:
509
+
510
+ ```yaml
511
+ orchestrator:
512
+ options:
513
+ spec_audit_enabled: true
514
+ skip_test_suite: true
515
+ e2e_enabled: null
516
+ user_docs_enabled: null
517
+ code_review_enabled: true
518
+ pragmatic_review_enabled: true
519
+ reality_check_enabled: true
520
+ production_check_enabled: true
521
+ task_context:
522
+ risk_level: null
523
+ clarifications_resolved: null
524
+ scope_expanded: null
525
+ architecture_decision: null
526
+ task_characteristics:
527
+ has_reproducible_defect: false
528
+ modifies_existing_code: false
529
+ creates_new_entities: false
530
+ involves_data_operations: false
531
+ ui_heavy: false
532
+ research_reference:
533
+ path: null
534
+ research_question: null
535
+ research_type: null
536
+ confidence_level: null
537
+ phase_summaries:
538
+ research: { summary: null, key_findings: [], recommended_approach: null }
539
+ codebase_analysis:
540
+ { key_files: [], primary_language: null, summary: null }
541
+ clarifications: []
542
+ gap_analysis: { integration_points: [], summary: null }
543
+ scope_clarifications: { scope_expanded: null, summary: null }
544
+ ui_mockups: { components_designed: [], summary: null }
545
+ specification: { summary: null }
546
+ architecture_decision: { decision: null, summary: null }
547
+ ```
548
+
549
+ ---
550
+
551
+ ## Task Structure
552
+
553
+ ```
554
+ .owflow/tasks/development/YYYY-MM-DD-task-name/
555
+ ├── orchestrator-state.yml
556
+ ├── analysis/
557
+ │ ├── research-context/ # If --research provided
558
+ │ ├── codebase-analysis.md # Phase 1
559
+ │ ├── clarifications.md # Phase 1
560
+ │ ├── gap-analysis.md # Phase 2
561
+ │ ├── scope-clarifications.md # Phase 2 (conditional)
562
+ │ ├── technical-clarifications.md # Phase 5 (conditional)
563
+ │ └── ui-mockups.md # Phase 4 (conditional)
564
+ ├── implementation/
565
+ │ ├── spec.md # Phase 5
566
+ │ ├── requirements.md # Phase 5
567
+ │ ├── implementation-plan.md # Phase 7
568
+ │ ├── work-log.md # Phase 8
569
+ │ ├── tdd-red-gate.md # Phase 3 (conditional)
570
+ │ └── tdd-green-gate.md # Phase 9 (conditional)
571
+ ├── verification/
572
+ │ ├── spec-audit.md # Phase 6 (recommended)
573
+ │ ├── implementation-verification.md # Phase 11
574
+ │ └── e2e-verification-report.md # Phase 12 (optional)
575
+ └── documentation/
576
+ └── user-guide.md # Phase 13 (optional)
577
+ ```
578
+
579
+ ---
580
+
581
+ ## Auto-Recovery
582
+
583
+ | Phase | Max Attempts | Strategy |
584
+ | ----- | ------------ | ------------------------------- |
585
+ | 1 | 2 | Expand search, prompt user |
586
+ | 2 | 2 | Re-analyze, ask user |
587
+ | 3 | 2 | Rewrite test, skip TDD with doc |
588
+ | 5 | 2 | Regenerate spec |
589
+ | 7 | 2 | Regenerate plan |
590
+ | 8 | 5 | Fix syntax, imports, tests |
591
+ | 9 | 3 | Return to implementation |
592
+ | 11 | 3 | Fix tests, re-run |
593
+
594
+ ---
595
+
596
+ ## Command Flags
597
+
598
+ | Flag | Effect |
599
+ | -------------------------------- | ------------------------------- |
600
+ | `--from=PHASE` | Start from specific phase |
601
+ | `--research=PATH` | Link to completed research task |
602
+ | `--audit` / `--no-audit` | Force/skip specification audit |
603
+ | `--e2e` / `--no-e2e` | Force/skip E2E testing |
604
+ | `--user-docs` / `--no-user-docs` | Force/skip user documentation |
605
+
606
+ ---
607
+
608
+ ## Research-Based Development
609
+
610
+ When starting development from a completed research task, the orchestrator loads research context to **INFORM** all phases.
611
+
612
+ ### Invocation Methods
613
+
614
+ **Method 1: Research folder as sole argument** (recommended)
615
+
616
+ ```
617
+ /development .owflow/tasks/research/2026-01-12-oauth-research
618
+ ```
619
+
620
+ The orchestrator auto-detects this is a research folder and:
621
+
622
+ - Extracts task description from `research_context.research_question`
623
+ - Reads all research artifacts
624
+ - Sets `research_reference` in state
625
+
626
+ **Method 2: Explicit --research flag**
627
+
628
+ ```
629
+ /development "Implement OAuth" --research=.owflow/tasks/research/2026-01-12-oauth-research
630
+ ```
631
+
632
+ ### Research Artifacts (Standard List)
633
+
634
+ When research context is detected, read these files from the research folder:
635
+
636
+ | Artifact | Path | Purpose |
637
+ | -------------------- | --------------------------------- | ---------------------------------------------- |
638
+ | State | `orchestrator-state.yml` | research_type, confidence_level |
639
+ | Report | `outputs/research-report.md` | Main findings and conclusions |
640
+ | Solution Exploration | `outputs/solution-exploration.md` | Alternatives and trade-offs (input to Phase 5) |
641
+ | High-Level Design | `outputs/high-level-design.md` | C4 architecture (input to Phase 5) |
642
+ | Decision Log | `outputs/decision-log.md` | ADR decisions (input to Phase 5) |
643
+
644
+ ### How Research Informs Each Phase
645
+
646
+ **Research INFORMS phases, never SKIPS them.** Research context passes to ALL phases via `task_context.phase_summaries.research`. No phases are skipped.
647
+
648
+ | Phase | How Research Context is Used |
649
+ | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
650
+ | Phase 1 | Codebase analyzer receives research findings as search guidance |
651
+ | Phase 2 | Gap analyzer uses research recommendations for comparison |
652
+ | Phase 5 | Specification creator uses high-level-design.md as INPUT (still creates full spec). Architecture decisions use research report AND decision-log.md (lighter when ADRs comprehensive) |
653
+ | Phase 7 | Implementation planner references research approach for task grouping |
654
+
655
+ ---
656
+
657
+ ## Command Integration
658
+
659
+ Invoked via:
660
+
661
+ - `/development [description] [--e2e] [--user-docs] [--research=PATH]` (new)
662
+ - `/development [task-path] [--from=PHASE] [--reset-attempts]` (resume)
663
+
664
+ ---
665
+
666
+ ## TDD Gate Rules
667
+
668
+ **Phase 3 (Red Gate)**: Test MUST FAIL before implementation (activated when gap-analyzer detects reproducible defect)
669
+ **Phase 9 (Green Gate)**: Test MUST PASS after implementation (activated when Phase 3 was executed)