@mstar-harness/omp 3.6.0-alpha.4

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 (280) hide show
  1. package/README.md +63 -0
  2. package/agents/architect.md +35 -0
  3. package/agents/code-reviewer.md +90 -0
  4. package/agents/frontend-dev.md +33 -0
  5. package/agents/fullstack-dev-2.md +33 -0
  6. package/agents/fullstack-dev.md +33 -0
  7. package/agents/ops-engineer.md +33 -0
  8. package/agents/product-manager.md +35 -0
  9. package/agents/project-manager.md +32 -0
  10. package/agents/prompt-engineer.md +33 -0
  11. package/agents/qa-engineer.md +35 -0
  12. package/agents/qc-specialist-2.md +62 -0
  13. package/agents/qc-specialist-3.md +62 -0
  14. package/agents/qc-specialist.md +62 -0
  15. package/agents/writing-specialist.md +35 -0
  16. package/assets/icon.png +0 -0
  17. package/assets/logo-dark.png +0 -0
  18. package/assets/logo-dark.svg +6 -0
  19. package/assets/logo.png +0 -0
  20. package/assets/logo.svg +6 -0
  21. package/commands/amazing-pr-review.md +31 -0
  22. package/commands/codebase-audit.md +40 -0
  23. package/commands/iteration-drive.md +48 -0
  24. package/commands/iteration-loop.md +99 -0
  25. package/commands/iteration-start.md +122 -0
  26. package/dist/hooks/pre/mstar-gates.js +6579 -0
  27. package/dist/tools/mstar_dispatch_validate/index.js +6291 -0
  28. package/dist/tools/mstar_iteration_gate/index.js +6321 -0
  29. package/dist/tools/mstar_lease_verify/index.js +6343 -0
  30. package/dist/tools/mstar_path_resolve/index.js +6297 -0
  31. package/dist/tools/mstar_status_validate/index.js +6402 -0
  32. package/dist/tools/mstar_worktree_check/index.js +6343 -0
  33. package/harness-agents/architect.md +35 -0
  34. package/harness-agents/code-reviewer.md +90 -0
  35. package/harness-agents/frontend-dev.md +33 -0
  36. package/harness-agents/fullstack-dev-2.md +33 -0
  37. package/harness-agents/fullstack-dev.md +33 -0
  38. package/harness-agents/ops-engineer.md +33 -0
  39. package/harness-agents/product-manager.md +35 -0
  40. package/harness-agents/project-manager.md +32 -0
  41. package/harness-agents/prompt-engineer.md +33 -0
  42. package/harness-agents/qa-engineer.md +35 -0
  43. package/harness-agents/qc-specialist-2.md +62 -0
  44. package/harness-agents/qc-specialist-3.md +62 -0
  45. package/harness-agents/qc-specialist.md +62 -0
  46. package/harness-agents/writing-specialist.md +35 -0
  47. package/harness-commands/amazing-pr-review.md +31 -0
  48. package/harness-commands/codebase-audit.md +40 -0
  49. package/harness-commands/iteration-drive.md +48 -0
  50. package/harness-commands/iteration-loop.md +99 -0
  51. package/harness-commands/iteration-start.md +122 -0
  52. package/harness-skills/grill-me/SKILL.md +10 -0
  53. package/harness-skills/mstar-artifacts/SKILL.md +66 -0
  54. package/harness-skills/mstar-artifacts/references/knowledge-and-designs.md +110 -0
  55. package/harness-skills/mstar-artifacts/references/plan-files-and-reports.md +98 -0
  56. package/harness-skills/mstar-artifacts/references/plan-quality-bar.md +99 -0
  57. package/harness-skills/mstar-artifacts/references/status-and-residuals.md +472 -0
  58. package/harness-skills/mstar-artifacts/templates/README.md +7 -0
  59. package/harness-skills/mstar-artifacts/templates/plan.main.md +54 -0
  60. package/harness-skills/mstar-artifacts/templates/status.empty.json +5 -0
  61. package/harness-skills/mstar-audit/SKILL.md +151 -0
  62. package/harness-skills/mstar-audit/references/audit-playbook.md +175 -0
  63. package/harness-skills/mstar-audit/references/codebase-audit.md +103 -0
  64. package/harness-skills/mstar-audit/references/finding-format.md +69 -0
  65. package/harness-skills/mstar-audit/references/pr-review-seat-evidence.md +28 -0
  66. package/harness-skills/mstar-audit/references/pr-review.md +475 -0
  67. package/harness-skills/mstar-audit/references/security-review.md +219 -0
  68. package/harness-skills/mstar-branch-worktree/SKILL.md +236 -0
  69. package/harness-skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +68 -0
  70. package/harness-skills/mstar-coding-behavior/SKILL.md +167 -0
  71. package/harness-skills/mstar-compound/SKILL.md +109 -0
  72. package/harness-skills/mstar-compound/assets/resolution-template.md +94 -0
  73. package/harness-skills/mstar-compound/references/category-mapping.md +37 -0
  74. package/harness-skills/mstar-compound/references/compound-workflow.md +171 -0
  75. package/harness-skills/mstar-compound/references/concepts-vocabulary.md +44 -0
  76. package/harness-skills/mstar-compound/references/schema.yaml +122 -0
  77. package/harness-skills/mstar-compound-refresh/SKILL.md +154 -0
  78. package/harness-skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +164 -0
  79. package/harness-skills/mstar-conventions/SKILL.md +215 -0
  80. package/harness-skills/mstar-conventions/references/artifact-storage-paths.md +53 -0
  81. package/harness-skills/mstar-conventions/references/effort-estimation.md +38 -0
  82. package/harness-skills/mstar-conventions/references/harness-bootstrap-and-agents-layering.md +96 -0
  83. package/harness-skills/mstar-design-md/SKILL.md +142 -0
  84. package/harness-skills/mstar-design-md/references/completeness-checklist.md +181 -0
  85. package/harness-skills/mstar-design-md/references/design-md-spec.md +508 -0
  86. package/harness-skills/mstar-design-md/references/vercel-example.md +200 -0
  87. package/harness-skills/mstar-design-md/templates/DESIGN.dark.md.template +354 -0
  88. package/harness-skills/mstar-design-md/templates/DESIGN.md.template +474 -0
  89. package/harness-skills/mstar-dispatch-gates/SKILL.md +134 -0
  90. package/harness-skills/mstar-dispatch-gates/references/leaf-executor-checklist.md +23 -0
  91. package/harness-skills/mstar-engine-legacy/SKILL.md +53 -0
  92. package/harness-skills/mstar-engine-legacy/references/anti-recursion-checklists.md +58 -0
  93. package/harness-skills/mstar-engine-legacy/references/engine-check-boilerplate.md +26 -0
  94. package/harness-skills/mstar-engine-legacy/references/lease-protocol.md +92 -0
  95. package/harness-skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +57 -0
  96. package/harness-skills/mstar-engine-legacy/references/status-field-history.md +186 -0
  97. package/harness-skills/mstar-harness-core/SKILL.md +196 -0
  98. package/harness-skills/mstar-host/SKILL.md +96 -0
  99. package/harness-skills/mstar-host/references/_shared/host-role-binding-core.md +51 -0
  100. package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
  101. package/harness-skills/mstar-host/references/codex.md +61 -0
  102. package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +170 -0
  103. package/harness-skills/mstar-host/references/cursor.md +183 -0
  104. package/harness-skills/mstar-host/references/dsh.md +507 -0
  105. package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +36 -0
  106. package/harness-skills/mstar-host/references/kimi.md +136 -0
  107. package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +32 -0
  108. package/harness-skills/mstar-host/references/omp.md +245 -0
  109. package/harness-skills/mstar-host/references/opencode.md +76 -0
  110. package/harness-skills/mstar-host/references/parallel-dispatch.md +68 -0
  111. package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +36 -0
  112. package/harness-skills/mstar-host/references/zcode.md +129 -0
  113. package/harness-skills/mstar-iteration/SKILL.md +408 -0
  114. package/harness-skills/mstar-iteration/references/autonomous-direction-lock.md +90 -0
  115. package/harness-skills/mstar-iteration/references/command-shared-invariants.md +62 -0
  116. package/harness-skills/mstar-iteration/references/iteration-artifact-boundaries.md +103 -0
  117. package/harness-skills/mstar-iteration/references/iteration-compass-template.md +142 -0
  118. package/harness-skills/mstar-iteration/references/iteration-corpus-hygiene.md +45 -0
  119. package/harness-skills/mstar-iteration/references/iteration-workspace-readme-template.md +27 -0
  120. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +205 -0
  121. package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +105 -0
  122. package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +85 -0
  123. package/harness-skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
  124. package/harness-skills/mstar-phase-gates/SKILL.md +118 -0
  125. package/harness-skills/mstar-project-governance/SKILL.md +119 -0
  126. package/harness-skills/mstar-review-qc/SKILL.md +76 -0
  127. package/harness-skills/mstar-review-qc/references/review-responsibility-boundaries.md +54 -0
  128. package/harness-skills/mstar-roles/SKILL.md +103 -0
  129. package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +65 -0
  130. package/harness-skills/mstar-roles/references/architect.md +109 -0
  131. package/harness-skills/mstar-roles/references/code-reviewer.md +118 -0
  132. package/harness-skills/mstar-roles/references/frontend-dev.md +70 -0
  133. package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +89 -0
  134. package/harness-skills/mstar-roles/references/ops-engineer.md +72 -0
  135. package/harness-skills/mstar-roles/references/product-manager.md +102 -0
  136. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +200 -0
  137. package/harness-skills/mstar-roles/references/project-manager/plan-management.md +59 -0
  138. package/harness-skills/mstar-roles/references/project-manager/qa-trigger-matrix.md +56 -0
  139. package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +99 -0
  140. package/harness-skills/mstar-roles/references/project-manager/routing-and-dev-allocation.md +99 -0
  141. package/harness-skills/mstar-roles/references/project-manager.md +310 -0
  142. package/harness-skills/mstar-roles/references/prompt-engineer.md +65 -0
  143. package/harness-skills/mstar-roles/references/qa-engineer/acceptance-gate.md +62 -0
  144. package/harness-skills/mstar-roles/references/qa-engineer.md +71 -0
  145. package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +104 -0
  146. package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +88 -0
  147. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-checklist.md +44 -0
  148. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +57 -0
  149. package/harness-skills/mstar-roles/references/qc-specialist-shared.md +120 -0
  150. package/harness-skills/mstar-roles/references/writing-specialist.md +88 -0
  151. package/harness-skills/mstar-sdd/SKILL.md +137 -0
  152. package/harness-skills/mstar-sdd/references/file-handoffs.md +85 -0
  153. package/harness-skills/mstar-sdd/references/implementer-continuation-prompt.md +44 -0
  154. package/harness-skills/mstar-sdd/references/implementer-prompt.md +56 -0
  155. package/harness-skills/mstar-sdd/references/sticky-implementer-session.md +103 -0
  156. package/harness-skills/mstar-sdd/references/task-reviewer-prompt.md +53 -0
  157. package/harness-skills/mstar-skill-authoring/SKILL.md +182 -0
  158. package/harness-skills/mstar-skill-authoring/references/regression-fixation.md +46 -0
  159. package/harness-skills/mstar-skill-authoring/references/skillsbench-authoring.md +154 -0
  160. package/harness-skills/mstar-strategy/SKILL.md +114 -0
  161. package/harness-skills/pm/SKILL.md +40 -0
  162. package/hooks/pre/mstar-gates.js +6579 -0
  163. package/package.json +45 -0
  164. package/plugin.json +49 -0
  165. package/skills/grill-me/SKILL.md +10 -0
  166. package/skills/mstar-artifacts/SKILL.md +66 -0
  167. package/skills/mstar-artifacts/references/knowledge-and-designs.md +110 -0
  168. package/skills/mstar-artifacts/references/plan-files-and-reports.md +98 -0
  169. package/skills/mstar-artifacts/references/plan-quality-bar.md +99 -0
  170. package/skills/mstar-artifacts/references/status-and-residuals.md +472 -0
  171. package/skills/mstar-artifacts/templates/README.md +7 -0
  172. package/skills/mstar-artifacts/templates/plan.main.md +54 -0
  173. package/skills/mstar-artifacts/templates/status.empty.json +5 -0
  174. package/skills/mstar-audit/SKILL.md +151 -0
  175. package/skills/mstar-audit/references/audit-playbook.md +175 -0
  176. package/skills/mstar-audit/references/codebase-audit.md +103 -0
  177. package/skills/mstar-audit/references/finding-format.md +69 -0
  178. package/skills/mstar-audit/references/pr-review-seat-evidence.md +28 -0
  179. package/skills/mstar-audit/references/pr-review.md +475 -0
  180. package/skills/mstar-audit/references/security-review.md +219 -0
  181. package/skills/mstar-branch-worktree/SKILL.md +236 -0
  182. package/skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +68 -0
  183. package/skills/mstar-coding-behavior/SKILL.md +167 -0
  184. package/skills/mstar-compound/SKILL.md +109 -0
  185. package/skills/mstar-compound/assets/resolution-template.md +94 -0
  186. package/skills/mstar-compound/references/category-mapping.md +37 -0
  187. package/skills/mstar-compound/references/compound-workflow.md +171 -0
  188. package/skills/mstar-compound/references/concepts-vocabulary.md +44 -0
  189. package/skills/mstar-compound/references/schema.yaml +122 -0
  190. package/skills/mstar-compound-refresh/SKILL.md +154 -0
  191. package/skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +164 -0
  192. package/skills/mstar-conventions/SKILL.md +215 -0
  193. package/skills/mstar-conventions/references/artifact-storage-paths.md +53 -0
  194. package/skills/mstar-conventions/references/effort-estimation.md +38 -0
  195. package/skills/mstar-conventions/references/harness-bootstrap-and-agents-layering.md +96 -0
  196. package/skills/mstar-design-md/SKILL.md +142 -0
  197. package/skills/mstar-design-md/references/completeness-checklist.md +181 -0
  198. package/skills/mstar-design-md/references/design-md-spec.md +508 -0
  199. package/skills/mstar-design-md/references/vercel-example.md +200 -0
  200. package/skills/mstar-design-md/templates/DESIGN.dark.md.template +354 -0
  201. package/skills/mstar-design-md/templates/DESIGN.md.template +474 -0
  202. package/skills/mstar-dispatch-gates/SKILL.md +134 -0
  203. package/skills/mstar-dispatch-gates/references/leaf-executor-checklist.md +23 -0
  204. package/skills/mstar-engine-legacy/SKILL.md +53 -0
  205. package/skills/mstar-engine-legacy/references/anti-recursion-checklists.md +58 -0
  206. package/skills/mstar-engine-legacy/references/engine-check-boilerplate.md +26 -0
  207. package/skills/mstar-engine-legacy/references/lease-protocol.md +92 -0
  208. package/skills/mstar-engine-legacy/references/qc-seat-n-restatements.md +57 -0
  209. package/skills/mstar-engine-legacy/references/status-field-history.md +186 -0
  210. package/skills/mstar-harness-core/SKILL.md +196 -0
  211. package/skills/mstar-host/SKILL.md +96 -0
  212. package/skills/mstar-host/references/_shared/host-role-binding-core.md +51 -0
  213. package/skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
  214. package/skills/mstar-host/references/codex.md +61 -0
  215. package/skills/mstar-host/references/cursor-plan-mode-bridge.md +170 -0
  216. package/skills/mstar-host/references/cursor.md +183 -0
  217. package/skills/mstar-host/references/dsh.md +507 -0
  218. package/skills/mstar-host/references/kimi-plan-mode-bridge.md +36 -0
  219. package/skills/mstar-host/references/kimi.md +136 -0
  220. package/skills/mstar-host/references/omp-plan-mode-bridge.md +32 -0
  221. package/skills/mstar-host/references/omp.md +245 -0
  222. package/skills/mstar-host/references/opencode.md +76 -0
  223. package/skills/mstar-host/references/parallel-dispatch.md +68 -0
  224. package/skills/mstar-host/references/zcode-plan-mode-bridge.md +36 -0
  225. package/skills/mstar-host/references/zcode.md +129 -0
  226. package/skills/mstar-iteration/SKILL.md +408 -0
  227. package/skills/mstar-iteration/references/autonomous-direction-lock.md +90 -0
  228. package/skills/mstar-iteration/references/command-shared-invariants.md +62 -0
  229. package/skills/mstar-iteration/references/iteration-artifact-boundaries.md +103 -0
  230. package/skills/mstar-iteration/references/iteration-compass-template.md +142 -0
  231. package/skills/mstar-iteration/references/iteration-corpus-hygiene.md +45 -0
  232. package/skills/mstar-iteration/references/iteration-workspace-readme-template.md +27 -0
  233. package/skills/mstar-iteration/references/phase-2-worktree-lease.md +205 -0
  234. package/skills/mstar-iteration/references/phase-3-iteration-close.md +105 -0
  235. package/skills/mstar-iteration/references/phase-4-5-pr-delivery.md +85 -0
  236. package/skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
  237. package/skills/mstar-phase-gates/SKILL.md +118 -0
  238. package/skills/mstar-project-governance/SKILL.md +119 -0
  239. package/skills/mstar-review-qc/SKILL.md +76 -0
  240. package/skills/mstar-review-qc/references/review-responsibility-boundaries.md +54 -0
  241. package/skills/mstar-roles/SKILL.md +103 -0
  242. package/skills/mstar-roles/references/_shared/leaf-executor-core.md +65 -0
  243. package/skills/mstar-roles/references/architect.md +109 -0
  244. package/skills/mstar-roles/references/code-reviewer.md +118 -0
  245. package/skills/mstar-roles/references/frontend-dev.md +70 -0
  246. package/skills/mstar-roles/references/fullstack-dev-shared.md +89 -0
  247. package/skills/mstar-roles/references/ops-engineer.md +72 -0
  248. package/skills/mstar-roles/references/product-manager.md +102 -0
  249. package/skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +200 -0
  250. package/skills/mstar-roles/references/project-manager/plan-management.md +59 -0
  251. package/skills/mstar-roles/references/project-manager/qa-trigger-matrix.md +56 -0
  252. package/skills/mstar-roles/references/project-manager/qc-and-residuals.md +99 -0
  253. package/skills/mstar-roles/references/project-manager/routing-and-dev-allocation.md +99 -0
  254. package/skills/mstar-roles/references/project-manager.md +310 -0
  255. package/skills/mstar-roles/references/prompt-engineer.md +65 -0
  256. package/skills/mstar-roles/references/qa-engineer/acceptance-gate.md +62 -0
  257. package/skills/mstar-roles/references/qa-engineer.md +71 -0
  258. package/skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +104 -0
  259. package/skills/mstar-roles/references/qc-specialist/report-template.md +88 -0
  260. package/skills/mstar-roles/references/qc-specialist/reviewer-checklist.md +44 -0
  261. package/skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +57 -0
  262. package/skills/mstar-roles/references/qc-specialist-shared.md +120 -0
  263. package/skills/mstar-roles/references/writing-specialist.md +88 -0
  264. package/skills/mstar-sdd/SKILL.md +137 -0
  265. package/skills/mstar-sdd/references/file-handoffs.md +85 -0
  266. package/skills/mstar-sdd/references/implementer-continuation-prompt.md +44 -0
  267. package/skills/mstar-sdd/references/implementer-prompt.md +56 -0
  268. package/skills/mstar-sdd/references/sticky-implementer-session.md +103 -0
  269. package/skills/mstar-sdd/references/task-reviewer-prompt.md +53 -0
  270. package/skills/mstar-skill-authoring/SKILL.md +182 -0
  271. package/skills/mstar-skill-authoring/references/regression-fixation.md +46 -0
  272. package/skills/mstar-skill-authoring/references/skillsbench-authoring.md +154 -0
  273. package/skills/mstar-strategy/SKILL.md +114 -0
  274. package/skills/pm/SKILL.md +40 -0
  275. package/tools/mstar_dispatch_validate.js +6291 -0
  276. package/tools/mstar_iteration_gate.js +6321 -0
  277. package/tools/mstar_lease_verify.js +6343 -0
  278. package/tools/mstar_path_resolve.js +6297 -0
  279. package/tools/mstar_status_validate.js +6402 -0
  280. package/tools/mstar_worktree_check.js +6343 -0
@@ -0,0 +1,136 @@
1
+ # Kimi host reference
2
+
3
+ Load when **`mstar-host`** detection resolves **kimi** (Kimi Code CLI session, `Agent` / `AgentSwarm` / `AskUserQuestion` / `EnterPlanMode` tools, or `/morning-star-harness:*` plugin commands).
4
+
5
+ Plan mode: read **`kimi-plan-mode-bridge.md`** when `EnterPlanMode` / `ExitPlanMode`, `/plan`, or `kimi --plan` is active.
6
+
7
+ Parallel PM dispatch: read **`parallel-dispatch.md`** when dispatching **N ≥ 2** concurrent `Agent` invocations.
8
+
9
+ ## Kimi-only context
10
+
11
+ - Plugin manifest: **`.kimi-plugin/plugin.json`** (plugin root is the **repo root**; paths stay `./skills/` and `./commands/`).
12
+ - Runtime skills: repo `skills/` mounted by the plugin (`"skills": "./skills/"`).
13
+ - Plugin commands: repo `commands/` → `/morning-star-harness:<name>` (e.g. `/morning-star-harness:iteration-start`).
14
+ - **`sessionStart.skill: pm`** auto-loads the PM entry shim on new sessions; `pm` → **Read next** → `mstar-harness-core` → `project-manager.md`.
15
+ - **`/skill:pm`** or **`pm` skill**: same PM entry when invoked manually.
16
+ - Install (user-scoped): in Kimi TUI `/plugins install https://github.com/btspoony/mstar-harness` then `/plugins reload` (or `/new`).
17
+ - Plugins are **user-scoped** (all projects); managed copy lives under `$KIMI_CODE_HOME/plugins/managed/` after `/plugins install`.
18
+ - Project `.agents/skills/` symlinks are **not** required when using the plugin — commands and skills come from the plugin mount.
19
+
20
+ ## Skill loading
21
+
22
+ 1. On session start: `pm` (via `sessionStart.skill`) → **Read next** loads `mstar-harness-core`, then `mstar-roles` → `project-manager.md` when PM is active.
23
+ 2. Read `mstar-host` and this Kimi reference.
24
+ 3. If Plan mode is active, read `kimi-plan-mode-bridge.md`.
25
+ 4. Load `mstar-roles` and the active role reference.
26
+ 5. Load topic skills on demand per the role reference.
27
+
28
+ Use skill names in prompts and references. Avoid absolute local paths unless maintaining this repository or skills are not installed. Skill-root resolve (plugin mount `./skills/<name>/`) → `mstar-host` § Resolve loaded skill root.
29
+
30
+ ## Tools map (default agent)
31
+
32
+ | Kimi tool | Harness use |
33
+ |-----------|-------------|
34
+ | **Agent** | Primary dispatch — delegate one subagent task (`subagent_type`: `coder` \| `explore` \| `plan`) |
35
+ | **AgentSwarm** | Parallel batch when **same** role/profile and prompts differ only by task slice; prefer **N× Agent** when roles differ |
36
+ | **AskUserQuestion** | Structured clarify (1–4 questions, 2–4 options each); prefer over free-form when choices are known |
37
+ | **EnterPlanMode** / **ExitPlanMode** | Plan mode entry/approval → **`kimi-plan-mode-bridge.md`** |
38
+ | **TodoList** | Session UX only; mirror to SSOT plan / workflow snapshot (`{WORKFLOW_DIR}/<id>/snapshot.json`) when durable |
39
+ | **Bash** | Commands, git, tests — evidence per `mstar-coding-behavior` |
40
+ | **Read** / **ReadMediaFile** | File reads |
41
+ | **Glob** / **Grep** | Search (prefer over shell find/grep) |
42
+ | **Write** / **Edit** | Edits |
43
+ | **WebSearch** / **FetchURL** | External docs / facts |
44
+ | **TaskList** / **TaskOutput** / **TaskStop** | Long-running task management when present |
45
+
46
+ OpenCode-style `question` and Cursor **Task** are **not** Kimi tools — do not assume them.
47
+
48
+ ## Role agents (C5 — hard constraint)
49
+
50
+ Kimi ships **built-in subagent types only**. Valid **`subagent_type`** values:
51
+
52
+ | `subagent_type` | Kimi profile | Harness mapping |
53
+ |-----------------|--------------|-----------------|
54
+ | `explore` | Read-only exploration | Orientation, codebase survey, Prepare explore passes |
55
+ | `plan` | Plan-mode subagent | Prepare plan-only work when host is already in plan context |
56
+ | `coder` | General implementation | **All other Morning Star roles** (`product-manager`, `fullstack-dev`, `qc-specialist`, …) |
57
+
58
+ Morning Star role ids (`project-manager`, `fullstack-dev`, `qc-specialist`, …) are **not** valid `subagent_type` values. The host cannot register custom named agents like Codex TOML or Cursor `subagent_type` role ids.
59
+
60
+ ### Role binding in prompt (C5b — required)
61
+
62
+ Role-binding contract + Assignment template → **`_shared/host-role-binding-core.md`** (C5/C5b). Kimi-specific invoke shapes, same turn:
63
+
64
+ ```text
65
+ Agent(
66
+ subagent_type: "coder",
67
+ prompt: "<full Assignment body including Act as + skill load>"
68
+ )
69
+ ```
70
+
71
+ For **`explore`** orientation:
72
+
73
+ ```text
74
+ Agent(subagent_type: "explore", prompt: "... Act as explore-only orientation; Execute as: n/a ...")
75
+ ```
76
+
77
+ For Prepare plan-only when plan subagent is appropriate:
78
+
79
+ ```text
80
+ Agent(subagent_type: "plan", prompt: "... Act as architect for plan design; load mstar-roles → architect.md ...")
81
+ ```
82
+
83
+ ## PM dispatch (`Agent` / `AgentSwarm`)
84
+
85
+ Harness **dispatch** on Kimi = **one or more `Agent` tool calls** with correct **`subagent_type`** and role-bound prompts (C5b → **`_shared/host-role-binding-core.md`**). N-parallel / 1-Assignment-1-invoke / paste-only mechanics → **`parallel-dispatch.md`**.
86
+
87
+ | Harness | Kimi |
88
+ |---------|------|
89
+ | `Execute as: <role-id>` | Role id in Assignment + **Act as** + skill load in **Agent** prompt (C5b) |
90
+ | `subagent_type` for invoke | `coder` \| `explore` \| `plan` only (see mapping) |
91
+ | Parallel batch **N** | **N `Agent`** calls in **one assistant message** when roles may differ; **`AgentSwarm`** only when same role/profile |
92
+
93
+ ### QC default
94
+
95
+ - **`Execution mode: sdd`**: **N=3** `Agent` calls (`qc-specialist`, `qc-specialist-2`, `qc-specialist-3`) — each prompt **Act as** the respective QC role, all `subagent_type: "coder"` (N rules → `parallel-dispatch.md`).
96
+ - **`inline`**: **N=1** per `parallel-dispatch.md`.
97
+
98
+ Cannot emit required **N** → **`Blocked`**.
99
+
100
+ ### SDD implement (serial)
101
+
102
+ - **`Execution mode: sdd`**: one implementer **`Agent`** per task id; task reviewer = new **`Agent`** with **Act as `code-reviewer`** (Kimi L2 review; not qc-specialist*), always via generic fallback `subagent_type: "coder"` per C5 — no sticky resume unless host adds it later. Serial rule → **`parallel-dispatch.md`** § SDD implement.
103
+ - **Never** multiple implementer Agents in one message for the same plan.
104
+
105
+ ## Clarify
106
+
107
+ - Prefer **`AskUserQuestion`** for 1–3 high-impact choices with known options.
108
+ - Fallback: one concise Markdown question after codebase exploration cannot answer it.
109
+ - `AskUserQuestion` for plan approval is wrong in Plan mode — use **`ExitPlanMode`** for plan sign-off.
110
+ - “Question asked” ≠ clarify done; blocking ambiguity → **`Blocked`** or escalation.
111
+
112
+ ## Commands and skills paths
113
+
114
+ | Surface | Path / invocation |
115
+ |---------|-------------------|
116
+ | Plugin skills | `/skill:<skill-name>` or auto-load from `skills/` via plugin |
117
+ | Plugin commands | `/morning-star-harness:iteration-start` etc. |
118
+ | Session entry | `sessionStart.skill: pm` → `mstar-harness-core` via pm **Read next** |
119
+
120
+ ## Files, shell, and approvals
121
+
122
+ - Prefer **Glob** / **Grep** for search; **Write** / **Edit** for edits.
123
+ - Respect Kimi approval prompts for destructive operations.
124
+ - Do not edit `$KIMI_CODE_HOME` credentials, managed plugin copies, or user secrets without explicit consent.
125
+
126
+ ## Git and final evidence
127
+
128
+ - Git work follows `mstar-branch-worktree` and Assignment **Working branch** / **Branch policy**.
129
+ - Completion reports cite concrete commands, artifacts, and commit lines when required.
130
+
131
+ ## Gotchas
132
+
133
+ - Plugin install copies source to managed dir — edit checkout + reinstall to pick up harness changes.
134
+ - **`AgentSwarm`** shares one template — not for mixed-role QC tri-review; use **3× Agent** instead.
135
+ - Session plan file and `TodoList` are not durable SSOT unless mirrored to `{HARNESS_DIR}`.
136
+ - No custom Kimi agent profiles for Morning Star roles — role binding is **always** prompt + skill load (C5b).
@@ -0,0 +1,32 @@
1
+ # omp Plan mode bridge
2
+
3
+ Load with **`omp.md`** when omp Plan mode is active (`/plan`, plan-yolo / plan-model flows, or read-only-with-resolve plan UX). Shared contract → **`references/_shared/plan-mode-bridge-core.md`** (dual-write SSOT rule + priority, bootstrap init, Build resume contract, bootstrap todos, implement done-gate, Phase 1 gate, shared anti-patterns). This bridge covers omp plan-UX specifics only.
4
+
5
+ ## Dual-write contract
6
+
7
+ omp session plans, composer todos, and plan-mode UI text are **session UX only**. Durable SSOT remains **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`):
8
+
9
+ | Artifact | SSOT |
10
+ |----------|------|
11
+ | Main plan | `{PLAN_DIR}/<plan-id>-<name>.md` |
12
+ | Plan registry | `{HARNESS_DIR}/status.json` (v2 root `workflows[]`) + `{WORKFLOW_DIR}/<id>/snapshot.json` (`plans[]` rows) |
13
+ | Iteration compass | `{ITERATION_DIR}/…` when in formal iteration |
14
+
15
+ Bootstrap before treating a plan as ready for Execute (read `mstar-conventions` + `mstar-artifacts`; ensure `{HARNESS_DIR}` / `{PLAN_DIR}` exist with process-artifact gitignore entries; mirror the active omp plan into the SSOT main plan path; register the root `workflows[]` entry + snapshot plan row when required by Prepare gates) → core.
16
+
17
+ **Never** use only the omp session plan / UI todo list as **Plan Path**.
18
+
19
+ ## `mstar-iteration` Phase 1 in Plan mode
20
+
21
+ When formal iteration Phase 1 runs under omp Plan UX, the shared gate → core: single SSOT draft plan path (no silent second plan file); feedback-driven in-place edits; **do not** run Review & Edit chain, commit, or create integration branch until the user leaves Plan mode / approves implementation (Build-equivalent). Recommended branch policy still applies — no silent work on `main`/`master` (`mstar-iteration` §1.2).
22
+
23
+ ## Clarify vs plan approval
24
+
25
+ - Use **`ask`** for high-impact product/tech choices while drafting.
26
+ - Plan sign-off is the host Plan resolve / approval path, not a casual chat question.
27
+ - After approval, resume as **`project-manager`**: reload `mstar-harness-core` + `omp.md`, then dispatch implementation through **`task`** (C5/C5b). Parent plan session must **not** implement product code unless the user explicitly overrides harness dispatch.
28
+
29
+ ## Gotchas
30
+
31
+ - Plan-yolo / prewalk model switches are host UX — they do not waive Morning Star gates, Assignment, or evidence rules.
32
+ - Isolated task worktrees from omp are orthogonal to Morning Star L1 lease/worktree fields; when L1 is active, still record harness **Worktree path** / leases.
@@ -0,0 +1,245 @@
1
+ # omp host reference
2
+
3
+ Load when **`mstar-host`** detection resolves **omp** (Oh My Pi / `omp` session, **`task`** tool with **`agent`** / **`tasks[]`** batch shape, **`ask`** tool, **`hub`** tool, or `/skill:pm` / `/iteration-*` from this plugin).
4
+
5
+ Plan mode: read **`omp-plan-mode-bridge.md`** when `/plan`, plan-yolo, or plan-model / read-only-with-resolve plan UX is active.
6
+
7
+ Parallel PM dispatch: read **`parallel-dispatch.md`** when dispatching **N ≥ 2** concurrent `task` invocations.
8
+
9
+ ## omp-only context
10
+
11
+ - Plugin markers: **`.omp-plugin/plugin.json`** (Morning Star host marker) and **`.claude-plugin/plugin.json`** (Claude-compatible marketplace discovery). The **npm package** (`@mstar-harness/omp`) ships its own package-root `plugin.json` + `skills/` + `commands/` + `agents/` + `hooks/` + `tools/` mirrors; the **maintainer link path** is now `<repo>/packages/omp` (built) — hooks/tools moved into the package (2026-09-03), so linking the repo root provides skills/commands/agents only, with NO runtime gates.
12
+ - Runtime skills: package `skills/` (or repo `skills/` on the link path) discovered after `omp plugin install` / `omp plugin link` (OMP extension-package sub-discovery) or Claude marketplace install.
13
+ - Plugin commands: `commands/<name>.md` → slash **`/<name>`** (e.g. `/iteration-start`). omp uses the **filename** as the command name (no `morning-star-harness:` prefix).
14
+ - Plugin agents: **`agents/*.md`** are discovered into the live **`task.agent`** list after install/link + reload. Morning Star **subagent** role ids (`product-manager`, `architect`, `fullstack-dev`, `qc-specialist`, …) are valid `agent` values **when listed** — see C5. `project-manager` is **`mode: primary`** (orchestration seat), not a typical `task` dispatch target.
15
+ - **No Kimi-style `sessionStart.skill`** — enter PM manually via **`/skill:pm`** (or the `pm` skill), then **Read next** → `mstar-harness-core` → `project-manager.md`.
16
+ - Install (user-scoped, recommended):
17
+ - `omp plugin install @mstar-harness/omp`
18
+ - or CLI: `npx @mstar-harness/cli init --target omp --scope global` (links `~/.mstar/harness`)
19
+ - Project scope: `omp plugin install @mstar-harness/omp --scope project` or `npx @mstar-harness/cli init --target omp --scope project`.
20
+ - Local maintainers: `omp plugin link /path/to/mstar-harness/packages/omp` (or the CLI-managed `~/.mstar/harness/packages/omp` checkout) — the linked package tree resolves the engine via the workspace member, so run `bun install && bun run engine:build && bun run --cwd packages/omp build` in the checkout first. Linking the repo root no longer provides the runtime gates (hooks/tools moved into the package); the npm install stays the primary path.
21
+ - After install/link: `omp plugin list` should show package **`@mstar-harness/omp`** (npm) or **`morning-star`** (root `package.json` name, link path). Reload / new session to pick up skills, commands, and agents.
22
+
23
+ ## Skill loading
24
+
25
+ 1. On entry: invoke **`pm`** via `/skill:pm` → **Read next** loads `mstar-harness-core`, then `mstar-roles` → `project-manager.md` when PM is active.
26
+ 2. Read `mstar-host` and this omp reference.
27
+ 3. If Plan mode is active, read `omp-plan-mode-bridge.md`.
28
+ 4. Load `mstar-roles` and the active role reference.
29
+ 5. Load topic skills on demand per the role reference.
30
+
31
+ Use skill names in prompts and references. Prefer `skill://<name>/…` / `/skill:<name>` over absolute local paths unless maintaining this repository. Full skill-root table (all hosts) → `mstar-host` § Resolve loaded skill root.
32
+
33
+ ## Internal URLs
34
+
35
+ omp resolves **internal URL schemes** natively (see <https://omp.sh/#urls>), so skills and shared content stay addressable wherever omp installs the plugin — prefer URLs over absolute local paths:
36
+
37
+ | Scheme | Use |
38
+ |--------|-----|
39
+ | `skill://<name>` | Load a skill's `SKILL.md` — e.g. `skill://mstar-harness-core`, `skill://mstar-host` |
40
+ | `skill://<name>/<path>` | Read a file inside a skill — e.g. `skill://mstar-host/references/omp.md` |
41
+ | `local://<name>.md` | Share context / assignments with subagents — prefer over pasting large payloads inline |
42
+ | `artifact://<id>` / `agent://<id>` | Read a subagent's output artifact / a nested child's output |
43
+ | `history://<id>` | Read-only transcript of a (sub)agent session |
44
+
45
+ `/skill:<name>` (slash command to **invoke**) and `skill://<name>` (URL the model can **`Read`**) resolve to the same skill. Put URLs in `task` assignment bodies and skill **Read next** lists so a role subagent loads the right skill regardless of install path — this is what makes cross-host skill references portable on omp.
46
+
47
+ ## Tools map (default agent)
48
+
49
+ | omp tool | Harness use |
50
+ |----------|-------------|
51
+ | **`task`** | Primary dispatch — fan out one or more subagents (`agent` = live-schema id; prefer Morning Star role id; batch via `tasks[]` + shared `context`) |
52
+ | **`ask`** | Structured clarify (options + recommended); prefer over free-form when choices are known |
53
+ | **`hub`** | Optional peer messaging / long-running process control among subagents — not a substitute for Assignment + `task` |
54
+ | **bash** | Commands, git, tests — evidence per `mstar-coding-behavior` |
55
+ | **read** / **write** / **edit** | File I/O (and host AST/edit variants when present) |
56
+ | **grep** / **glob** | Search (prefer over shell find/grep) |
57
+ | **web_search** / URL fetch tools | External docs / facts when present |
58
+
59
+ OpenCode **`question`** / **`task`+`subagent`**, Cursor **Task**+`subagent_type`, and Kimi/ZCode **Agent** / **AskUserQuestion** are **not** omp tools — do not assume them.
60
+
61
+ ### `task` shape (operational SSOT)
62
+
63
+ Prefer the live tool schema every session. Typical batch shape:
64
+
65
+ ```text
66
+ task(
67
+ context: "<shared batch context>",
68
+ tasks: [
69
+ {
70
+ name: "CamelCaseId",
71
+ agent: "<Execute as role-id>", # prefer live-schema role agent — see C5
72
+ task: "<full Assignment body including Act as + skill load>"
73
+ }
74
+ ]
75
+ )
76
+ ```
77
+
78
+ Single-task shorthand may exist depending on host version — always match the live schema. Parallel **N** Morning Star assignees ⇒ **one** `task` call with **N** `tasks[]` entries **or** **N** `task` calls in one assistant message when the host requires that shape. Count emitted dispatches = **N**.
79
+
80
+ **Envelope-first**: write `agent` + `name` as the first fields of each `tasks[]` entry, before the long `task` body — the body crowds them out and `agent` gets silently dropped (omp defaults to generic `task`, no error). SSOT → `parallel-dispatch.md` § Mandatory order.
81
+
82
+ ## Role agents (C5 — hard constraint)
83
+
84
+ **Live `task` tool schema is SSOT every session.** Exact `agent` names vary by omp version and which `agents/*.md` were discovered after plugin install/link. Read the tool's Available Agents list before dispatch — do not invent names; do not hard-code stale tables over the live list.
85
+
86
+ ### Selection order (required)
87
+
88
+ 1. **Role match first** — if Assignment `Execute as: <role-id>` appears in the live `task.agent` list, set **`agent: "<role-id>"`**. Examples commonly present after Morning Star plugin discovery: `product-manager`, `architect`, `frontend-dev`, `fullstack-dev`, `fullstack-dev-2`, `ops-engineer`, `prompt-engineer`, `qa-engineer`, `qc-specialist`, `qc-specialist-2`, `qc-specialist-3`, `writing-specialist`.
89
+ 2. **Generic built-in only as fallback** — when the role id is **absent** from the live schema, pick the closest host built-in and keep full C5b prompt binding:
90
+
91
+ | Fallback `agent` | When |
92
+ |------------------|------|
93
+ | `scout` / `explore` | Read-only orientation / codebase survey / Prepare explore |
94
+ | `reviewer` / `security-reviewer` | Optional QC assist **only if** the matching `qc-specialist*` agent is missing |
95
+ | `designer` | UI-heavy work when `frontend-dev` is missing |
96
+ | `librarian` | External library/API research assist |
97
+ | `sonic` / `quick_task` | Mechanical / low-reasoning transcription only |
98
+ | `task` (or omit if schema says omit = general worker) | Last resort general worker when no specialist fits |
99
+
100
+ 3. **Anti-pattern** — **`agent: "task"` (or omitting agent) while a matching role agent is listed** is incorrect dispatch. Prefer the specialist; generic `task` is not the Morning Star default when role agents are available.
101
+
102
+ ### Notes
103
+
104
+ - `project-manager` is the **primary** orchestration agent (`agents/project-manager.md` `mode: primary`). Do not dispatch PM-to-PM via `task` unless the live schema explicitly lists it **and** the Assignment requires it.
105
+ - Host generics (`scout`, `reviewer`, `designer`, …) remain useful for non-role orientation / assist — they do not replace a listed Morning Star role agent for role-owned deliverables.
106
+
107
+ ### Role binding in prompt (C5b — required)
108
+
109
+ omp C5/C5b SSOT is **this file** — do **not** use `_shared/host-role-binding-core.md` (that file is Kimi/ZCode only). Even when `agent` already matches the role id, still bind Morning Star process in the Assignment / `task` body (agent shell ≠ full role prompt; skill load is not automatic).
110
+
111
+ Required in every role dispatch:
112
+
113
+ 1. **`Execute as: <role-id>`** in Assignment (harness routing SSOT).
114
+ 2. **`Act as <role-id>`** (or equivalent) at the top of the `task` body.
115
+ 3. **Skill load list** — instruct the subagent to read `mstar-roles` → `references/<role-id>.md` (or shared reference + parameters) and topic skills per that reference.
116
+ 4. **`agent`** — live-schema role id per C5 above (not “always `task`”).
117
+
118
+ Paste-only Assignment **without** a `task` invoke is **not** dispatch.
119
+
120
+ Assignment / prompt template:
121
+
122
+ ```markdown
123
+ ## Assignment
124
+
125
+ **Execute as**: fullstack-dev
126
+ **Delegation**: forbidden
127
+ **Working branch**: feat/example
128
+ **Plan Path**: .mstar/plans/20260717-example.md
129
+
130
+ **IDENTITY:** You ARE `fullstack-dev`. Act as `fullstack-dev` for this task.
131
+
132
+ Load: `mstar-harness-core` → `mstar-host` → `omp.md` → `mstar-roles` → `references/fullstack-dev-shared.md` → topic skills per that reference.
133
+
134
+ <task body>
135
+ ```
136
+
137
+ omp invoke shapes, same turn:
138
+
139
+ ```text
140
+ task(
141
+ context: "Morning Star dispatch for plan 20260717-example",
142
+ tasks: [{
143
+ name: "ImplementAuth",
144
+ agent: "fullstack-dev", # live-schema role id matching Execute as
145
+ task: "<full Assignment body including Act as + skill load>"
146
+ }]
147
+ )
148
+ ```
149
+
150
+ Review & Edit / Prepare specialist chain (sequential, **N=1** each turn — re-set **`agent`** on **every** dispatch; at N=1 the count gate is trivial, so the **field** gate is the only protection):
151
+
152
+ ```text
153
+ # pass 1 — product-manager
154
+ task(
155
+ context: "Review & Edit — product scope",
156
+ tasks: [{ name: "ReviewEditProduct", agent: "product-manager",
157
+ task: "<Assignment: Execute as product-manager; Act as + skill load>" }]
158
+ )
159
+ # repeat for architect, writing-specialist, … — each a separate N=1 dispatch with agent re-set
160
+ ```
161
+
162
+ For explore-only orientation (no Morning Star role deliverable):
163
+
164
+ ```text
165
+ task(
166
+ tasks: [{
167
+ name: "ExploreAuth",
168
+ agent: "scout", # or explore if that is what the live schema lists
169
+ task: "... Act as explore-only orientation; Execute as: n/a ..."
170
+ }]
171
+ )
172
+ ```
173
+
174
+ ## PM dispatch (`task`)
175
+
176
+ Harness **dispatch** on omp = **one or more `task` tool calls** with correct **`agent`** values and role-bound assignment text (C5 + C5b in this file). N-parallel / 1-Assignment-1-invoke / paste-only mechanics → **`parallel-dispatch.md`**.
177
+
178
+ | Harness | omp |
179
+ |---------|-----|
180
+ | `Execute as: <role-id>` | **`agent: "<role-id>"`** when listed in live schema; else generic built-in + C5b |
181
+ | Role identity / skills | Assignment **Act as** + skill load in **task** body (C5b) — always |
182
+ | Parallel batch **N** | **N** `tasks[]` entries in **one** `task` call, or **N** `task` calls in **one** assistant message |
183
+
184
+ ### QC default
185
+
186
+ - **`Execution mode: sdd`**: **N=3** task entries — prefer `agent: "qc-specialist"`, `"qc-specialist-2"`, `"qc-specialist-3"` when listed; each body still **Act as** the respective QC role + QC skill load. If a seat is missing from the live schema, fall back per C5 (generic + C5b) for that seat only. N rules → `parallel-dispatch.md`.
187
+ - **`inline`**: **N=1** per `parallel-dispatch.md`.
188
+
189
+ Cannot emit required **N** → **`Blocked`**.
190
+
191
+ ### SDD implement (serial)
192
+
193
+ - **`Execution mode: sdd`**: one implementer `task` entry per task id with `agent` matching the implementer role when listed; task reviewer = new entry with `agent: "code-reviewer"` (omp L2 review; not qc-specialist*) or `agent: "reviewer"`/`"task"` as fallback + C5b — no sticky resume unless host resume/id is available and recorded. Serial rule → **`parallel-dispatch.md`** § SDD implement.
194
+ - **Never** multiple implementer entries in one message for the same plan.
195
+
196
+ ## Clarify
197
+
198
+ - Prefer **`ask`** for 1–3 high-impact choices with known options (`recommended` when there is a default).
199
+ - Fallback: one concise Markdown question after codebase exploration cannot answer it.
200
+ - Plan approval in Plan mode follows **`omp-plan-mode-bridge.md`** — do not treat a casual `ask` as plan lock.
201
+ - “Question asked” ≠ clarify done; blocking ambiguity → **`Blocked`** or escalation.
202
+
203
+ ## Commands and skills paths
204
+
205
+ | Surface | Path / invocation |
206
+ |---------|-------------------|
207
+ | Plugin skills | `/skill:<skill-name>` or auto-load from `skills/` via plugin discovery |
208
+ | Plugin commands | `/iteration-start`, `/iteration-drive`, `/iteration-loop` (filename-based) |
209
+ | Session entry | `/skill:pm` → `mstar-harness-core` via pm **Read next** |
210
+
211
+ ## In-process engine binding (omp ≥ 17.2.11)
212
+
213
+ - **Surfaces** (npm package root = plugin root; sources live in `packages/omp/src/`): `hooks/pre/mstar-gates.js` — one `tool_call` pre-hook that returns `{ block: true, reason }` (structured refusal the model sees as the tool error) or `undefined` (pass); `tools/mstar_{status_validate,dispatch_validate,lease_verify,path_resolve,iteration_gate,worktree_check}.js` — six model-callable validator tools (engine validators only, Zod params via `pi.zod`). omp discovers these by convention from the installed package root (`<pkg>/hooks/pre/` any file, `<pkg>/tools/` direct `*.js` files — the sub-directory scan only accepts `tools/<name>/index.ts`), not from `dist/`.
214
+ |- **Enforcement semantics**: block ONLY under `Enforcement: hard`. Both gates read the repo `.mstarc` `[config] enforcement`, else the harness compass frontmatter (`enforcement: hard`, active/locked iterations only); the dispatch gate ALSO honors each Assignment's own header flag (`assignmentHeaderRegion` — a body example never hardens). A hard repo setting therefore hardens flag-less dispatches (Gate 1 / dsh `resolveDispatchHard` parity). Soft-mode dispatch violations are warn-logged through the extension logger (never blocked); soft status-write violations stay a silent pass. Rollback = unset the flag (or `.mstarc` `soft`). Never global.
215
+ - **Anti-recursion scope (issue #156)**: the engine's `antiRecursionPrecheck` is **caller-scoped** — it compares the DISPATCHING agent's own role against the new Assignment's `Execute as`. omp's `tool_call` event carries no caller identity and the task entry `agent` is the spawn TARGET, which equals `Execute as` on every compliant dispatch (C5 above) — so Gate 2 does NOT run the precheck on omp (the pre-#156 wiring hard-blocked every compliant hard-mode dispatch on `self-type`, or on `empty-binding` when `agent` was omitted). The NEVER red line stays prompt-level on this host (`mstar-dispatch-gates`); dsh enforces it in-engine via Config `dispatchBinding`.
216
+ - **Engine dependency**: the npm package **bundles the engine inline** into every hook/tool bundle at build time — zero runtime package resolution, so module link can never fail on a missing package (the 2026-09-03 hotfix for the bare-import load failure). The maintainer `omp plugin link` path (now `<repo>/packages/omp`) still resolves the engine via the workspace member — run `bun install && bun run engine:build && bun run --cwd packages/omp build` in the checkout first (the member's `dist/` and the package's generated mirrors are gitignored).
217
+ - **Graceful degradation (explicit)**: module load failure → `mstar_*` tools skipped, hook absent (no blocking), `commands/*.md` shell-out fallback intact. Caveat: a partial failure is SILENT — no in-band signal that gates are off; verify with `omp -p '/extensions'`.
218
+ |- **`MSTAR_HARNESS_DIR` override / `.mstarc`**: the hook and tools discover `{HARNESS_DIR}` via `resolveHarnessDir` — a repo `.mstarc` `[config] harness_dir` (gitignored local config) first, then the probe `.mstar/` → `.agents/` → `.plans/`/`plans/`. Repos using a non-standard harness root can declare it in `.mstarc` or MUST export `MSTAR_HARNESS_DIR` (absolute path) in the omp session env — without either the status gate does not cover those roots and tools like `mstar_path_resolve` / `mstar_lease_verify` error out (parity with the opencode binding).
219
+ - **Edit-path limitation**: the status gate validates the on-disk file for `edit` events (pre-edit state) — a corrupting edit is caught by the next write or `mstar_status_validate` (known v1 limitation, parity with opencode).
220
+ - **Engine version compatibility**: the hook and tools degrade gracefully until the engine release exporting both `composeDispatchGate` and `parseCompassFrontmatter` (published 2.0.2 predates both). Missing exports never fail module load: the hook's dispatch gate needs `composeDispatchGate` — on older engines Gate 2 (task dispatch) is skipped with a one-time warning while Gate 1 (status) stays active — and `mstar_dispatch_validate` / `mstar_iteration_gate` report an explicit upgrade error instead of loading (no silent absence; CLI fallbacks: `mstar dispatch validate`, `mstar iteration gate`).
221
+ - **Reload**: edits are picked up by a new session (`?mtime` cache-buster); in-session `/reload-plugins` (omp ≥ 17.2.11) applies them without a new session.
222
+
223
+ ## Files, shell, and approvals
224
+
225
+ - Prefer host search/edit tools over shell find/sed when available.
226
+ - Respect omp approval prompts (`approval-mode`, write/yolo) for destructive operations.
227
+ - Do not edit `~/.omp/` credentials, plugin lockfiles, or user secrets without explicit consent.
228
+
229
+ ## Git and final evidence
230
+
231
+ - Git work follows `mstar-branch-worktree` and Assignment **Working branch** / **Branch policy**.
232
+ - omp may offer task isolation / worktrees (`task.isolation`, `~/.omp/wt`) — that is **host-level** task isolation **outside** the Morning Star convention; Morning Star **`Worktree path`** stays `<repoRoot>/.worktrees/` (record it + leases when L1 gates apply).
233
+ - Completion reports cite concrete commands, artifacts, and commit lines when required.
234
+
235
+ ## Gotchas
236
+
237
+ - Installed npm plugin package name is **`@mstar-harness/omp`** (git/link path: root **`morning-star`**); Morning Star display name remains **morning-star-harness**.
238
+ - Marketplace (Claude) installs and `omp plugin install` are different discovery providers — prefer one install path per machine to avoid duplicate skill listings.
239
+ - Session plan UI / todos are not durable SSOT unless mirrored to `{HARNESS_DIR}`.
240
+ - After install/link, **reload / new session** so `agents/*.md` appear in the live `task.agent` list — stale sessions may only show host generics and wrongly push you to `agent: "task"`.
241
+ - Role agent shell ≠ full role prompt: **C5b skill load remains required** even when `agent` already equals the role id.
242
+ - omp has no `sessionStart.skill`; new sessions do **not** auto-load PM — invoke `/skill:pm` manually.
243
+ - Do not confuse omp **`task.agent`** with OpenCode **`subagent`** or Cursor **`subagent_type`**.
244
+ - Do not treat Kimi/ZCode “built-ins only → always `coder`/`task`” habits as omp defaults when Morning Star role agents are listed.
245
+ - **Sequential N=1 Review-&-Edit turns are where `agent` gets dropped**: the “all N in one message” pressure is absent and the count gate passes trivially — re-verify **`agent: "<Execute as>"`** on every single dispatch; `tasks:[{task:"…"}]` with no `agent` is a silent generic fallback, not a valid role invoke.
@@ -0,0 +1,76 @@
1
+ # OpenCode host reference
2
+
3
+ Load when **`mstar-host`** detection resolves **opencode** (`question` tool, **task tool** with **subagent** parameter, or OpenCode session).
4
+
5
+ Parallel PM dispatch: **`parallel-dispatch.md`** (read in dispatch rounds).
6
+
7
+ ## Role loading
8
+
9
+ - Skill root: load by skill **name** from `@mstar-harness/opencode` (`harness-skills/<name>/` inside the package). Never `process.cwd()/skills/` — see `mstar-host` § Resolve loaded skill root.
10
+ - **PM entry**: **`/pm`** or **`pm` skill** → `project-manager` for general orchestration; host **`commands/`** for formal iteration Phase 1–5 (semantics → **`mstar-iteration`**).
11
+ - **Role shell**: `agents/<id>.md` referenced by `opencode.json` `agent.<id>` (frontmatter + role binding only).
12
+ - **Role body**: `mstar-roles` `references/<id>.md` (or shared references + parameters).
13
+ - Implementation evidence and RCA behavior: `mstar-coding-behavior`.
14
+
15
+ ## OpenCode-specific capabilities
16
+
17
+ - **Structured clarify**: prefer **`question`** tool (title, prompt, options, optional custom text). Requires `permission.question` in config (user-maintained; do not edit global config without consent).
18
+ - **Built-in subagents** (via **task tool**): **explore** (read-only), **general**; subject to `mstar-harness-core` explore boundaries.
19
+ - **Named role subagents**: Morning Star roles configured under `opencode.json` `agent.<id>` — PM must **call the task tool** with **`subagent`** set to that agent id. Assignment Markdown alone does not open subagent sessions.
20
+ - **Per-role models**: configurable per subagent in `opencode.json`.
21
+
22
+ ## PM dispatch (task tool + subagent)
23
+
24
+ Harness **dispatch** on OpenCode = **one or more `task` tool calls**, each with **`subagent: <agent-id>`** (read the tool schema every session). N-parallel / 1-Assignment-1-invoke / paste-only mechanics → **`parallel-dispatch.md`**.
25
+
26
+ | Harness | OpenCode |
27
+ |---------|----------|
28
+ | `Execute as: <role-id>` | **`subagent`** on **task tool** = same agent id |
29
+ | Parallel batch **N** | **N task tool** calls in **one assistant message** when the host allows (`parallel-dispatch.md`) |
30
+
31
+ PM workflow: finalize Assignment → **call task tool** with **subagent** + generated prompt → wait for subagent Completion Report → update plan / status.
32
+
33
+ **SDD sticky implementer:** if the task tool exposes **resume** / agent id, follow **`mstar-sdd/references/sticky-implementer-session.md`** and the active host reference. If resume is **not** available, use **micro-batch** (2–3 tasks, one invoke) or **`SDD implementer session: fresh`** per task — do not assume sticky without host support.
34
+
35
+ **SDD task reviewer:** each task review is a **new** task tool call with `subagent: "code-reviewer"` (OpenCode L2 review; not qc-specialist*) when that agent is configured, else generic built-in fallback + C5b — no sticky resume for reviewers (fresh per task).
36
+
37
+ ## Role-mention hygiene (OpenCode)
38
+
39
+ OpenCode may **auto-append** system lines when prompt text stacks multiple agent-id **prefix mentions**. Typical boilerplate (host-generated — **not** harness Assignment):
40
+
41
+ ```text
42
+ Use the above message and context to generate a prompt and call the task tool with subagent: <agent-id>
43
+ ```
44
+
45
+ (Same sentence repeated with different **subagent** values — mechanical template, not user prose.)
46
+
47
+ | Do | Don't |
48
+ |----|-------|
49
+ | Use **plain role ids** (`product-manager`) in skill / command / Assignment prose | Stack prefix-style role mentions that trigger multi-**subagent** boilerplate |
50
+ | Sequential chains: **one task tool / one subagent per dispatch turn** | Treat auto-appended **task tool + subagent** lines as authorized parallel batch |
51
+ | Real dispatch: PM **calls task tool** with explicit Assignment + **`Delegation`** rules | Confuse boilerplate with **`Delegation: allowed`** |
52
+
53
+ When documenting this in harness text, avoid embedding prefix-style role examples in the warning — that can re-trigger the host.
54
+
55
+ ## Prepare phase — serial roles still require invoke
56
+
57
+ `mstar-roles` **project-manager** may route `explore → product-manager → architect` **sequentially**. Each handoff still needs a real **task tool** call with the matching **subagent** and Assignment (**`N = 1`** per dispatch turn). Writing PRD / architecture only in the PM chat is **not** a substitute.
58
+
59
+ ## Gotchas
60
+
61
+ - `question` availability is config-dependent; if unavailable, structured Markdown clarify.
62
+ - **explore** subagent (via task tool) is orientation only — not role-owned implementation or review deliverables.
63
+ - More MCPs do not replace phase gates or evidence rules.
64
+
65
+ ## Session noise control
66
+
67
+ - Large unrelated platform injections (e.g. long ecosystem prompts): prefer on-demand / `alwaysApply: false` when not stack-relevant.
68
+ - One default channel per capability class (search, docs).
69
+
70
+ ## Standalone harness note
71
+
72
+ Bundled **`mstar-*` skills** are self-contained in this repository. User-installed host MCPs, external skills, or CLIs are **outside harness SSOT** — do not add them to `mstar-*` load order or treat them as required for gates.
73
+
74
+ ## Maintenance boundary
75
+
76
+ Runtime only — do not modify `opencode.json`, `secrets.env`, or `.secrets/*` without explicit user consent.
@@ -0,0 +1,68 @@
1
+ # Parallel dispatch (invoke-capable hosts)
2
+
3
+ Shared PM dispatch contract for **any** host that uses subagent / Task / Agent invoke (OpenCode task tool, Cursor Task, Kimi **Agent** / **AgentSwarm**, omp **`task`** with **`agent`** / **`tasks[]`**, Codex only when a callable multi-agent / Task tool is actually available). Process SSOT also in `mstar-dispatch-gates`.
4
+
5
+ If the active host has no callable invoke tool, this reference does not create delegation capability — mark dispatch **`Blocked`** and report to the user. Do not substitute PM-thread or single-session role execution unless the user explicitly overrides harness dispatch for this turn.
6
+
7
+ ## Paste-only failure
8
+
9
+ Printing `## Assignment` in the main thread **without** matching host invocations is **not** delegation; downstream work **does not start**. Parallel dispatch makes this worse (N Assignments printed, zero invokes).
10
+
11
+ ## Prerequisite vs dispatch turn
12
+
13
+ - **Prerequisite turn** (optional): `bash` / `read` / `glob` / `grep` to collect facts (`merge-base`, `Review range`, `git rev-parse`, paths). **Do not** emit **any** batch dispatch in this message unless `N = 1` and that single call *is* the dispatch.
14
+ - **Dispatch turn** (when `N ≥ 2`): the **first** message that emits **any** dispatch for the batch must contain **all `N`** invocations. If not ready for all `N`, emit **zero** dispatches — finish prep, then one message with **`N`** calls.
15
+
16
+ ## Mandatory order (dispatch turn)
17
+
18
+ 1. Finalize all `N` Assignment payloads (after any prerequisite turn). **Build each invoke entry envelope-first**: set the role-binding field (omp `agent` / Cursor `subagent_type` / OpenCode `subagent` / Kimi·ZCode `subagent_type`) + `name` *before* writing the long Assignment body.
19
+ 2. Count distinct `Execute as` sessions (`N`).
20
+ 3. Issue **`N` host invocations first** — OpenCode: **N `task` tool** calls with **subagent**; Cursor: **N `Task`** with `subagent_type` (JSON field shape → `cursor.md` § Task invoke schema); Kimi: **N `Agent`** calls (each prompt carries **Act as** + skill load; `subagent_type` ∈ {`coder`,`explore`,`plan`} only — see `kimi.md` C5/C5b); omp: **one `task` call with N `tasks[]`** (or N `task` calls) with `agent` = live-schema role id matching `Execute as` when listed (else generic built-in) + **Act as** / skill load (see `omp.md` C5/C5b); each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
21
+ 4. Optionally post a short **Status Update** after invocations (audit trail only — does not replace step 3).
22
+
23
+ ## Hard rules
24
+
25
+ - **Emit zero until batch-ready**: if `N ≥ 2` and only one invoke is possible now, **do not** send that one; complete payloads, then **`N` in one message**.
26
+ - Do not end the dispatch turn until **`N` invocations emitted**, or mark `Blocked` / `dispatch incomplete`.
27
+ - Dual-track implement: **`N = 2` ⇒ two invocations in one message** when parallel is required.
28
+ - Status Update on dispatch turns: **`Subagent invokes issued: N`** (must match Assignment count). If Assignments were written but `N = 0` → **`dispatch failed — paste-only`**; fix next message.
29
+ - **Per-item field completeness (same severity as paste-only)**: every invocation must carry the role-binding field set to **`Execute as`** — omp **`agent`** / Cursor **`subagent_type`** / OpenCode **`subagent`** / Kimi·ZCode **`subagent_type`**. A missing field (e.g. omp omitting `agent` ⇒ silent generic `task` fallback) = **dispatch incomplete** even though count = N passes. Sequential **N=1** Review-&-Edit turns are not exempt — re-set the field on **every** dispatch.
30
+
31
+ ## QC default (initial wave)
32
+
33
+ - **`Execution mode: sdd`**: **N=3** tri-review + branch review-package path → `{SDD_DIR}/review/qc1.md`…`qc3.md` + consolidated.
34
+ - **`inline` / override**: **N=1** → `{SDD_DIR}/review/qc.md`.
35
+
36
+ ## QC iteration / SDD (same rule)
37
+
38
+ Formal iteration Phase 2 uses the same SDD + tri rule — not a separate carve-out.
39
+
40
+ ## QC full tri-review(非 SDD 但显式 tri)
41
+
42
+ 当 plan 为 **`Execution mode: inline`** 或单轨,但 Assignment 仍写 **`QC mode: full tri-review`** 时:
43
+
44
+ - Launch `qc-specialist`, `qc-specialist-2`, `qc-specialist-3` in **one** dispatch turn (**N=3**).
45
+ - Post-dispatch: verify three distinct agent IDs; on mismatch → invalid dispatch.
46
+
47
+ (**SDD 默认**已在上一节;本节仅覆盖显式 tri 的非 SDD 场景。)
48
+
49
+ ## SDD implement (serial — not parallel)
50
+
51
+ - **`Execution mode: sdd`**: implementer and task reviewer dispatches are **one at a time** per task.
52
+ - **Never** multiple implementer Tasks in one message for the same plan.
53
+ - See **`mstar-sdd`**.
54
+
55
+ ## QC targeted re-review (after fixes)
56
+
57
+ - Assignment: **`QC re-review: targeted — reviewers: <role-ids>`** → **N** = listed seats only (1–3), **one** dispatch turn with **N** invocations.
58
+ - Do **not** default to three invocations after a routine fix round.
59
+ - Post-dispatch: verify only **dispatched** seats returned; PM updates same bundle `qc-consolidated.md` and durable plan summary (see `mstar-artifacts/references/plan-files-and-reports.md`).
60
+
61
+ ## Self-check before send
62
+
63
+ 1. Required assignments this turn? (`N`)
64
+ 2. Prerequisite-only message? → **zero** batch dispatches unless `N = 1`.
65
+ 3. Dispatch message contains **exactly `N`** invocation calls?
66
+ 4. **Each** invocation carries its role-binding field set to **`Execute as`** (omp `agent` / Cursor `subagent_type` / OpenCode `subagent` / Kimi·ZCode `subagent_type`)? A bare `task`/prompt item with no role field = **incomplete**, even at **N=1**.
67
+ 5. QC initial: **`Execution mode: sdd`** → **N=3**? **`inline`** → **N=1**? Targeted re-review → **N** = Assignment reviewer count?
68
+ 6. SDD implement → **serial** (never batch implementers); sticky = **resume** same implementer, not parallel
@@ -0,0 +1,36 @@
1
+ # ZCode Plan Mode × Harness Dual-Write Bridge
2
+
3
+ > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-host`** and **`references/zcode.md`**, then **`references/_shared/plan-mode-bridge-core.md`** (shared contract) + this bridge. When Plan mode is active, also read **`mstar-conventions`** and **`mstar-artifacts`**. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-conventions`. On conflict, **`mstar-harness-core`** wins.
4
+
5
+ **Shared contract** (dual-write SSOT rule + priority, bootstrap init, Build resume contract, bootstrap todos, implement done-gate, Phase 1 gate, shared anti-patterns) → **`references/_shared/plan-mode-bridge-core.md`**. This bridge covers ZCode plan-UX specifics only.
6
+
7
+ ZCode **Plan mode** (`EnterPlanMode` / `ExitPlanMode`) uses read-only exploration for design and a plan approval gate before implementation; the session todo list is a **session UX mirror** — **NEVER** cite only a session todo list path in Assignment **Plan Path**, **Context Loaded**, or Completion Report when `{PLAN_DIR}/<plan-id>-<name>.md` should exist.
8
+
9
+ ## When this applies
10
+
11
+ - ZCode **Plan mode** is active (`EnterPlanMode` succeeded).
12
+ - Morning Star plugin is installed (`.zcode-plugin/plugin.json` skills loaded) or **`/morning-star-harness:pm`** / **`pm` skill** is in use.
13
+
14
+ ## Plan mode workflow (dual-write)
15
+
16
+ | Step | ZCode session | Harness SSOT |
17
+ |------|---------------|--------------|
18
+ | Enter | `EnterPlanMode` — explore read-only | Ensure `{HARNESS_DIR}` exists; register the root `workflows[]` entry + snapshot plan row when known |
19
+ | Design | Draft plan content; surface via `ExitPlanMode` plan text | Mirror main plan to `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes |
20
+ | Clarify | `AskUserQuestion` for blocking ambiguity only | Record decisions in plan / spec when durable |
21
+ | Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; snapshot plan row updated |
22
+ | Implement | Agent mode resumes | Per-task commits, Working branch, dispatch per `mstar-dispatch-gates` |
23
+
24
+ `TodoWrite` and ZCode UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and the workflow snapshot (`{WORKFLOW_DIR}/<id>/snapshot.json` → `plans[]`) when coordination requires it.
25
+
26
+ ## ExitPlanMode gate
27
+
28
+ Host plan approval (`ExitPlanMode`) is **not** Morning Star **Done** (gate → core). Implementation still follows phase gates, per-task commits, QC, and QA per the SSOT plan.
29
+
30
+ ## `mstar-iteration` Phase 1
31
+
32
+ When iteration Phase 1 runs in Plan mode, the shared gate (single plan session, feedback-driven in-place edits, no Review & Edit / commit / integration branch until approval) → core. After approval: reload `mstar-harness-core` + **`zcode.md`**; resume as `project-manager` orchestration.
33
+
34
+ ## Enforcement
35
+
36
+ Conflict with harness invariants → **`mstar-harness-core`** wins. Full Cursor CreatePlan bridge detail lives in `cursor-plan-mode-bridge.md` when hosts differ; ZCode uses this lighter Enter/Exit bridge only.