@mstar-harness/dsh 2.1.1

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 (146) hide show
  1. package/README.i18n.yaml +7 -0
  2. package/README.md +448 -0
  3. package/README.zh.md +221 -0
  4. package/bundle/README.md +312 -0
  5. package/bundle/cordis.patch.yml +17 -0
  6. package/dist/client/index.d.ts +14 -0
  7. package/dist/client/panel/PanelView.d.ts +67 -0
  8. package/dist/client/panel/TabNav.d.ts +28 -0
  9. package/dist/client/panel/graph/event-log.d.ts +76 -0
  10. package/dist/client/panel/graph/project-graph.d.ts +499 -0
  11. package/dist/client/panel/graph/schema.d.ts +224 -0
  12. package/dist/client/panel/guards.d.ts +12 -0
  13. package/dist/client/panel/locale.d.ts +134 -0
  14. package/dist/client/panel/pages/AgentCanvasPage.d.ts +363 -0
  15. package/dist/client/panel/pages/EventLogPage.d.ts +48 -0
  16. package/dist/client/panel/pages/IterationInfoSection.d.ts +80 -0
  17. package/dist/client/panel/pages/IterationTaskPage.d.ts +37 -0
  18. package/dist/client/panel/panel-meta.d.ts +18 -0
  19. package/dist/client/panel/plan-sort.d.ts +54 -0
  20. package/dist/client/panel/sidebar.d.ts +17 -0
  21. package/dist/client/panel/state-section.d.ts +23 -0
  22. package/dist/client/panel/use-mstar-engine-status.d.ts +42 -0
  23. package/dist/client/panel/zones/Legend.d.ts +18 -0
  24. package/dist/client/panel/zones/TaskBoard.d.ts +40 -0
  25. package/dist/client.d.ts +1 -0
  26. package/dist/client.js +4486 -0
  27. package/dist/gates/_shared.d.ts +198 -0
  28. package/dist/gates/adapter.d.ts +131 -0
  29. package/dist/gates/agent-flow.d.ts +320 -0
  30. package/dist/gates/catalog.d.ts +118 -0
  31. package/dist/gates/dispatch.d.ts +152 -0
  32. package/dist/gates/seams.d.ts +152 -0
  33. package/dist/gates/skill-lint.d.ts +87 -0
  34. package/dist/gates/status.d.ts +81 -0
  35. package/dist/gates/tools.d.ts +37 -0
  36. package/dist/index.d.ts +107 -0
  37. package/dist/index.js +5748 -0
  38. package/dist/invariant.d.ts +15 -0
  39. package/dist/invariant.js +29 -0
  40. package/dist/service.d.ts +96 -0
  41. package/dist/types.d.ts +241 -0
  42. package/harness-commands/codebase-audit.md +40 -0
  43. package/harness-commands/iteration-drive.md +129 -0
  44. package/harness-commands/iteration-loop.md +139 -0
  45. package/harness-commands/iteration-start.md +179 -0
  46. package/harness-skills/grill-me/SKILL.md +10 -0
  47. package/harness-skills/mstar-audit/SKILL.md +183 -0
  48. package/harness-skills/mstar-audit/references/audit-playbook.md +130 -0
  49. package/harness-skills/mstar-audit/references/finding-format.md +65 -0
  50. package/harness-skills/mstar-branch-worktree/SKILL.md +219 -0
  51. package/harness-skills/mstar-branch-worktree/references/parallel-writable-pre-dispatch.md +68 -0
  52. package/harness-skills/mstar-coding-behavior/SKILL.md +147 -0
  53. package/harness-skills/mstar-compound/SKILL.md +105 -0
  54. package/harness-skills/mstar-compound/assets/resolution-template.md +94 -0
  55. package/harness-skills/mstar-compound/references/category-mapping.md +37 -0
  56. package/harness-skills/mstar-compound/references/compound-workflow.md +155 -0
  57. package/harness-skills/mstar-compound/references/concepts-vocabulary.md +44 -0
  58. package/harness-skills/mstar-compound/references/schema.yaml +122 -0
  59. package/harness-skills/mstar-compound-refresh/SKILL.md +140 -0
  60. package/harness-skills/mstar-compound-refresh/references/project-knowledge-bootstrap.md +164 -0
  61. package/harness-skills/mstar-design-md/SKILL.md +142 -0
  62. package/harness-skills/mstar-design-md/references/completeness-checklist.md +181 -0
  63. package/harness-skills/mstar-design-md/references/design-md-spec.md +508 -0
  64. package/harness-skills/mstar-design-md/references/vercel-example.md +200 -0
  65. package/harness-skills/mstar-design-md/templates/DESIGN.dark.md.template +354 -0
  66. package/harness-skills/mstar-design-md/templates/DESIGN.md.template +474 -0
  67. package/harness-skills/mstar-dispatch-gates/SKILL.md +128 -0
  68. package/harness-skills/mstar-dispatch-gates/references/leaf-executor-checklist.md +23 -0
  69. package/harness-skills/mstar-harness-core/SKILL.md +180 -0
  70. package/harness-skills/mstar-host/SKILL.md +78 -0
  71. package/harness-skills/mstar-host/references/_shared/host-role-binding-core.md +51 -0
  72. package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
  73. package/harness-skills/mstar-host/references/codex.md +61 -0
  74. package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +159 -0
  75. package/harness-skills/mstar-host/references/cursor.md +183 -0
  76. package/harness-skills/mstar-host/references/dsh.md +502 -0
  77. package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +36 -0
  78. package/harness-skills/mstar-host/references/kimi.md +136 -0
  79. package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +32 -0
  80. package/harness-skills/mstar-host/references/omp.md +244 -0
  81. package/harness-skills/mstar-host/references/opencode.md +76 -0
  82. package/harness-skills/mstar-host/references/parallel-dispatch.md +68 -0
  83. package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +36 -0
  84. package/harness-skills/mstar-host/references/zcode.md +129 -0
  85. package/harness-skills/mstar-iteration/SKILL.md +393 -0
  86. package/harness-skills/mstar-iteration/references/autonomous-direction-lock.md +90 -0
  87. package/harness-skills/mstar-iteration/references/iteration-artifact-boundaries.md +103 -0
  88. package/harness-skills/mstar-iteration/references/iteration-compass-template.md +142 -0
  89. package/harness-skills/mstar-iteration/references/iteration-corpus-hygiene.md +45 -0
  90. package/harness-skills/mstar-iteration/references/iteration-workspace-readme-template.md +27 -0
  91. package/harness-skills/mstar-iteration/references/phase-2-worktree-lease.md +193 -0
  92. package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +95 -0
  93. package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +84 -0
  94. package/harness-skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
  95. package/harness-skills/mstar-phase-gates/SKILL.md +112 -0
  96. package/harness-skills/mstar-plan-artifacts/SKILL.md +46 -0
  97. package/harness-skills/mstar-plan-artifacts/references/done-compaction.md +88 -0
  98. package/harness-skills/mstar-plan-artifacts/references/knowledge-and-designs.md +100 -0
  99. package/harness-skills/mstar-plan-artifacts/references/plan-files-and-reports.md +99 -0
  100. package/harness-skills/mstar-plan-artifacts/references/plan-quality-bar.md +99 -0
  101. package/harness-skills/mstar-plan-artifacts/references/status-and-residuals.md +570 -0
  102. package/harness-skills/mstar-plan-artifacts/templates/README.md +9 -0
  103. package/harness-skills/mstar-plan-artifacts/templates/notes.empty.json +5 -0
  104. package/harness-skills/mstar-plan-artifacts/templates/plan.main.md +54 -0
  105. package/harness-skills/mstar-plan-artifacts/templates/plans-done.empty.json +3 -0
  106. package/harness-skills/mstar-plan-artifacts/templates/status.empty.json +7 -0
  107. package/harness-skills/mstar-plan-conventions/SKILL.md +165 -0
  108. package/harness-skills/mstar-plan-conventions/references/artifact-storage-paths.md +50 -0
  109. package/harness-skills/mstar-plan-conventions/references/effort-estimation.md +38 -0
  110. package/harness-skills/mstar-plan-conventions/references/harness-bootstrap-and-agents-layering.md +93 -0
  111. package/harness-skills/mstar-review-qc/SKILL.md +60 -0
  112. package/harness-skills/mstar-review-qc/references/review-responsibility-boundaries.md +54 -0
  113. package/harness-skills/mstar-roles/SKILL.md +86 -0
  114. package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +46 -0
  115. package/harness-skills/mstar-roles/references/architect.md +114 -0
  116. package/harness-skills/mstar-roles/references/code-reviewer.md +109 -0
  117. package/harness-skills/mstar-roles/references/frontend-dev.md +70 -0
  118. package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +89 -0
  119. package/harness-skills/mstar-roles/references/ops-engineer.md +78 -0
  120. package/harness-skills/mstar-roles/references/product-manager.md +107 -0
  121. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +198 -0
  122. package/harness-skills/mstar-roles/references/project-manager/plan-management.md +61 -0
  123. package/harness-skills/mstar-roles/references/project-manager/qa-trigger-matrix.md +56 -0
  124. package/harness-skills/mstar-roles/references/project-manager/qc-and-residuals.md +98 -0
  125. package/harness-skills/mstar-roles/references/project-manager/routing-and-dev-allocation.md +99 -0
  126. package/harness-skills/mstar-roles/references/project-manager.md +310 -0
  127. package/harness-skills/mstar-roles/references/prompt-engineer.md +71 -0
  128. package/harness-skills/mstar-roles/references/qa-engineer/acceptance-gate.md +62 -0
  129. package/harness-skills/mstar-roles/references/qa-engineer.md +79 -0
  130. package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +95 -0
  131. package/harness-skills/mstar-roles/references/qc-specialist/report-template.md +72 -0
  132. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-checklist.md +44 -0
  133. package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +57 -0
  134. package/harness-skills/mstar-roles/references/qc-specialist-shared.md +128 -0
  135. package/harness-skills/mstar-roles/references/writing-specialist.md +59 -0
  136. package/harness-skills/mstar-sdd/SKILL.md +133 -0
  137. package/harness-skills/mstar-sdd/references/file-handoffs.md +83 -0
  138. package/harness-skills/mstar-sdd/references/implementer-continuation-prompt.md +44 -0
  139. package/harness-skills/mstar-sdd/references/implementer-prompt.md +56 -0
  140. package/harness-skills/mstar-sdd/references/sticky-implementer-session.md +103 -0
  141. package/harness-skills/mstar-sdd/references/task-reviewer-prompt.md +53 -0
  142. package/harness-skills/mstar-skill-authoring/SKILL.md +162 -0
  143. package/harness-skills/mstar-skill-authoring/references/skillsbench-authoring.md +117 -0
  144. package/harness-skills/mstar-strategy/SKILL.md +130 -0
  145. package/harness-skills/pm/SKILL.md +40 -0
  146. package/package.json +92 -0
@@ -0,0 +1,180 @@
1
+ ---
2
+ name: mstar-harness-core
3
+ description: Morning Star (启明星) harness **强制全局入口** —— 信息源优先级、最小交付循环、状态机与 Done 权限、Task category 路由(含 quick 禁豁免)、@explore 边界、长任务纪律、护栏不变量、反模式索引、Morning Star Skill 索引与宿主入口。**任何**非平凡任务开始前必须先 Read 本 skill;再按角色与任务 **按需** Read 其它 `mstar-*` 专题(勿默认通读全部)。`@project-manager` 开轮必读 + `mstar-dispatch-gates` / `mstar-phase-gates` / `mstar-plan-conventions` 等;实现/审查/QA 必读本 skill + `mstar-coding-behavior` 及角色清单(见 `mstar-roles`)。Prepare/派发/Git/residual/QC 细则在专题 skill,不在此重复。
4
+ ---
5
+
6
+ # Morning Star Harness Core(启明星核心)
7
+
8
+ 本 skill 是 harness 的**唯一全局入口与裁决层**。专题 skill 展开细节;**冲突时以本 skill 的状态机、Done 权限与索引为准**。
9
+
10
+ ## 与其它 `mstar-*` skill 的加载契约
11
+
12
+ - 凡 **`mstar-*`**(`name` ≠ `mstar-harness-core`)假定读者**已 Read 本 skill**。
13
+ - **仅读专题、未读核心** → 未完成 harness 加载。
14
+ - 各专题 SKILL.md 含 **Load order**;按 **`mstar-harness-core`** 专题 skill 索引 + 角色 load contract 按需加载,**禁止**为「保险」通读全部专题。
15
+
16
+ ## Standalone harness(`mstar-*` 自洽)
17
+
18
+ - **`mstar-*` skill 体系**在本仓库内自洽运行:正文与 load order **不得**依赖仓库外的 skills、CLI、或 MCP 服务。
19
+ - **Commands**(如 `/iteration-start`)可引用本仓库 bundled、**非 `mstar-*`** 的辅助资产(例如 `skills/grill-me/`);该引用**仅**存在于 command 层,**不**进入 `mstar-*` 专题索引或 load matrix。
20
+ - 框架/SDK/API 问题:先 Read/Grep 项目内文档与源码;不将第三方文档工具写入 `mstar-*` 必读路径。
21
+
22
+ ## 信息源优先级
23
+
24
+ 1. 当轮用户显式指令
25
+ 2. 项目 `AGENTS.md` / `CLAUDE.md`
26
+ 3. `mstar-*` skills(本 skill + 专题)
27
+ 4. `mstar-roles` 角色正文
28
+
29
+ 冲突且用户未覆盖 → **暂停升级人工**。
30
+
31
+ ## 最小交付循环
32
+
33
+ **per-plan**:`specify → clarify → plan` → `plan(locked) → tasks → implement`(多 task 默认 SDD)→ plan QC tri + **QA gate**(`mandatory` 派 QA 或 `pm-acceptance`)→ Done(`inline` 单席例外)。阶段细则 → **`mstar-phase-gates`**;QA 分级 → **`mstar-roles/references/project-manager/qa-trigger-matrix.md`**。
34
+
35
+ **迭代级**:`iteration-start → [per-plan cycle × N] → iteration-close → PR delivery → PR merge-ready loop`。细则 → **`mstar-iteration`**。
36
+
37
+ ## 加载约定(强制)
38
+
39
+ | 角色 | 始终 | 按任务追加(典型) |
40
+ |------|------|-------------------|
41
+ | **全部** | 本 skill | — |
42
+ | **`@project-manager`** | 本 skill | `mstar-dispatch-gates`、`mstar-phase-gates`、`mstar-plan-conventions`、`mstar-roles`;implement 波次 `mstar-sdd`;派 QC 前 `mstar-review-qc`;并行/审查 `mstar-branch-worktree`;plan/status/review bundle `mstar-plan-artifacts`;UI 类 plan Prepare 阶段 `mstar-design-md`(DESIGN.md 门禁);新建/大改 skill 时 `mstar-skill-authoring`;迭代管理 `mstar-iteration`(Phase 1–5);战略性工作 `mstar-strategy`;`audit` 类请求 `mstar-audit`(执行归 `@code-reviewer`)。**不**读 `mstar-coding-behavior` |
43
+ | **实现/审查/运维** | 本 skill + `mstar-coding-behavior` + 角色 ref | 有 git 写:`mstar-branch-worktree`;有 plan 路径:`mstar-plan-conventions`;**PM** 派 QC 前:`mstar-review-qc`;**`qc-specialist*`**:`mstar-roles` → `references/qc-specialist/`;`qa-engineer`:`references/qa-engineer/`;改 status/residual:`mstar-plan-artifacts`;UI:`mstar-design-md`;知识库:`mstar-compound`(PM) |
44
+ | **leaf 承接方** | 上栏 + **`mstar-dispatch-gates`**(反递归节) | — |
45
+
46
+ Routing eval(Cursor 插件内回归用,**非**运行时必读)→ `.cursor/skills/mstar-routing-eval/`。
47
+
48
+ ## 状态机
49
+
50
+ `Todo` → `InProgress` → `InReview` → `Done` | `Blocked`
51
+
52
+ - **`Done`**:仅 `@project-manager` 或 `@qa-engineer`。
53
+ - 实现类可设 **`InReview`**,不可设 **`Done`**。
54
+
55
+ `status.json` 字段与 residual → **`mstar-plan-artifacts`**。
56
+
57
+ ## Task category(路由摘要)
58
+
59
+ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
60
+
61
+ | Category | 倾向角色 |
62
+ |----------|----------|
63
+ | `visual` | `@frontend-dev`(复杂 IA 可前置 `@product-manager`) |
64
+ | `deep` | `@explore` → dev / `@architect` |
65
+ | `quick` | `@general` 或单 dev — **不豁免 Prepare** |
66
+ | `logic` | `@architect` + dev |
67
+ | `ops` | `@ops-engineer` |
68
+ | `docs` | `@product-manager` / `@architect` / `@writing-specialist` |
69
+ | `audit` | `@code-reviewer`(mstar-audit 承载;大型仓库经 Assignment `Delegation: allowed (scout/explore only, read-only)` 扇出只读 scout;read-only advisory;不进入状态机) |
70
+
71
+ **硬规则**:`quick` **从不**跳过 `specify → clarify → plan`;禁止把新 CLI/API/多模块/新测例标为 `quick`。已启用 `{HARNESS_DIR}` 时,首次 implement 前须有主 plan 路径 + `status.json` 登记(见 **`mstar-plan-conventions`**)。
72
+
73
+ ## `@explore` 边界
74
+
75
+ - 已分派角色的 Assignment:**禁止**用 `@explore` 代替实现/测试/审查/文档交付。
76
+ - 允许短窄只读辅助;`glob`/`grep`/`read` 够用时不必 `@explore`。
77
+ - PM 分派前摸底:**推荐**;分派后承接方**勿**转包。
78
+
79
+ ## 长任务纪律
80
+
81
+ 可追踪清单(plan `tasks` 或 Todo);偏离时 PM 拉回;完成前须可核对证据(实现侧自检见 **`mstar-coding-behavior`**;门禁证据见 **`mstar-phase-gates`** / **`mstar-review-qc`**)。
82
+
83
+ **Durable Roadmap Gate**:凡声明“分批 / 后续 / next plan / later / temporary workaround”的非热修任务,必须在 `{PLAN_DIR}` 主 plan、CreatePlan mirror、`status.json`/residual、或 PM Task Board 中写清后续路线(批次、依赖、owner/触发条件、完成定义)。只在对话或 Completion Report 里说“以后做”不算可追踪,不能进入 implement GO 或 Done。
84
+
85
+ ## 专题 skill 索引
86
+
87
+ | Skill | 职责 |
88
+ |-------|------|
89
+ | `mstar-harness-core` | 本文件:入口、状态机、Task category、explore、索引、护栏 |
90
+ | `mstar-phase-gates` | per-plan 双阶段门禁:Prepare/Execute、意图门禁、hotfix、可验证编辑 |
91
+ | `mstar-iteration` | 迭代管理:Phase 1–5(start / Autonomous Execute / iteration-close / PR delivery / PR merge-ready loop) |
92
+ | `mstar-dispatch-gates` | 派发、Delegation、反递归、SDD 串行、SDD 路径 plan QC 强制 tri |
93
+ | `mstar-sdd` | Subagent-driven development:file handoff、per-task review、ledger |
94
+ | `mstar-branch-worktree` | 功能分支、worktree、QC/QA 检出对齐 |
95
+ | `mstar-plan-conventions` | `{HARNESS_DIR}` 发现、初始化、Spec 分支模型摘要、产物路径 SSOT |
96
+ | `mstar-plan-artifacts` | 主 plan、review bundle / durable summaries、`status.json`、residual、knowledge、Done 归档 |
97
+ | `mstar-design-md` | DESIGN.md 设计系统规范 —— 创建/审计/维护 design tokens,三级检查清单,light/dark 双主题 |
98
+ | `mstar-review-qc` | PM:QC tri 编排、residual 留档、四层边界;leaf 执行 → `mstar-roles/references/qc-specialist/` |
99
+ | `mstar-coding-behavior` | Think / Simplicity / Surgical / Debugging / Review Feedback / Goal-Driven / Communication |
100
+ | `mstar-compound` | 知识结晶 —— 已解决问题→结构化知识文档,双轨(Bug/Knowledge),「是否值得结晶」自检清单,重叠检测,可发现性检查,CONCEPTS.md 协同 |
101
+ | `mstar-compound-refresh` | 知识维护 —— 审查/更新/合并/删除 `{KNOWLEDGE_DIR}` 文档;**项目知识 bootstrap**(无/残旧 STRATEGY.md、CONCEPTS.md、`{KNOWLEDGE_DIR}`)→ `references/project-knowledge-bootstrap.md` |
102
+ | `mstar-strategy` | `STRATEGY.md` 全局战略方向 —— 产品愿景、技术方向、决策原则 |
103
+ | `mstar-skill-authoring` | 通用 skill 撰写门控(SkillsBench 六原则):trigger 契约、紧凑 5 问 body、渐进披露、paired 证据 |
104
+ | `mstar-audit` | Read-only codebase audit → prioritized, self-contained improvement plans(`audit-playbook` 9 类别 + `finding-format` + `plan-quality-bar`) |
105
+ | `mstar-roles` | 角色正文 hub |
106
+ | `mstar-host` | 宿主适配(自动识别;`references/opencode.md` / `cursor.md` / `codex.md` / `kimi.md` / `parallel-dispatch.md`) |
107
+
108
+ ## 宿主 `mstar-host`
109
+
110
+ Read **`mstar-host`** after this skill; detect host per its table, then Read the matching reference.
111
+
112
+ | 宿主 | 要点 |
113
+ |------|------|
114
+ | OpenCode | `question`、**task tool**(**subagent** 参数)→ `references/opencode.md` |
115
+ | Cursor | Task 并行 QC;Plan 双写 → `references/cursor.md` · `cursor-plan-mode-bridge.md` |
116
+ | Codex | plugin skills、sandbox/apply_patch/tool discovery;无 invoke 工具时不声称 subagent dispatch → `references/codex.md` |
117
+ | Kimi | `Agent`/`AgentSwarm`(仅 `coder`/`explore`/`plan`);角色绑定在 prompt(C5b);Plan 双写 → `references/kimi.md` · `kimi-plan-mode-bridge.md` |
118
+ | 其它 | 同 `mstar-host` skill;按工具信号选 reference |
119
+
120
+ ## 护栏(不变量)
121
+
122
+ - 未经用户同意不改 `opencode.json`、凭据、`secrets.env`。
123
+ - 行为变更须有验证证据。
124
+ - 业务仓默认功能分支(Assignment `Branch policy` 例外)→ **`mstar-branch-worktree`**。
125
+ - **Dev 三角**:`@fullstack-dev` 后端主导;UI → `@frontend-dev`;第二轨 → `@fullstack-dev-2`(`mstar-roles` PM 节)。
126
+ - 工期仅 agent-oriented → **`mstar-plan-conventions`** · effort-estimation。
127
+ - plan-writing artifacts land in `{PLAN_DIR}`, not external default plan directories.
128
+ - PM Assignment 键名英文;任务正文可中文;产出/报告默认英文。
129
+
130
+ ## 库文档 / API 问题
131
+
132
+ 先 Read/Grep 项目内文档、规格与源码;仍不确定时再向用户澄清。**不**将第三方 MCP/CLI 文档工具写入 `mstar-*` load order。
133
+
134
+ ## 升级触发
135
+
136
+ 验收仍模糊、评审冲突、重复失败、根因不可收敛 → 升级报告(状态、方案、推荐路径)。
137
+
138
+ ## 反模式(索引)
139
+
140
+ | 反模式 | 详见 |
141
+ |--------|------|
142
+ | SDD paste-only / 跳过 task review / 并行 implementer | `mstar-sdd` · `mstar-dispatch-gates` |
143
+ | SDD plan 以单席 `qc.md` 收尾 / 跳过 plan tri | `mstar-dispatch-gates` · `mstar-review-qc` · `mstar-sdd` |
144
+ | fix 后无脑重派三审 / 用 `-rev2` 代替原位复验 | `mstar-plan-artifacts` · `mstar-review-qc` |
145
+ | 递归误派 / 误读 Handoff | `mstar-dispatch-gates` |
146
+ | `quick` 跳过 Prepare | 上表 + `mstar-phase-gates` |
147
+ | 多 worktree 未归并就 QC | `mstar-branch-worktree` |
148
+ | 因默认 gitignore 致 feature 缺 plans 而 `Worktree mode: waived`(应保留 feature worktree + control 绝对 Plan Path / SDD dir;无 flock 仅 → `Plan parallelism: serial`) | `mstar-branch-worktree` · `mstar-iteration` §2.0 #5 · `phase-2-worktree-lease` |
149
+ | 并行 writable implement 无隔离(L2 同 plan 多轨:N invoke ≠ worktree;L1 跨 plan:无 verified `execution_lease` + feature worktree) | `mstar-branch-worktree` L1/L2 · `mstar-iteration` §2.6 · `references/parallel-writable-pre-dispatch.md` |
150
+ | 跨 plan 可写派发无 verified `execution_lease` / steal 活跃 lease / 并行 merge 入 `spec_integration_branch` | `mstar-iteration` · `mstar-plan-artifacts`(leases)· `mstar-branch-worktree` L1 |
151
+ | `InProgress` 无 `execution_lease` 未恢复即可写派发 | `mstar-plan-artifacts` — orphan recovery |
152
+ | 混淆跨 plan lease 门控并行与单 plan 内 SDD 并行 implementer | `mstar-dispatch-gates` · `mstar-sdd` |
153
+ | residual 只写 plan 不写 SSOT | `mstar-plan-artifacts` |
154
+ | `zero-residual` 下把可修 findings 登记为 open R# / 草草 `Approve with residuals` | `mstar-plan-artifacts` Findings cleanup modes · `mstar-review-qc` |
155
+ | 角色文件塞流程长文 | 用专题 skill |
156
+ | 无证据宣称完成 | `mstar-coding-behavior` / verification |
157
+ | CreatePlan 不落盘 / 无 `{HARNESS_DIR}` mirror | `mstar-host` · `cursor-plan-mode-bridge` |
158
+ | 临时方案 / 后续计划只写在对话里 | `mstar-phase-gates` · Durable Roadmap Gate |
159
+ | Phase 1 review chain 未完成即 commit | `mstar-iteration` §1.6;PM 代做专业角色编辑;或三角色并行派发 |
160
+ | OpenCode prompt 含多个 prefix-style role mention | `mstar-host/references/opencode.md` § Role-mention hygiene |
161
+ | Phase 2 paste-only / PM 自实现 | `mstar-dispatch-gates` |
162
+ | Phase 3 折叠进 final plan closure / 跳过 §3.1 gate | `mstar-iteration` §3.0–§3.5 |
163
+ | Phase 4 开 PR 后跳过 merge-ready loop | `mstar-iteration` §5 |
164
+ | Phase 5 在 CI / AI review 仍在跑时 push | `mstar-iteration` §5.1a |
165
+ | iteration-close 无 frontmatter completed / 漏 compound Phase 6 | `mstar-iteration` §3.0.5、§3.4、§3.2 #5 |
166
+ | iteration 默认 `main` 作 base 或 PR 目标 | `mstar-iteration` §1.2、§2.3;`mstar-plan-conventions` Spec 分支模型 |
167
+
168
+ ## 常见 harness 说法对照(帮助理解角色分工)
169
+
170
+ | 常见说法 | 本仓库实体 |
171
+ |----------|------------|
172
+ | 总编排 | `@project-manager` |
173
+ | 规划/访谈 | `@product-manager` / `@architect` + Prepare 阶段 |
174
+ | category 路由 | **`Task category`** + 路由表 + 子代理选择 |
175
+ | 持续推进 / 不半途而废 | Phase Gate + Todo/`tasks` + 验证门禁 |
176
+ | 行级哈希锚定编辑 | 以 **读后再改 + 小步 Patch** 纪律落实(`mstar-phase-gates`) |
177
+
178
+ 项目根 **`AGENTS.md` 写什么、分层 bootstrap** → **`mstar-plan-conventions`** `references/harness-bootstrap-and-agents-layering.md`(勿在 core 重复长文)。
179
+
180
+ **专题 skill**(规则在各自 `SKILL.md`):`mstar-phase-gates`、`mstar-branch-worktree`、`mstar-plan-artifacts` 等 — 见上表索引。
@@ -0,0 +1,78 @@
1
+ ---
2
+ name: mstar-host
3
+ description: Morning Star host adapter (OpenCode, Cursor, Codex, Kimi, ZCode, omp, dsh). Use after mstar-harness-core whenever host entry, clarify, dispatch, or plan UX differs by platform - OpenCode question/task-tool subagent invoke, Cursor /pm and CreatePlan/SwitchMode dual-write and Task parallel QC, Codex plugin skills plus Plan/Goal Mode, Kimi Agent/AgentSwarm with built-in subagent types only (coder/explore/plan) and role-in-prompt binding, ZCode Agent/AskUserQuestion/EnterPlanMode with built-in subagent types and role-in-prompt binding, omp task/ask/hub preferring live-schema role agents (agents/*.md) with C5b skill-load binding (generic task/scout only as fallback), dsh (DeepSeek Harness) subagent tool with in-process engine gates and bundled mstar commands, sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
4
+ ---
5
+
6
+ # Morning Star Host Adapter
7
+
8
+ Host-specific **capabilities and entry behavior** for Morning Star. Process gates and invariants stay in `mstar-harness-core` and topic `mstar-*` skills.
9
+
10
+ ## First action
11
+
12
+ Read **`mstar-harness-core`** before this skill (even when the host injects project `AGENTS.md`).
13
+
14
+ ## Default path
15
+
16
+ 1. Read `mstar-harness-core`
17
+ 2. Read **`mstar-host`** (this skill) and detect host below
18
+ 3. Read **`references/<host>.md`** for the active host
19
+ 4. Load role via `mstar-roles`
20
+ 5. Execute with evidence-first completion checks
21
+
22
+ Load topic skills **on demand** per `mstar-roles` (do not read every `mstar-*` skill by default). Cursor routing-eval (`.cursor/skills/mstar-routing-eval/`) is regression tooling only — not part of runtime load order.
23
+
24
+ ## Detect active host
25
+
26
+ Detect from **session tool shapes and available commands** — not from plugin markers on disk. The `*-plugin/plugin.json` files **cannot** identify the host: they all coexist in this harness source repo and in any multi-host install.
27
+
28
+ | Signal | Host | Next read |
29
+ |--------|------|-----------|
30
+ | **`subagent_type`** param on the Task tool (plus **CreatePlan**/**SwitchMode** when Plan mode is active) | `cursor` | `references/cursor.md`; Plan mode also `references/cursor-plan-mode-bridge.md` |
31
+ | **`question`** tool, or **`task`** tool with **`subagent`** (singular) — no `tasks[]` batch | `opencode` | `references/opencode.md` |
32
+ | **`task`** tool with **`agent`** / **`tasks[]`** batch, **`ask`**, **`hub`** (omp also exposes `/goal`; goal rule is host-agnostic per below) | `omp` | `references/omp.md`; Plan mode also `references/omp-plan-mode-bridge.md` |
33
+ | **`subagent`** tool (dsh's model-facing delegation tool — `@deepseek-ai/dsh-tool-subagent` default `toolName`) | `dsh` | `references/dsh.md` |
34
+ | **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** + **`AgentSwarm`** (Kimi-only) | `kimi` | `references/kimi.md`; Plan mode also `references/kimi-plan-mode-bridge.md` |
35
+ | **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** / **`TodoWrite`**, **no `AgentSwarm`** | `zcode` | `references/zcode.md`; Plan mode also `references/zcode-plan-mode-bridge.md` |
36
+ | `/plan`, `/goal` slash commands; **Goal tools**; `functions.*` / `codex_app.*` tool namespaces; `tool_search`; Browser plugin tools | `codex` | `references/codex.md`; Plan mode also `references/_shared/plan-mode-bridge-core.md` |
37
+ | Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, **`codex.md`**, **`kimi.md`**, **`zcode.md`**, **`omp.md`**, and **`dsh.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
38
+
39
+ Order matters: check `cursor` → `opencode` → `omp` → `dsh` → `kimi` → `zcode` → `codex`. `subagent_type` (Cursor) vs `subagent` (OpenCode) vs `agent`/`tasks[]` (omp) is the sharpest split among the Task-based hosts; dsh's `subagent` tool collides with no other row, so it sits with the agent-tool hosts.
40
+
41
+ > **Engine check (when available):** run `mstar host detect --signals <comma-list>` (or `import { detectHost } from "@mstar-harness/engine"` in a host hook) to resolve the detection table above from session tool shapes (prints the host id, or `ambiguous` to fall back on the table + judgment). On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
42
+
43
+ ## Parallel dispatch (invoke-capable hosts)
44
+
45
+ When PM dispatches **N >= 2** concurrent assignees (QC tri-review, dual-track implement, etc.) and the host exposes actual invoke / Task / subagent tools, read **`references/parallel-dispatch.md`** in the dispatch round (shared with `mstar-dispatch-gates`). Without a callable invoke tool when dispatch is required → **`Blocked`**; Assignment Markdown alone is not dispatch.
46
+
47
+ ## `/goal` directive (host-agnostic)
48
+
49
+ **Applicability is by capability, not host identity**: any host that exposes a `/goal` command (currently Codex Goal Mode and omp; other code agents may add it later) attaches a persistent objective to the thread. Rule — **always set the goal to running the complete flow to the end**, never a sub-stage:
50
+
51
+ - **Advancing an iteration**: set the goal to **complete the entire iteration flow** (`iteration-start → per-plan cycles → iteration-close → PR delivery → PR merge-ready loop`). Do not set a sub-stage goal (e.g. "finish Phase 1 only").
52
+ - **Advancing non-iteration work** (single plan / hotfix / one-off task): set the goal to **complete the entire per-plan flow** (`specify → clarify → plan → tasks → implement → plan QC tri + QA gate → Done`). Do not set a sub-stage goal (e.g. "write the plan" or "implement one task").
53
+
54
+ Goal text is a session-level objective only: `{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json` remain SSOT, and goal completion is **not** harness Done. Mirror goal success criteria into the SSOT plan; when the goal changes, update goal text and the SSOT in the same round.
55
+
56
+ ## Resolve loaded skill root
57
+
58
+ Docs name assets as skill **`<name>`** → `scripts/…` / `references/…`. **Resolve the loaded skill directory first** — do **not** open `skills/<name>/…` from a consumer app cwd (that layout exists in the harness source / plugin package only).
59
+
60
+ | Host | Prefer | Filesystem fallback (only if the host cannot load by name) |
61
+ |------|--------|--------------------------------------------------------------|
62
+ | **omp** | `skill://<name>` / `skill://<name>/<rel>` / `/skill:<name>` | Plugin package root `skills/<name>/` after install/link — not app cwd |
63
+ | **Cursor** | Skill **name** via plugin skills | Global `~/.cursor/plugins/local/morning-star-harness/skills/<name>/`; project `.cursor/plugins/morning-star-harness/skills/<name>/` |
64
+ | **Codex** | Skill **name** via plugin | Plugin-mounted `skills/<name>/`; project command skills under `.agents/skills/<name>/` |
65
+ | **OpenCode** | Skill **name** via `@mstar-harness/opencode` | Package-internal `harness-skills/<name>/` — never `process.cwd()/skills/` |
66
+ | **dsh** | Skill **name** via the mstar skill-local provider (`providerName: mstar`) | `$DSH_BUNDLED_SKILL_DIR/<name>[/<rel>]` — the packaged `harness-skills/` mirror mounted package-relative by `@mstar-harness/dsh`; never app cwd |
67
+ | **Kimi / ZCode** | Skill **name** / `/skill:<name>` | Plugin mount `./skills/<name>/` from the installed plugin root |
68
+
69
+ Authoring convention: **`mstar-skill-authoring`** § Skill-relative script and asset paths. Per-host URI / mount detail: `references/<host>.md`.
70
+
71
+ > **Engine check (when available):** import `resolveSkillRoot` from `@mstar-harness/engine` in a host hook to resolve the loaded skill root per the table above (no CLI form yet). On `fail` -> do not proceed; fix and re-run. Skill text below remains authoritative when the runtime is absent.
72
+
73
+ ## Conflict order
74
+
75
+ 1. User explicit instructions (this turn)
76
+ 2. Project `AGENTS.md` / `CLAUDE.md`
77
+ 3. `mstar-harness-core` and related `mstar-*` skills
78
+ 4. This `mstar-host` skill and `references/*`
@@ -0,0 +1,51 @@
1
+ # Host role-binding core (C5/C5b)
2
+
3
+ Shared role-binding contract for **Kimi / ZCode** — hosts where Morning Star role ids are **never** valid invoke types, so picking `subagent_type` alone cannot carry Assignment IDENTITY + skill load.
4
+
5
+ Other hosts follow their own `references/<host>.md` and do **not** use this file for agent selection. Read this file only when the active host reference is Kimi or ZCode.
6
+
7
+ ## C5 — invoke type selection (Kimi / ZCode)
8
+
9
+ | Host | Invoke-type selection (C5) | Prompt role binding (C5b) |
10
+ |------|----------------------------|---------------------------|
11
+ | **Kimi / ZCode** | Built-in types only (`coder` / `explore` / `plan`, …). Morning Star role ids are **never** valid invoke types. | **Required** |
12
+
13
+ - **Never invent** agent / subagent names. The **live tool schema** (plus the active host reference C5 table) is SSOT every session.
14
+ - Morning Star role ids (`product-manager`, `fullstack-dev`, `qc-specialist`, …) are **not** valid invoke types — map via the host reference table (`coder` / `explore` / `plan`, …), then rely on C5b.
15
+
16
+ ## C5b — role binding in prompt (required)
17
+
18
+ Every dispatch on Kimi / ZCode **must** carry the played Morning Star role in the **Assignment** and in the **invoke prompt**:
19
+
20
+ 1. **`Execute as: <role-id>`** in Assignment (harness routing SSOT).
21
+ 2. **`Act as <role-id>`** (or equivalent) at the top of the invoke prompt.
22
+ 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.
23
+ 4. **`subagent_type`** — pick from the live built-in set per the host C5 table (not a Morning Star role id).
24
+
25
+ Paste-only Assignment **without** an invoke call is **not** dispatch.
26
+
27
+ ## Invocation rules
28
+
29
+ - **1 Assignment ⇒ 1 invoke**: one invoke call carrying the full Assignment body per assignee.
30
+ - **Parallel batch N**: **N** invocations in **one** assistant message (mechanics → **`parallel-dispatch.md`**).
31
+ - **No invoke call** → **Not dispatched** — paste-only / `dispatch incomplete`.
32
+ - **Anti-recursion NEVER**: leaf executors are already `Execute as` — **no** recursive invoke of the same role; Assignment wins (`Delegation: forbidden` unless stated). **Never** multiple implementer invokes in one message for the same plan (SDD serial → **`parallel-dispatch.md`** § SDD implement).
33
+
34
+ ## Assignment / prompt template
35
+
36
+ ```markdown
37
+ ## Assignment
38
+
39
+ **Execute as**: fullstack-dev
40
+ **Delegation**: forbidden
41
+ **Working branch**: feat/example
42
+ **Plan Path**: .mstar/plans/20260717-example.md
43
+
44
+ **IDENTITY:** You ARE `fullstack-dev`. Act as `fullstack-dev` for this task.
45
+
46
+ Load: `mstar-harness-core` → `mstar-host` → `<host>.md` → `mstar-roles` → `references/fullstack-dev-shared.md` → topic skills per that reference.
47
+
48
+ <task body>
49
+ ```
50
+
51
+ The active host reference shows the matching invoke shape (same turn) — e.g. Kimi/ZCode `Agent` with `subagent_type: "coder"` plus this C5b body.
@@ -0,0 +1,91 @@
1
+ # Plan-Mode Bridge Core (shared)
2
+
3
+ > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-host`** and the host reference + this bridge. When plan management is required, also read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** before creating or claiming any durable plan state. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-plan-conventions`. On conflict, **`mstar-harness-core`** wins.
4
+
5
+ Each per-host bridge (`cursor-plan-mode-bridge.md`, `kimi-plan-mode-bridge.md`, `zcode-plan-mode-bridge.md`, `omp-plan-mode-bridge.md`) loads this core and adds its host-specific plan UX (plan tooling, approval gate, todo UI, command surfaces). Codex Plan Mode reads this core directly via `references/codex.md` (no per-host codex plan bridge; the `/goal` rule is host-agnostic in `mstar-host` SKILL.md).
6
+
7
+ ## Dual-write SSOT rule
8
+
9
+ The host **Plan mode** (session plan file, todos, UI) is a **session UX mirror**. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`): the main plan in `{PLAN_DIR}/<plan-id>-<name>.md`, the plan registry in `{HARNESS_DIR}/status.json`, the iteration compass under `{ITERATION_DIR}/…` when in a formal iteration. Mirror every durable plan artifact to the repo; never treat the host plan file/URI/UI alone as the handoff surface.
10
+
11
+ ### Priority (hard)
12
+
13
+ 1. User explicit instructions (this turn)
14
+ 2. Project `AGENTS.md` / `CLAUDE.md`
15
+ 3. **`{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json`** (harness SSOT)
16
+ 4. Host session plan / todos / UI (session UX mirror) — the host bridge names its surfaces
17
+
18
+ **NEVER** cite only a host plan path / session todo list / chat summary in Assignment **Plan Path**, **Context Loaded**, or Completion Report when `{PLAN_DIR}/<plan-id>-<name>.md` should exist.
19
+
20
+ ## Before the first plan (bootstrap init)
21
+
22
+ 1. **Read** (minimum): `mstar-plan-conventions`, `mstar-plan-artifacts` (SKILL.md); Prepare gates from `mstar-phase-gates` if not hotfix.
23
+ 2. **Discover** `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions` (prefer `.mstar/` + `.mstar/plans/`; reuse legacy `.agents/` only when already present and `.mstar/` is absent).
24
+ 3. **Initialize** if absent: `{HARNESS_DIR}/`, `{PLAN_DIR}/`, `status.json` from `mstar-plan-artifacts/templates/status.empty.json`, `archived/residuals/`, Morning Star process-artifact gitignore set (canonical snippet → `mstar-plan-conventions` SKILL.md「Git 跟踪策略」). Full PM checklist: `mstar-roles/references/project-manager/plan-management.md`.
25
+
26
+ ## Build resume contract
27
+
28
+ Host **Build** / plan approval resumes the current plan in Agent mode. Do **not** assume it replays `/pm` or re-enters a role skill automatically.
29
+
30
+ First action after Build, before product-code edits:
31
+
32
+ 1. Reload the harness entry: `mstar-harness-core` → `mstar-host` host reference → this bridge.
33
+ 2. If the plan is a Morning Star plan, resume as `project-manager` for coordination and dispatch only.
34
+ 3. Read the SSOT plan and `status.json`; use them as the source of truth over the host plan URI/UI.
35
+ 4. For each implement/code todo, require a PM Assignment with `Execute as`, `Delegation`, `Working branch` or `Branch policy`, and SSOT `Plan Path`.
36
+ 5. If the Assignment or SSOT state is missing, report **Blocked** and repair the harness state before implementation.
37
+
38
+ Allowed in the parent Build session: plan/status maintenance, routing decisions, Assignment writing, and host task dispatch.
39
+
40
+ Not allowed in the parent Build session by default: product implementation, test implementation, QC execution, QA execution, deployment, or ops changes. Those follow the normal PM dispatch rules unless the user explicitly overrides the harness.
41
+
42
+ ## CreatePlan: fixed bootstrap todos (prefix)
43
+
44
+ **Emit these three todos first**, in order, **before** any implement / code todos. Do **not** mark implement todos in progress until all three are **done**.
45
+
46
+ | Todo ID (use in title) | Goal | On-disk outcome |
47
+ |------------------------|------|-----------------|
48
+ | **`harness-init`** | Bootstrap harness tree | `{HARNESS_DIR}/`, `{PLAN_DIR}/`, process-artifact gitignore set, `archived/residuals/`, `status.json` initialized |
49
+ | **`spec-register`** | Register plan in SSOT | New `plans[]` row in `status.json` (`id`, `status`, `file`, `metadata`); spec stub in `{SPECS_DIR}` or plan frontmatter |
50
+ | **`mirror-plan`** | SSOT main plan file | `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes aligned to the host plan body |
51
+
52
+ After the host plan is created, keep the host plan body and mirror file **in sync** when scope changes (update both in the same coordination round).
53
+
54
+ ## Implement todo completion gate (every code todo)
55
+
56
+ **Before marking the todo done:**
57
+
58
+ 1. **Commit**: `git add` + `git commit` on the authorized **Working branch** for this **task id** (one commit per task unless PM explicitly allowed batched commits in Assignment).
59
+ 2. **Plan checkbox**: Set `- [x]` on the matching line in `{PLAN_DIR}/<plan-id>-<name>.md`.
60
+ 3. **status.json** (when PM round requires): bump `plans[].status` (e.g. `InProgress`) or append coordination notes per `mstar-plan-artifacts`.
61
+ 4. **Evidence**: Record real `git log -1 --oneline` in Completion Report **Git** (or the plan-mode status note if executing as PM in Plan mode).
62
+
63
+ **NEVER**
64
+
65
+ - Mark implement todos done without a commit when tracked files changed.
66
+ - Batch all work into one closing commit unless PM documented an exception.
67
+ - Mark plan-level `Done` in `status.json` without PM/QA authority and without recorded **`QA gate`** (`mandatory` fulfilled or `pm-acceptance` checklist per `qa-trigger-matrix.md`).
68
+
69
+ Dev-role NEVER rules also apply when executing as implementer: `mstar-roles/references/fullstack-dev-shared.md` (Git NEVER).
70
+
71
+ ## `mstar-iteration` Phase 1 in Plan mode (shared gate)
72
+
73
+ - **Single plan session**: use **one** plan file (host or SSOT draft); iterate the **same** file in place with feedback-driven edits. If a duplicate plan file was created by mistake: merge into the original, delete the duplicate.
74
+ - **Do not** run Review & Edit, commit, or create the integration branch until the user approves implementation (host approval gate: **Build** / **`ExitPlanMode`** / plan resolve). Plan mode ≠ executing todos — approval is the Phase 1 executable gate (Review chain, lock, branch).
75
+ - Prepare phase (`specify → clarify → plan`) still applies; the mirrored plan is the harness **`plan`** artifact, not a substitute for clarify.
76
+ - Branch policy in the plan session: write **recommended** `iteration_base_branch` / `target_branch` (+ short rationale) into the plan — do **not** silently default to `main`/`master`.
77
+ - Host plan approval is **not** Morning Star **Done**. Implementation still follows phase gates, per-task commits, QC, and QA per the SSOT plan.
78
+
79
+ ## Anti-patterns (shared)
80
+
81
+ | Anti-pattern | Fix |
82
+ |--------------|-----|
83
+ | Host plan only, no `{HARNESS_DIR}` files | Run bootstrap todos; write mirror plan + status.json |
84
+ | Todo done, no commit | Commit per task; paste `git log -1` evidence |
85
+ | Drift between host plan and SSOT plan | Update both in same round |
86
+ | Host plan URI as Plan Path | Use `{PLAN_DIR}/...` path |
87
+ | Skip `spec-register` | Add `plans[]` row before implement |
88
+ | Build starts coding in the parent session | Resume PM context; dispatch implement work or block on missing Assignment |
89
+ | Host plan approval treated as Done authority | Check harness plan/status/QC/QA gates first |
90
+ | Resume starts coding from host chat summary | Reload harness context and SSOT plan/status first |
91
+ | Phase 1 Plan mode: Review / commit / branch before Build | Keep Pre-Build document-only; execute those todos after approval |
@@ -0,0 +1,61 @@
1
+ # Codex host reference
2
+
3
+ Load when **`mstar-host`** detection resolves **codex** (Codex app/CLI session, `/plan` / `/goal` slash commands, Goal tools, or Codex tool namespaces such as `functions.*`, `codex_app.*`, `tool_search`, `image_gen`, or Browser plugin tools).
4
+
5
+ Plan Mode: read **`references/_shared/plan-mode-bridge-core.md`** when Codex Plan Mode (`/plan`) is active. Goal Mode (`/goal`, goal tools, or goal progress controls) follows the host-agnostic **`/goal`** rule in `mstar-host` SKILL.md — applicability is by the `/goal` command, not host identity. Codex session plans, UI todos, and goal text are not durable harness SSOT.
6
+
7
+ Parallel PM dispatch: read **`parallel-dispatch.md`** only when Codex exposes an actual multi-agent / Task-style invocation tool. If no callable invoke tool exists, Assignment Markdown is coordination text only; do **not** claim subagent dispatch.
8
+
9
+ ## Codex-only context
10
+
11
+ - Plugin source: `.codex-plugin/plugin.json`.
12
+ - Runtime skills: repo `skills/` mounted by the Codex plugin (`"skills": "./skills/"`).
13
+ - Custom agent source: repo `codex/agents/*.toml`; CLI/manual install links these into `~/.codex/agents/` or project `.codex/agents/`.
14
+ - **`/pm`** or **`pm` skill**: force PM entry → `mstar-roles` → `project-manager.md` (Codex primary; Cursor/OpenCode for general per-plan work). **`commands/`** when running iteration Phase 1–5; project CLI install (`mstar-harness init --target codex --scope project`) materializes `iteration-start`, `iteration-drive`, and `iteration-loop` as `.agents/skills/<name>/SKILL.md` symlinks.
15
+ - Role files under root `agents/` are for hosts that load OpenCode/Cursor-style agent shells; Codex uses `codex/agents/*.toml` and still loads `mstar-roles` references directly.
16
+ - Tool and plugin availability can be lazy-loaded or session-dependent. Use the tools actually present in the current session; do not infer capability from documentation alone.
17
+
18
+ ## Skill loading
19
+
20
+ 1. Read `mstar-harness-core`.
21
+ 2. Read `mstar-host` and this Codex reference.
22
+ 3. If Plan Mode is active, read `references/_shared/plan-mode-bridge-core.md`; Goal Mode follows the `/goal` rule in `mstar-host` SKILL.md.
23
+ 4. Load `mstar-roles` and the active role reference.
24
+ 5. Load topic skills on demand per the role reference.
25
+
26
+ Use skill names in prompts and references. Avoid absolute local paths unless the user is maintaining this repository or the skill is not installed and must be read from the checkout. Skill-root resolve (plugin `skills/<name>/`, project `.agents/skills/<name>/`) → `mstar-host` § Resolve loaded skill root.
27
+
28
+ ## Clarify
29
+
30
+ - Codex does not imply an OpenCode-style `question` tool.
31
+ - If a structured user-input tool is available in the active mode, use it for concise 1-3 choice decisions.
32
+ - Otherwise ask one concise Markdown question only after codebase exploration cannot answer it.
33
+ - `update_plan` / local todo UI is session progress only; it does not replace `{PLAN_DIR}` plans or `{HARNESS_DIR}/status.json`.
34
+ - Codex Goal Mode objective is completion criteria for the host thread, not Morning Star Done authority; mirror it into the SSOT plan when the work is implementation-sized.
35
+
36
+ ## Dispatch and role execution
37
+
38
+ - **No invoke tool / no linked custom agent = no dispatch**: printing `## Assignment` does not start another Codex worker.
39
+ - If Codex exposes custom-agent / multi-agent tools and matching Morning Star agents are linked, PM may dispatch through those tools and must follow `parallel-dispatch.md`.
40
+ - If no invoke tool is present when dispatch is required, return **`Blocked`** — report missing invoke capability to the user. Do not substitute single-session role execution in the PM thread unless the user explicitly overrides harness dispatch for this turn.
41
+ - QC: N rules → **`parallel-dispatch.md`** (**`Execution mode: sdd`** → N=3; **`inline`** → N=1) when a callable invoke tool exists. Cannot emit required **N** → **`Blocked`**.
42
+ - Leaf executors still follow `mstar-dispatch-gates`: no recursive Task/subagent calls unless Assignment says `Delegation: allowed (...)`.
43
+
44
+ ## Files, shell, and approvals
45
+
46
+ - Prefer `rg` / `rg --files` for search and `apply_patch` for manual edits.
47
+ - Respect Codex sandbox and approval prompts. If a required command fails because of sandbox or network restrictions, request escalation through the host approval mechanism.
48
+ - Do not edit global Codex plugin metadata, marketplace files, credentials, secrets, or user config without explicit user consent.
49
+ - Browser, image, document, spreadsheet, presentation, and automation capabilities are host tools. Use them only when the user request or verification need calls for them.
50
+
51
+ ## Git and final evidence
52
+
53
+ - Git work still follows `mstar-branch-worktree` and the Assignment `Working branch` / `Branch policy`.
54
+ - Codex app git directives, when available, are audit annotations only. Emit them only after the underlying git action succeeds; never use a directive as a substitute for staging, committing, pushing, or PR creation evidence.
55
+ - Completion reports should cite concrete commands, artifacts, and commit lines when required by the Assignment.
56
+
57
+ ## Gotchas
58
+
59
+ - Codex plugin install gives skills; Morning Star role subagents require custom agent TOML files linked from `codex/agents/`.
60
+ - Tool discovery (`tool_search`) can reveal capabilities, but availability is not authorization; Assignment `Delegation` still controls use.
61
+ - Session plans, Goal Mode text, chat summaries, and UI todos are not durable harness SSOT unless mirrored to `{HARNESS_DIR}`.
@@ -0,0 +1,159 @@
1
+ # Cursor Plan Mode × Harness Dual-Write Bridge
2
+
3
+ > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-host`** and **`references/cursor.md`**, then **`references/_shared/plan-mode-bridge-core.md`** (shared contract) + this bridge. When plan management is required, also read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** before the first **CreatePlan** in Plan mode. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-plan-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 Cursor **CreatePlan** / **SwitchMode** / Plan-mode specifics only.
6
+
7
+ ## When this applies
8
+
9
+ - Cursor **Plan mode** is active (system guidance to use **CreatePlan** / **SwitchMode**).
10
+ - Morning Star plugin or `/pm` is in use (`mstar-host`, `pm` skill, or `rules/mstar-cursor-plan-mode.mdc`).
11
+
12
+ ## Before the first CreatePlan
13
+
14
+ 1. **Read** (minimum): `mstar-plan-conventions`, `mstar-plan-artifacts` (SKILL.md); Prepare gates from `mstar-phase-gates` if not hotfix.
15
+ 2. **Discover** `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions` (prefer `.mstar/` + `.mstar/plans/`; reuse legacy `.agents/` only when already present and `.mstar/` is absent).
16
+ 3. **Initialize** if absent — checklist in core; full PM checklist (incl. process-artifact gitignore set): `mstar-roles/references/project-manager/plan-management.md` (canonical gitignore snippet → `mstar-plan-conventions` SKILL.md「Git 跟踪策略」).
17
+
18
+ ## CreatePlan specifics
19
+
20
+ Bootstrap todos `harness-init` / `spec-register` / `mirror-plan` (emit first, in order, before any implement todos) → core.
21
+
22
+ ### `spec-register` minimum fields
23
+
24
+ Add one object to `status.json` → `plans[]`:
25
+
26
+ ```json
27
+ {
28
+ "id": "<plan-id>",
29
+ "status": "Todo",
30
+ "file": ".mstar/plans/<plan-id>-<short-name>.md",
31
+ "metadata": {
32
+ "primary_spec": "<spec-id or path if known>",
33
+ "description": "<one-line summary>"
34
+ }
35
+ }
36
+ ```
37
+
38
+ Set `updated_at` on `status.json` to today (`YYYY-MM-DD`). Commit **tracked results** in the business repo when applicable: `{HARNESS_DIR}/AGENTS.md`, `{KNOWLEDGE_DIR}/`, `{SPECS_DIR}/` (default git policy — see `mstar-plan-conventions`). Do **not** default `git add` for `status.json`, `plans/`, or `iterations/`.
39
+
40
+ ### `mirror-plan` minimum content
41
+
42
+ - YAML or markdown frontmatter with `plan_id`, title, status (`Todo` / `InProgress` — not `Done` unless PM/QA authority).
43
+ - **Task list** as markdown checkboxes (`- [ ]` / `- [x]`) matching CreatePlan implement todos.
44
+ - **Roadmap / deferred scope** section when delivery is staged, partial, or uses a temporary workaround.
45
+ - Link: “SSOT status: `{HARNESS_DIR}/status.json` → `plans[]` / `residual_findings`.”
46
+
47
+ After **CreatePlan**, keep CreatePlan body and mirror file **in sync** when scope changes (update both in the same coordination round).
48
+
49
+ ### CreatePlan body template (copyable)
50
+
51
+ Use this structure in CreatePlan `plan` markdown; mirror the same sections into `{PLAN_DIR}/<plan-id>-<name>.md`.
52
+
53
+ ```markdown
54
+ # Plan: <title>
55
+
56
+ **plan_id**: <plan-id>
57
+ **HARNESS_DIR**: .mstar/
58
+ **Plan file (SSOT)**: .mstar/plans/<plan-id>-<short-name>.md
59
+ **status.json**: .mstar/status.json
60
+
61
+ ## Prepare gates
62
+
63
+ - specify: [done|n/a]
64
+ - clarify: [done|n/a]
65
+ - plan: [done|in progress]
66
+
67
+ ## Roadmap / deferred scope
68
+
69
+ - Target state: <complete outcome>
70
+ - Current slice: <what this plan/batch delivers>
71
+ - Later slices: <batch/order/owner or trigger>
72
+ - Deferred scope / temporary workaround removal: <tracking location or N/A>
73
+ - Final Done definition: <condition for full completion>
74
+
75
+ ## Tasks (mirror as checkboxes in SSOT plan file)
76
+
77
+ ### Bootstrap (fixed prefix — complete before implement)
78
+
79
+ 1. harness-init — init .mstar/, status.json, process-artifact gitignore set, archived/residuals/
80
+ 2. spec-register — register plan_id in status.json; spec stub if applicable
81
+ 3. mirror-plan — write .mstar/plans/<plan-id>-<short-name>.md
82
+
83
+ ### Implement
84
+
85
+ - [ ] <task-id-1>: <description>
86
+ - Done when: git commit on Working branch + checkbox [x] in SSOT plan + evidence below
87
+ - [ ] <task-id-2>: ...
88
+
89
+ ## Working branch
90
+
91
+ <branch-name or "PM to assign before implement">
92
+
93
+ ## Verification
94
+
95
+ - Commands / tests required before InReview
96
+ ```
97
+
98
+ ## Implement todo completion gate (every code todo)
99
+
100
+ Commit → SSOT checkbox → `status.json` sync → `git log -1 --oneline` evidence; NEVER list → core. Dev-role NEVER rules also apply when executing as implementer: `mstar-roles/references/fullstack-dev-shared.md` (Git NEVER).
101
+
102
+ ## SwitchMode → Agent (pre-flight)
103
+
104
+ Before switching from Plan to Agent for implementation (or declaring Plan phase complete):
105
+
106
+ - [ ] `{PLAN_DIR}/<plan-id>-<name>.md` exists on disk
107
+ - [ ] `status.json` contains `plans[]` entry with matching `id` and `file`
108
+ - [ ] Bootstrap todos `harness-init`, `spec-register`, `mirror-plan` are **done**
109
+ - [ ] CreatePlan implement todos reference **task ids** traceable to SSOT plan checkboxes
110
+ - [ ] If staged/partial/temporary, CreatePlan and SSOT plan both contain `Roadmap / deferred scope`
111
+ - [ ] **Plan Path** for any Assignment uses the SSOT path, not the Cursor plan URI
112
+
113
+ If any item fails → **Blocked**; finish harness sync before implement.
114
+
115
+ ## Build resume contract
116
+
117
+ → core. Cursor delta: **Build** resumes the current plan in Agent mode; do not assume it replays `/pm` or re-enters a role skill automatically.
118
+
119
+ ## PM in Plan mode (`/pm`)
120
+
121
+ When `/pm` runs under Plan mode:
122
+
123
+ - Load this reference via **`mstar-host`** (Cursor detection) after `mstar-harness-core`.
124
+ - **CreatePlan** todos **must** include the three bootstrap prefix items.
125
+ - Prepare phase (`specify → clarify → plan`) still applies; `mirror-plan` is the harness **`plan`** artifact, not a substitute for clarify.
126
+ - Before QC dispatch, read **`mstar-review-qc`** (unchanged).
127
+
128
+ ## `mstar-iteration` Phase 1 in Plan mode
129
+
130
+ When starting a **new iteration** under Cursor Plan mode (host command may orchestrate Phase 1):
131
+
132
+ | Phase | Behavior | Forbidden |
133
+ |-------|----------|-----------|
134
+ | Early CreatePlan | After read-only research, **CreatePlan once** with blank Phase 1 scaffold + Build-bound todos; **record the returned plan file path** | Wait until direction lock finishes; call CreatePlan again later |
135
+ | Feedback loop | User gives **direction / opinions only** (no questionnaire). Agent explores, recommends, and **edits that same plan file in place** (+ SSOT drafts). Absorb feedback → update again | Routine one-question-at-a-time interview; gate plan updates on user answers; write a second `*.plan.md`; open interview helpers before feedback-close |
136
+ | Feedback-close | When user signals feedback done (e.g. 反馈结束 / 总结 / 准备 Build): if blocking gaps remain → **minimal** deferred interview on gaps only, still editing the **same** plan file; else ready for Build | Start the interview helper as the main Plan-session loop |
137
+ | Pre-Build | Maintain documents only | Execute Review chain, commit, or create `spec_integration_branch` |
138
+ | Build | Finalize SSOT from the **same** CreatePlan body → sequential Review & Edit → PM lock → integration branch | Replay feedback/interview; finalize from a different plan URI than View Plan |
139
+
140
+ **Single CreatePlan URI (HARD)**: one CreatePlan per Phase 1 Plan session. Updates use file edit tools on that path. If a duplicate plan file was created by mistake: merge into the original, delete the duplicate, keep View Plan on the original.
141
+
142
+ **Bootstrap relationship**: ordinary per-plan work still uses `harness-init` / `spec-register` / `mirror-plan`. Phase 1 CreatePlan uses Phase 1 todos (`harness-init` → `finalize-compass-plans` → review-edit seats → `pm-lock` → `integration-branch`). Business `plans[]` rows should exist as drafts before Build when direction has converged.
143
+
144
+ **Helpers**: third-party interview helpers are **not** named here; host **command** layer may use them only after feedback-close when gaps remain.
145
+
146
+ ## Anti-patterns (Cursor-specific)
147
+
148
+ | Anti-pattern | Fix |
149
+ |--------------|-----|
150
+ | Follow-up only in chat / no roadmap section | Add `Roadmap / deferred scope` to CreatePlan and SSOT plan before implement |
151
+ | Phase 1 Plan mode: second CreatePlan / stale open plan | Edit the original plan file only; merge+delete duplicates |
152
+ | Phase 1 Plan mode: interview loop before feedback-close | Feedback-driven autonomous plan updates; deferred interview only after close signal if gaps remain |
153
+
154
+ ## Related skills
155
+
156
+ - `mstar-plan-conventions` — discovery, init, plan-writing path gate
157
+ - `mstar-plan-artifacts` — `status.json`, review bundle summaries, checkboxes, residual
158
+ - `mstar-phase-gates` — Prepare / Execute order
159
+ - `mstar-roles/references/project-manager/dispatch-and-assignment.md` — Checkpoint: commit → Completion Report → Status Update