@duypham93/openkit 0.2.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 (178) hide show
  1. package/.opencode/README.md +47 -0
  2. package/.opencode/install-manifest.json +41 -0
  3. package/.opencode/lib/artifact-scaffolder.js +111 -0
  4. package/.opencode/lib/contract-consistency.js +218 -0
  5. package/.opencode/lib/parallel-execution-rules.js +261 -0
  6. package/.opencode/lib/runtime-paths.js +95 -0
  7. package/.opencode/lib/runtime-summary.js +82 -0
  8. package/.opencode/lib/state-guard.js +99 -0
  9. package/.opencode/lib/task-board-rules.js +375 -0
  10. package/.opencode/lib/work-item-store.js +280 -0
  11. package/.opencode/lib/workflow-state-controller.js +1739 -0
  12. package/.opencode/lib/workflow-state-rules.js +331 -0
  13. package/.opencode/opencode.json +93 -0
  14. package/.opencode/package.json +3 -0
  15. package/.opencode/tests/artifact-scaffolder.test.js +733 -0
  16. package/.opencode/tests/multi-work-item-runtime.test.js +369 -0
  17. package/.opencode/tests/parallel-execution-runtime.test.js +259 -0
  18. package/.opencode/tests/session-start-hook.test.js +357 -0
  19. package/.opencode/tests/state-guard.test.js +124 -0
  20. package/.opencode/tests/task-board-rules.test.js +204 -0
  21. package/.opencode/tests/work-item-store.test.js +380 -0
  22. package/.opencode/tests/workflow-behavior.test.js +149 -0
  23. package/.opencode/tests/workflow-contract-consistency.test.js +387 -0
  24. package/.opencode/tests/workflow-state-cli.test.js +1275 -0
  25. package/.opencode/tests/workflow-state-controller.test.js +1038 -0
  26. package/.opencode/work-items/feature-001/state.json +70 -0
  27. package/.opencode/work-items/index.json +13 -0
  28. package/.opencode/workflow-state.js +489 -0
  29. package/.opencode/workflow-state.json +70 -0
  30. package/AGENTS.md +265 -0
  31. package/README.md +401 -0
  32. package/agents/architect-agent.md +63 -0
  33. package/agents/ba-agent.md +56 -0
  34. package/agents/code-reviewer.md +77 -0
  35. package/agents/fullstack-agent.md +115 -0
  36. package/agents/master-orchestrator.md +60 -0
  37. package/agents/pm-agent.md +56 -0
  38. package/agents/qa-agent.md +124 -0
  39. package/agents/tech-lead-agent.md +60 -0
  40. package/assets/install-bundle/README.md +7 -0
  41. package/assets/install-bundle/opencode/README.md +11 -0
  42. package/assets/install-bundle/opencode/agents/ArchitectAgent.md +63 -0
  43. package/assets/install-bundle/opencode/agents/BAAgent.md +56 -0
  44. package/assets/install-bundle/opencode/agents/CodeReviewer.md +77 -0
  45. package/assets/install-bundle/opencode/agents/FullstackAgent.md +115 -0
  46. package/assets/install-bundle/opencode/agents/MasterOrchestrator.md +60 -0
  47. package/assets/install-bundle/opencode/agents/PMAgent.md +56 -0
  48. package/assets/install-bundle/opencode/agents/QAAgent.md +124 -0
  49. package/assets/install-bundle/opencode/agents/TechLeadAgent.md +60 -0
  50. package/assets/install-bundle/opencode/commands/brainstorm.md +44 -0
  51. package/assets/install-bundle/opencode/commands/delivery.md +45 -0
  52. package/assets/install-bundle/opencode/commands/execute-plan.md +44 -0
  53. package/assets/install-bundle/opencode/commands/migrate.md +61 -0
  54. package/assets/install-bundle/opencode/commands/quick-task.md +45 -0
  55. package/assets/install-bundle/opencode/commands/task.md +46 -0
  56. package/assets/install-bundle/opencode/commands/write-plan.md +50 -0
  57. package/assets/install-bundle/opencode/context/core/lane-selection.md +54 -0
  58. package/assets/install-bundle/opencode/skills/brainstorming/SKILL.md +51 -0
  59. package/assets/install-bundle/opencode/skills/code-review/SKILL.md +48 -0
  60. package/assets/install-bundle/opencode/skills/subagent-driven-development/SKILL.md +79 -0
  61. package/assets/install-bundle/opencode/skills/systematic-debugging/SKILL.md +61 -0
  62. package/assets/install-bundle/opencode/skills/test-driven-development/SKILL.md +48 -0
  63. package/assets/install-bundle/opencode/skills/using-skills/SKILL.md +39 -0
  64. package/assets/install-bundle/opencode/skills/verification-before-completion/SKILL.md +137 -0
  65. package/assets/install-bundle/opencode/skills/writing-plans/SKILL.md +68 -0
  66. package/assets/install-bundle/opencode/skills/writing-specs/SKILL.md +47 -0
  67. package/assets/opencode.json.template +11 -0
  68. package/assets/openkit-install.json.template +19 -0
  69. package/bin/openkit.js +9 -0
  70. package/commands/brainstorm.md +44 -0
  71. package/commands/delivery.md +45 -0
  72. package/commands/execute-plan.md +44 -0
  73. package/commands/migrate.md +61 -0
  74. package/commands/quick-task.md +45 -0
  75. package/commands/task.md +46 -0
  76. package/commands/write-plan.md +50 -0
  77. package/context/core/approval-gates.md +146 -0
  78. package/context/core/code-quality.md +42 -0
  79. package/context/core/issue-routing.md +85 -0
  80. package/context/core/lane-selection.md +54 -0
  81. package/context/core/project-config.md +143 -0
  82. package/context/core/session-resume.md +85 -0
  83. package/context/core/workflow-state-schema.md +224 -0
  84. package/context/core/workflow.md +442 -0
  85. package/context/navigation.md +94 -0
  86. package/docs/adr/README.md +6 -0
  87. package/docs/architecture/2026-03-20-task-intake-dashboard.md +54 -0
  88. package/docs/architecture/README.md +7 -0
  89. package/docs/briefs/2026-03-20-task-intake-dashboard.md +48 -0
  90. package/docs/briefs/README.md +7 -0
  91. package/docs/governance/README.md +25 -0
  92. package/docs/governance/adr-policy.md +27 -0
  93. package/docs/governance/definition-of-done.md +17 -0
  94. package/docs/governance/naming-conventions.md +21 -0
  95. package/docs/governance/severity-levels.md +12 -0
  96. package/docs/maintainer/README.md +51 -0
  97. package/docs/operations/README.md +79 -0
  98. package/docs/operations/internal-records/2026-03-24-release-checklist.md +79 -0
  99. package/docs/operations/internal-records/2026-03-24-simplified-install-ux.md +36 -0
  100. package/docs/operations/internal-records/README.md +18 -0
  101. package/docs/operations/runbooks/README.md +23 -0
  102. package/docs/operations/runbooks/openkit-daily-usage.md +288 -0
  103. package/docs/operations/runbooks/workflow-state-smoke-tests.md +302 -0
  104. package/docs/operator/README.md +50 -0
  105. package/docs/plans/2026-03-20-task-intake-dashboard.md +49 -0
  106. package/docs/plans/2026-03-21-openkit-full-delivery-multi-task-runtime.md +521 -0
  107. package/docs/plans/2026-03-23-openkit-global-install-runtime.md +157 -0
  108. package/docs/plans/README.md +7 -0
  109. package/docs/qa/2026-03-20-task-intake-dashboard.md +41 -0
  110. package/docs/qa/README.md +7 -0
  111. package/docs/specs/2026-03-20-task-intake-dashboard.md +50 -0
  112. package/docs/specs/2026-03-21-openkit-full-delivery-multi-task-runtime.md +462 -0
  113. package/docs/specs/README.md +7 -0
  114. package/docs/templates/README.md +36 -0
  115. package/docs/templates/adr-template.md +18 -0
  116. package/docs/templates/architecture-template.md +31 -0
  117. package/docs/templates/implementation-plan-template.md +32 -0
  118. package/docs/templates/migration-baseline-checklist.md +48 -0
  119. package/docs/templates/migration-plan-template.md +52 -0
  120. package/docs/templates/migration-report-template.md +74 -0
  121. package/docs/templates/migration-verify-checklist.md +39 -0
  122. package/docs/templates/product-brief-template.md +32 -0
  123. package/docs/templates/qa-report-template.md +37 -0
  124. package/docs/templates/quick-task-template.md +36 -0
  125. package/docs/templates/spec-template.md +31 -0
  126. package/hooks/hooks.json +16 -0
  127. package/hooks/session-start +162 -0
  128. package/package.json +24 -0
  129. package/registry.json +328 -0
  130. package/skills/brainstorming/SKILL.md +51 -0
  131. package/skills/code-review/SKILL.md +48 -0
  132. package/skills/subagent-driven-development/SKILL.md +79 -0
  133. package/skills/systematic-debugging/SKILL.md +61 -0
  134. package/skills/test-driven-development/SKILL.md +48 -0
  135. package/skills/using-skills/SKILL.md +39 -0
  136. package/skills/verification-before-completion/SKILL.md +137 -0
  137. package/skills/writing-plans/SKILL.md +68 -0
  138. package/skills/writing-specs/SKILL.md +47 -0
  139. package/src/audit/vietnamese-detection.js +259 -0
  140. package/src/cli/commands/detect-vietnamese.js +24 -0
  141. package/src/cli/commands/doctor.js +33 -0
  142. package/src/cli/commands/help.js +33 -0
  143. package/src/cli/commands/init.js +25 -0
  144. package/src/cli/commands/install-global.js +26 -0
  145. package/src/cli/commands/install.js +25 -0
  146. package/src/cli/commands/run.js +63 -0
  147. package/src/cli/commands/uninstall.js +32 -0
  148. package/src/cli/commands/upgrade.js +25 -0
  149. package/src/cli/conflict-output.js +19 -0
  150. package/src/cli/index.js +56 -0
  151. package/src/global/doctor.js +101 -0
  152. package/src/global/ensure-install.js +32 -0
  153. package/src/global/install-state.js +73 -0
  154. package/src/global/launcher.js +51 -0
  155. package/src/global/materialize.js +123 -0
  156. package/src/global/paths.js +85 -0
  157. package/src/global/uninstall.js +25 -0
  158. package/src/global/workspace-state.js +63 -0
  159. package/src/install/asset-manifest.js +284 -0
  160. package/src/install/conflicts.js +43 -0
  161. package/src/install/discovery.js +138 -0
  162. package/src/install/install-state.js +136 -0
  163. package/src/install/materialize.js +158 -0
  164. package/src/install/merge-policy.js +145 -0
  165. package/src/runtime/doctor.js +281 -0
  166. package/src/runtime/launcher.js +49 -0
  167. package/src/runtime/opencode-layering.js +135 -0
  168. package/src/runtime/openkit-managed-summary.js +27 -0
  169. package/tests/cli/openkit-cli.test.js +417 -0
  170. package/tests/global/doctor.test.js +130 -0
  171. package/tests/global/ensure-install.test.js +105 -0
  172. package/tests/install/discovery.test.js +124 -0
  173. package/tests/install/install-state.test.js +346 -0
  174. package/tests/install/materialize.test.js +244 -0
  175. package/tests/install/merge-policy.test.js +177 -0
  176. package/tests/runtime/doctor.test.js +430 -0
  177. package/tests/runtime/launcher.test.js +230 -0
  178. package/tests/runtime/module-boundary.test.js +16 -0
@@ -0,0 +1,7 @@
1
+ # Plans
2
+
3
+ This directory stores implementation plans produced by the Tech Lead agent.
4
+
5
+ - File naming: `YYYY-MM-DD-<feature-slug>.md`
6
+ - Source template: `docs/templates/implementation-plan-template.md`
7
+ - Approval gate: Tech Lead -> Fullstack
@@ -0,0 +1,41 @@
1
+ ---
2
+ artifact_type: qa_report
3
+ version: 1
4
+ status: approved
5
+ feature_id: FEATURE-001
6
+ feature_slug: task-intake-dashboard
7
+ source_plan: docs/plans/2026-03-20-task-intake-dashboard.md
8
+ owner: QAAgent
9
+ approval_gate: qa_to_done
10
+ ---
11
+
12
+ # QA Report: Task Intake Dashboard
13
+
14
+ ## Overall Status
15
+ - PASS
16
+
17
+ ## Spec Compliance
18
+
19
+ | Acceptance Criteria | Result | Notes |
20
+ | --- | --- | --- |
21
+ | Dashboard shows title, queue, status, and owner | PASS | Covered by spec and architecture artifacts |
22
+ | Empty state is shown when no tasks exist | PASS | Covered by spec |
23
+ | Filters narrow the visible list | PASS | Covered by spec |
24
+
25
+ ## Quality Checks
26
+
27
+ - Artifact frontmatter matches template expectations.
28
+ - Workflow handoffs are present for each stage.
29
+
30
+ ## Test Evidence
31
+
32
+ - No repo-native application test command exists yet.
33
+ - Validation performed via artifact and workflow review.
34
+
35
+ ## Issues
36
+
37
+ No open blocking issues.
38
+
39
+ ## Conclusion
40
+
41
+ PASS - Golden path artifact chain is internally consistent.
@@ -0,0 +1,7 @@
1
+ # QA Reports
2
+
3
+ This directory stores QA validation reports produced by the QA agent.
4
+
5
+ - File naming: `YYYY-MM-DD-<feature-slug>.md`
6
+ - Source template: `docs/templates/qa-report-template.md`
7
+ - Approval gate: QA -> Done
@@ -0,0 +1,50 @@
1
+ ---
2
+ artifact_type: specification
3
+ version: 1
4
+ status: approved
5
+ feature_id: FEATURE-001
6
+ feature_slug: task-intake-dashboard
7
+ source_brief: docs/briefs/2026-03-20-task-intake-dashboard.md
8
+ owner: BAAgent
9
+ approval_gate: ba_to_architect
10
+ ---
11
+
12
+ # Spec: Task Intake Dashboard
13
+
14
+ ## Summary
15
+
16
+ Operators need a simple dashboard to review incoming tasks, scan status, and identify blocked work quickly.
17
+
18
+ ## User Stories
19
+
20
+ ### US-001: Review intake list
21
+ As an operations coordinator, I want a single intake list so that I can triage work quickly.
22
+
23
+ **Acceptance Criteria**
24
+ - Given incoming tasks exist, when the dashboard loads, then each row shows title, queue, status, and owner.
25
+ - Given no incoming tasks exist, when the dashboard loads, then an empty state message is shown.
26
+
27
+ **Edge Cases**
28
+ - Empty queue
29
+ - Unknown status value normalized to a safe label
30
+
31
+ ### US-002: Filter visible tasks
32
+ As a delivery lead, I want to filter the list so that I can focus on urgent or blocked work.
33
+
34
+ **Acceptance Criteria**
35
+ - Given filters are available, when the user selects a priority or queue, then only matching tasks remain visible.
36
+
37
+ **Edge Cases**
38
+ - Filter returns zero tasks
39
+
40
+ ## Non-Functional Requirements
41
+
42
+ - Task state labels should remain explicit and readable.
43
+
44
+ ## Out of Scope
45
+
46
+ - Auto-assignment logic
47
+
48
+ ## Open Questions
49
+
50
+ - None for the golden path example
@@ -0,0 +1,462 @@
1
+ ---
2
+ artifact_type: specification
3
+ version: 1
4
+ status: draft
5
+ feature_id: FEATURE-004
6
+ feature_slug: openkit-full-delivery-multi-task-runtime
7
+ owner: BAAgent
8
+ approval_gate: ba_to_architect
9
+ ---
10
+
11
+ # OpenKit Full-Delivery Multi-Task Runtime Specification
12
+
13
+ ## Goal
14
+
15
+ Extend OpenKit from a single-active-work-item runtime into a multi-work-item runtime that supports team-like execution for `Full Delivery` work. The new runtime must let PM, BA, Architect, and Tech Lead shape a feature at the feature level, then let Tech Lead split that feature into execution tasks assigned to multiple developers and QA owners without overlap.
16
+
17
+ This specification does **not** expand the quick lane. `Quick Task` keeps the current single-item, low-overhead runtime model.
18
+
19
+ ## Problem Statement
20
+
21
+ The current OpenKit runtime centers on one file-backed active work item in `.opencode/workflow-state.json`. That model works for a single worker progressing one item through the hard-split workflow, but it breaks down once a `Full Delivery` feature needs to be executed like a real team:
22
+
23
+ - one feature may need multiple developers working in parallel on independent implementation tasks
24
+ - one or more QA owners may need to verify different completed tasks without colliding with implementation ownership
25
+ - Tech Lead needs a runtime-native way to break an approved plan into discrete task assignments
26
+ - Master Orchestrator needs to see aggregate progress without micromanaging each file-level change
27
+ - the runtime needs explicit ownership and dependency rules so work does not overlap or drift
28
+
29
+ Without a task-aware runtime, the repository can describe team roles but cannot reliably coordinate them.
30
+
31
+ ## Scope
32
+
33
+ In scope for this feature:
34
+
35
+ - introduce a multi-work-item runtime foundation
36
+ - keep per-work-item state instead of relying on one global work item snapshot only
37
+ - add a task-board model for `Full Delivery` work items only
38
+ - let Tech Lead create execution tasks from the implementation-plan stage onward
39
+ - let developers and QA claim and update task ownership through explicit runtime commands
40
+ - add validation rules that prevent overlapping ownership and invalid dependency states
41
+ - align runtime docs, workflow docs, and tests to the new model
42
+
43
+ Out of scope for this feature:
44
+
45
+ - changing the quick-lane contract
46
+ - adding a third lane or new workflow mode enum
47
+ - distributed orchestration across multiple repositories or remote services
48
+ - rich UI dashboards beyond the existing CLI/runtime-doc surface
49
+ - collaborative editing on the same execution task by multiple developers at once
50
+ - automatic scheduling or optimization-based assignment
51
+ - replacing the current workflow with a general-purpose project management system
52
+
53
+ ## Design Principles
54
+
55
+ 1. Keep the hard split intact: `Quick Task` stays simple, `Full Delivery` gets the richer coordination model.
56
+ 2. Treat execution tasks as runtime coordination units, not as replacements for the feature-level workflow.
57
+ 3. Preserve feature-level approvals, artifacts, and stage semantics.
58
+ 4. Use one primary owner per execution task to prevent overlapping implementation work.
59
+ 5. Keep QA ownership explicit and task-scoped.
60
+ 6. Add structure only where it supports real team-like coordination.
61
+ 7. Maintain file-backed explicit state; avoid hidden orchestration.
62
+
63
+ ## Runtime Model
64
+
65
+ ### 1. Work item layer
66
+
67
+ OpenKit should move from a single-active-work-item runtime to a multi-work-item runtime.
68
+
69
+ Each work item remains the top-level workflow entity. A work item still owns:
70
+
71
+ - `mode`
72
+ - `current_stage`
73
+ - `current_owner`
74
+ - `approvals`
75
+ - `artifacts`
76
+ - `issues`
77
+ - escalation metadata
78
+
79
+ For phase 1 compatibility, `.opencode/workflow-state.json` remains the external canonical runtime interface referenced by current docs, commands, and resume behavior. The new per-item files are introduced behind that interface, with the active work item mirrored into `.opencode/workflow-state.json` until a later approved migration changes the external canonical contract.
80
+
81
+ ### 2. Execution-task layer
82
+
83
+ Only `Full Delivery` work items gain an execution-task board.
84
+
85
+ An execution task is a task-level coordination object created from the implementation plan. It is not a new workflow lane and not a new top-level work item by default.
86
+
87
+ Each execution task should contain at least:
88
+
89
+ - `task_id`
90
+ - `title`
91
+ - `summary`
92
+ - `kind`
93
+ - `status`
94
+ - `primary_owner`
95
+ - `qa_owner`
96
+ - `depends_on`
97
+ - `blocked_by`
98
+ - `artifact_refs`
99
+ - `plan_refs`
100
+ - `branch_or_worktree` (optional metadata only in phase 1)
101
+ - `created_by`
102
+ - `created_at`
103
+ - `updated_at`
104
+
105
+ ## Ownership Matrix
106
+
107
+ The feature-level workflow owner and the task-level owners serve different purposes.
108
+
109
+ ### Feature-level `current_owner`
110
+
111
+ `current_owner` stays role-level and reflects who owns the active feature stage, not which developer is editing which execution task.
112
+
113
+ Examples:
114
+
115
+ - `full_plan` -> `TechLeadAgent`
116
+ - `full_implementation` -> `FullstackAgent`
117
+ - `full_qa` -> `QAAgent`
118
+
119
+ This preserves compatibility with the current workflow schema and stage ownership map.
120
+
121
+ ### Task-level owners
122
+
123
+ - `primary_owner` identifies the single developer or implementation agent currently responsible for one execution task
124
+ - `qa_owner` identifies the QA owner responsible for validating that execution task during QA handoff
125
+
126
+ ### Mutation authority
127
+
128
+ - `MasterOrchestrator` may create, activate, summarize, and route work items and may block or reroute the feature-level workflow
129
+ - `TechLeadAgent` may create execution tasks, define dependencies, assign initial owners, and restructure the task board during `full_plan`
130
+ - the task `primary_owner` may move that task through implementation states
131
+ - the task `qa_owner` may move that task through QA states and emit task-scoped findings
132
+ - only the feature-level authority for the current stage may advance the feature stage itself
133
+
134
+ Task-level ownership never overrides feature-stage ownership.
135
+
136
+ ## Mode-specific Behavior
137
+
138
+ ### Quick Task
139
+
140
+ Quick mode stays unchanged:
141
+
142
+ - no task board
143
+ - no task-level ownership model
144
+ - no multi-developer orchestration
145
+ - no QA-per-subtask coordination layer
146
+ - existing `quick_intake -> quick_plan -> quick_build -> quick_verify -> quick_done` flow remains the source of truth
147
+
148
+ This feature must not make quick mode heavier.
149
+
150
+ ### Full Delivery
151
+
152
+ Full mode gains a task board from `full_plan` onward.
153
+
154
+ #### Stage expectations
155
+
156
+ - `full_intake`, `full_brief`, `full_spec`, `full_architecture`
157
+ - no execution-task board is required yet
158
+ - work remains coordinated at the feature level
159
+
160
+ - `full_plan`
161
+ - Tech Lead creates or updates the implementation plan
162
+ - Tech Lead creates the initial execution-task board
163
+ - tasks may begin in `queued` or `ready`
164
+ - dependencies, ownership strategy, and QA expectations become explicit here
165
+ - a feature may remain in `full_plan` while the board is still being defined, but it may not enter `full_implementation` until the board exists and passes validation
166
+
167
+ - `full_implementation`
168
+ - execution-task board is the source of truth for implementation progress
169
+ - developers claim and advance execution tasks
170
+ - feature-level `current_owner` remains `FullstackAgent` while task-level implementation ownership is distributed across execution tasks
171
+
172
+ - `full_qa`
173
+ - execution-task board is also the source of truth for task-level QA progress
174
+ - QA owners claim and verify task handoffs
175
+ - feature-level `current_owner` remains `QAAgent` while task-level QA ownership is distributed across execution tasks
176
+
177
+ - `full_done`
178
+ - feature-level completion is allowed only when all required execution tasks are complete and no blocking issue remains open
179
+
180
+ ## Execution Task Lifecycle
181
+
182
+ Recommended task statuses:
183
+
184
+ - `queued`
185
+ - `ready`
186
+ - `claimed`
187
+ - `in_progress`
188
+ - `dev_done`
189
+ - `qa_ready`
190
+ - `qa_in_progress`
191
+ - `done`
192
+ - `blocked`
193
+ - `cancelled`
194
+
195
+ These statuses are task-board statuses, not replacements for feature-level workflow stages.
196
+
197
+ ### Required transition rules
198
+
199
+ - `queued -> ready`
200
+ - allowed only when dependencies are satisfied or absent
201
+ - controlled by `TechLeadAgent` or orchestration logic during planning
202
+
203
+ - `ready -> claimed`
204
+ - allowed when the task has no blocking dependency and no current primary owner
205
+
206
+ - `claimed -> in_progress`
207
+ - allowed only for the current `primary_owner`
208
+
209
+ - `in_progress -> dev_done`
210
+ - allowed only for the current `primary_owner`
211
+ - requires implementation evidence to be attached or referenced
212
+
213
+ - `dev_done -> qa_ready`
214
+ - allowed only when the task has either an assigned `qa_owner` or is explicitly ready for QA assignment
215
+ - may be performed by the task owner, `TechLeadAgent`, or orchestrating logic, but must preserve task evidence and ownership history
216
+
217
+ - `qa_ready -> qa_in_progress`
218
+ - allowed only for the assigned `qa_owner`, or for a QA claimant when the task is explicitly available for QA claim
219
+
220
+ - `qa_in_progress -> done`
221
+ - allowed only for the active `qa_owner`
222
+
223
+ - `qa_in_progress -> blocked`
224
+ - allowed for the active `qa_owner` when the task cannot be verified due to missing input, invalid environment, or unresolved upstream dependency
225
+
226
+ - `qa_in_progress -> claimed` or `in_progress`
227
+ - allowed only as a QA-fail rework transition
228
+ - must attach a task-scoped finding
229
+ - the rework target is chosen by `MasterOrchestrator` or `TechLeadAgent`, not by QA alone
230
+
231
+ - `* -> cancelled`
232
+ - allowed only for `TechLeadAgent` or `MasterOrchestrator`
233
+ - cancelled tasks are excluded from aggregate completion requirements unless a later policy introduces required-vs-optional cancellation semantics explicitly
234
+
235
+ ## Ownership Model
236
+
237
+ ### Primary ownership
238
+
239
+ Each execution task has exactly one `primary_owner` at a time.
240
+
241
+ Rules:
242
+
243
+ - no two developers may actively own the same execution task simultaneously
244
+ - if work truly needs two developers, Tech Lead must split it into multiple execution tasks with explicit dependencies
245
+ - only the current owner or the orchestrating authority may advance the task through implementation states
246
+
247
+ ### QA ownership
248
+
249
+ Each execution task may also have one `qa_owner` when it reaches QA handoff.
250
+
251
+ Rules:
252
+
253
+ - QA ownership is task-scoped
254
+ - QA does not become the implementation owner
255
+ - QA may move a task through QA-specific validation states and emit task-scoped findings
256
+ - QA findings must point back to a specific execution task unless the issue is genuinely feature-wide or systemic
257
+
258
+ ### Reassignment
259
+
260
+ The runtime must support explicit reassignment or release.
261
+
262
+ Reassignment should happen only when:
263
+
264
+ - the owner explicitly releases the task
265
+ - the orchestrator or Tech Lead reassigns it intentionally
266
+ - a stale or blocked state is resolved through an explicit runtime action
267
+
268
+ ## QA Failure And Rework Rules
269
+
270
+ When a QA owner fails an execution task:
271
+
272
+ - the task must leave `qa_in_progress`
273
+ - the task returns only to an allowed rework target state defined in the transition rules above
274
+ - the finding must be attached to the specific `task_id`
275
+ - the feature may remain in `full_qa` if the board is already in the QA phase, or it may be routed back to `full_implementation` if the aggregate feature state requires renewed implementation work
276
+
277
+ Feature-level rework decisions remain owned by `MasterOrchestrator` according to the canonical workflow rules.
278
+
279
+ ## Dependency Model
280
+
281
+ Execution tasks may depend on other execution tasks.
282
+
283
+ Rules:
284
+
285
+ - a task cannot be moved to `ready` if required dependencies are not satisfied
286
+ - a task cannot be claimed when it is blocked by unresolved dependencies
287
+ - dependency cycles must be rejected by runtime validation
288
+ - the task board should allow simple directed dependencies rather than a complex generic graph model in phase 1
289
+
290
+ ## Aggregate Feature Rules
291
+
292
+ The feature-level workflow and the task board must stay aligned.
293
+
294
+ Minimum aggregate rules:
295
+
296
+ - a `full` work item cannot enter `full_implementation` without an initialized task board
297
+ - a `full` work item in `full_implementation` must have at least one task in `ready`, `claimed`, `in_progress`, `dev_done`, `qa_ready`, or `qa_in_progress`
298
+ - a `full` work item cannot enter `full_qa` while required implementation tasks remain incomplete
299
+ - a `full` work item cannot enter `full_done` while required QA tasks remain incomplete or blocking issues remain open
300
+
301
+ Feature-level approval integration:
302
+
303
+ - `tech_lead_to_fullstack` may be granted only when the implementation plan is approved and the initial task board exists in a valid form
304
+ - `fullstack_to_qa` may be granted only when all required implementation tasks have reached a completed developer handoff state such as `dev_done` or `qa_ready`
305
+ - `qa_to_done` may be granted only when all required QA tasks are `done` and no blocking feature-level issue remains open
306
+
307
+ ## Resume Behavior For Multi-Task Full Delivery
308
+
309
+ When the active work item is a `full` item in `full_implementation` or `full_qa`, resume must restore both:
310
+
311
+ - feature-level context
312
+ - active work item id
313
+ - current feature stage
314
+ - feature-level owner
315
+ - linked artifacts and open issues relevant to the current stage
316
+
317
+ - task-level context
318
+ - tasks currently assigned to the resuming worker or agent role
319
+ - tasks currently in `claimed`, `in_progress`, `qa_ready`, `qa_in_progress`, or `blocked`
320
+ - any dependencies or blockers that prevent the worker from continuing safely
321
+
322
+ Resume priority rules:
323
+
324
+ - resume always starts from the active work item first
325
+ - the feature stage remains the primary workflow coordinate
326
+ - task-level context is then narrowed to the assigned or active execution tasks relevant to the resuming owner or role
327
+ - if multiple tasks are active for the same role, resume should present a concise task summary rather than guessing one implicit active subtask
328
+ - if no execution task is assigned to the resuming owner, resume should show the feature-stage context and the set of `ready` tasks appropriate for that role instead of inventing assignment
329
+
330
+ ## Suggested File Layout
331
+
332
+ Phase-1 target layout:
333
+
334
+ - `.opencode/work-items/index.json`
335
+ - `.opencode/work-items/<work-item-id>/state.json`
336
+ - `.opencode/work-items/<work-item-id>/tasks.json`
337
+
338
+ Recommended responsibilities:
339
+
340
+ - `index.json`
341
+ - lists known work items
342
+ - tracks which item is active in the current repo/session context
343
+ - stores lightweight summary metadata only
344
+
345
+ - `state.json`
346
+ - stores feature-level workflow state for one work item
347
+ - preserves lane/stage/approvals/artifacts/issues semantics
348
+
349
+ - `tasks.json`
350
+ - stores the execution-task board for `full` work items
351
+ - remains absent or unused for `quick` work items
352
+
353
+ ## Migration Strategy
354
+
355
+ The repository should migrate in phases, not in one breaking rewrite.
356
+
357
+ ### Phase 1 migration rules
358
+
359
+ - keep `.opencode/workflow-state.json` for compatibility during transition
360
+ - introduce the new work-item directory structure alongside the current file
361
+ - allow the current active state file to mirror the active work item while the new runtime becomes authoritative internally
362
+ - update `status`, `doctor`, `show`, and resume behavior to understand the new layout incrementally
363
+
364
+ Mirror and sync invariants:
365
+
366
+ - the active per-item `state.json` is written first
367
+ - `.opencode/workflow-state.json` is then refreshed as the compatibility mirror for the active work item
368
+ - if the mirror refresh fails, the runtime must report divergence clearly rather than silently claiming success
369
+ - `doctor` must report active-item pointer errors, missing per-item state, stale `tasks.json` on quick items, and mirror divergence across active state surfaces
370
+
371
+ The repository must not pretend that the old single-state model disappeared until code, tests, and docs all agree.
372
+
373
+ ## Command Surface Direction
374
+
375
+ Current implemented commands follow the existing CLI shape:
376
+
377
+ `node .opencode/workflow-state.js <command> ...`
378
+
379
+ ### Implemented phase-1 command surface
380
+
381
+ Work-item commands:
382
+
383
+ - `list-work-items`
384
+ - `show-work-item <work_item_id>`
385
+ - `activate-work-item <work_item_id>`
386
+ - `create-work-item <mode> <feature_id> <feature_slug> <mode_reason>`
387
+
388
+ Full-delivery task-board commands:
389
+
390
+ - `list-tasks <work_item_id>`
391
+ - `create-task <work_item_id> <task_id> <title> <kind> [branch] [worktree_path]`
392
+ - `claim-task <work_item_id> <task_id> <owner> <requested_by>`
393
+ - `release-task <work_item_id> <task_id> <requested_by>`
394
+ - `reassign-task <work_item_id> <task_id> <owner> <requested_by>`
395
+ - `assign-qa-owner <work_item_id> <task_id> <owner> <requested_by>`
396
+ - `set-task-status <work_item_id> <task_id> <status>`
397
+
398
+ Aggregate and validation commands:
399
+
400
+ - `validate-work-item-board <work_item_id>`
401
+ - existing `status`, `show`, and `doctor` should become multi-item aware
402
+
403
+ Commands such as `show-task`, `add-task-dependency`, and `summarize-work-item` remain future-facing ideas only until `.opencode/workflow-state.js` implements them. The runtime must stay additive and CLI-oriented rather than introducing a separate orchestration surface first.
404
+
405
+ ## Validation Requirements
406
+
407
+ The runtime must reject at least these invalid states:
408
+
409
+ - a quick work item with an active execution-task board
410
+ - a full work item in `full_implementation` without a task board
411
+ - more than one primary owner on the same task
412
+ - dependency cycles in a task board
413
+ - tasks marked `ready` or claimable while blocked by incomplete prerequisites
414
+ - invalid task transition edges, including `dev_done -> done` without QA and QA-fail transitions chosen by the wrong authority
415
+ - feature-level completion while required tasks or blocking issues remain open
416
+ - active-item pointer referencing a missing work item
417
+ - active compatibility mirror diverging from the active per-item state
418
+ - a quick item carrying a stale `tasks.json`
419
+
420
+ `doctor` and targeted runtime tests should be extended to cover these invariants.
421
+
422
+ ## Testing Strategy
423
+
424
+ Phase 1 should add tests for:
425
+
426
+ - work-item index and per-item state behavior
427
+ - compatibility behavior for the active-item mirror during migration
428
+ - task-board creation only for `full` work items
429
+ - task ownership and reassignment guardrails
430
+ - dependency validation and cycle rejection
431
+ - aggregate stage/task-board alignment rules
432
+ - `doctor` diagnostics for invalid multi-item and task-board states
433
+ - session-start and resume behavior when multiple work items exist
434
+ - active-item pointer and compatibility-mirror sync behavior
435
+
436
+ ## Risks
437
+
438
+ - letting the task board leak into quick mode would destroy quick-lane simplicity
439
+ - mixing feature-level stages with task-level statuses too loosely would create ambiguous ownership and broken resume logic
440
+ - allowing multiple active implementers on the same execution task would reintroduce overlap instead of preventing it
441
+ - migrating away from the current single-state runtime too abruptly would destabilize docs, commands, and tests together
442
+ - unclear sync order between per-item state and the compatibility mirror would create split-brain runtime state
443
+
444
+ ## Non-Goals For Phase 1
445
+
446
+ - advanced locking or lease expiry across distributed workers
447
+ - real-time synchronization across multiple machines
448
+ - a graphical board UI
449
+ - auto-assignment or workload balancing
450
+ - multi-collaborator execution on one task
451
+ - changing `Quick Task` into a multi-worker lane
452
+
453
+ ## Acceptance Criteria
454
+
455
+ - OpenKit can represent multiple work items in the repository runtime.
456
+ - `Full Delivery` work items can carry a task board from `full_plan` onward.
457
+ - Tech Lead can split a full-delivery feature into execution tasks with explicit dependencies.
458
+ - Each execution task has one primary owner at a time.
459
+ - QA ownership is explicit and task-scoped.
460
+ - Runtime validation blocks overlapping ownership and invalid dependency states.
461
+ - Quick mode remains unchanged in contract and runtime complexity.
462
+ - Docs, runtime commands, and tests describe the same model honestly.
@@ -0,0 +1,7 @@
1
+ # Specs
2
+
3
+ This directory stores detailed specification artifacts produced by the BA agent.
4
+
5
+ - File naming: `YYYY-MM-DD-<feature-slug>.md`
6
+ - Source template: `docs/templates/spec-template.md`
7
+ - Approval gate: BA -> Architect
@@ -0,0 +1,36 @@
1
+ # Templates
2
+
3
+ These files are source-of-truth document templates for OpenKit artifacts.
4
+
5
+ Their presence does not automatically mean the runtime can scaffold every artifact type.
6
+
7
+ Current reality:
8
+
9
+ - templates define the expected artifact shapes
10
+ - runtime scaffolding support is narrower than the full template set
11
+ - quick-mode work does not require every template-backed artifact
12
+ - template ownership stays here even though audience routing now starts from `README.md`, `docs/operator/README.md`, and `docs/maintainer/README.md`
13
+
14
+ Current template set aligns to the live artifact directories:
15
+
16
+ - quick-task card drafts for `docs/tasks/` when optional traceability is useful
17
+ - migration and full-delivery artifacts for `docs/architecture/`, `docs/plans/`, `docs/qa/`, and `docs/adr/`
18
+ - reusable migration checklists for `migration_baseline` and `migration_verify`
19
+ - a reusable migration report template for teams that want one artifact spanning baseline, strategy, execution, and verification
20
+ - full-delivery artifacts for `docs/briefs/`, `docs/specs/`, `docs/architecture/`, `docs/plans/`, `docs/qa/`, and `docs/adr/`
21
+
22
+ Use current runtime docs before assuming a template is backed by a live command.
23
+
24
+ For the current command reality, use `context/core/project-config.md`.
25
+
26
+ For navigation around related support surfaces, use:
27
+
28
+ - `docs/operator/README.md` for operator wayfinding
29
+ - `docs/maintainer/README.md` for maintainer wayfinding
30
+ - `docs/operations/README.md` for runbooks and internal-record guidance
31
+
32
+ Authority guardrail:
33
+
34
+ - templates are source-of-truth shapes for artifacts
35
+ - canonical workflow and runtime semantics still live under `context/core/` and `.opencode/`
36
+ - the new audience and support indexes route readers to those sources; they do not replace them
@@ -0,0 +1,18 @@
1
+ ---
2
+ artifact_type: adr
3
+ version: 1
4
+ status: proposed
5
+ decision_id: ADR-000
6
+ decision_slug: example-decision
7
+ owner: ArchitectAgent
8
+ ---
9
+
10
+ # ADR: <Decision Name>
11
+
12
+ ## Context
13
+
14
+ ## Decision
15
+
16
+ ## Consequences
17
+
18
+ ## Alternatives Considered
@@ -0,0 +1,31 @@
1
+ ---
2
+ artifact_type: architecture
3
+ version: 1
4
+ status: draft
5
+ feature_id: FEATURE-000
6
+ feature_slug: example-feature
7
+ source_spec: docs/specs/YYYY-MM-DD-example-feature.md
8
+ owner: ArchitectAgent
9
+ approval_gate: architect_to_tech_lead
10
+ ---
11
+
12
+ # Architecture: <Feature Name>
13
+
14
+ ## Summary
15
+
16
+ ## System Diagram
17
+
18
+ ## Components
19
+
20
+ ### <Component Name>
21
+ - Responsibility:
22
+ - Interface:
23
+ - Dependencies:
24
+
25
+ ## Data Contracts
26
+
27
+ ## Technology Choices
28
+
29
+ ## Risks and Mitigations
30
+
31
+ ## ADR References