@mstar-harness/opencode 1.7.1 → 1.8.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.
- package/CHANGELOG.md +16 -0
- package/harness-commands/codebase-audit.md +34 -0
- package/harness-commands/iteration-drive.md +17 -159
- package/harness-commands/iteration-loop.md +16 -194
- package/harness-commands/iteration-start.md +17 -183
- package/harness-skills/mstar-audit/SKILL.md +181 -0
- package/harness-skills/mstar-audit/references/audit-playbook.md +130 -0
- package/harness-skills/mstar-audit/references/finding-format.md +65 -0
- package/harness-skills/mstar-branch-worktree/SKILL.md +38 -27
- package/harness-skills/mstar-coding-behavior/SKILL.md +40 -114
- package/harness-skills/mstar-compound/SKILL.md +25 -197
- package/harness-skills/mstar-compound/references/compound-workflow.md +155 -0
- package/harness-skills/mstar-dispatch-gates/SKILL.md +3 -8
- package/harness-skills/mstar-harness-core/SKILL.md +3 -1
- package/harness-skills/mstar-host/references/_shared/host-role-binding-core.md +44 -0
- package/harness-skills/mstar-host/references/_shared/plan-mode-bridge-core.md +91 -0
- package/harness-skills/mstar-host/references/codex-plan-goal-mode-bridge.md +6 -11
- package/harness-skills/mstar-host/references/codex.md +1 -1
- package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +9 -78
- package/harness-skills/mstar-host/references/cursor.md +3 -3
- package/harness-skills/mstar-host/references/kimi-plan-mode-bridge.md +5 -24
- package/harness-skills/mstar-host/references/kimi.md +5 -32
- package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +3 -13
- package/harness-skills/mstar-host/references/omp.md +5 -32
- package/harness-skills/mstar-host/references/opencode.md +1 -3
- package/harness-skills/mstar-host/references/zcode-plan-mode-bridge.md +5 -24
- package/harness-skills/mstar-host/references/zcode.md +5 -32
- package/harness-skills/mstar-iteration/SKILL.md +21 -211
- package/harness-skills/mstar-iteration/references/phase-3-iteration-close.md +95 -0
- package/harness-skills/mstar-iteration/references/phase-4-5-pr-delivery.md +81 -0
- package/harness-skills/mstar-iteration/references/phase5-helper-discovery.md +24 -0
- package/harness-skills/mstar-phase-gates/SKILL.md +2 -2
- package/harness-skills/mstar-plan-artifacts/references/plan-quality-bar.md +99 -0
- package/harness-skills/mstar-roles/SKILL.md +1 -1
- package/harness-skills/mstar-roles/references/_shared/leaf-executor-core.md +46 -0
- package/harness-skills/mstar-roles/references/architect.md +3 -23
- package/harness-skills/mstar-roles/references/frontend-dev.md +4 -24
- package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +4 -24
- package/harness-skills/mstar-roles/references/ops-engineer.md +3 -23
- package/harness-skills/mstar-roles/references/product-manager.md +3 -23
- package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +5 -5
- package/harness-skills/mstar-roles/references/project-manager.md +4 -13
- package/harness-skills/mstar-roles/references/prompt-engineer.md +4 -23
- package/harness-skills/mstar-roles/references/qa-engineer.md +3 -22
- package/harness-skills/mstar-roles/references/qc-specialist/deep-review-lenses.md +16 -75
- package/harness-skills/mstar-roles/references/qc-specialist/reviewer-workflow.md +1 -1
- package/harness-skills/mstar-roles/references/qc-specialist-shared.md +4 -17
- package/harness-skills/mstar-roles/references/writing-specialist.md +4 -24
- package/harness-skills/mstar-sdd/SKILL.md +1 -0
- package/harness-skills/pm/SKILL.md +2 -0
- package/package.json +1 -1
|
@@ -21,249 +21,77 @@ Knowledge that isn't captured evaporates when the session ends. Knowledge that i
|
|
|
21
21
|
|
|
22
22
|
**SSOT**: `mstar-plan-conventions/references/artifact-storage-paths.md`。本 skill 不重定义路径;知识文档 → `{HARNESS_DIR}/knowledge/<category>/<slug>.md`,CONCEPTS.md → `<repo-root>/CONCEPTS.md`。`<category>` 取值见 `references/category-mapping.md`。
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## 是否值得结晶(自检门禁)
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
调用本 skill 前,PM(或触发方)**必须**对候选问题逐条自检 Q1–Q8(诊断耗时 / 非显而易见性 / 可复用性 / 项目特异性 / 既有重叠 / 架构影响 / 失败尝试价值 / 跨模块)。完整问题表、决策矩阵(Yes≥4 强烈建议;Yes=3 Lightweight;Yes≤2 跳过;Q5=Yes 高重叠不新建)与示例判定 → **`references/compound-workflow.md`**「是否值得结晶」。
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
| # | 问题 | 说明 |
|
|
31
|
-
|---|------|------|
|
|
32
|
-
| Q1 | 这个问题的诊断过程耗时是否 ≥ 15 分钟(或 ≥ 3 次尝试)? | 若只是 1-2 次尝试就找到答案,可能太琐碎 |
|
|
33
|
-
| Q2 | 解决方案是否涉及**非显而易见**的知识(隐含假设、框架行为、workaround)? | 显而易见的知识无需文档化(如"少了个分号") |
|
|
34
|
-
| Q3 | 同一个开发者在未来遇到类似问题时,是否可能**再次花费相似的时间**来诊断? | 核心问题:知识能否复用? |
|
|
35
|
-
| Q4 | 问题的**根因**是否是项目特定的(不是通用语言/框架问题)? | 通用问题可搜索到,项目特定问题必须自己记录 |
|
|
36
|
-
| Q5 | `{KNOWLEDGE_DIR}` 中是否**已有**与此高度重叠的文档? | 若有 → 更新已有文档,不新建(见 Phase 2 重叠检测) |
|
|
37
|
-
| Q6 | 此解决方案是否可能**引导未来架构决策**或成为约定? | Knowledge track 的典型触发条件 |
|
|
38
|
-
| Q7 | 此解决方案中的"**什么没起作用**"部分是否有价值? | 失败的尝试往往是最有教学价值的部分 |
|
|
39
|
-
| Q8 | 问题是否涉及** ≥ 2 个模块/组件**的交互? | 跨模块问题最难排查,最值得记录 |
|
|
40
|
-
|
|
41
|
-
### 决策矩阵
|
|
42
|
-
|
|
43
|
-
| 得分 | 行动 |
|
|
44
|
-
|------|------|
|
|
45
|
-
| **Yes ≥ 4**(含 Q5=No) | **强烈建议结晶**。执行完整 Phase 1-7。 |
|
|
46
|
-
| **Yes = 3** | **建议结晶**。使用 Lightweight 模式(Phase 1 单遍)。 |
|
|
47
|
-
| **Yes ≤ 2** | **跳过**。在 conversation/Completion Report 中注明"跳过结晶(<简述原因>)"。 |
|
|
48
|
-
| **Q5 = Yes(高重叠)** | 无论其它得分如何,**不要新建**。执行 Phase 2 重叠检测,更新已有文档即可。 |
|
|
49
|
-
| **任一 Not sure** | 倾向于回答者的默认判断。若 Q1-Q4 有 ≥ 2 个 Yes,仍建议结晶。 |
|
|
50
|
-
|
|
51
|
-
### 示例判定
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
Q1: Yes — debug 了 40 分钟
|
|
55
|
-
Q2: Yes — ActiveRecord 的 counter_cache 在 after_destroy 回调中的时序问题
|
|
56
|
-
Q3: Yes — 下次遇到类似时序问题仍会踩坑
|
|
57
|
-
Q4: Yes — 是项目特有 model 结构导致的
|
|
58
|
-
Q5: No — grep 了 knowledge/ 无匹配
|
|
59
|
-
Q6: No — 纯 bug 修复
|
|
60
|
-
Q7: Yes — 第一次尝试了手动更新 counter 导致数据不一致
|
|
61
|
-
Q8: No — 只涉及一个 model
|
|
62
|
-
→ Yes = 5 → 强烈建议结晶(Bug track)
|
|
63
|
-
```
|
|
28
|
+
**快判**:Q5 高重叠 → 更新已有文档,**不新建**;其余按决策矩阵 Yes 数。
|
|
64
29
|
|
|
65
30
|
## Integration with mstar lifecycle
|
|
66
31
|
|
|
67
|
-
Compound 在迭代收口时触发(`mstar-iteration` § iteration-close),不在 per-plan Done
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
iteration-start → [plan lifecycle × N: specify→...→Done] → iteration-close
|
|
71
|
-
│
|
|
72
|
-
mstar-compound
|
|
73
|
-
(per-iteration round)
|
|
74
|
-
│
|
|
75
|
-
{KNOWLEDGE_DIR}
|
|
76
|
-
│
|
|
77
|
-
feeds back into next iteration's specify / plan
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
迭代内所有 plan Done 后,PM 回顾整轮迭代中产生的可结晶知识,批量 compound。per-plan Done 是 per-plan 的闭环终点;compound 是迭代级收口活动。
|
|
32
|
+
Compound 在迭代收口时触发(`mstar-iteration` § iteration-close),不在 per-plan Done 后单独执行:`iteration-start → [plan lifecycle × N] → iteration-close → mstar-compound(per-iteration round)→ {KNOWLEDGE_DIR} → feeds next iteration's specify/plan`。迭代内所有 plan Done 后,PM 回顾整轮迭代可结晶知识,批量 compound。per-plan Done 是 per-plan 闭环终点;compound 是迭代级收口活动。
|
|
81
33
|
|
|
82
34
|
### Iteration package promotion(iteration-close 强制盘点)
|
|
83
35
|
|
|
84
|
-
正式迭代收口时,compound **除** plan 实现/debug/review
|
|
36
|
+
正式迭代收口时,compound **除** plan 实现/debug/review 素材外,**必须**盘点当前迭代 package。
|
|
85
37
|
|
|
86
38
|
**路径**:`{ITERATION_DIR}/<iteration-id>/**`(含 `guides/`、`specs/`、扁平 `.md`;**默认排除** `delivery-compass.md` 除非 PM 显式纳入。Legacy 根目录 `*-delivery-compass.md` 同理排除)。
|
|
87
39
|
|
|
88
40
|
| 步骤 | 动作 |
|
|
89
41
|
|------|------|
|
|
90
|
-
| 1. Inventory | 列出 package 下全部 `.md
|
|
42
|
+
| 1. Inventory | 列出 package 下全部 `.md`(除默认排除 compass);读各文件 + package `README.md`(若有) |
|
|
91
43
|
| 2. Triage | 每篇:**Promote** / **Keep snapshot** / **Skip**(理由写入 compound 摘要) |
|
|
92
44
|
| 3. Promote | 值得跨迭代复用 → 走 Q1–Q8(或轻量判定)→ Phase 2 重叠检测 → Phase 3–6 **结构化重写**进 `{KNOWLEDGE_DIR}/`(**禁止**无改写整文件复制) |
|
|
93
45
|
| 4. Trace | 源文件顶栏或 package README:`Promoted to: <knowledge-path>`;`{KNOWLEDGE_DIR}/README.md` 的 Source 可记 `iteration:<iteration-id>/<relpath>` |
|
|
94
46
|
| 5. Summary | PM 写入 compass `## Compound Round Summary`:提升篇数、保留快照、跳过及原因 |
|
|
95
47
|
|
|
96
|
-
**Promote 典型**:迭代 spec 已验证且指导未来实现;guide
|
|
97
|
-
|
|
98
|
-
**Keep snapshot**:仅迭代史、已被 `{SPECS_DIR}/` 取代的草案、或自检 ≤2 Yes 的琐碎笔记。
|
|
48
|
+
**Promote 典型**:迭代 spec 已验证且指导未来实现;guide 含非显而易见过程知识或失败尝试。**Keep snapshot**:仅迭代史、已被 `{SPECS_DIR}/` 取代的草案、或自检 ≤2 Yes 的琐碎笔记。边界 SSOT → **`mstar-iteration/references/iteration-artifact-boundaries.md`**。
|
|
99
49
|
|
|
100
|
-
|
|
50
|
+
## When to use / Skip
|
|
101
51
|
|
|
102
|
-
|
|
52
|
+
**Use**:迭代收口(`mstar-iteration` § iteration-close)批量回顾;独立触发(非迭代或紧急,任何非平凡问题解决后);重大 bug 修复后(`mstar-iteration` 未启用时手动)。
|
|
103
53
|
|
|
104
|
-
|
|
105
|
-
- **独立触发**(非迭代模式或紧急情况):任何非平凡问题解决后,PM 或开发者手动触发
|
|
106
|
-
- **Debug 后**:`mstar-iteration` 尚未启用时,重大 bug 修复后手动触发
|
|
107
|
-
|
|
108
|
-
### Skip when
|
|
109
|
-
|
|
110
|
-
- 自检清单判定 ≤ 2 个 Yes
|
|
111
|
-
- Q5 高重叠(应更新已有文档而非新建)
|
|
112
|
-
- 纯机械性工作:格式化、依赖升级、typo 修复
|
|
113
|
-
- 问题仍在进行中或方案未经验证
|
|
54
|
+
**Skip**:自检 ≤2 Yes;Q5 高重叠(更新已有而非新建);纯机械工作(格式化、依赖升级、typo);问题未经验证。
|
|
114
55
|
|
|
115
56
|
## Two tracks
|
|
116
57
|
|
|
117
|
-
The skill classifies work into one of two tracks based on problem type:
|
|
118
|
-
|
|
119
58
|
| Track | What it captures | Section structure |
|
|
120
59
|
|-------|-----------------|-------------------|
|
|
121
60
|
| **Bug** | Incident-level fix — "X broke, here's why and how we fixed it" | Problem, Symptoms, What Didn't Work, Solution, Why This Works, Prevention |
|
|
122
61
|
| **Knowledge** | Durable guidance — "this is how we do X, and why" | Context, Guidance, Why This Matters, When to Apply, Examples |
|
|
123
62
|
|
|
124
|
-
Track
|
|
63
|
+
Track 由 `problem_type` 决定,完整映射见 `references/category-mapping.md`。
|
|
125
64
|
|
|
126
65
|
## Execution modes
|
|
127
66
|
|
|
128
67
|
| Mode | When | Behavior |
|
|
129
68
|
|------|------|----------|
|
|
130
|
-
| **Full** (default) | Most cases | Dispatches research subagents for context analysis, solution extraction,
|
|
69
|
+
| **Full** (default) | Most cases | Dispatches research subagents for context analysis, solution extraction, overlap detection |
|
|
131
70
|
| **Lightweight** | Simple fixes, context-tight sessions | Single-pass documentation, no subagents, faster |
|
|
132
71
|
|
|
133
72
|
In Cursor, Full mode dispatches subagents via Task tool. PM selects mode.
|
|
134
73
|
|
|
135
|
-
## Phase 1
|
|
136
|
-
|
|
137
|
-
Read the conversation history **and**, when `iteration_id` is known, scan **`{ITERATION_DIR}/<iteration-id>/`** package per **Iteration package promotion** above.
|
|
138
|
-
|
|
139
|
-
Understand:
|
|
140
|
-
- What problem was solved (the concrete issue)
|
|
141
|
-
- What was tried and didn't work
|
|
142
|
-
- What the working solution was
|
|
143
|
-
- Why the solution works (root cause)
|
|
144
|
-
- Which files/modules were involved
|
|
145
|
-
- The plan_id if applicable (link to `status.json`)
|
|
146
|
-
|
|
147
|
-
If `{KNOWLEDGE_DIR}/README.md` exists, scan its index for related existing documents.
|
|
148
|
-
|
|
149
|
-
Classify the problem into a track (bug vs knowledge) and category using `references/category-mapping.md`.
|
|
150
|
-
|
|
151
|
-
## Phase 2: Overlap detection
|
|
152
|
-
|
|
153
|
-
Before creating a new doc, check if an existing doc covers the same ground:
|
|
154
|
-
|
|
155
|
-
1. Extract keywords from the problem (module names, error messages, technical terms)
|
|
156
|
-
2. Search `{KNOWLEDGE_DIR}/**/*.md` using frontmatter fields (`module:`, `tags:`, `problem_type:`)
|
|
157
|
-
3. Score overlap across dimensions: problem statement, root cause, solution approach, referenced files, prevention
|
|
158
|
-
|
|
159
|
-
| Overlap | Action |
|
|
160
|
-
|---------|--------|
|
|
161
|
-
| **High** (4-5 dimensions match) | **Update** the existing doc with fresher context instead of creating a new one. Add `last_updated` field. |
|
|
162
|
-
| **Moderate** (2-3 dimensions match) | Create new doc; flag for consolidation review (potential `mstar-compound-refresh` trigger) |
|
|
163
|
-
| **Low/None** | Create new doc normally |
|
|
164
|
-
|
|
165
|
-
## Phase 3: Write the document
|
|
166
|
-
|
|
167
|
-
### 3.1 Determine path
|
|
168
|
-
|
|
169
|
-
Category → directory under `{KNOWLEDGE_DIR}/`. Examples:
|
|
170
|
-
- Bug track: `build-errors/`, `runtime-errors/`, `performance-issues/`, `database-issues/`, `security-issues/`, `integration-issues/`
|
|
171
|
-
- Knowledge track: `architecture-patterns/`, `design-patterns/`, `conventions/`, `workflow-patterns/`, `tooling-decisions/`, `best-practices/`
|
|
172
|
-
|
|
173
|
-
Filename: `<sanitized-slug>.md` (lowercase, hyphen-separated, no date prefix).
|
|
174
|
-
|
|
175
|
-
### 3.2 Frontmatter
|
|
176
|
-
|
|
177
|
-
Required fields for both tracks (SSOT: `references/schema.yaml`):
|
|
178
|
-
|
|
179
|
-
```yaml
|
|
180
|
-
---
|
|
181
|
-
module: <area>
|
|
182
|
-
date: YYYY-MM-DD
|
|
183
|
-
problem_type: <enum value>
|
|
184
|
-
category: <directory name>
|
|
185
|
-
severity: critical|high|medium|low
|
|
186
|
-
plan_id: <optional, link to status.json>
|
|
187
|
-
tags: [<keywords>]
|
|
188
|
-
---
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
Bug-track adds: `symptoms`, `root_cause`, `resolution_type`.
|
|
192
|
-
Knowledge-track adds: `applies_when` (optional).
|
|
193
|
-
|
|
194
|
-
### 3.3 Body
|
|
195
|
-
|
|
196
|
-
Follow the section structure from `assets/resolution-template.md` for the determined track.
|
|
197
|
-
|
|
198
|
-
### 3.4 Validate
|
|
199
|
-
|
|
200
|
-
After writing, validate the YAML frontmatter:
|
|
201
|
-
- `---` delimiters are correct
|
|
202
|
-
- All required fields present
|
|
203
|
-
- Enum values match allowed values
|
|
204
|
-
- `date` is YYYY-MM-DD format
|
|
205
|
-
- Array fields use `[item1, item2]` syntax
|
|
206
|
-
|
|
207
|
-
## Phase 4: Discoverability check
|
|
208
|
-
|
|
209
|
-
Check whether the project's `AGENTS.md` or `CLAUDE.md` would lead a future agent to discover `{KNOWLEDGE_DIR}`.
|
|
210
|
-
|
|
211
|
-
If `{KNOWLEDGE_DIR}` is not mentioned in the root instruction file, propose the smallest addition that surfaces the knowledge store. Example:
|
|
212
|
-
|
|
213
|
-
```markdown
|
|
214
|
-
- `{HARNESS_DIR}/knowledge/` — captured solutions and reusable patterns
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
Ask for user consent before applying (PM can approve). If the user declines, the doc is still written — only the discoverability edit is skipped.
|
|
218
|
-
|
|
219
|
-
## Phase 5: CONCEPTS.md synergy
|
|
74
|
+
## Workflow skeleton(Phase 1–7)
|
|
220
75
|
|
|
221
|
-
|
|
76
|
+
完整步骤细节(Gather context / Overlap detection / Write document 含 frontmatter schema + path + validate / Discoverability check / CONCEPTS.md synergy / Update indexes / Refresh trigger)→ **`references/compound-workflow.md`**。每 Phase 一个关键决策:
|
|
222
77
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
1. Add a row to `{KNOWLEDGE_DIR}/README.md` index table (create if missing):
|
|
232
|
-
- Document (link), Source Plan (`plan_id`), Description, Status (`Active`)
|
|
233
|
-
|
|
234
|
-
2. If `plan_id` was provided, optionally update `status.json` metadata to reference this doc under `knowledge_refs`.
|
|
235
|
-
|
|
236
|
-
**iteration-close gate**: `mstar-iteration` §3.2 #5 — **each** new doc in the compound round must complete this phase; do not skip for lightweight captures.
|
|
237
|
-
|
|
238
|
-
## Phase 7: Refresh trigger
|
|
239
|
-
|
|
240
|
-
After capturing, check if the new learning suggests an older doc may now be stale (contradicted, superseded, or in a refactored domain). If so, recommend:
|
|
241
|
-
|
|
242
|
-
```
|
|
243
|
-
Consider: /pm compound-refresh <scope hint>
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
Do not automatically run refresh — only flag when there's a concrete reason.
|
|
247
|
-
|
|
248
|
-
## CONCEPTS.md bootstrap requests
|
|
249
|
-
|
|
250
|
-
If invoked specifically to create CONCEPTS.md from scratch (not to document a solved problem), redirect to `mstar-compound-refresh` (which handles full repo-wide vocabulary bootstrapping). `mstar-compound` only seeds vocabulary as a side effect of capturing a real learning.
|
|
78
|
+
1. **Gather** — 读对话史 + iteration package;分类 track/category(`references/category-mapping.md`)
|
|
79
|
+
2. **Overlap** — 高重叠 → 更新已有(加 `last_updated`);中度 → 新建并标 consolidation review;低/无 → 正常新建
|
|
80
|
+
3. **Write** — path + frontmatter(SSOT `references/schema.yaml`)+ body(`assets/resolution-template.md`)+ YAML validate
|
|
81
|
+
4. **Discoverability** — 若 root `AGENTS.md`/`CLAUDE.md` 未提 `{KNOWLEDGE_DIR}`,提议最小补充(需用户同意;拒绝则仅跳过该编辑,doc 仍写)
|
|
82
|
+
5. **CONCEPTS.md** — 项目特定领域词满足 qualifying bar 时提议入 `CONCEPTS.md`(规则见 `references/concepts-vocabulary.md`);全仓 bootstrap 归 `mstar-compound-refresh`
|
|
83
|
+
6. **Indexes** — `{KNOWLEDGE_DIR}/README.md` 加行(Document / Source Plan / Description / Status);可选 `status.json` `knowledge_refs`。**iteration-close gate**:每篇新 doc 必须 Phase 6
|
|
84
|
+
7. **Refresh trigger** — 新知识暗示旧 doc 过时 → 推荐 `/pm compound-refresh <scope>`(不自动跑,仅 flag)
|
|
251
85
|
|
|
252
86
|
## Support files
|
|
253
87
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
- `references/schema.yaml` — canonical frontmatter schema (Phase 3)
|
|
257
|
-
- `references/category-mapping.md` — problem_type → directory + track mapping (Phase 1)
|
|
258
|
-
- `references/concepts-vocabulary.md` — CONCEPTS.md rules (Phase 5)
|
|
259
|
-
- `assets/resolution-template.md` — section structure per track (Phase 3)
|
|
88
|
+
读 `references/compound-workflow.md`(Q1–Q8 + Phase 1–7)、`references/schema.yaml`(frontmatter)、`references/category-mapping.md`(track/path 映射)、`references/concepts-vocabulary.md`(CONCEPTS.md 规则)、`assets/resolution-template.md`(track 正文结构)。
|
|
260
89
|
|
|
261
90
|
## Skill dependencies
|
|
262
91
|
|
|
263
|
-
|
|
264
|
-
- **`mstar-plan-
|
|
265
|
-
- **`mstar-
|
|
266
|
-
- **`mstar-compound-refresh`** — for knowledge maintenance after capture
|
|
92
|
+
- **`mstar-plan-conventions`** — path symbols(`{KNOWLEDGE_DIR}`、`{HARNESS_DIR}`)
|
|
93
|
+
- **`mstar-plan-artifacts`** — `status.json` linking、index maintenance
|
|
94
|
+
- **`mstar-compound-refresh`** — capture 后知识维护;CONCEPTS.md 全仓 bootstrap
|
|
267
95
|
|
|
268
96
|
## NOT to do
|
|
269
97
|
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# mstar-compound — 工作流详情
|
|
2
|
+
|
|
3
|
+
> Loaded by `mstar-compound` SKILL.md at the self-check and Phase 1–7 steps. **Read `mstar-harness-core` first.** Path symbols → `mstar-plan-conventions`.
|
|
4
|
+
|
|
5
|
+
## 是否值得结晶 —— 完整自检(Q1–Q8)
|
|
6
|
+
|
|
7
|
+
在调用本 skill 前,PM(或触发方)**必须**逐条回答以下问题。得分仅辅助决策,不替代判断。每条回答 Yes / No / Not sure。
|
|
8
|
+
|
|
9
|
+
| # | 问题 | 说明 |
|
|
10
|
+
|---|------|------|
|
|
11
|
+
| Q1 | 这个问题的诊断过程耗时是否 ≥ 15 分钟(或 ≥ 3 次尝试)? | 若只是 1-2 次尝试就找到答案,可能太琐碎 |
|
|
12
|
+
| Q2 | 解决方案是否涉及**非显而易见**的知识(隐含假设、框架行为、workaround)? | 显而易见的知识无需文档化(如"少了个分号") |
|
|
13
|
+
| Q3 | 同一个开发者在未来遇到类似问题时,是否可能**再次花费相似的时间**来诊断? | 核心问题:知识能否复用? |
|
|
14
|
+
| Q4 | 问题的**根因**是否是项目特定的(不是通用语言/框架问题)? | 通用问题可搜索到,项目特定问题必须自己记录 |
|
|
15
|
+
| Q5 | `{KNOWLEDGE_DIR}` 中是否**已有**与此高度重叠的文档? | 若有 → 更新已有文档,不新建(见 Phase 2 重叠检测) |
|
|
16
|
+
| Q6 | 此解决方案是否可能**引导未来架构决策**或成为约定? | Knowledge track 的典型触发条件 |
|
|
17
|
+
| Q7 | 此解决方案中的"**什么没起作用**"部分是否有价值? | 失败的尝试往往是最有教学价值的部分 |
|
|
18
|
+
| Q8 | 问题是否涉及** ≥ 2 个模块/组件**的交互? | 跨模块问题最难排查,最值得记录 |
|
|
19
|
+
|
|
20
|
+
### 决策矩阵
|
|
21
|
+
|
|
22
|
+
| 得分 | 行动 |
|
|
23
|
+
|------|------|
|
|
24
|
+
| **Yes ≥ 4**(含 Q5=No) | **强烈建议结晶**。执行完整 Phase 1-7。 |
|
|
25
|
+
| **Yes = 3** | **建议结晶**。使用 Lightweight 模式(Phase 1 单遍)。 |
|
|
26
|
+
| **Yes ≤ 2** | **跳过**。在 conversation/Completion Report 中注明"跳过结晶(<简述原因>)"。 |
|
|
27
|
+
| **Q5 = Yes(高重叠)** | 无论其它得分如何,**不要新建**。执行 Phase 2 重叠检测,更新已有文档即可。 |
|
|
28
|
+
| **任一 Not sure** | 倾向于回答者的默认判断。若 Q1-Q4 有 ≥ 2 个 Yes,仍建议结晶。 |
|
|
29
|
+
|
|
30
|
+
### 示例判定
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
Q1: Yes — debug 了 40 分钟
|
|
34
|
+
Q2: Yes — ActiveRecord 的 counter_cache 在 after_destroy 回调中的时序问题
|
|
35
|
+
Q3: Yes — 下次遇到类似时序问题仍会踩坑
|
|
36
|
+
Q4: Yes — 是项目特有 model 结构导致的
|
|
37
|
+
Q5: No — grep 了 knowledge/ 无匹配
|
|
38
|
+
Q6: No — 纯 bug 修复
|
|
39
|
+
Q7: Yes — 第一次尝试了手动更新 counter 导致数据不一致
|
|
40
|
+
Q8: No — 只涉及一个 model
|
|
41
|
+
→ Yes = 5 → 强烈建议结晶(Bug track)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Phase 1: Gather context
|
|
45
|
+
|
|
46
|
+
Read the conversation history **and**, when `iteration_id` is known, scan **`{ITERATION_DIR}/<iteration-id>/`** package per **Iteration package promotion** (SKILL.md).
|
|
47
|
+
|
|
48
|
+
Understand:
|
|
49
|
+
- What problem was solved (the concrete issue)
|
|
50
|
+
- What was tried and didn't work
|
|
51
|
+
- What the working solution was
|
|
52
|
+
- Why the solution works (root cause)
|
|
53
|
+
- Which files/modules were involved
|
|
54
|
+
- The plan_id if applicable (link to `status.json`)
|
|
55
|
+
|
|
56
|
+
If `{KNOWLEDGE_DIR}/README.md` exists, scan its index for related existing documents.
|
|
57
|
+
|
|
58
|
+
Classify the problem into a track (bug vs knowledge) and category using `references/category-mapping.md`.
|
|
59
|
+
|
|
60
|
+
## Phase 2: Overlap detection
|
|
61
|
+
|
|
62
|
+
Before creating a new doc, check if an existing doc covers the same ground:
|
|
63
|
+
|
|
64
|
+
1. Extract keywords from the problem (module names, error messages, technical terms)
|
|
65
|
+
2. Search `{KNOWLEDGE_DIR}/**/*.md` using frontmatter fields (`module:`, `tags:`, `problem_type:`)
|
|
66
|
+
3. Score overlap across dimensions: problem statement, root cause, solution approach, referenced files, prevention
|
|
67
|
+
|
|
68
|
+
| Overlap | Action |
|
|
69
|
+
|---------|--------|
|
|
70
|
+
| **High** (4-5 dimensions match) | **Update** the existing doc with fresher context instead of creating a new one. Add `last_updated` field. |
|
|
71
|
+
| **Moderate** (2-3 dimensions match) | Create new doc; flag for consolidation review (potential `mstar-compound-refresh` trigger) |
|
|
72
|
+
| **Low/None** | Create new doc normally |
|
|
73
|
+
|
|
74
|
+
## Phase 3: Write the document
|
|
75
|
+
|
|
76
|
+
### 3.1 Determine path
|
|
77
|
+
|
|
78
|
+
Category → directory under `{KNOWLEDGE_DIR}/`. Examples:
|
|
79
|
+
- Bug track: `build-errors/`, `runtime-errors/`, `performance-issues/`, `database-issues/`, `security-issues/`, `integration-issues/`
|
|
80
|
+
- Knowledge track: `architecture-patterns/`, `design-patterns/`, `conventions/`, `workflow-patterns/`, `tooling-decisions/`, `best-practices/`
|
|
81
|
+
|
|
82
|
+
Filename: `<sanitized-slug>.md` (lowercase, hyphen-separated, no date prefix).
|
|
83
|
+
|
|
84
|
+
### 3.2 Frontmatter
|
|
85
|
+
|
|
86
|
+
Required fields for both tracks (SSOT: `references/schema.yaml`):
|
|
87
|
+
|
|
88
|
+
```yaml
|
|
89
|
+
---
|
|
90
|
+
module: <area>
|
|
91
|
+
date: YYYY-MM-DD
|
|
92
|
+
problem_type: <enum value>
|
|
93
|
+
category: <directory name>
|
|
94
|
+
severity: critical|high|medium|low
|
|
95
|
+
plan_id: <optional, link to status.json>
|
|
96
|
+
tags: [<keywords>]
|
|
97
|
+
---
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Bug-track adds: `symptoms`, `root_cause`, `resolution_type`.
|
|
101
|
+
Knowledge-track adds: `applies_when` (optional).
|
|
102
|
+
|
|
103
|
+
### 3.3 Body
|
|
104
|
+
|
|
105
|
+
Follow the section structure from `assets/resolution-template.md` for the determined track.
|
|
106
|
+
|
|
107
|
+
### 3.4 Validate
|
|
108
|
+
|
|
109
|
+
After writing, validate the YAML frontmatter:
|
|
110
|
+
- `---` delimiters are correct
|
|
111
|
+
- All required fields present
|
|
112
|
+
- Enum values match allowed values
|
|
113
|
+
- `date` is YYYY-MM-DD format
|
|
114
|
+
- Array fields use `[item1, item2]` syntax
|
|
115
|
+
|
|
116
|
+
## Phase 4: Discoverability check
|
|
117
|
+
|
|
118
|
+
Check whether the project's `AGENTS.md` or `CLAUDE.md` would lead a future agent to discover `{KNOWLEDGE_DIR}`.
|
|
119
|
+
|
|
120
|
+
If `{KNOWLEDGE_DIR}` is not mentioned in the root instruction file, propose the smallest addition that surfaces the knowledge store. Example:
|
|
121
|
+
|
|
122
|
+
```markdown
|
|
123
|
+
- `{HARNESS_DIR}/knowledge/` — captured solutions and reusable patterns
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
Ask for user consent before applying (PM can approve). If the user declines, the doc is still written — only the discoverability edit is skipped.
|
|
127
|
+
|
|
128
|
+
## Phase 5: CONCEPTS.md synergy
|
|
129
|
+
|
|
130
|
+
If the captured learning introduces or clarifies a domain term whose meaning is project-specific and not obvious to a newcomer, propose adding it to `CONCEPTS.md` at the repo root.
|
|
131
|
+
|
|
132
|
+
Read `references/concepts-vocabulary.md` for inclusion rules. Only propose when the term meets the qualifying bar:
|
|
133
|
+
- Its meaning in this project is precise enough that a new engineer would need it defined
|
|
134
|
+
- It is not general programming vocabulary
|
|
135
|
+
|
|
136
|
+
If `CONCEPTS.md` doesn't exist yet, ask whether to seed it. A seed populates the core domain nouns of the area the learning touches; a full repo-wide bootstrap is the job of `mstar-compound-refresh`.
|
|
137
|
+
|
|
138
|
+
## Phase 6: Update indexes
|
|
139
|
+
|
|
140
|
+
1. Add a row to `{KNOWLEDGE_DIR}/README.md` index table (create if missing):
|
|
141
|
+
- Document (link), Source Plan (`plan_id`), Description, Status (`Active`)
|
|
142
|
+
|
|
143
|
+
2. If `plan_id` was provided, optionally update `status.json` metadata to reference this doc under `knowledge_refs`.
|
|
144
|
+
|
|
145
|
+
**iteration-close gate**: `mstar-iteration` §3.2 #5 — **each** new doc in the compound round must complete this phase; do not skip for lightweight captures.
|
|
146
|
+
|
|
147
|
+
## Phase 7: Refresh trigger
|
|
148
|
+
|
|
149
|
+
After capturing, check if the new learning suggests an older doc may now be stale (contradicted, superseded, or in a refactored domain). If so, recommend:
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
Consider: /pm compound-refresh <scope hint>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Do not automatically run refresh — only flag when there's a concrete reason.
|
|
@@ -105,19 +105,14 @@ When **`Execution mode: sdd`** (`mstar-sdd`):
|
|
|
105
105
|
|
|
106
106
|
## 反模式(派发)
|
|
107
107
|
|
|
108
|
+
完整反模式索引见 **`mstar-harness-core`**;lease / worktree / Phase 相关反模式见 **`mstar-branch-worktree`** 与 **`mstar-iteration`**。本节仅列派发机制专属:
|
|
109
|
+
|
|
108
110
|
- QC 三审拆在多条消息(tri 模式)或单席却未附 review-package 路径。
|
|
109
111
|
- 仅 1 次 invoke 却声称「tri-review 已并行启动」(tri 模式 N=3)。
|
|
110
|
-
- SDD 并行 implementer dispatch(**同一 plan 内**多 task)— **不同于**跨 plan lease 门控并行(后者见上节 L1
|
|
111
|
-
- 跨 plan 可写派发无 verified `execution_lease`;steal / 覆盖活跃 `execution_lease` 或 `integration_merge_lease`;并行 integration merge。
|
|
112
|
-
- 跨 plan **并行**可写派发在 **无** same-host 独占写锁(跨主机 / 无共享 flock)且 **无** 用户本轮 `Cross-host lease race: accepted` + audit `notes` — **无论** `Worktree mode: waived`。
|
|
113
|
-
- 将 **`Worktree mode: waived`** 当作跨 plan 无锁并行授权(须 serial 或 race-accepted + audit)。
|
|
114
|
-
- 因 feature worktree 在默认 gitignore 下看不到 `plans/` 而设 **`Worktree mode: waived`**(应保留 feature worktree + control 绝对 `Plan Path` / `SDD dir`)。
|
|
115
|
-
- `InProgress` 无 `execution_lease` 未走 orphan recovery 即 writable-dispatch。
|
|
116
|
-
- 同仓多轨 writable implement:**N invoke ≠ worktree 隔离**(L2)→ **`mstar-branch-worktree`** **`references/parallel-writable-pre-dispatch.md`**。
|
|
112
|
+
- SDD 并行 implementer dispatch(**同一 plan 内**多 task)— **不同于**跨 plan lease 门控并行(后者见上节 L1 / **`mstar-branch-worktree`**)。
|
|
117
113
|
- 递归同角色 subagent;把 Handoff / 多轨编排措辞当 invoke。
|
|
118
114
|
- Review-and-edit 链未完成即 commit integration 分支;PM 代做专业角色编辑而不 invoke。
|
|
119
115
|
- Phase 1 review-and-edit 链三角色并行派发,或未等上一角色返回即派发下一角色。
|
|
120
|
-
- 全部 plan `Done` 后跳过 Phase 3 直接 PR;final plan closure 替代 `mstar-iteration` §3.1–§3.5。
|
|
121
116
|
- Assignment 已写、invoke 为零(paste-only)却进入下一 gate。
|
|
122
117
|
|
|
123
118
|
## References
|
|
@@ -39,7 +39,7 @@ description: Morning Star (启明星) harness **强制全局入口** —— 信
|
|
|
39
39
|
| 角色 | 始终 | 按任务追加(典型) |
|
|
40
40
|
|------|------|-------------------|
|
|
41
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`。**不**读 `mstar-coding-behavior` |
|
|
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`。**不**读 `mstar-coding-behavior` |
|
|
43
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
44
|
| **leaf 承接方** | 上栏 + **`mstar-dispatch-gates`**(反递归节) | — |
|
|
45
45
|
|
|
@@ -66,6 +66,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
|
|
|
66
66
|
| `logic` | `@architect` + dev |
|
|
67
67
|
| `ops` | `@ops-engineer` |
|
|
68
68
|
| `docs` | `@product-manager` / `@architect` / `@writing-specialist` |
|
|
69
|
+
| `audit` | `@architect` / read-only `scout` subagents → `mstar-audit`(read-only advisory;不进入状态机) |
|
|
69
70
|
|
|
70
71
|
**硬规则**:`quick` **从不**跳过 `specify → clarify → plan`;禁止把新 CLI/API/多模块/新测例标为 `quick`。已启用 `{HARNESS_DIR}` 时,首次 implement 前须有主 plan 路径 + `status.json` 登记(见 **`mstar-plan-conventions`**)。
|
|
71
72
|
|
|
@@ -100,6 +101,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
|
|
|
100
101
|
| `mstar-compound-refresh` | 知识维护 —— 审查/更新/合并/删除 `{KNOWLEDGE_DIR}` 文档;**项目知识 bootstrap**(无/残旧 STRATEGY.md、CONCEPTS.md、`{KNOWLEDGE_DIR}`)→ `references/project-knowledge-bootstrap.md` |
|
|
101
102
|
| `mstar-strategy` | `STRATEGY.md` 全局战略方向 —— 产品愿景、技术方向、决策原则 |
|
|
102
103
|
| `mstar-skill-authoring` | mstar-native skill authoring: trigger contracts, progressive disclosure, pressure scenarios, behavior-change evidence |
|
|
104
|
+
| `mstar-audit` | Read-only codebase audit → prioritized, self-contained improvement plans(`audit-playbook` 9 类别 + `finding-format` + `plan-quality-bar`) |
|
|
103
105
|
| `mstar-roles` | 角色正文 hub |
|
|
104
106
|
| `mstar-host` | 宿主适配(自动识别;`references/opencode.md` / `cursor.md` / `codex.md` / `kimi.md` / `parallel-dispatch.md`) |
|
|
105
107
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Host role-binding core (C5/C5b)
|
|
2
|
+
|
|
3
|
+
Shared role-binding contract for hosts that **cannot bind Morning Star roles via agent config** (Kimi, ZCode, omp). Cursor / OpenCode / Codex bind roles through agent config or `subagent_type` role ids and do **not** use this file. Read from the active host reference when dispatching.
|
|
4
|
+
|
|
5
|
+
## C5 — built-in invoke types only
|
|
6
|
+
|
|
7
|
+
- The host ships **built-in subagent types only**; the active host reference's C5 mapping table is the authoritative type list.
|
|
8
|
+
- Morning Star role ids (`project-manager`, `fullstack-dev`, `qc-specialist`, …) are **not** valid invoke types on these hosts — never invent agent names.
|
|
9
|
+
|
|
10
|
+
## C5b — role binding in prompt (required)
|
|
11
|
+
|
|
12
|
+
Because the host cannot bind roles via agent config, every dispatch **must** carry the played Morning Star role in the **Assignment** and in the **invoke prompt**:
|
|
13
|
+
|
|
14
|
+
1. **`Execute as: <role-id>`** in Assignment (harness routing SSOT).
|
|
15
|
+
2. **`Act as <role-id>`** (or equivalent) at the top of the invoke prompt.
|
|
16
|
+
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.
|
|
17
|
+
4. **`subagent_type` / `agent`** — pick from the host's built-in types only (C5 table in the host reference).
|
|
18
|
+
|
|
19
|
+
Paste-only Assignment **without** an invoke call is **not** dispatch.
|
|
20
|
+
|
|
21
|
+
## Invocation rules
|
|
22
|
+
|
|
23
|
+
- **1 Assignment ⇒ 1 invoke**: one invoke call carrying the full Assignment body per assignee.
|
|
24
|
+
- **Parallel batch N**: **N** invocations in **one** assistant message (mechanics → **`parallel-dispatch.md`**).
|
|
25
|
+
- **No invoke call** → **Not dispatched** — paste-only / `dispatch incomplete`.
|
|
26
|
+
- **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).
|
|
27
|
+
|
|
28
|
+
## Assignment / prompt template
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
## Assignment
|
|
32
|
+
|
|
33
|
+
**Execute as**: fullstack-dev
|
|
34
|
+
**Delegation**: forbidden
|
|
35
|
+
**Working branch**: feat/example
|
|
36
|
+
**Plan Path**: .mstar/plans/20260717-example.md
|
|
37
|
+
|
|
38
|
+
**IDENTITY:** You ARE `fullstack-dev`. Act as `fullstack-dev` for this task.
|
|
39
|
+
Load: `mstar-harness-core` → `mstar-host` → `<host>.md` → `mstar-roles` → `references/fullstack-dev-shared.md` → topic skills per that reference.
|
|
40
|
+
|
|
41
|
+
<task body>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The active host reference shows the matching invoke shape (same turn).
|
|
@@ -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`, `codex-plan-goal-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).
|
|
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 |
|