@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
package/README.md ADDED
@@ -0,0 +1,401 @@
1
+ # OpenKit — AI Software Factory
2
+
3
+ OpenKit is a workflow kit that turns your AI coding assistant into a mode-aware software team. It combines explicit artifacts, approval gates, resumable workflow state, and a bounded full-delivery task runtime with a global OpenKit kit layered over OpenCode.
4
+
5
+ ## Audience Navigation
6
+
7
+ Use the top-level docs as routing layers before diving into detailed references:
8
+
9
+ - `README.md`: concise top-level entrypoint for the repository surface
10
+ - `docs/operator/README.md`: operator-facing index for daily use, command selection, and wayfinding
11
+ - `docs/maintainer/README.md`: maintainer-facing index for canonical docs, runtime internals, and repository upkeep
12
+
13
+ Phase-1 docs layout also routes supporting material through dedicated hubs:
14
+
15
+ - `docs/operations/README.md`: operational support split into `runbooks/` and `internal-records/`
16
+ - `docs/templates/README.md`: template inventory and artifact-shape guardrails
17
+
18
+ Phase-1 authority rule:
19
+
20
+ - the new audience directories are index layers only
21
+ - they do not relocate or replace canonical workflow, runtime, governance, or operations docs
22
+ - `context/core/workflow.md` remains the canonical live workflow-semantics document
23
+ - companion core docs under `context/core/` remain the authoritative operational references they already were
24
+
25
+ ## What Is Live Here
26
+
27
+ This repository currently contains two active surface types:
28
+
29
+ 1. **Global managed kit path**
30
+ - the `openkit` CLI now installs the kit into the OpenCode home directory
31
+ - install the CLI with `npm install -g openkit`, then use `openkit run` and `openkit doctor` as the intended operator path
32
+ - global workspace state is created per project under the OpenCode home directory instead of copying the kit into each repository
33
+
34
+ 2. **Checked-in authoring and compatibility runtime**
35
+ - this repository still carries the source-of-truth `agents/`, `commands/`, `skills/`, `hooks/`, `context/`, docs, and the legacy `.opencode/` runtime surface
36
+ - those checked-in files remain the authoring source and compatibility path while the global install model matures
37
+
38
+ Historical planning and example docs have been intentionally pruned from the working tree. If you need older rationale, use git history rather than treating removed docs as part of the live contract.
39
+
40
+ If you only need the live checked-in workflow/runtime behavior, prefer the current runtime docs and commands over older repository history.
41
+
42
+ The repository currently runs on the live `Quick Task+` successor semantics for the `quick` lane together with dedicated `Migration` and `Full Delivery` lanes. The system now supports three live modes: `quick`, `migration`, and `full`.
43
+
44
+ ## Workflow Lanes
45
+
46
+ OpenKit now uses a hard split between three lanes:
47
+
48
+ 1. **Quick Task**: For narrow, low-risk daily tasks that should move fast.
49
+ 2. **Migration**: For upgrades, framework migrations, dependency modernization, and compatibility remediation.
50
+ 3. **Full Delivery**: For feature work and higher-risk changes that benefit from the full multi-role team flow.
51
+
52
+ The Master Orchestrator chooses the lane, records the decision in workflow state, and routes the work.
53
+
54
+ Lane boundary heuristic:
55
+
56
+ - choose `Quick Task` for bounded low-risk work inside already-understood behavior
57
+ - choose `Migration` when behavior should stay the same and compatibility modernization is the main uncertainty
58
+ - choose `Full Delivery` when product behavior, requirements, or cross-boundary solution design are the main uncertainty
59
+
60
+ Concrete examples live in `context/core/workflow.md` under `Lane Decision Matrix`.
61
+ The stricter routing rubric and anti-patterns live in `context/core/lane-selection.md`.
62
+
63
+ Parallel-runtime guardrails now implemented:
64
+
65
+ - only `Full Delivery` work items can carry an execution task board
66
+ - quick and migration modes still have no task board and no task-level ownership model
67
+ - `.opencode/workflow-state.json` is now the active external compatibility mirror for the active work item, while `.opencode/work-items/` is the internal managed backing store
68
+ - safe parallel support is limited to the checked-in commands and validations; do not assume broader multi-agent safety than the runtime currently enforces
69
+
70
+ Live quick-lane guardrails:
71
+
72
+ - `Quick Task+` is the live successor semantics of the existing quick lane, not a third lane.
73
+ - Current command names remain unchanged.
74
+ - Runtime mode enums remain `quick`, `migration`, and `full`.
75
+
76
+ ## Product Boundary And Install Direction
77
+
78
+ The preferred product path is now the globally installed OpenKit kit. This repository still keeps the checked-in authoring and compatibility runtime needed to build, inspect, and validate that kit.
79
+
80
+ Preferred global path:
81
+
82
+ 1. Run `npm install -g openkit` to install the CLI once on the machine.
83
+ 2. Run `openkit run <args>` to launch `opencode --profile openkit`; on first run, OpenKit materializes the global kit into the OpenCode home directory automatically.
84
+ 3. Run `openkit doctor` to confirm the global install and current workspace are healthy.
85
+ 4. Run `openkit upgrade` to refresh the installed global kit when a newer package version is available.
86
+ 5. Run `openkit uninstall [--remove-workspaces]` when you need to remove the global kit and optionally clear workspace state.
87
+
88
+ In this worktree today:
89
+
90
+ - the global install path is implemented for the `openkit` CLI and is now the preferred user experience.
91
+ - the checked-in `.opencode/` surface remains the authoring and compatibility runtime inside this repository.
92
+ - project repositories do not need to vendor the kit just to use it; only workflow output artifacts belong in the project.
93
+
94
+ OpenKit currently exposes two related but not identical surfaces:
95
+
96
+ - the global kit surface used for installation, readiness checks, launch, upgrade, and uninstall
97
+ - the checked-in repository-local runtime surface that exists today in this worktree
98
+
99
+ On first run, `openkit run` materializes the managed global kit into the OpenCode home directory automatically.
100
+
101
+ Current boundary:
102
+
103
+ - `.opencode/opencode.json` is still the live runtime manifest in this checked-in repository runtime.
104
+ - `.opencode/workflow-state.json`, `.opencode/work-items/`, `.opencode/workflow-state.js`, `hooks/`, `agents/`, `skills/`, `commands/`, `context/`, and `docs/` remain repository-internal runtime or support surfaces.
105
+ - `registry.json` is local metadata describing repository surfaces and the global-kit compatibility contract.
106
+ - `.opencode/install-manifest.json` records the local installed profile for this repository and remains additive metadata rather than a destructive installer.
107
+ - The checked-in agents, skills, commands, hooks, docs, and workflow-state files remain the source of truth for what actually exists.
108
+
109
+ Install-direction guardrails:
110
+
111
+ - The global install path stays additive over the current repo-local surfaces rather than erasing them in one step.
112
+ - The transition remains non-destructive, with compatibility for existing repository-local runtime users and maintainers.
113
+ - When docs refer to raw `.opencode/*` files, treat them as repository/runtime internals that power the global kit rather than as proof that the global path is unsupported.
114
+
115
+ Repository-internal vs global-kit summary:
116
+
117
+ - Global-kit user path: `npm install -g openkit`, `openkit run`, `openkit doctor`, `openkit upgrade`, and `openkit uninstall`
118
+ - Global kit lives under the OpenCode home directory, not inside each project
119
+ - Repository-internal authoring surface remains: `.opencode/opencode.json`, workflow-state files, the workflow-state CLI, hooks, agents, skills, commands, context, and maintained docs
120
+ - The checked-in runtime remains useful for maintainers and compatibility testing even though end-user installation is now global-first
121
+
122
+ ## The 7-Role Team
123
+
124
+ The full-delivery lane uses 7 distinct team roles:
125
+
126
+ 1. **Master Orchestrator**: Routes work, chooses the lane, and manages feedback loops.
127
+ 2. **PM Agent**: Defines product goals and priorities.
128
+ 3. **BA Agent**: Writes detailed specifications and acceptance criteria.
129
+ 4. **Architect Agent**: Designs system architecture and technology choices.
130
+ 5. **Tech Lead Agent**: Enforces standards and creates bite-sized implementation plans.
131
+ 6. **Fullstack Agent**: Implements approved work.
132
+ 7. **QA Agent**: Validates implementation and classifies issues.
133
+
134
+ Quick tasks use the canonical `quick_*` stage chain defined in `context/core/workflow.md`, with the `QA Agent` operating in `QA Lite` mode.
135
+
136
+ Migration work uses the canonical `migration_*` stage chain defined in `context/core/workflow.md`, with validation centered on baseline evidence, compatibility checks, and staged regression rather than default TDD-first execution.
137
+
138
+ The migration lane is behavior-preserving by design: freeze invariants, decouple only the blockers that are tightly coupled to the old stack, migrate in slices, and clean up after parity is proven.
139
+
140
+ Repeatable migration support docs now include `docs/templates/migration-baseline-checklist.md` and `docs/templates/migration-verify-checklist.md`.
141
+
142
+ For teams that prefer one living artifact across the whole migration, `docs/templates/migration-report-template.md` is also available.
143
+
144
+ The runtime can now scaffold that artifact directly through `node .opencode/workflow-state.js scaffold-artifact migration_report <slug>` while in the right migration stage.
145
+
146
+ ## Workflow & Skills
147
+
148
+ Agents use a library of **Skills** (standard operating procedures) to accomplish their tasks without relying purely on LLM instinct:
149
+
150
+ - `brainstorming`: Socratic design refinement.
151
+ - `writing-specs`: Converting vague ideas into BDD acceptance criteria.
152
+ - `writing-plans`: Creating bite-sized, atomic task plans.
153
+ - `test-driven-development`: The RED-GREEN-REFACTOR iron law.
154
+ - `subagent-driven-development`: Dispatching fresh subagents for execution.
155
+ - `systematic-debugging`: A 4-phase root cause analysis process.
156
+ - `code-review`: Two-stage review (compliance, then quality).
157
+
158
+ ## Context System
159
+
160
+ Context is loaded dynamically based on the current phase, anchored by `context/navigation.md`. Critical contexts include:
161
+ - `context/core/code-quality.md`: The repo's coding standards.
162
+ - `context/core/workflow.md`: The canonical Quick Task, Migration, and Full Delivery workflow contract.
163
+ - `context/core/approval-gates.md`: Approval recording rules for stage transitions.
164
+ - `context/core/issue-routing.md`: QA issue classification and ownership routing.
165
+ - `context/core/session-resume.md`: Resume protocol for fresh sessions.
166
+
167
+ Historical planning background has been intentionally pruned from this worktree. Do not treat older git history as the live contract when repository state differs.
168
+
169
+ Current docs layout to keep straight:
170
+
171
+ - audience routing stays at `README.md`, `docs/operator/README.md`, and `docs/maintainer/README.md`
172
+ - artifact guidance stays with the owning directories such as `docs/briefs/`, `docs/specs/`, `docs/architecture/`, `docs/plans/`, `docs/qa/`, and `docs/adr/`
173
+ - operational support now routes through `docs/operations/runbooks/` and `docs/operations/internal-records/`
174
+ - the phase-1 derived install bundle is documented under `assets/install-bundle/opencode/` and does not replace the root authoring sources
175
+
176
+ ## Maintainer Startup
177
+
178
+ Use this flow when you want to inspect or resume the checked-in OpenKit runtime directly. In this worktree, that remains the concrete checked-in path.
179
+
180
+ 1. Ensure `.opencode/opencode.json` is present in the project root.
181
+ 2. Ensure `.opencode/workflow-state.json` is present as the active compatibility mirror for the current work item.
182
+ 3. Ensure `.opencode/work-items/` is present when you need task-aware full-delivery resume or work-item inspection.
183
+ 4. In the OpenCode runtime configured by this repository, `hooks/session-start` is intended to run at session start, emit an OpenKit runtime status block, print `status`, `doctor`, and `show` command hints, and load the repo-local `using-skills` meta-skill into the agent's context when that skill file exists.
184
+ 5. When workflow state is present, the session-start hook also prints a canonical resume hint that points back to `AGENTS.md`, `context/navigation.md`, `context/core/workflow.md`, `.opencode/workflow-state.json`, and `context/core/session-resume.md`, plus active work-item and task-board summary when available.
185
+ 6. Use `node .opencode/workflow-state.js status` to inspect the current runtime summary and `node .opencode/workflow-state.js doctor` to check whether key runtime files, work-item mirror alignment, and contract-alignment checks pass.
186
+
187
+ If the session-start JSON helper is unavailable, the hook degrades gracefully: runtime status still prints, but manifest-derived details and resume hints may be reduced until the helper works again.
188
+
189
+ Practical maintainer flow:
190
+
191
+ ```bash
192
+ node .opencode/workflow-state.js status
193
+ node .opencode/workflow-state.js doctor
194
+ node .opencode/workflow-state.js list-work-items
195
+ node .opencode/workflow-state.js show
196
+ node --test ".opencode/tests/*.test.js"
197
+ ```
198
+
199
+ The default manifest currently carries a starter model value inherited from the existing repo setup. Treat that as a default, not as a statement that the kit only supports one model.
200
+
201
+ ## Registry Metadata
202
+
203
+ OpenKit includes a small checked-in metadata layer for local inspection and for the global-kit compatibility contract:
204
+
205
+ - `registry.json` describes the component categories that exist in this repository today, including agents, skills, commands, artifact directories, runtime files, hooks, and anchor docs, while also declaring which metadata participates in the global-kit compatibility contract.
206
+ - `.opencode/install-manifest.json` records which local profile is active for this repository, points back to `registry.json`, and documents the current install stance as additive and non-destructive.
207
+ - `.opencode/opencode.json` remains the live repository-local manifest while also exposing pointers to both metadata files plus the active profile name and current wrapper-readiness status.
208
+
209
+ This metadata is local repository state, not a remote installer. It does not fetch, download, replace, or update components from elsewhere.
210
+
211
+ Do not collapse these roles together: the metadata helps define the global-kit compatibility surface, but the checked-in repository runtime remains the authoring and maintainer-facing runtime in this worktree.
212
+
213
+ Current checked-in profile:
214
+
215
+ - `openkit-core`: the full local OpenKit kit that matches the agents, skills, commands, docs, hooks, and runtime files currently present in this repository.
216
+
217
+ Additional non-default profile in the registry:
218
+
219
+ - `runtime-docs-surface`: a narrower local metadata profile for the checked-in runtime, hooks, command docs, artifact directories, and shared documentation surfaces. It is listed for inspection only and is not the active profile in this repository.
220
+
221
+ The install manifest is intended to make future runtime commands and diagnostics easier to implement and inspect. For now, treat it as honest local metadata only.
222
+
223
+ ## Profile And Install-Manifest Workflow
224
+
225
+ The current workflow for profile metadata is local and inspectable:
226
+
227
+ 1. `registry.json` defines the available component categories, checked-in components, and named profiles.
228
+ 2. `.opencode/opencode.json` points to the registry and install manifest, declares the repository's active profile, and remains the live manifest for the current repository-local runtime.
229
+ 3. `.opencode/install-manifest.json` records which profile is installed for this working tree, which broad component categories are present, and that installation remains additive rather than destructive.
230
+ 4. `node .opencode/workflow-state.js profiles` lists the named profiles from the registry.
231
+ 5. `node .opencode/workflow-state.js show-profile <name>` shows whether a profile is the repository default and which component categories it includes.
232
+ 6. `node .opencode/workflow-state.js sync-install-manifest <name>` updates `.opencode/install-manifest.json` so its recorded active profile matches a named local profile.
233
+
234
+ This is not a package installer. `sync-install-manifest` updates checked-in local metadata only; it does not create missing files, fetch remote assets, remove existing runtime surfaces, or switch the repository to a different command surface automatically. It also does not replace the preferred global OpenKit install path.
235
+
236
+ Practical inspection flow:
237
+
238
+ - Run `node .opencode/workflow-state.js status` to see the active profile together with the runtime summary.
239
+ - Run `node .opencode/workflow-state.js doctor` to confirm the registry and install-manifest files are present and readable.
240
+ - Run `node .opencode/workflow-state.js profiles` before changing the manifest so you only reference a checked-in profile name.
241
+ - Run `node .opencode/workflow-state.js show-profile openkit-core` to inspect the currently documented default profile.
242
+ - Run `node .opencode/workflow-state.js sync-install-manifest openkit-core` when you need the install manifest to record the intended checked-in active profile again.
243
+
244
+ ## Artifact Model
245
+
246
+ Artifacts depend on the active lane.
247
+
248
+ Quick-task artifact:
249
+
250
+ - `docs/tasks/`: lightweight quick-task cards when traceability beyond workflow state is useful
251
+
252
+ The live quick lane includes a first-class `quick_plan` stage for bounded planning. Task cards remain optional rather than mandatory. For the canonical quick-lane contract, including stage order, escalation, approvals, and artifact expectations, use `context/core/workflow.md`.
253
+
254
+ Full-delivery artifacts:
255
+
256
+ - `docs/briefs/`: PM product briefs
257
+ - `docs/specs/`: BA specs
258
+ - `docs/architecture/`: Architect design docs
259
+ - `docs/plans/`: Tech Lead implementation plans
260
+ - `docs/qa/`: QA reports
261
+ - `docs/adr/`: architecture decision records
262
+
263
+ Templates live in `docs/templates/`.
264
+
265
+ ## Usage
266
+
267
+ You can trigger workflows with the following commands:
268
+
269
+ - `/task` — Default entrypoint; Master chooses `Quick Task`, `Migration`, or `Full Delivery`
270
+ - `/quick-task` — Explicit quick lane for small, localized work
271
+ - `/migrate` — Explicit migration lane for upgrades and modernization work
272
+ - `/delivery` — Explicit full-delivery lane for feature work and higher-risk changes
273
+ - `/brainstorm` — Migration or full-delivery only; explore design or upgrade direction
274
+ - `/write-plan` — Migration or full-delivery only; convert approved context into an Implementation Plan
275
+ - `/execute-plan` — Migration or full-delivery only; start building the approved plan
276
+
277
+ You can also type your request in normal language, and the Master Orchestrator will choose the appropriate lane.
278
+
279
+ The command surface above is the current live interface. The live contract keeps `/quick-task` and adds `/migrate` as the explicit upgrade lane command.
280
+
281
+ ## Daily Operator Path
282
+
283
+ For normal day-to-day use:
284
+
285
+ - prefer `npm install -g openkit`, then `openkit run`, `openkit doctor`, `openkit upgrade`, and `openkit uninstall`
286
+ - use the lower-level checked-in runtime path below when you are maintaining or validating this repository itself
287
+
288
+ 1. Run `node .opencode/workflow-state.js status` to see whether work is already in progress.
289
+ 2. Run `node .opencode/workflow-state.js doctor` if the runtime looks off or you are entering a repo for the first time.
290
+ 3. Start with `/task` unless you already know the work must be `Quick Task`, `Migration`, or `Full Delivery`.
291
+ 4. Use `node .opencode/workflow-state.js show` when you need the current state object or linked artifact paths.
292
+ 5. Use `node .opencode/workflow-state.js validate` before trusting a resumed or manually edited workflow state.
293
+
294
+ For the step-by-step operator walkthrough, use `docs/operations/runbooks/openkit-daily-usage.md`.
295
+
296
+ This is the current checked-in operator surface for this worktree: `status`, `doctor`, `show`, `validate`, and the work-item/task-board inspection commands documented below. Treat those as bounded runtime helpers, not as evidence that arbitrary parallel execution support is safe.
297
+
298
+ ## Command Selection Matrix
299
+
300
+ | If you want to... | Use | Notes |
301
+ | --- | --- | --- |
302
+ | let the system choose the lane | `/task` | default entrypoint for most requests |
303
+ | force bounded daily work into the quick lane | `/quick-task` | only when quick-lane criteria already fit |
304
+ | start upgrade or migration work in the migration lane | `/migrate` | use when the main risk is compatibility and upgrade sequencing |
305
+ | start feature or higher-risk work in the full lane | `/delivery` | use when the work clearly needs briefs, specs, architecture, or a plan |
306
+ | refine design or upgrade direction before planning | `/brainstorm` | migration or full-delivery only; follow the brainstorming skill |
307
+ | turn approved artifacts into an implementation plan | `/write-plan` | migration or full-delivery only; points to the planning skill and templates |
308
+ | execute an approved implementation plan | `/execute-plan` | migration or full-delivery only; follow the plan and report the real validation path |
309
+
310
+ Helpful wayfinding docs:
311
+
312
+ - `docs/operator/README.md` for operator-focused routing across the live surfaces
313
+ - `docs/maintainer/README.md` for maintainer-focused routing across canonical and support docs
314
+ - `context/navigation.md` for context discovery
315
+ - `docs/briefs/README.md`, `docs/specs/README.md`, `docs/architecture/README.md`, `docs/plans/README.md`, `docs/qa/README.md`, and `docs/adr/README.md` for artifact-specific guidance
316
+ - `docs/governance/README.md` and `docs/operations/README.md` for policy and operational support, including runbooks and sparse internal-records guidance
317
+ - `docs/operations/runbooks/openkit-daily-usage.md` for the detailed day-to-day usage path in this checked-in runtime
318
+ - `docs/operations/runbooks/workflow-state-smoke-tests.md` for runtime smoke checks and command examples
319
+ - `assets/install-bundle/opencode/README.md` for the derived phase-1 managed bundle boundary
320
+
321
+ ## Operator Entry Points
322
+
323
+ Current checked-in operator entrypoints in this repository are:
324
+
325
+ - slash commands such as `/task`, `/quick-task`, `/migrate`, `/delivery`, `/brainstorm`, `/write-plan`, and `/execute-plan`
326
+ - `node .opencode/workflow-state.js status`
327
+ - `node .opencode/workflow-state.js doctor`
328
+ - `node .opencode/workflow-state.js show`
329
+ - `node .opencode/workflow-state.js validate`
330
+ - `node .opencode/workflow-state.js list-work-items`
331
+ - `node .opencode/workflow-state.js show-work-item <work_item_id>`
332
+ - `node .opencode/workflow-state.js list-tasks <work_item_id>` when the active full-delivery item uses a task board
333
+
334
+ Use those for the checked-in repository runtime, state inspection, and resume checks. Treat the `openkit` global commands as the preferred top-level operator path for everyday use.
335
+
336
+ ## Workflow-State Utility Commands
337
+
338
+ For the authoritative workflow-state command inventory, use `context/core/project-config.md`.
339
+
340
+ In this README, keep only the concise operator-facing surface:
341
+
342
+ - `node .opencode/workflow-state.js status`
343
+ - `node .opencode/workflow-state.js doctor`
344
+ - `node .opencode/workflow-state.js show`
345
+ - `node .opencode/workflow-state.js validate`
346
+ - `node .opencode/workflow-state.js list-work-items`
347
+ - `node .opencode/workflow-state.js show-work-item <work_item_id>`
348
+ - `node .opencode/workflow-state.js list-tasks <work_item_id>` when the active full-delivery item uses a task board
349
+
350
+ Use lower-level mutation commands only when you are intentionally operating the checked-in workflow state machinery, and read `context/core/project-config.md` for the maintained full command list.
351
+
352
+ Operational guidance:
353
+
354
+ - `status` prints the project root, kit metadata, state file path, active mode, stage, workflow status, owner, and work item when present.
355
+ - `doctor` reports repository runtime checks such as the registry, install manifest, compatibility mirror, active work-item pointer, task-board validity, workflow-state CLI, hooks config, session-start hook, and lightweight contract-consistency checks for declared runtime surfaces and schema alignment.
356
+ - `profiles` lists the local registry profiles known to this repository and marks the repository default with `*`.
357
+ - `show-profile <name>` prints the profile name, whether it is the repository default, and the component categories referenced by that profile.
358
+ - `sync-install-manifest <name>` rewrites `.opencode/install-manifest.json` so its recorded active profile matches the named registry profile.
359
+ - `list-work-items` shows managed work items and marks the active one.
360
+ - `show-work-item <work_item_id>` prints the selected work item's mode, stage, and status.
361
+ - `list-tasks <work_item_id>` shows the task board for a full-delivery work item.
362
+ - `validate-work-item-board <work_item_id>` checks that a full-delivery task board is present and structurally valid.
363
+ - task commands only apply to full-delivery work items with an execution task board; quick and migration modes intentionally stay task-board free.
364
+ - `scaffold-artifact <task_card|plan|migration_report> <slug>` creates a narrow repo-native draft from a checked-in template and links it into the active workflow state when the target slot is still empty.
365
+ - `task_card` scaffolding is available only in `quick` mode and is intentionally allowed as optional traceability anywhere in the quick lane.
366
+ - `plan` scaffolding is available in `full` mode at `full_plan` and in `migration` mode at `migration_strategy`; it requires a linked architecture artifact before the draft is created.
367
+ - `migration_report` scaffolding is available in `migration` mode at `migration_baseline` or `migration_strategy` for one-file migration tracking.
368
+ - the session-start hook prints a `<openkit_runtime_status>` block with `status`, `doctor`, and `show` command hints, then prints a `<workflow_resume_hint>` block with canonical resume-reading guidance when workflow state contains resumable context.
369
+ - the same runtime surfaces may include active work-item id and task-board summaries for full-delivery work, but the hook still warns operators to confirm safety with `doctor` before relying on parallel task support.
370
+
371
+ Validation guidance in the current repository:
372
+
373
+ - `status`, `doctor`, `show`, and `validate` help inspect workflow runtime state; they are not substitutes for application build, lint, or test commands.
374
+ - work-item and task-board commands help inspect and coordinate the implemented full-delivery runtime; they are not a general-purpose distributed scheduler.
375
+ - This repository does not yet define repo-native app build/lint/test commands, so command docs and plans should name the real validation path honestly.
376
+ - When no app-native tooling exists, use the workflow-state utility where relevant and then record manual or artifact-based verification instead of inventing automation.
377
+
378
+ ## Safe Extension
379
+
380
+ When extending OpenKit, register what you add instead of leaving the metadata layer stale.
381
+
382
+ - New agent: add the file under `agents/`, add it to `.opencode/opencode.json` when it belongs in the runtime manifest, and add an `agents` entry in `registry.json`.
383
+ - New skill: add the file under `skills/`, then register it in `registry.json` so profiles and future diagnostics can see it.
384
+ - New command: add the command doc under `commands/`, update `.opencode/opencode.json` if it is part of the live command surface, and add a `commands` entry in `registry.json`.
385
+ - New operational or governance anchor doc: add it to the relevant docs directory and register it in the `docs` section of `registry.json` when it becomes part of the maintained kit surface.
386
+ - New profile: add a named profile in `registry.json` that references existing component categories; keep profile names descriptive and local to what the repository actually contains.
387
+
388
+ If an extension changes runtime behavior, profile semantics, or the long-term shape of the install-manifest/registry contract, also review `docs/governance/adr-policy.md` to decide whether the change needs an ADR rather than only a doc update.
389
+
390
+ ## Approved Direction
391
+
392
+ FEATURE-002 records the roadmap and rationale behind the contract that is already live today:
393
+
394
+ - continue refining the current quick lane after the `Quick Task+` successor semantics activation while keeping the explicit lane model coherent
395
+ - harden runtime behavior with stronger bootstrap guidance, operational discoverability, and workflow-level verification
396
+
397
+ Rely on the current workflow contract and runtime surfaces that exist in the repository today. Treat these artifacts as roadmap context, not as overrides for `context/core/workflow.md` or the implemented runtime.
398
+
399
+ ## Current Validation Reality
400
+
401
+ This repository does not yet define a repo-native build, lint, or test command for application code. Agents must not invent stack-specific commands unless the repository later adopts them and documents them in `AGENTS.md` and `context/core/project-config.md`.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: ArchitectAgent
3
+ description: "System Architect agent. Converts an approved spec into an architecture decision package that is ready for planning."
4
+ mode: subagent
5
+ ---
6
+
7
+ # Architect Agent - System Architect
8
+
9
+ You are the System Architect for OpenKit full-delivery and migration work. `context/core/workflow.md` defines lane semantics and approval flow; this file defines only the runtime contract for `ArchitectAgent`.
10
+
11
+ ## Required Inputs
12
+
13
+ - approved requirements spec at `docs/specs/YYYY-MM-DD-<feature>.md`
14
+ - handoff summary from `BAAgent`
15
+ - current workflow stage and approval context when resuming
16
+
17
+ ## Required Context Reads
18
+
19
+ - `context/core/workflow.md`
20
+ - `context/core/project-config.md`
21
+ - `context/core/code-quality.md`
22
+ - `docs/templates/architecture-template.md` when present
23
+ - `docs/templates/migration-baseline-checklist.md` when in migration mode
24
+ - the approved spec plus any existing repository files needed to understand current structure and reusable patterns
25
+ - when working in migration mode, the current system baseline, dependency versions, and compatibility constraints
26
+
27
+ ## Role-Local Responsibilities
28
+
29
+ - design to the approved requirements and acceptance criteria rather than rewriting them
30
+ - evaluate the existing repository honestly before proposing new structure, contracts, or artifacts
31
+ - make key trade-offs explicit, including why the chosen approach is the simplest adequate fit
32
+ - record only architecture decisions that the implementation and QA flow truly need
33
+ - in migration mode, capture current-state constraints, likely breakpoints, preserved invariants, and compatibility boundaries before upgrade execution starts
34
+ - in migration mode, identify where business logic is overly coupled to framework APIs and where seams or adapters are needed to migrate safely
35
+
36
+ ## Expected Output Artifact
37
+
38
+ - architecture document at `docs/architecture/YYYY-MM-DD-<feature>.md`
39
+ - start from `docs/templates/architecture-template.md` when available so planning handoff stays stable
40
+ - add ADR paths only when a decision is important enough to warrant a separate record
41
+
42
+ ## Approval-Ready Conditions
43
+
44
+ - the chosen architecture traces back to the approved spec and covers the material acceptance constraints
45
+ - component boundaries, interfaces, data shapes, and key risks are explicit enough for planning
46
+ - trade-offs and assumptions are documented with current-repository realism
47
+ - when in migration mode, the architecture distinguishes preserved behavior from allowed technical restructuring and avoids speculative rewrites
48
+ - any required ADR-worthy decisions are identified, with no speculative platform claims
49
+
50
+ ## Handoff Payload
51
+
52
+ - path to the approved architecture document
53
+ - concise summary of chosen approach, key interfaces, data model expectations, risks, and unresolved implementation sensitivities
54
+ - explicit notes on what Tech Lead must preserve in the implementation plan
55
+
56
+ ## Stop, Reject, Or Escalate Conditions
57
+
58
+ - the spec is missing approval, contradictory, or too incomplete for sound design
59
+ - the repository state does not support an assumed technology or structure and the gap changes the design materially
60
+ - a blocking requirement ambiguity still belongs with BA or PM rather than architecture
61
+ - a proposed solution would exceed the current scope or require broader product renegotiation
62
+
63
+ When a stop condition occurs, report it to `MasterOrchestrator` instead of forcing a design through unresolved requirement gaps.
@@ -0,0 +1,56 @@
1
+ ---
2
+ name: BAAgent
3
+ description: "Business Analyst agent. Converts an approved brief into a requirements spec with clear acceptance criteria and edge cases."
4
+ mode: subagent
5
+ ---
6
+
7
+ # BA Agent - Business Analyst
8
+
9
+ You are the Business Analyst for OpenKit full-delivery work. `context/core/workflow.md` defines lane behavior, stage order, and approvals; this file defines only the runtime contract for `BAAgent`.
10
+
11
+ ## Required Inputs
12
+
13
+ - approved product brief at `docs/briefs/YYYY-MM-DD-<feature>.md`
14
+ - handoff summary from `PMAgent`
15
+ - current workflow stage and approval context when resuming
16
+
17
+ ## Required Context Reads
18
+
19
+ - `context/core/workflow.md`
20
+ - `context/core/project-config.md`
21
+ - `docs/templates/spec-template.md` when present
22
+ - the approved product brief and any linked clarifications already recorded for the task
23
+
24
+ ## Role-Local Responsibilities
25
+
26
+ - translate brief-level scope into specific requirements without making architecture decisions
27
+ - decompose the feature into user stories or equivalent requirement slices that downstream roles can trace
28
+ - write binary acceptance criteria and explicit edge cases, including failure paths and invalid input handling when relevant
29
+ - surface ambiguity early; ask for clarification instead of guessing requirement intent
30
+
31
+ ## Expected Output Artifact
32
+
33
+ - requirements spec at `docs/specs/YYYY-MM-DD-<feature>.md`
34
+ - start from `docs/templates/spec-template.md` when available so architecture handoff stays stable
35
+
36
+ ## Approval-Ready Conditions
37
+
38
+ - every in-scope requirement is traceable back to the approved brief
39
+ - acceptance criteria are testable as pass/fail statements rather than open interpretation
40
+ - edge cases, exclusions, and non-functional constraints are captured when they materially affect implementation or QA
41
+ - the spec defines `what` must happen without locking in `how` it must be built
42
+
43
+ ## Handoff Payload
44
+
45
+ - path to the approved spec
46
+ - concise summary of requirement slices, acceptance criteria hotspots, edge cases, and open constraints
47
+ - explicit notes on questions Architect must honor or resolve in design
48
+
49
+ ## Stop, Reject, Or Escalate Conditions
50
+
51
+ - the brief is missing approval, contradictory, or too vague to decompose safely
52
+ - a needed decision is product-level and must return to PM or the user
53
+ - the work now requires architecture exploration before requirements can be stabilized
54
+ - required context is missing from the active workflow state or conflicts with linked artifacts
55
+
56
+ When a stop condition occurs, report it to `MasterOrchestrator` instead of filling requirement gaps by assumption.
@@ -0,0 +1,77 @@
1
+ ---
2
+ name: CodeReviewer
3
+ description: "Code reviewer subagent. Two-stage review: spec compliance first, then code quality. Dispatched by Fullstack Agent."
4
+ mode: subagent
5
+ permission:
6
+ edit:
7
+ "**": "deny"
8
+ write:
9
+ "**": "deny"
10
+ ---
11
+
12
+ # Code Reviewer — Subagent
13
+
14
+ You are the Code Reviewer subagent, dispatched by the Fullstack Agent. You perform a two-stage review: spec compliance first, code quality second.
15
+
16
+ ## Important
17
+
18
+ You are **stateless** - you do not carry context from previous sessions. The Fullstack Agent will provide all required context in the prompt.
19
+
20
+ ## Stage 1: Spec Compliance Review
21
+
22
+ Check whether the code matches the spec exactly - no more, no less:
23
+
24
+ **PASS when:**
25
+ - All acceptance criteria are implemented
26
+ - No features were added beyond what the spec requires
27
+ - Edge cases called out in the spec are handled
28
+
29
+ **FAIL when:**
30
+ - One or more acceptance criteria are missing
31
+ - The code adds behavior outside the spec (over-building)
32
+ - Edge cases are ignored
33
+
34
+ **Output format:**
35
+ ```
36
+ ## Stage 1: Spec Compliance
37
+ Status: ✅ PASS / ❌ FAIL
38
+
39
+ Issues (if FAIL):
40
+ - Missing: [acceptance criteria not implemented]
41
+ - Extra: [unnecessary feature added]
42
+ ```
43
+
44
+ ## Stage 2: Code Quality Review
45
+
46
+ Only perform this after Stage 1 passes.
47
+
48
+ Review against `context/core/code-quality.md`:
49
+
50
+ **Categories:**
51
+ - **Critical** — Block progress (security holes, data loss risk)
52
+ - **Important** — Should be fixed (naming, error handling)
53
+ - **Minor** — Can be left as-is (style preferences)
54
+
55
+ **Output format:**
56
+ ```
57
+ ## Stage 2: Code Quality
58
+ Status: ✅ APPROVED / ⚠️ ISSUES FOUND
59
+
60
+ Strengths:
61
+ - [Strengths]
62
+
63
+ Issues (Important):
64
+ - [file:line] [issue description] — [fix suggestion]
65
+
66
+ Issues (Minor):
67
+ - [...]
68
+
69
+ Overall: APPROVED / NEEDS WORK
70
+ ```
71
+
72
+ ## Principles
73
+
74
+ - **Spec compliance before code quality** — Do not review quality if spec compliance fails
75
+ - **Constructive** — Every issue should include a fix suggestion
76
+ - **Evidence-based** — Cite specific `file:line` references instead of speaking vaguely
77
+ - **No fixing** — Report issues only; do not edit the code yourself