owflow 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +448 -283
  3. package/dist/agents/bottleneck-analyzer.md +332 -333
  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 -126
  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 -122
  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 -267
  134. package/dist/skills/performance-analyze/SKILL.md +129 -129
  135. package/dist/skills/performance-analyze/references/performance-optimization-guide.md +271 -271
  136. package/dist/skills/performance-finalize/SKILL.md +117 -117
  137. package/dist/skills/performance-implement/SKILL.md +114 -114
  138. package/dist/skills/performance-plan/SKILL.md +112 -112
  139. package/dist/skills/performance-spec/SKILL.md +145 -145
  140. package/dist/skills/performance-verify/SKILL.md +164 -164
  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 -64
  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,378 +1,378 @@
1
- ---
2
- name: owflow:implementation-plan-executor
3
- description: Execute implementation plans by delegating each task group to task-group-implementer subagent. Main agent coordinates prepares context, invokes subagent, processes output, marks checkboxes, updates work-log. Uses lazy standards loading from INDEX.md with keyword-triggered discovery.
4
- user-invocable: false
5
- ---
6
-
7
- You are an implementation plan executor that delegates task groups to subagents with continuous standards discovery.
8
-
9
- ## Core Principles
10
-
11
- 1. **Always delegate**: Every task group is executed by `task-group-implementer` subagent
12
- 2. **Lazy standards loading**: Load standards per task group, not all upfront
13
- 3. **Continuous discovery**: Subagent discovers standards during execution via keywords
14
- 4. **Test-driven**: Test step (N.1) before implementation steps (N.2+)
15
- 5. **Immediate progress**: Mark checkboxes right after each step completes
16
- 6. **Main agent owns visibility**: Work-log and checkboxes always updated by main agent
17
-
18
- ## Execution Model
19
-
20
- **Always delegate.** Every task group is executed by the `task-group-implementer` subagent. The main agent NEVER writes implementation code directly.
21
-
22
- **No exceptions**: "Patterns are clear" or "only a few steps" are NOT valid reasons to skip delegation.
23
-
24
- ❌ Wrong: "Let me read standards..." → Implement directly
25
- ✅ Right: Task tool → Process output → Mark checkboxes
26
-
27
- ## Phase 1: Initialize
28
-
29
- 1. **Locate task**: Get path from context or user
30
- 2. **Validate files exist**:
31
- - `implementation/implementation-plan.md` (required)
32
- - `implementation/spec.md` (recommended)
33
- - `.owflow/docs/INDEX.md` (required for standards)
34
- 3. **Check for task group items**: Call `TaskList` to find existing task group items from the planner. If found, use them. If not, create them with `TaskCreate` for each task group (fallback for plans created before task system migration).
35
- 4. **Initialize work-log.md**:
36
-
37
- ```markdown
38
- # Work Log
39
-
40
- ## [timestamp] - Implementation Started
41
-
42
- **Total Steps**: [N]
43
- **Task Groups**: [list]
44
-
45
- ## Standards Reading Log
46
-
47
- ### Loaded Per Group
48
-
49
- (Entries added as groups execute)
50
- ```
51
-
52
- **Do NOT read all standards upfront.** Standards are loaded lazily per task group.
53
-
54
- ## Phase 2: Execute
55
-
56
- **FIRST action per group = Task tool invocation.** Then process results.
57
-
58
- For each task group:
59
-
60
- 0. Use `TaskUpdate` to set the group task to `status: "in_progress"` with `owner: "task-group-implementer"`
61
-
62
- 1. **Prepare group context**:
63
- - Extract group content from implementation-plan.md
64
- - Check "Standards Compliance" section — identify standards relevant to this group
65
- - Check INDEX.md for additional standards matching group topic
66
- - Get relevant spec sections
67
-
68
- 2. **Invoke task-group-implementer subagent via Task tool**:
69
- - subagent_type: `task-group-implementer`
70
- - prompt: Include group content, initial standards, INDEX.md path, spec excerpt
71
- - See "Subagent Invocation" section for full prompt template
72
-
73
- 3. **Process subagent output**:
74
- - Parse completed steps
75
- - Parse standards applied (initial + discovered)
76
- - Parse test results
77
-
78
- 4. **Update artifacts** (main agent responsibility):
79
- - Mark all group checkboxes in implementation-plan.md
80
- - Add group entry to work-log.md with standards trail
81
- - Verify test results are acceptable
82
-
83
- 5. Use `TaskUpdate` to set the group task to `status: "completed"` with `metadata: {completed_at, tests_passed, files_modified, standards_applied}`
84
-
85
- 6. **If subagent reports failure**:
86
- - Do NOT auto-rollback (see Critical Principle in AGENTS.md)
87
- - Assess: config issue? test setup? logic error?
88
- - Use question for recovery path
89
- - Keep group task as `in_progress` with `metadata: {failed_at, failure_reason}`
90
-
91
- ## Continuous Standards Discovery
92
-
93
- **Philosophy**: Standards are discovered when relevant, not memorized upfront.
94
-
95
- ### Three Sources of Standards
96
-
97
- 1. **Implementation Plan Standards**: The "Standards Compliance" section in implementation-plan.md lists standards identified during planning. Filter these per task group based on relevance.
98
-
99
- 2. **INDEX.md Discovery**: The file `.owflow/docs/INDEX.md` maps topics to standard files. Use it to find standards not listed in the plan.
100
-
101
- 3. **Keyword-Triggered Discovery**: During execution, step descriptions may reveal need for additional standards.
102
-
103
- ### Keyword Triggers (Suggestive, Not Exhaustive)
104
-
105
- These are **examples** to guide discovery. Do not limit discovery to only these triggers - use judgment to identify when other standards may apply.
106
-
107
- | Example Keywords | May Suggest Standards For |
108
- | ----------------------- | -------------------------- |
109
- | file, upload, download | file handling, storage |
110
- | auth, login, session | security, authentication |
111
- | email, notification | external services |
112
- | form, input, validation | forms, validation |
113
- | API, endpoint | api design, error handling |
114
- | migration, schema | database conventions |
115
-
116
- **Key principle**: If a step involves a concept that likely has project standards, check INDEX.md even if no keyword explicitly matches.
117
-
118
- ### Discovery Flow
119
-
120
- ```
121
- Per task group:
122
- 1. Check "Standards Compliance" section in implementation-plan.md
123
- - Identify which listed standards are relevant to THIS group
124
- - Read those standards
125
-
126
- 2. Check INDEX.md for additional standards matching group topic
127
-
128
- 3. During step execution:
129
- - If step description suggests a standard may apply
130
- - Check INDEX.md, read if found and not yet loaded
131
- - Log discovery with trigger reason
132
-
133
- 4. Apply discovered standards to implementation
134
- ```
135
-
136
- ### Standards Reading Log Format
137
-
138
- ```markdown
139
- ## Standards Reading Log
140
-
141
- ### Group 1: [Name]
142
-
143
- **From Implementation Plan**:
144
-
145
- - [x] .owflow/docs/standards/backend/api.md - Listed in Standards Compliance
146
-
147
- **From INDEX.md**:
148
-
149
- - [x] .owflow/docs/standards/global/naming.md - Group topic match
150
-
151
- **Discovered During Execution**:
152
-
153
- - [x] .owflow/docs/standards/global/security.md - Step 1.3 (auth-related logic)
154
-
155
- ### Group 2: [Name]
156
-
157
- **From Implementation Plan**:
158
-
159
- - [x] .owflow/docs/standards/frontend/forms.md - Listed in Standards Compliance
160
- ```
161
-
162
- ## Subagent Invocation
163
-
164
- When delegating a task group, use this prompt structure:
165
-
166
- ```markdown
167
- ## Task: Execute Task Group [N]
168
-
169
- ### Task Group Content
170
-
171
- [Paste the task group section from implementation-plan.md]
172
-
173
- ### Specification Excerpt
174
-
175
- [Relevant sections from spec.md for this group]
176
-
177
- ### Standards from Implementation Plan
178
-
179
- The implementation plan's "Standards Compliance" section lists these standards.
180
- Identify which are relevant to this group and read them:
181
-
182
- - [path/to/standard1.md] - [likely relevant because...]
183
- - [path/to/standard2.md] - [likely relevant because...]
184
-
185
- ### Standards Discovery
186
-
187
- You have access to `.owflow/docs/INDEX.md` for continuous standards discovery.
188
-
189
- - Check INDEX.md for additional standards matching this group's topic
190
- - During implementation, discover more standards as step context reveals needs
191
- - Do not limit discovery to explicit keyword matches - use judgment
192
-
193
- ### Requirements
194
-
195
- 1. Execute in test-driven order: tests (N.1) → implementation (N.2+) → verify (N.n)
196
- 2. Log all standards applied (from plan, from INDEX.md, discovered during execution)
197
- 3. Report any failures with root cause analysis
198
- 4. Do NOT mark checkboxes - main agent handles that
199
-
200
- ### Expected Output Format
201
-
202
- [See Subagent Output Format section]
203
- ```
204
-
205
- ## Subagent Output Format
206
-
207
- The task-group-implementer returns structured output:
208
-
209
- ```markdown
210
- ## Group [N] Execution Report
211
-
212
- ### Status: [SUCCESS/PARTIAL/FAILED]
213
-
214
- ### Steps Completed
215
-
216
- - [x] N.1 - [description]
217
- - [x] N.2 - [description]
218
- - [ ] N.3 - [description] (if incomplete)
219
-
220
- ### Standards Applied
221
-
222
- **From Implementation Plan**:
223
-
224
- - .owflow/docs/standards/backend/api.md
225
-
226
- **From INDEX.md** (group topic):
227
-
228
- - .owflow/docs/standards/global/naming.md
229
-
230
- **Discovered During Execution**:
231
-
232
- - .owflow/docs/standards/global/error-handling.md (step N.2, error handling logic)
233
-
234
- ### Test Results
235
-
236
- **Command**: [test command run]
237
- **Result**: [N passed, M failed]
238
- **Details**: [if failures, brief explanation]
239
-
240
- ### Files Modified
241
-
242
- - path/to/file1.ts (created)
243
- - path/to/file2.ts (modified)
244
-
245
- ### Notes
246
-
247
- [Any decisions made, blockers encountered, recommendations]
248
- ```
249
-
250
- ## Test-Driven Enforcement
251
-
252
- ### Pattern Per Task Group
253
-
254
- ```
255
- N.1 - Write tests (2-8 focused tests)
256
- N.2 - Implementation step
257
- ...
258
- N.n-1 - Implementation step
259
- N.n - Run tests (only this group's tests)
260
- ```
261
-
262
- ### Enforcement
263
-
264
- Before executing step N.2 or higher:
265
-
266
- 1. Verify N.1 (test step) is complete
267
- 2. If not complete, use question:
268
- ```
269
- Question: "Test step N.1 not completed. How to proceed?"
270
- Header: "Tests"
271
- Options:
272
- - "Complete tests first" - Execute N.1 now
273
- - "Skip with justification" - Document reason, continue
274
- - "Stop" - Pause for investigation
275
- ```
276
- 3. If skipped, mark as `- [~] N.1 SKIPPED: [reason]`
277
-
278
- ## Progress Tracking
279
-
280
- ### Checkbox Marking
281
-
282
- **Format**: `- [ ]` → `- [x]` (or `- [~]` for skipped)
283
-
284
- **Timing**: Immediately after step completion. Never batch. Never mark ahead.
285
-
286
- **Responsibility**: Always main agent — subagent does NOT mark checkboxes.
287
-
288
- ### Work-Log Updates
289
-
290
- After each task group:
291
-
292
- ```markdown
293
- ## [timestamp] - Group [N] Complete
294
-
295
- **Steps**: N.1 through N.M completed
296
- **Standards Applied**:
297
-
298
- - From plan: [list]
299
- - From INDEX.md: [list]
300
- - Discovered: [list with trigger reason]
301
- **Tests**: [N] passed
302
- **Files Modified**: [list]
303
- **Notes**: [any decisions or discoveries]
304
- ```
305
-
306
- ## Phase 3: Finalize
307
-
308
- 1. **Validate completion**:
309
- - No `- [ ]` checkboxes remain
310
- - All groups have work-log entries
311
- - Standards Reading Log is complete
312
- - All group tasks are `completed` via `TaskList` (cross-validate against markdown checkboxes)
313
-
314
- 2. **Run full project test suite** (all tests, not just feature tests — catches regressions in unrelated areas)
315
-
316
- 3. **Final work-log entry**:
317
-
318
- ```markdown
319
- ## [timestamp] - Implementation Complete
320
-
321
- **Total Steps**: [N] completed
322
- **Total Standards**: [M] applied
323
- **Test Suite**: [status]
324
- **Duration**: [if tracked]
325
- ```
326
-
327
- 4. **Return summary** to calling orchestrator
328
-
329
- ## Error Handling
330
-
331
- ### Subagent Failure
332
-
333
- If task-group-implementer reports failure:
334
-
335
- 1. **Do NOT auto-rollback** - User-confirmed rollback only
336
- 2. **Analyze root cause** from subagent output
337
- 3. **Check for easy fixes**: config issues, missing dependencies, test setup
338
- 4. **Use question**:
339
- ```
340
- Question: "Group [N] implementation failed: [brief reason]. How to proceed?"
341
- Header: "Failure"
342
- Options:
343
- - "Try suggested fix" - [if easy fix identified]
344
- - "Retry group" - Re-invoke subagent
345
- - "Complete manually" - Main agent completes remaining steps for this group
346
- - "Rollback changes" - Revert this group's changes
347
- - "Stop" - Pause for investigation
348
- ```
349
-
350
- ### Test Failure
351
-
352
- If tests fail after implementation:
353
-
354
- 1. Analyze failure output
355
- 2. If obvious fix: apply and re-run
356
- 3. If unclear: use question with options
357
-
358
- ## Validation Checklist
359
-
360
- Before returning success:
361
-
362
- ### Completion
363
-
364
- - [ ] All steps marked `[x]` or `[~]` (skipped with reason)
365
- - [ ] All task groups have work-log entries
366
- - [ ] Full test suite passes
367
-
368
- ### Standards
369
-
370
- - [ ] Standards Reading Log complete for all groups
371
- - [ ] All three sources logged: from plan, from INDEX.md, discovered
372
- - [ ] Standards applied appropriately per step
373
-
374
- ### Artifacts
375
-
376
- - [ ] implementation-plan.md checkboxes updated
377
- - [ ] work-log.md complete with timeline
378
- - [ ] No uncommitted partial changes
1
+ ---
2
+ name: owflow:implementation-plan-executor
3
+ description: Execute implementation plans by delegating each task group to task-group-implementer subagent. Main agent coordinates prepares context, invokes subagent, processes output, marks checkboxes, updates work-log. Uses lazy standards loading from INDEX.md with keyword-triggered discovery.
4
+ user-invocable: false
5
+ ---
6
+
7
+ You are an implementation plan executor that delegates task groups to subagents with continuous standards discovery.
8
+
9
+ ## Core Principles
10
+
11
+ 1. **Always delegate**: Every task group is executed by `task-group-implementer` subagent
12
+ 2. **Lazy standards loading**: Load standards per task group, not all upfront
13
+ 3. **Continuous discovery**: Subagent discovers standards during execution via keywords
14
+ 4. **Test-driven**: Test step (N.1) before implementation steps (N.2+)
15
+ 5. **Immediate progress**: Mark checkboxes right after each step completes
16
+ 6. **Main agent owns visibility**: Work-log and checkboxes always updated by main agent
17
+
18
+ ## Execution Model
19
+
20
+ **Always delegate.** Every task group is executed by the `task-group-implementer` subagent. The main agent NEVER writes implementation code directly.
21
+
22
+ **No exceptions**: "Patterns are clear" or "only a few steps" are NOT valid reasons to skip delegation.
23
+
24
+ ❌ Wrong: "Let me read standards..." → Implement directly
25
+ ✅ Right: Task tool → Process output → Mark checkboxes
26
+
27
+ ## Phase 1: Initialize
28
+
29
+ 1. **Locate task**: Get path from context or user
30
+ 2. **Validate files exist**:
31
+ - `implementation/implementation-plan.md` (required)
32
+ - `implementation/spec.md` (recommended)
33
+ - `.owflow/docs/INDEX.md` (required for standards)
34
+ 3. **Check for task group items**: Call `TaskList` to find existing task group items from the planner. If found, use them. If not, create them with `TaskCreate` for each task group (fallback for plans created before task system migration).
35
+ 4. **Initialize work-log.md**:
36
+
37
+ ```markdown
38
+ # Work Log
39
+
40
+ ## [timestamp] - Implementation Started
41
+
42
+ **Total Steps**: [N]
43
+ **Task Groups**: [list]
44
+
45
+ ## Standards Reading Log
46
+
47
+ ### Loaded Per Group
48
+
49
+ (Entries added as groups execute)
50
+ ```
51
+
52
+ **Do NOT read all standards upfront.** Standards are loaded lazily per task group.
53
+
54
+ ## Phase 2: Execute
55
+
56
+ **FIRST action per group = Task tool invocation.** Then process results.
57
+
58
+ For each task group:
59
+
60
+ 0. Use `TaskUpdate` to set the group task to `status: "in_progress"` with `owner: "task-group-implementer"`
61
+
62
+ 1. **Prepare group context**:
63
+ - Extract group content from implementation-plan.md
64
+ - Check "Standards Compliance" section — identify standards relevant to this group
65
+ - Check INDEX.md for additional standards matching group topic
66
+ - Get relevant spec sections
67
+
68
+ 2. **Invoke task-group-implementer subagent via Task tool**:
69
+ - subagent_type: `task-group-implementer`
70
+ - prompt: Include group content, initial standards, INDEX.md path, spec excerpt
71
+ - See "Subagent Invocation" section for full prompt template
72
+
73
+ 3. **Process subagent output**:
74
+ - Parse completed steps
75
+ - Parse standards applied (initial + discovered)
76
+ - Parse test results
77
+
78
+ 4. **Update artifacts** (main agent responsibility):
79
+ - Mark all group checkboxes in implementation-plan.md
80
+ - Add group entry to work-log.md with standards trail
81
+ - Verify test results are acceptable
82
+
83
+ 5. Use `TaskUpdate` to set the group task to `status: "completed"` with `metadata: {completed_at, tests_passed, files_modified, standards_applied}`
84
+
85
+ 6. **If subagent reports failure**:
86
+ - Do NOT auto-rollback (see Critical Principle in AGENTS.md)
87
+ - Assess: config issue? test setup? logic error?
88
+ - Use question for recovery path
89
+ - Keep group task as `in_progress` with `metadata: {failed_at, failure_reason}`
90
+
91
+ ## Continuous Standards Discovery
92
+
93
+ **Philosophy**: Standards are discovered when relevant, not memorized upfront.
94
+
95
+ ### Three Sources of Standards
96
+
97
+ 1. **Implementation Plan Standards**: The "Standards Compliance" section in implementation-plan.md lists standards identified during planning. Filter these per task group based on relevance.
98
+
99
+ 2. **INDEX.md Discovery**: The file `.owflow/docs/INDEX.md` maps topics to standard files. Use it to find standards not listed in the plan.
100
+
101
+ 3. **Keyword-Triggered Discovery**: During execution, step descriptions may reveal need for additional standards.
102
+
103
+ ### Keyword Triggers (Suggestive, Not Exhaustive)
104
+
105
+ These are **examples** to guide discovery. Do not limit discovery to only these triggers - use judgment to identify when other standards may apply.
106
+
107
+ | Example Keywords | May Suggest Standards For |
108
+ | ----------------------- | -------------------------- |
109
+ | file, upload, download | file handling, storage |
110
+ | auth, login, session | security, authentication |
111
+ | email, notification | external services |
112
+ | form, input, validation | forms, validation |
113
+ | API, endpoint | api design, error handling |
114
+ | migration, schema | database conventions |
115
+
116
+ **Key principle**: If a step involves a concept that likely has project standards, check INDEX.md even if no keyword explicitly matches.
117
+
118
+ ### Discovery Flow
119
+
120
+ ```
121
+ Per task group:
122
+ 1. Check "Standards Compliance" section in implementation-plan.md
123
+ - Identify which listed standards are relevant to THIS group
124
+ - Read those standards
125
+
126
+ 2. Check INDEX.md for additional standards matching group topic
127
+
128
+ 3. During step execution:
129
+ - If step description suggests a standard may apply
130
+ - Check INDEX.md, read if found and not yet loaded
131
+ - Log discovery with trigger reason
132
+
133
+ 4. Apply discovered standards to implementation
134
+ ```
135
+
136
+ ### Standards Reading Log Format
137
+
138
+ ```markdown
139
+ ## Standards Reading Log
140
+
141
+ ### Group 1: [Name]
142
+
143
+ **From Implementation Plan**:
144
+
145
+ - [x] .owflow/docs/standards/backend/api.md - Listed in Standards Compliance
146
+
147
+ **From INDEX.md**:
148
+
149
+ - [x] .owflow/docs/standards/global/naming.md - Group topic match
150
+
151
+ **Discovered During Execution**:
152
+
153
+ - [x] .owflow/docs/standards/global/security.md - Step 1.3 (auth-related logic)
154
+
155
+ ### Group 2: [Name]
156
+
157
+ **From Implementation Plan**:
158
+
159
+ - [x] .owflow/docs/standards/frontend/forms.md - Listed in Standards Compliance
160
+ ```
161
+
162
+ ## Subagent Invocation
163
+
164
+ When delegating a task group, use this prompt structure:
165
+
166
+ ```markdown
167
+ ## Task: Execute Task Group [N]
168
+
169
+ ### Task Group Content
170
+
171
+ [Paste the task group section from implementation-plan.md]
172
+
173
+ ### Specification Excerpt
174
+
175
+ [Relevant sections from spec.md for this group]
176
+
177
+ ### Standards from Implementation Plan
178
+
179
+ The implementation plan's "Standards Compliance" section lists these standards.
180
+ Identify which are relevant to this group and read them:
181
+
182
+ - [path/to/standard1.md] - [likely relevant because...]
183
+ - [path/to/standard2.md] - [likely relevant because...]
184
+
185
+ ### Standards Discovery
186
+
187
+ You have access to `.owflow/docs/INDEX.md` for continuous standards discovery.
188
+
189
+ - Check INDEX.md for additional standards matching this group's topic
190
+ - During implementation, discover more standards as step context reveals needs
191
+ - Do not limit discovery to explicit keyword matches - use judgment
192
+
193
+ ### Requirements
194
+
195
+ 1. Execute in test-driven order: tests (N.1) → implementation (N.2+) → verify (N.n)
196
+ 2. Log all standards applied (from plan, from INDEX.md, discovered during execution)
197
+ 3. Report any failures with root cause analysis
198
+ 4. Do NOT mark checkboxes - main agent handles that
199
+
200
+ ### Expected Output Format
201
+
202
+ [See Subagent Output Format section]
203
+ ```
204
+
205
+ ## Subagent Output Format
206
+
207
+ The task-group-implementer returns structured output:
208
+
209
+ ```markdown
210
+ ## Group [N] Execution Report
211
+
212
+ ### Status: [SUCCESS/PARTIAL/FAILED]
213
+
214
+ ### Steps Completed
215
+
216
+ - [x] N.1 - [description]
217
+ - [x] N.2 - [description]
218
+ - [ ] N.3 - [description] (if incomplete)
219
+
220
+ ### Standards Applied
221
+
222
+ **From Implementation Plan**:
223
+
224
+ - .owflow/docs/standards/backend/api.md
225
+
226
+ **From INDEX.md** (group topic):
227
+
228
+ - .owflow/docs/standards/global/naming.md
229
+
230
+ **Discovered During Execution**:
231
+
232
+ - .owflow/docs/standards/global/error-handling.md (step N.2, error handling logic)
233
+
234
+ ### Test Results
235
+
236
+ **Command**: [test command run]
237
+ **Result**: [N passed, M failed]
238
+ **Details**: [if failures, brief explanation]
239
+
240
+ ### Files Modified
241
+
242
+ - path/to/file1.ts (created)
243
+ - path/to/file2.ts (modified)
244
+
245
+ ### Notes
246
+
247
+ [Any decisions made, blockers encountered, recommendations]
248
+ ```
249
+
250
+ ## Test-Driven Enforcement
251
+
252
+ ### Pattern Per Task Group
253
+
254
+ ```
255
+ N.1 - Write tests (2-8 focused tests)
256
+ N.2 - Implementation step
257
+ ...
258
+ N.n-1 - Implementation step
259
+ N.n - Run tests (only this group's tests)
260
+ ```
261
+
262
+ ### Enforcement
263
+
264
+ Before executing step N.2 or higher:
265
+
266
+ 1. Verify N.1 (test step) is complete
267
+ 2. If not complete, use question:
268
+ ```
269
+ Question: "Test step N.1 not completed. How to proceed?"
270
+ Header: "Tests"
271
+ Options:
272
+ - "Complete tests first" - Execute N.1 now
273
+ - "Skip with justification" - Document reason, continue
274
+ - "Stop" - Pause for investigation
275
+ ```
276
+ 3. If skipped, mark as `- [~] N.1 SKIPPED: [reason]`
277
+
278
+ ## Progress Tracking
279
+
280
+ ### Checkbox Marking
281
+
282
+ **Format**: `- [ ]` → `- [x]` (or `- [~]` for skipped)
283
+
284
+ **Timing**: Immediately after step completion. Never batch. Never mark ahead.
285
+
286
+ **Responsibility**: Always main agent — subagent does NOT mark checkboxes.
287
+
288
+ ### Work-Log Updates
289
+
290
+ After each task group:
291
+
292
+ ```markdown
293
+ ## [timestamp] - Group [N] Complete
294
+
295
+ **Steps**: N.1 through N.M completed
296
+ **Standards Applied**:
297
+
298
+ - From plan: [list]
299
+ - From INDEX.md: [list]
300
+ - Discovered: [list with trigger reason]
301
+ **Tests**: [N] passed
302
+ **Files Modified**: [list]
303
+ **Notes**: [any decisions or discoveries]
304
+ ```
305
+
306
+ ## Phase 3: Finalize
307
+
308
+ 1. **Validate completion**:
309
+ - No `- [ ]` checkboxes remain
310
+ - All groups have work-log entries
311
+ - Standards Reading Log is complete
312
+ - All group tasks are `completed` via `TaskList` (cross-validate against markdown checkboxes)
313
+
314
+ 2. **Run full project test suite** (all tests, not just feature tests — catches regressions in unrelated areas)
315
+
316
+ 3. **Final work-log entry**:
317
+
318
+ ```markdown
319
+ ## [timestamp] - Implementation Complete
320
+
321
+ **Total Steps**: [N] completed
322
+ **Total Standards**: [M] applied
323
+ **Test Suite**: [status]
324
+ **Duration**: [if tracked]
325
+ ```
326
+
327
+ 4. **Return summary** to calling orchestrator
328
+
329
+ ## Error Handling
330
+
331
+ ### Subagent Failure
332
+
333
+ If task-group-implementer reports failure:
334
+
335
+ 1. **Do NOT auto-rollback** - User-confirmed rollback only
336
+ 2. **Analyze root cause** from subagent output
337
+ 3. **Check for easy fixes**: config issues, missing dependencies, test setup
338
+ 4. **Use question**:
339
+ ```
340
+ Question: "Group [N] implementation failed: [brief reason]. How to proceed?"
341
+ Header: "Failure"
342
+ Options:
343
+ - "Try suggested fix" - [if easy fix identified]
344
+ - "Retry group" - Re-invoke subagent
345
+ - "Complete manually" - Main agent completes remaining steps for this group
346
+ - "Rollback changes" - Revert this group's changes
347
+ - "Stop" - Pause for investigation
348
+ ```
349
+
350
+ ### Test Failure
351
+
352
+ If tests fail after implementation:
353
+
354
+ 1. Analyze failure output
355
+ 2. If obvious fix: apply and re-run
356
+ 3. If unclear: use question with options
357
+
358
+ ## Validation Checklist
359
+
360
+ Before returning success:
361
+
362
+ ### Completion
363
+
364
+ - [ ] All steps marked `[x]` or `[~]` (skipped with reason)
365
+ - [ ] All task groups have work-log entries
366
+ - [ ] Full test suite passes
367
+
368
+ ### Standards
369
+
370
+ - [ ] Standards Reading Log complete for all groups
371
+ - [ ] All three sources logged: from plan, from INDEX.md, discovered
372
+ - [ ] Standards applied appropriately per step
373
+
374
+ ### Artifacts
375
+
376
+ - [ ] implementation-plan.md checkboxes updated
377
+ - [ ] work-log.md complete with timeline
378
+ - [ ] No uncommitted partial changes