@mstar-harness/opencode 1.3.1 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to the `@mstar-harness/opencode` package are documented in t
4
4
 
5
5
  The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface releases.
6
6
 
7
+ ## 1.4.0
8
+
9
+ - Version alignment with harness **1.4.0** (Kimi Code host support lives in shared skills / `.kimi-plugin`; OpenCode package unchanged beyond version bump).
10
+
11
+ See root [CHANGELOG.md](../../CHANGELOG.md) **1.4.0**.
12
+
13
+ ## 1.3.2
14
+
15
+ - Bundled commands: `/iteration-start` Cursor Plan path — feedback-driven plan updates; deferred grill after feedback-close; single CreatePlan URI (in-place edits only).
16
+ - Bundled skills: `mstar-iteration` §1.2 Plan UX feedback-driven + recommended branch policy; `mstar-host` Cursor Phase 1 bridge/rule.
17
+
18
+ See root [CHANGELOG.md](../../CHANGELOG.md) **1.3.2**.
19
+
7
20
  ## 1.3.1
8
21
 
9
22
  - Bundled skills/commands: iteration package layout — `{ITERATION_DIR}/<id>/delivery-compass.md` + sibling `guides/` / `specs/`; one-row root iteration index; legacy flat compass read-compat.
@@ -28,7 +28,7 @@ Detailed workflow → **`mstar-iteration` § Phase 1**(含 §1.6 Review & Edit
28
28
 
29
29
  | 宿主上下文 | 走哪条 |
30
30
  |------------|--------|
31
- | **Cursor Plan mode**(CreatePlan / Plan 会话活跃) | §0 Boot → §P(本命令 Plan 分支)— **先**空白 CreatePlan,再动态 grill-me 改文档;**Build 前不执行** Review 链 / commit / integration 分支 |
31
+ | **Cursor Plan mode**(CreatePlan / Plan 会话活跃) | §0 Boot → §P **先**空白 CreatePlan,再 **feedback-driven** 自主改同一份 plan;grill-me **仅**在用户明确结束反馈后、仍有阻塞疑问时;**Build 前不执行** Review 链 / commit / integration 分支 |
32
32
  | **其它**(Agent、OpenCode、非 Plan) | §0 Boot → §1–§6(Research → Explore → grill-me → Write → Review → branch) |
33
33
 
34
34
  ## 0. Boot
@@ -43,19 +43,28 @@ Detailed workflow → **`mstar-iteration` § Phase 1**(含 §1.6 Review & Edit
43
43
 
44
44
  **若 Cursor Plan mode 活跃 → 进入 §P;否则继续 §1。**
45
45
 
46
- ## P. Cursor Plan mode(Phase 1 scaffold → staged grill → Build)
46
+ ## P. Cursor Plan mode(Phase 1 scaffold → feedback loop → deferred grill → Build)
47
47
 
48
48
  **Detect**:会话处于 Cursor Plan mode(系统要求 CreatePlan / SwitchMode,或 Plan 工具可用且当前为 Plan 会话)。
49
49
 
50
- **语义**:Plan 模式期间 **只维护 CreatePlan + SSOT 草稿**;**不**把 grill 段标成已执行 todo;**不**派发 Review 链;**不** commit;**不**建 integration 分支。点 **Build** 后才执行下方 Build todos(对齐 `mstar-host/references/cursor-plan-mode-bridge.md` · Phase 1 in Plan mode)。
50
+ **语义**:Plan 模式期间 **只维护 CreatePlan + SSOT 草稿**;用户侧是 **纯反馈**(提方向 / 提意见),**不是**答问卷。Agent **探索 + 推荐并直接改 plan**。**不**派发 Review 链;**不** commit;**不**建 integration 分支。点 **Build** 后才执行下方 Build todos(对齐 `mstar-host/references/cursor-plan-mode-bridge.md` · Phase 1 in Plan mode)。
51
+
52
+ ### P.0 Single CreatePlan URI(HARD — 防双 plan)
53
+
54
+ | 规则 | 说明 |
55
+ |------|------|
56
+ | **CreatePlan 只调用一次** | §P.2 空白脚手架是本会话 **唯一** 一次 CreatePlan |
57
+ | **记录路径** | 记下工具返回的 plan 文件路径(常在 `~/.cursor/plans/*.plan.md`);后续所有修订都写 **这一份** |
58
+ | **更新方式** | Feedback / deferred grill 后用 **Read + Write/StrReplace 原地改** 该文件;**禁止**再调 CreatePlan 开第二份 |
59
+ | **发现重复** | 若已误开第二份:把有效内容 **合并进第一份**,删除重复文件,并确保用户 View Plan 指向第一份 |
51
60
 
52
61
  ### P.1 Research(只读)
53
62
 
54
63
  执行与 §1 相同的调研(structured + unstructured + `STRATEGY.md`)。**不要**在本步写 compass/plans 终稿。
55
64
 
56
- ### P.2 Early CreatePlan(空白脚手架 — 先于方向锁定)
65
+ ### P.2 Early CreatePlan(空白脚手架 — 本会话唯一一次)
57
66
 
58
- Research 后 **立刻** CreatePlan(**禁止**等 grill-me 全部完成再 CreatePlan)。
67
+ Research 后 **立刻** CreatePlan **一次**(**禁止**等方向锁定完成再 CreatePlan;**禁止**之后再 CreatePlan)。
59
68
 
60
69
  **CreatePlan 最小结构**(session mirror;dual-write 草稿见 P.3):
61
70
 
@@ -86,39 +95,62 @@ TBD
86
95
  |---------|------|--------|-------|
87
96
  | TBD | | Todo | |
88
97
 
89
- ## Grill-me log
90
- (每段收敛后追加:日期 / 议题 / 决议)
98
+ ## Feedback log
99
+ (吸收用户反馈 / agent 推荐决议后追加)
100
+
101
+ ## Deferred grill log
102
+ (仅 P.3.5 若发起 grill 时追加;可空)
91
103
  ```
92
104
 
93
- **Build 才勾的 todos**(顺序;**不要**把 grill 段写成 Build todo):
105
+ **Build 才勾的 todos**(顺序;**不要**把 feedback / grill 写成 Build todo):
94
106
 
95
107
  1. `harness-init` — 若 `{HARNESS_DIR}` / `status.json` 缺失则初始化
96
- 2. `finalize-compass-plans` — 将 CreatePlan 正文落成 compass + `{PLAN_DIR}/` plans + `status.json` 登记 + `{ITERATION_DIR}/README.md`
108
+ 2. `finalize-compass-plans` — 将 **同一份** CreatePlan 正文落成 compass + `{PLAN_DIR}/` plans + `status.json` 登记 + `{ITERATION_DIR}` 索引
97
109
  3. `review-edit-product-manager` — §5.1 invoke
98
110
  4. `review-edit-architect` — §5.2 invoke
99
111
  5. `review-edit-writing-specialist` — §5.3 invoke
100
112
  6. `pm-lock` — §5.4 compass `status: locked` + Prepare gates
101
113
  7. `integration-branch` — §6
102
114
 
103
- ### P.3 Dynamic grill-me(不固定段数)
115
+ ### P.3 Feedback loop(主路径 — 直到用户明确结束反馈)
116
+
117
+ **用户模式**:提方向、提意见、纠正推荐 — **纯反馈**。**不要**把用户当成问卷答题人;**禁止**例行一问一答卡更新。
118
+
119
+ **Agent 每轮**(可多轮,直到用户喊停):
120
+
121
+ 1. 探索代码 / harness / roadmap(能靠读回答的先读)
122
+ 2. 形成推荐(Direction / Scope / Acceptance / Non-Goals / Branch policy / Plans)
123
+ 3. **立刻**原地更新 **§P.2 那一份** CreatePlan(含 `## Feedback log`)+ 推荐 dual-write SSOT 草稿
124
+ 4. 吸收用户新反馈 → 再探索/再改 **同一份** plan
125
+
126
+ **Branch policy**:在 plan 中写入 **推荐值 + 简短 rationale**(不得静默默认 `main`/`master`);用户可用反馈改掉。**不要**在本阶段为 branch 开 grill。
127
+
128
+ **禁止**:
129
+
130
+ - 再调 CreatePlan / 写到另一份 plan 文件
131
+ - 把「等用户回答问题」当作更新 plan 的门禁
132
+ - 在用户结束反馈前加载 / 运行 `grill-me`
133
+ - 固定死反馈轮数;Plan 模式内派发 §5 / commit / §6
134
+
135
+ ### P.3.5 Feedback-close → deferred grill(可选)
104
136
 
105
- **Before this step:** Read `skills/grill-me/SKILL.md`(**仅本命令**引用;勿从 `mstar-*` 加载)。
137
+ **触发**:用户明确表示反馈结束(例如:反馈结束、总结、分析反馈、可以了、准备 Build)。
106
138
 
107
- **Direction lock mode: `interactive`**。按决策树 **动态切段**(段数不固定;随用户需求增减):
139
+ 然后 Agent 自检 CreatePlan:Direction / Scope / Acceptance / Non-Goals / Branch policy / Plans 是否仍有 **阻塞缺口**。
108
140
 
109
- - 一段一问;能靠读代码回答的先探索代码
110
- - 每段收敛后 **立刻** 更新 CreatePlan body(Direction / Scope / Acceptance / Non-Goals / Branch policy / Plans 表)并 **追加** `## Grill-me log`
111
- - 同轮 dual-write SSOT **草稿**(可选但推荐):`{ITERATION_DIR}/` compass stub、`{PLAN_DIR}/` plan stubs、`status.json` 业务 plan 行(方向收敛后至少有草稿登记)
112
- - **禁止**:固定死 4/5 段;把 grill 标成「已执行完的 todo」;Plan 模式内派发 §5 / commit / §6
141
+ | 结果 | 动作 |
142
+ |------|------|
143
+ | **无阻塞缺口** | **不**开 grill-me;宣布可 Build;确认同一份 CreatePlan + 草稿 SSOT 已反映锁定内容 |
144
+ | **仍有阻塞缺口** | Read `skills/grill-me/SKILL.md`(**仅本命令**);对 **剩余缺口** 做最小 grill(一段一问);每段收敛后仍 **原地改同一份** CreatePlan,并追加 `## Deferred grill log` |
113
145
 
114
- 用户表示方向/范围已够用、可 Build 停止 grill;确认 CreatePlan 与草稿 SSOT 已反映锁定内容。
146
+ **Direction lock mode** 仍为 interactive 语义,但 Plan 会话的 **主路径是 feedback-driven**;grill close 后门禁,不是主循环。
115
147
 
116
148
  ### P.4 Build(执行 Phase 1 可执行门禁)
117
149
 
118
150
  用户点击 **Build**(或 Plan → Agent)后:
119
151
 
120
- 1. 按 Build todos 顺序执行:`harness-init` → `finalize-compass-plans` §5 Review 链(5.1→5.2→5.3)→ `pm-lock` → §6
121
- 2. **禁止**把 Build 当成重新跑一遍 grill-me
152
+ 1. 按 Build todos 顺序执行:`harness-init` → `finalize-compass-plans`(以 **View Plan 打开的那一份** CreatePlan 为准)→ §5 Review 链(5.1→5.2→5.3)→ `pm-lock` → §6
153
+ 2. **禁止**把 Build 当成重新跑 feedback / grill
122
154
  3. pre-commit checklist(见 §5)全 `[x]` 后再 commit / push integration 分支
123
155
 
124
156
  **非 Plan 路径从这里继续 ↓**
@@ -156,11 +188,11 @@ Explore candidate directions targeting **product completeness**:
156
188
 
157
189
  ## 3. Lock Direction — bundled `grill-me`
158
190
 
159
- > **非 Plan 路径**。Cursor Plan mode 用 §P.3 动态 grill-me(先 CreatePlan 再分阶段改文档)。
191
+ > **非 Plan 路径**。Cursor Plan mode 用 §P.3 feedback loop + §P.3.5 deferred grill(主路径不是 grill)。
160
192
 
161
193
  **Direction lock mode: `interactive`**(`mstar-iteration` §1.2 默认;本命令不使用 `autonomous`)。
162
194
 
163
- This command bundles a **non-`mstar-*`** skill at `skills/grill-me/SKILL.md`. **Only this command step**(及 §P.3)references it — **do not** load it from `mstar-harness-core` or other `mstar-*` skills.
195
+ This command bundles a **non-`mstar-*`** skill at `skills/grill-me/SKILL.md`. **Only this command step**(及 §P.3.5 deferred grill)references it — **do not** load it from `mstar-harness-core` or other `mstar-*` skills.
164
196
 
165
197
  **Before this step:** Read `skills/grill-me/SKILL.md`.
166
198
 
@@ -176,7 +208,7 @@ Run **grill-me** to stress-test candidate directions with the user:
176
208
 
177
209
  ## 4. Write Compass & Plans
178
210
 
179
- > **非 Plan 路径**。Plan mode 在 §P.2–P.3 维护草稿,Build 时由 `finalize-compass-plans` 落盘终稿。
211
+ > **非 Plan 路径**。Plan mode 在 §P.2–P.3.5 维护 **同一份** CreatePlan 草稿,Build 时由 `finalize-compass-plans` 落盘终稿。
180
212
 
181
213
  Produce harness artifacts per **`mstar-iteration` § 1.3**(template: `mstar-iteration/references/iteration-compass-template.md`):
182
214
 
@@ -224,7 +256,7 @@ Only after 5.4 → proceed to §6.
224
256
 
225
257
  PM must print this block before §6; all `[ ]` must be `[x]`:
226
258
 
227
- - [ ] grill-me decisions recorded in compass
259
+ - [ ] direction lock decisions recorded in compass(Plan 路径:Feedback log + 可选 Deferred grill log;非 Plan:grill-me)
228
260
  - [ ] Draft compass + plans + `status.json` registered
229
261
  - [ ] product-manager invoke completed — compass / plans / specs / **`<iteration-id>/` package**(按需);**未**向 `{KNOWLEDGE_DIR}/` 新增
230
262
  - [ ] architect invoke completed — compass / **specs** edited;**未**向 `{KNOWLEDGE_DIR}/` 新增
@@ -101,7 +101,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
101
101
  | `mstar-strategy` | `STRATEGY.md` 全局战略方向 —— 产品愿景、技术方向、决策原则 |
102
102
  | `mstar-skill-authoring` | mstar-native skill authoring: trigger contracts, progressive disclosure, pressure scenarios, behavior-change evidence |
103
103
  | `mstar-roles` | 角色正文 hub |
104
- | `mstar-host` | 宿主适配(自动识别;`references/opencode.md` / `cursor.md` / `codex.md` / `parallel-dispatch.md`) |
104
+ | `mstar-host` | 宿主适配(自动识别;`references/opencode.md` / `cursor.md` / `codex.md` / `kimi.md` / `parallel-dispatch.md`) |
105
105
 
106
106
  ## 宿主 `mstar-host`
107
107
 
@@ -112,6 +112,7 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
112
112
  | OpenCode | `question`、**task tool**(**subagent** 参数)→ `references/opencode.md` |
113
113
  | Cursor | Task 并行 QC;Plan 双写 → `references/cursor.md` · `cursor-plan-mode-bridge.md` |
114
114
  | Codex | plugin skills、sandbox/apply_patch/tool discovery;无 invoke 工具时不声称 subagent dispatch → `references/codex.md` |
115
+ | Kimi | `Agent`/`AgentSwarm`(仅 `coder`/`explore`/`plan`);角色绑定在 prompt(C5b);Plan 双写 → `references/kimi.md` · `kimi-plan-mode-bridge.md` |
115
116
  | 其它 | 同 `mstar-host` skill;按工具信号选 reference |
116
117
 
117
118
  ## 护栏(不变量)
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-host
3
- description: Morning Star host adapter (OpenCode, Cursor, Codex). 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, sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
3
+ description: Morning Star host adapter (OpenCode, Cursor, Codex, Kimi). 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, sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
4
4
  ---
5
5
 
6
6
  # Morning Star Host Adapter
@@ -31,7 +31,8 @@ Use **capability signals** (not filesystem paths):
31
31
  | **`question`** tool or **`task`** tool (**subagent** invoke) | `opencode` | `references/opencode.md` |
32
32
  | **Task** + `subagent_type`, no CreatePlan | `cursor` | `references/cursor.md` |
33
33
  | **Codex app/CLI/plugin context**, `/plan`, `/goal`, Goal tools, `functions.*`, `codex_app.*`, `tool_search`, Browser plugin tools | `codex` | `references/codex.md`; Plan/Goal mode also `references/codex-plan-goal-mode-bridge.md` |
34
- | Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, and **`codex.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
34
+ | **`Agent`** / **`AgentSwarm`** / **`AskUserQuestion`** / **`EnterPlanMode`**, Kimi plugin (`.kimi-plugin/plugin.json`), `/morning-star-harness:*` commands | `kimi` | `references/kimi.md`; Plan mode also `references/kimi-plan-mode-bridge.md` |
35
+ | Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, **`codex.md`**, and **`kimi.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
35
36
 
36
37
  ## Parallel dispatch (invoke-capable hosts)
37
38
 
@@ -189,16 +189,21 @@ When starting a **new iteration** under Cursor Plan mode (host command may orche
189
189
 
190
190
  | Phase | Behavior | Forbidden |
191
191
  |-------|----------|-----------|
192
- | Early CreatePlan | After read-only research, **immediately** CreatePlan with blank Phase 1 scaffold (Direction / Scope / Acceptance / Non-Goals / Branch policy / Plans / Grill log placeholders) + Build-bound todos | Wait until interactive direction lock finishes before CreatePlan |
193
- | Staged interactive lock | Dynamic number of clarify stages in the Plan session; after each stage, **update CreatePlan body** and dual-write SSOT **drafts** (`{ITERATION_DIR}/<id>/delivery-compass.md` stub, `{PLAN_DIR}` plan stubs, `status.json` rows when direction converges) | Treat lock stages as completed Build todos; fix a hard-coded stage count; dispatch Review & Edit / commit / integration branch |
192
+ | 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 |
193
+ | 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 |
194
+ | 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 |
194
195
  | Pre-Build | Maintain documents only | Execute Review chain, commit, or create `spec_integration_branch` |
195
- | Build | Run Phase 1 executable todos: finalize SSOT → sequential Review & Edit (`product-manager` `architect` → `writing-specialist`) → PM lock → integration branch | Replay interactive direction lock as if Plan session never happened |
196
+ | 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 |
197
+
198
+ **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.
196
199
 
197
200
  **Plan mode ≠ executing todos.** Build = Phase 1 executable gate (Review chain, lock, branch).
198
201
 
202
+ **Branch policy in Plan session**: write **recommended** `iteration_base_branch` / `target_branch` (+ short rationale) into the plan — do **not** silently default to `main`/`master`. User may correct via feedback; ask only after feedback-close if still TBD/conflicting.
203
+
199
204
  **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.
200
205
 
201
- **Helpers**: third-party interview helpers are **not** named here; host **command** layer discovers them when needed.
206
+ **Helpers**: third-party interview helpers are **not** named here; host **command** layer may use them only after feedback-close when gaps remain.
202
207
 
203
208
  ## Anti-patterns
204
209
 
@@ -211,7 +216,8 @@ When starting a **new iteration** under Cursor Plan mode (host command may orche
211
216
  | Skip `spec-register` | Add `plans[]` row before implement |
212
217
  | Build starts coding in the parent session | Resume PM context; dispatch implement work or block on missing Assignment |
213
218
  | Follow-up only in chat / no roadmap section | Add `Roadmap / deferred scope` to CreatePlan and SSOT plan before implement |
214
- | Phase 1 Plan mode: grill/lock finishes before first CreatePlan | CreatePlan blank scaffold first; update body each lock stage |
219
+ | Phase 1 Plan mode: second CreatePlan / stale open plan | Edit the original plan file only; merge+delete duplicates |
220
+ | Phase 1 Plan mode: interview loop before feedback-close | Feedback-driven autonomous plan updates; deferred interview only after close signal if gaps remain |
215
221
  | Phase 1 Plan mode: Review / commit / branch before Build | Keep Pre-Build document-only; execute those todos after Build |
216
222
 
217
223
  ## Related skills
@@ -29,7 +29,7 @@ Before **SwitchMode → Agent**: mirror plan exists; `status.json` lists `plan_i
29
29
 
30
30
  After **Build**: treat the run as plan resume, not `/pm` replay. Reload `mstar-harness-core` + this Cursor reference, resume Morning Star plans as `project-manager` orchestration, and dispatch implementation through Task unless the user explicitly overrides the harness.
31
31
 
32
- **`mstar-iteration` Phase 1 in Plan mode**: CreatePlan blank scaffold **before** interactive direction lock; update CreatePlan + SSOT drafts each lock stage; **do not** run Review & Edit / commit / integration branch until **Build**. Detail → **`cursor-plan-mode-bridge.md`** § `mstar-iteration` Phase 1 in Plan mode.
32
+ **`mstar-iteration` Phase 1 in Plan mode**: CreatePlan **once** (blank scaffold); then **feedback-driven** in-place updates on that same plan file; deferred interview only after user signals feedback-close **and** gaps remain; **do not** run Review & Edit / commit / integration branch until **Build**. Detail → **`cursor-plan-mode-bridge.md`** § `mstar-iteration` Phase 1 in Plan mode.
33
33
 
34
34
  Enforcement: `rules/mstar-cursor-plan-mode.mdc` when plugin active.
35
35
 
@@ -0,0 +1,55 @@
1
+ # Kimi Plan Mode × Harness Dual-Write Bridge
2
+
3
+ > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** when Plan mode is active. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-plan-conventions`. On conflict, **`mstar-harness-core`** wins.
4
+
5
+ ## Purpose
6
+
7
+ Kimi **Plan mode** (`EnterPlanMode` / `ExitPlanMode`, `/plan`, or `Shift-Tab`) uses a session plan file and read-only exploration for design. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`). This reference defines **dual-write**: mirror durable plan artifacts to the repo; never treat the Kimi session plan file alone as the handoff surface.
8
+
9
+ ## Priority (hard)
10
+
11
+ 1. User explicit instructions (this turn)
12
+ 2. Project `AGENTS.md` / `CLAUDE.md`
13
+ 3. **`{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json`** (harness SSOT)
14
+ 4. Kimi plan file and `TodoList` UI (session UX mirror)
15
+
16
+ **NEVER** cite only a Kimi plan file path in Assignment **Plan Path**, **Context Loaded**, or Completion Report when `{PLAN_DIR}/<plan-id>-<name>.md` should exist.
17
+
18
+ ## When this applies
19
+
20
+ - Kimi **Plan mode** is active (`EnterPlanMode` succeeded, `/plan on`, or `kimi --plan`).
21
+ - Morning Star plugin is installed (`.kimi-plugin/plugin.json` skills loaded) or **`/skill:pm`** / **`pm` skill** is in use.
22
+
23
+ ## Before entering Plan mode
24
+
25
+ 1. **Read** (minimum): `mstar-plan-conventions`, `mstar-plan-artifacts` (SKILL.md); Prepare gates from `mstar-phase-gates` if not hotfix.
26
+ 2. **Discover** `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions`.
27
+ 3. **Initialize** if absent: `{HARNESS_DIR}/`, `{PLAN_DIR}/`, `status.json` from `mstar-plan-artifacts/templates/status.empty.json`, `archived/residuals/`, gitignored `sdd/`.
28
+
29
+ ## Plan mode workflow (dual-write)
30
+
31
+ | Step | Kimi session | Harness SSOT |
32
+ |------|--------------|--------------|
33
+ | Enter | `EnterPlanMode` or `/plan on` — explore read-only | Ensure `{HARNESS_DIR}` exists; register `plan_id` in `status.json` when known |
34
+ | Design | Edit Kimi plan file with `Write` / `Edit` (when Plan mode allows writes) | Mirror main plan to `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes |
35
+ | Clarify | `AskUserQuestion` for blocking ambiguity only | Record decisions in plan / spec when durable |
36
+ | Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; `status.json` row updated |
37
+ | Implement | Agent mode resumes | Per-task commits, Working branch, dispatch per `mstar-dispatch-gates` |
38
+
39
+ `TodoList` and Kimi UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and `status.json` when coordination requires it.
40
+
41
+ ## ExitPlanMode gate
42
+
43
+ Do **not** treat ExitPlanMode approval as Morning Star **Done**. Implementation still follows phase gates, per-task commits, QC, and QA per the SSOT plan.
44
+
45
+ ## `mstar-iteration` Phase 1
46
+
47
+ When iteration Phase 1 runs in Plan mode:
48
+
49
+ - Use **one** plan session; iterate the **same** Kimi plan file and SSOT mirror in place (feedback-driven edits).
50
+ - Do **not** run Review & Edit, commit integration branch, or dispatch implementers until the user approves via `ExitPlanMode` (or explicit go-ahead after plan lock).
51
+ - After approval: reload `mstar-harness-core` + `kimi.md`; resume as `project-manager` orchestration.
52
+
53
+ ## Enforcement
54
+
55
+ Conflict with harness invariants → **`mstar-harness-core`** wins. Full Cursor CreatePlan bridge detail lives in `cursor-plan-mode-bridge.md` when hosts differ; Kimi uses this lighter Enter/Exit bridge only.
@@ -0,0 +1,163 @@
1
+ # Kimi host reference
2
+
3
+ Load when **`mstar-host`** detection resolves **kimi** (Kimi Code CLI session, `.kimi-plugin/plugin.json` plugin installed, `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.
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 / `status.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
+ Because Kimi cannot bind roles via agent config, every dispatch **must** carry the played Morning Star role in the **Assignment** and in the **`Agent` prompt**:
63
+
64
+ 1. **`Execute as: <role-id>`** in Assignment (harness routing SSOT).
65
+ 2. **`Act as <role-id>`** (or equivalent) at the top of the Agent prompt.
66
+ 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.
67
+ 4. **`subagent_type`** — pick from the mapping table above only.
68
+
69
+ Paste-only Assignment without an **`Agent`** call is **not** dispatch.
70
+
71
+ ### Assignment / Agent-prompt template
72
+
73
+ ```markdown
74
+ ## Assignment
75
+
76
+ **Execute as**: fullstack-dev
77
+ **Delegation**: forbidden
78
+ **Working branch**: feat/example
79
+ **Plan Path**: .mstar/plans/20260717-example.md
80
+
81
+ **IDENTITY:** You ARE `fullstack-dev`. Act as `fullstack-dev` for this task.
82
+ Load: `mstar-harness-core` → `mstar-host` → `kimi.md` → `mstar-roles` → `references/fullstack-dev-shared.md` → topic skills per that reference.
83
+
84
+ <task body>
85
+ ```
86
+
87
+ PM dispatch invocation (same turn):
88
+
89
+ ```text
90
+ Agent(
91
+ subagent_type: "coder",
92
+ prompt: "<full Assignment body including Act as + skill load>"
93
+ )
94
+ ```
95
+
96
+ For **`explore`** orientation:
97
+
98
+ ```text
99
+ Agent(subagent_type: "explore", prompt: "... Act as explore-only orientation; Execute as: n/a ...")
100
+ ```
101
+
102
+ For Prepare plan-only when plan subagent is appropriate:
103
+
104
+ ```text
105
+ Agent(subagent_type: "plan", prompt: "... Act as architect for plan design; load mstar-roles → architect.md ...")
106
+ ```
107
+
108
+ ## PM dispatch (`Agent` / `AgentSwarm`)
109
+
110
+ Harness **dispatch** on Kimi = **one or more `Agent` tool calls** with correct **`subagent_type`** and role-bound prompts.
111
+
112
+ | Harness | Kimi |
113
+ |---------|------|
114
+ | `Execute as: <role-id>` | Role id in Assignment + **Act as** + skill load in **Agent** prompt |
115
+ | `subagent_type` for invoke | `coder` \| `explore` \| `plan` only (see mapping) |
116
+ | 1 Assignment ⇒ 1 invoke | **1 `Agent`** call with full Assignment prompt |
117
+ | Parallel batch **N** | **N `Agent`** calls in **one assistant message** when roles may differ; **`AgentSwarm`** only when same role/profile |
118
+ | No `Agent` call | **Not dispatched** — paste-only / `dispatch incomplete` |
119
+
120
+ ### QC default
121
+
122
+ - **`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"`.
123
+ - **`inline`**: **N=1** per `parallel-dispatch.md`.
124
+
125
+ Cannot emit required **N** → **`Blocked`**.
126
+
127
+ ### SDD implement (serial)
128
+
129
+ - **`Execution mode: sdd`**: one implementer **`Agent`** per task id; task reviewer = new **`Agent`** (no sticky resume unless host adds it later).
130
+ - **Never** multiple implementer Agents in one message for the same plan.
131
+
132
+ ## Clarify
133
+
134
+ - Prefer **`AskUserQuestion`** for 1–3 high-impact choices with known options.
135
+ - Fallback: one concise Markdown question after codebase exploration cannot answer it.
136
+ - `AskUserQuestion` for plan approval is wrong in Plan mode — use **`ExitPlanMode`** for plan sign-off.
137
+ - “Question asked” ≠ clarify done; blocking ambiguity → **`Blocked`** or escalation.
138
+
139
+ ## Commands and skills paths
140
+
141
+ | Surface | Path / invocation |
142
+ |---------|-------------------|
143
+ | Plugin skills | `/skill:<skill-name>` or auto-load from `skills/` via plugin |
144
+ | Plugin commands | `/morning-star-harness:iteration-start` etc. |
145
+ | Session entry | `sessionStart.skill: pm` → `mstar-harness-core` via pm **Read next** |
146
+
147
+ ## Files, shell, and approvals
148
+
149
+ - Prefer **Glob** / **Grep** for search; **Write** / **Edit** for edits.
150
+ - Respect Kimi approval prompts for destructive operations.
151
+ - Do not edit `$KIMI_CODE_HOME` credentials, managed plugin copies, or user secrets without explicit consent.
152
+
153
+ ## Git and final evidence
154
+
155
+ - Git work follows `mstar-branch-worktree` and Assignment **Working branch** / **Branch policy**.
156
+ - Completion reports cite concrete commands, artifacts, and commit lines when required.
157
+
158
+ ## Gotchas
159
+
160
+ - Plugin install copies source to managed dir — edit checkout + reinstall to pick up harness changes.
161
+ - **`AgentSwarm`** shares one template — not for mixed-role QC tri-review; use **3× Agent** instead.
162
+ - Session plan file and `TodoList` are not durable SSOT unless mirrored to `{HARNESS_DIR}`.
163
+ - No custom Kimi agent profiles for Morning Star roles — role binding is **always** prompt + skill load (C5b).
@@ -1,6 +1,6 @@
1
1
  # Parallel dispatch (invoke-capable hosts)
2
2
 
3
- Shared PM dispatch contract for **any** host that uses subagent / Task / named-role invoke (OpenCode, Cursor Task, Codex only when a callable multi-agent / Task tool is actually available). Process SSOT also in `mstar-dispatch-gates`.
3
+ Shared PM dispatch contract for **any** host that uses subagent / Task / Agent invoke (OpenCode task tool, Cursor Task, Kimi **Agent** / **AgentSwarm**, Codex only when a callable multi-agent / Task tool is actually available). Process SSOT also in `mstar-dispatch-gates`.
4
4
 
5
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
6
 
@@ -17,7 +17,7 @@ Printing `## Assignment` in the main thread **without** matching host invocation
17
17
 
18
18
  1. Finalize all `N` Assignment payloads (after any prerequisite turn).
19
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`; each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
20
+ 3. Issue **`N` host invocations first** — OpenCode: **N `task` tool** calls with **subagent**; Cursor: **N `Task`** with `subagent_type`; Kimi: **N `Agent`** calls (each prompt carries **Act as** + skill load; `subagent_type` ∈ {`coder`,`explore`,`plan`} only — see `kimi.md` C5/C5b); each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
21
21
  4. Optionally post a short **Status Update** after invocations (audit trail only — does not replace step 3).
22
22
 
23
23
  ## Hard rules
@@ -92,11 +92,18 @@ compass/plans 初稿落盘前,必须锁定**单一**迭代方向、成功标
92
92
  | **`interactive`** | **默认**(未显式声明 mode 时一律用此) | 与用户/产品**逐问**收敛方向与 branch policy;不得静默默认 `main`/`master` |
93
93
  | **`autonomous`** | **仅**当 caller / Assignment **显式**声明 `Direction lock mode: autonomous`(或等价书面 opt-in) | 代码优先调研 → 排序候选 → **锁定推荐方向并落盘 rationale**;不因「是否同意该方向」例行问用户。细则 → **`references/autonomous-direction-lock.md`** |
94
94
 
95
- **宿主 Plan UX(interactive)**:若宿主提供 Plan 会话(先写 session plan、后点 Build 才执行 todos),允许 **先 scaffold 空白 Phase 1 文档/todos,再分阶段收敛**方向与 branch policy,并在每段收敛后更新 scaffold;**非** Plan 会话仍按「收敛后再写 compass/plans 初稿」的默认顺序。此条 **不**改变 autonomous 路径,也 **不**要求非 Plan 宿主先写空文件。
95
+ **宿主 Plan UX(interactive)**:若宿主提供 Plan 会话(先写 session plan、后点 Build 才执行 todos):
96
+
97
+ - 允许 **先 scaffold 空白 Phase 1 文档/todos**,再以 **用户反馈驱动** 收敛:Agent 探索并写入推荐,**原地更新同一份** session plan;用户提方向/意见,**不以**例行问卷为主路径。
98
+ - Branch policy:在 plan 中写推荐值 + rationale(不得静默 `main`/`master`);用户可用反馈改正;仅在用户明确结束反馈后仍缺字段时再追问。
99
+ - 访谈式收敛 **仅**在反馈结束后仍有阻塞缺口时可选发起。
100
+ - **禁止**为更新内容再开第二份 session plan。
101
+
102
+ **非** Plan 会话仍按「收敛后再写 compass/plans 初稿」的默认顺序。此条 **不**改变 autonomous 路径,也 **不**要求非 Plan 宿主先写空文件。
96
103
 
97
104
  **禁止**:在未显式 opt-in 时自行切换到 `autonomous`(例如仅因读了本 skill 或存在 roadmap next)。
98
105
 
99
- **Branch policy gate(interactive — 默认路径)**:若用户、现有 roadmap、或项目约定未明确 `iteration_base_branch` / `target_branch`,PM 必须检查当前分支并向用户确认。**不得**因为存在 `main` / `master` 就默认从默认分支开 iteration 或向默认分支提 PR。
106
+ **Branch policy gate(interactive — 默认路径)**:若用户、现有 roadmap、或项目约定未明确 `iteration_base_branch` / `target_branch`,PM 必须检查当前分支并向用户确认(**Plan 会话**走上方「推荐写入 plan + 反馈改正」;非 Plan 仍须确认)。**不得**因为存在 `main` / `master` 就默认从默认分支开 iteration 或向默认分支提 PR。
100
107
 
101
108
  **Autonomous branch resolve**:仅 `autonomous` 模式;解析顺序与 STOP 规则见 **`references/autonomous-direction-lock.md`**(勿把该顺序套用到 interactive 以跳过向用户确认)。
102
109
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: pm
3
- description: "PM entry shim — force project-manager orchestration when user invokes /pm or this skill (Codex and Cursor). General per-plan PM work: this skill + project-manager.md. Formal iteration lifecycle: mstar-iteration (host commands/ may orchestrate Phase 1–5). Boot, routing, dispatch SSOT → mstar-roles/references/project-manager.md and topic mstar-* skills — not here."
3
+ description: "PM entry shim — force project-manager orchestration when user invokes /pm or this skill (Codex, Cursor, OpenCode, and Kimi). General per-plan PM work: this skill + project-manager.md. Formal iteration lifecycle: mstar-iteration (host commands/ may orchestrate Phase 1–5). Boot, routing, dispatch SSOT → mstar-roles/references/project-manager.md and topic mstar-* skills — not here."
4
4
  ---
5
5
 
6
6
  # PM (entry shim)
@@ -14,10 +14,11 @@ description: "PM entry shim — force project-manager orchestration when user in
14
14
  | **Codex** | **`/pm`** or this skill → **`project-manager`** for the session |
15
15
  | **Cursor** | **`/pm`** or this skill → general PM orchestration (single-plan, hotfix, QC waves, dispatch) **without** starting an iteration. Formal iteration → host **`commands/`** + **`mstar-iteration`** |
16
16
  | **OpenCode** | Same as Cursor when no command: **`project-manager`** via `mstar-roles` → `references/project-manager.md` |
17
+ | **Kimi** | **`/skill:pm`** or this skill → **`project-manager`**; iteration → plugin **`commands/`** (`/morning-star-harness:iteration-*`) |
17
18
 
18
19
  **Iteration lifecycle** (optional): host `commands/` may sequence Phase 1–5; semantics SSOT → **`mstar-iteration`**. Not required for ordinary PM work.
19
20
 
20
- Detect host → **`mstar-host`** → `references/codex.md` | `cursor.md` | `opencode.md`.
21
+ Detect host → **`mstar-host`** → `references/codex.md` | `cursor.md` | `opencode.md` | `kimi.md`.
21
22
 
22
23
  ## Read next (in order)
23
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {