@mstar-harness/opencode 1.8.0 → 1.8.2
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 +5 -68
- package/harness-commands/iteration-drive.md +17 -159
- package/harness-commands/iteration-loop.md +16 -194
- package/harness-commands/iteration-start.md +17 -185
- 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-host/SKILL.md +9 -8
- 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 +2 -2
- 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 +6 -33
- package/harness-skills/mstar-host/references/omp-plan-mode-bridge.md +3 -13
- package/harness-skills/mstar-host/references/omp.md +20 -33
- 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 +6 -33
- 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 +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/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mstar-coding-behavior
|
|
3
|
-
description: Morning Star
|
|
3
|
+
description: Morning Star 跨角色通用编码行为准则 —— 任何实现、调试、重构、审查任务动手前必读。约束 Think Before Coding(先读懂再改、显式假设、不静默猜测)、Simplicity First(YAGNI、The Ladder、`simplify:` 标记、最小耐久切片)、Surgical Changes(改动可追溯、Bug 修根因先 grep 所有调用点、不 piggyback)、Debugging(先复现、一步一测、修前写复现测试)、Review Feedback Handling(先核实再改、证据反驳)、Goal-Driven Execution(非平凡逻辑留可运行检查、Step→verify)、Communication。`@fullstack-dev*` / `@frontend-dev` / `@architect` / `@qa-engineer` / `@ops-engineer` / `@prompt-engineer` 必读;QC 核对手术范围时必读。不覆盖分支门禁、QC/QA 路由、Assignment 权限。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Load order(必读顺序)
|
|
@@ -9,55 +9,29 @@ description: Morning Star (启明星) 跨角色通用编码行为准则 —— T
|
|
|
9
9
|
|
|
10
10
|
**摘要**:`mstar-harness-core` — 不变量与门禁;本 skill — 实现与审查时的工程习惯,不替代 harness。
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
This skill captures lightweight, host-agnostic coding behavior principles that reduce common agent mistakes. It complements the other Morning Star skills and does not override stage gates or role routing.
|
|
15
|
-
|
|
16
|
-
Priority remains (同 `mstar-harness-core` SKILL.md「信息源优先级」):
|
|
12
|
+
Priority remains(同 `mstar-harness-core`「信息源优先级」):① 当轮用户显式指令 ② 项目 `AGENTS.md` / `CLAUDE.md` ③ `mstar-harness-core` ④ 其它 `mstar-*`(含本 skill)⑤ `mstar-roles` 角色正文。
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
2. Project `AGENTS.md` / `CLAUDE.md`
|
|
20
|
-
3. `mstar-harness-core` skill(global entry & SSOT)
|
|
21
|
-
4. Other `mstar-*` skills(含本 skill)
|
|
22
|
-
5. Role prompts in `mstar-roles` skill
|
|
14
|
+
**Scope**:适用于非平凡编码/调试/重构/审查任务;trivial one-liner 用判断、保持低开销。定义执行行为,不定义分支策略或门禁所有权。
|
|
23
15
|
|
|
24
|
-
|
|
16
|
+
# Morning Star Coding Behavior Guidelines
|
|
25
17
|
|
|
26
|
-
-
|
|
27
|
-
- For trivial one-liners, use judgment and keep overhead minimal.
|
|
28
|
-
- This skill defines execution behavior, not branch policy or gate ownership.
|
|
18
|
+
Lightweight, host-agnostic coding-behavior principles that reduce common agent mistakes. Complements other Morning Star skills; does not override stage gates or role routing.
|
|
29
19
|
|
|
30
20
|
## 1) Think Before Coding
|
|
31
21
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- State assumptions explicitly before implementation when uncertainty is material.
|
|
35
|
-
- If there are multiple plausible interpretations, present options and ask for confirmation.
|
|
36
|
-
- Surface key tradeoffs when they affect scope, risk, or maintainability.
|
|
37
|
-
- If critical context is missing, pause and clarify instead of guessing.
|
|
22
|
+
Do not silently choose an interpretation when ambiguity exists. State assumptions explicitly when material; if multiple plausible interpretations exist, present options and ask. Surface tradeoffs affecting scope/risk/maintainability. If critical context is missing, pause and clarify instead of guessing.
|
|
38
23
|
|
|
39
|
-
Quick check:
|
|
40
|
-
|
|
41
|
-
- Can another reviewer see what assumptions were made?
|
|
42
|
-
- If assumptions are wrong, will the user detect it before large edits happen?
|
|
24
|
+
Quick check: can another reviewer see the assumptions made? If assumptions are wrong, will the user detect it before large edits happen?
|
|
43
25
|
|
|
44
26
|
**Never lazy about understanding.** Shorten the solution, never the reading. Read the task and every file the change touches fully first; trace the actual flow end to end. A small diff in the wrong place is not efficiency — it is a second bug shipped with confidence.
|
|
45
27
|
|
|
46
|
-
**Read before you write.** Before generating code in an existing project:
|
|
47
|
-
|
|
48
|
-
- Inspect the imports at the top of each file you are about to modify. They tell you which libraries the project actually uses — do not introduce a different library for the same purpose.
|
|
49
|
-
- Look at nearby test files. They document expected behavior more precisely than comments or your own assumptions.
|
|
50
|
-
- Follow existing project patterns. If there is a convention for API routes, file structure, or error handling, match it. Do not silently introduce a different pattern.
|
|
51
|
-
- If you cannot find a precedent for something, say so. "I do not see a pattern for X in the codebase — should I follow approach Y?" is always better than guessing.
|
|
52
|
-
- If you are not 100% sure a method signature or parameter exists, check the actual source code or docs before using it. Confidently calling a non-existent API is one of the costliest agent mistakes — it may compile, then fail at runtime.
|
|
28
|
+
**Read before you write.** Before generating code in an existing project: inspect imports (which libraries the project actually uses — do not introduce a different library for the same purpose); look at nearby tests (they document expected behavior more precisely than comments); follow existing patterns (API routes, file structure, error handling — match it, do not silently introduce a different one). If no precedent exists, say so and ask. If not 100% sure a signature/parameter exists, check source/docs before using it — confidently calling a non-existent API may compile then fail at runtime.
|
|
53
29
|
|
|
54
|
-
The failure mode:
|
|
30
|
+
The failure mode: "correct" code that is alien to the codebase — works but looks like a different person wrote it, forcing a rewrite or permanent inconsistency.
|
|
55
31
|
|
|
56
32
|
## 2) Simplicity First
|
|
57
33
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
**Question the need (YAGNI).** Before writing code, ask: does this task need code at all? Can the goal be achieved by deletion, reusing existing logic, or a configuration change? If a path requires no code, take it and explain in one line.
|
|
34
|
+
Implement the smallest durable slice that satisfies the request and acceptance criteria.
|
|
61
35
|
|
|
62
36
|
**The Ladder.** A reflex hierarchy for every decision — stop at the first rung that holds:
|
|
63
37
|
|
|
@@ -65,20 +39,15 @@ Core idea: implement the smallest durable slice that satisfies the request and a
|
|
|
65
39
|
2. **Already in this codebase?** A helper, util, type, or pattern that already lives here → reuse it. Look before you write.
|
|
66
40
|
3. **Stdlib / built-in covers it?** Use it.
|
|
67
41
|
4. **Native platform feature covers it?** CSS over JS, DB constraint over app code, OS primitive over a library.
|
|
68
|
-
5. **Already-installed dependency solves it?** Use it. Never add a new dependency for what a few lines
|
|
42
|
+
5. **Already-installed dependency solves it?** Use it. Never add a new dependency for what a few lines can do. When a new dependency appears necessary, evaluate: (a) can this be done with what is already in the project? (b) can the standard library do it? (c) is the package maintained (check last commit date and issue tracker) and reasonably sized? If you add it, state why in one sentence — silently adding packages is not acceptable.
|
|
69
43
|
6. **Can it be one line?** One line.
|
|
70
44
|
7. **Only then:** the minimum durable code that works.
|
|
71
45
|
|
|
72
|
-
The ladder runs after understanding, not instead of it. Two rungs work → take the higher one
|
|
46
|
+
The ladder runs after understanding, not instead of it. Two rungs work → take the higher one.
|
|
73
47
|
|
|
74
|
-
**Deletion over addition. Boring over clever.** Removing unnecessary code is a feature
|
|
48
|
+
**Deletion over addition. Boring over clever.** Removing unnecessary code is a feature; cleverness is what someone decodes at 3am — prefer a boring, obvious solution a tired reviewer verifies in seconds. Do not add unrequested features/flags/configurability; avoid new abstractions for single-use logic; prefer straightforward local fixes over framework-level reshaping **only when they fit the target design**; reject speculative error handling for impossible paths unless required by project policy.
|
|
75
49
|
|
|
76
|
-
|
|
77
|
-
- Avoid introducing new abstractions for single-use logic.
|
|
78
|
-
- Prefer straightforward local fixes over framework-level reshaping **only when they fit the target design**.
|
|
79
|
-
- Reject speculative error handling for impossible paths unless required by project policy.
|
|
80
|
-
|
|
81
|
-
**Simplification markers.** When a deliberate shortcut has a known ceiling (global lock, O(n²) scan, naive heuristic), mark it with a `simplify:` comment that names the ceiling and the upgrade path:
|
|
50
|
+
**Simplification markers.** When a deliberate shortcut has a known ceiling (global lock, O(n²) scan, naive heuristic), mark it with a `simplify:` comment naming the ceiling and the upgrade path:
|
|
82
51
|
|
|
83
52
|
```text
|
|
84
53
|
// simplify: global lock on cache misses. Replace with per-key lock if throughput matters.
|
|
@@ -87,66 +56,43 @@ The ladder runs after understanding, not instead of it. Two rungs work → take
|
|
|
87
56
|
This signals intent — the simplicity is deliberate, not an oversight — and gives the next person the upgrade path without research.
|
|
88
57
|
|
|
89
58
|
- Do not confuse "minimum" with "temporary." A small implementation must still align with the long-term target state, stable interfaces, and known follow-up plan.
|
|
90
|
-
- If a workaround is unavoidable, label it
|
|
59
|
+
- If a workaround is unavoidable, label it `simplify:` / `temporary`, explain why, and record the removal path in the plan/status artifact before claiming the task complete.
|
|
91
60
|
|
|
92
61
|
**Simplicity anti-patterns — stop and reconsider when you spot these:**
|
|
93
62
|
|
|
94
63
|
| Anti-pattern | Signal |
|
|
95
64
|
|---|---|
|
|
96
|
-
| **Premature abstraction** |
|
|
97
|
-
| **Speculative error handling** |
|
|
98
|
-
| **Unnecessary configurability** |
|
|
99
|
-
| **Dead flexibility** |
|
|
100
|
-
| **"In case we need to"** |
|
|
101
|
-
|
|
102
|
-
Default rule:
|
|
65
|
+
| **Premature abstraction** | Writing a class/interface/strategy where a single function suffices. |
|
|
66
|
+
| **Speculative error handling** | Wrapping code in try/catch for errors that cannot happen. |
|
|
67
|
+
| **Unnecessary configurability** | Making a value configurable (env var, parameter) that will never change. Hardcode it until there is a real reason not to. |
|
|
68
|
+
| **Dead flexibility** | An interface with one implementation, or a generic type with one instantiation — cost with zero benefit until a second use exists. |
|
|
69
|
+
| **"In case we need to"** | Justification for abstraction includes a guess about future requirements. "In case we need to" is a guess, and guesses about the future are usually wrong. |
|
|
103
70
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Durability check:
|
|
107
|
-
|
|
108
|
-
- Can this slice be extended by the next batch without undoing its core shape?
|
|
109
|
-
- Are deferred items captured in an existing roadmap / task board / residual tracker, not just mentioned in chat?
|
|
110
|
-
- Would a reviewer understand whether this is the final approach, a staged slice, or a deliberate simplification?
|
|
71
|
+
**Durability check**: can this slice be extended by the next batch without undoing its core shape? Are deferred items captured in an existing roadmap/task board/residual tracker (not just chat)? Would a reviewer understand whether this is the final approach, a staged slice, or a deliberate simplification?
|
|
111
72
|
|
|
112
73
|
## 3) Surgical Changes
|
|
113
74
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
- Touch only files and regions needed for the requested outcome.
|
|
117
|
-
- Do not opportunistically refactor adjacent code.
|
|
118
|
-
- Match existing style and patterns unless a change is explicitly requested.
|
|
119
|
-
- Remove only artifacts made unused by your own change.
|
|
120
|
-
- If unrelated issues are found, report them separately instead of piggyback editing.
|
|
75
|
+
Every changed line should be traceable to the task. Touch only files/regions needed for the requested outcome; do not opportunistically refactor adjacent code; match existing style unless a change is explicitly requested; remove only artifacts made unused by your own change; report unrelated issues separately instead of piggyback editing.
|
|
121
76
|
|
|
122
|
-
Traceability test
|
|
123
|
-
|
|
124
|
-
- Each hunk should map to a user requirement, acceptance criterion, or required fix-up.
|
|
77
|
+
**Traceability test**: each hunk maps to a user requirement, acceptance criterion, or required fix-up.
|
|
125
78
|
|
|
126
79
|
**Bug fix = root cause, not symptom.** A bug report names a symptom, not the cause. Before editing, grep every caller of the function or code path you are about to touch. The fix belongs where all callers route through — one guard in the shared function is smaller than a guard in every caller. Patching only the path the ticket names leaves every sibling caller still broken. Fix it once, at the narrowest shared point.
|
|
127
80
|
|
|
128
81
|
## 4) Debugging
|
|
129
82
|
|
|
130
|
-
|
|
83
|
+
When something does not work, investigate; do not guess.
|
|
131
84
|
|
|
132
|
-
- **Read the error message entirely
|
|
133
|
-
- **Reproduce before fixing.** If you cannot reproduce
|
|
134
|
-
- **Change one thing at a time.** Changing three things and seeing the bug disappear tells you nothing about which change fixed it — or what new bugs the other two introduced.
|
|
135
|
-
- **Fix the root cause, not the symptom.** If a value is unexpectedly null, do not just add a null check
|
|
136
|
-
- **Write a reproduction test before fixing a bug.**
|
|
137
|
-
- **Run existing tests before and after
|
|
138
|
-
- **If
|
|
85
|
+
- **Read the error message entirely**, including the full stack trace — a `TypeError` can mean a hundred things; the message and trace tell you which one.
|
|
86
|
+
- **Reproduce before fixing.** If you cannot reproduce, you cannot verify. "I think this should fix it" is gambling.
|
|
87
|
+
- **Change one thing at a time.** Changing three things and seeing the bug disappear tells you nothing about which change fixed it — or what new bugs the other two introduced.
|
|
88
|
+
- **Fix the root cause, not the symptom.** If a value is unexpectedly null, do not just add a null check — figure out why it is null (see Surgical Changes · bug=root-cause).
|
|
89
|
+
- **Write a reproduction test before fixing a bug.** Minimal test reproducing the reported behavior → watch it fail → apply fix → watch it pass. The only way to prove you fixed the actual problem, not merely suppressed symptoms.
|
|
90
|
+
- **Run existing tests before and after changes.** If they passed before and fail after, you broke something. If they were already failing, say so.
|
|
91
|
+
- **If stuck, say so.** "I tried X and Y; neither worked. I'm seeing Z. I think it might be W but am not sure" is infinitely more useful than silently trying random things for 20 iterations.
|
|
139
92
|
|
|
140
93
|
## 5) Goal-Driven Execution
|
|
141
94
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
- Define concrete success criteria before major edits.
|
|
145
|
-
- For multi-step tasks, use brief `Step -> verify` checkpoints.
|
|
146
|
-
- For split delivery, maintain a durable roadmap: current slice, later slices, dependencies, owner/trigger, and completion condition.
|
|
147
|
-
- Prefer evidence-backed completion claims (tests, command output, reproducible checks).
|
|
148
|
-
- If verification fails, loop on diagnosis and fix before declaring completion.
|
|
149
|
-
- Do not finish with "next plan / later / follow-up" only in prose. If the work is not fully complete, the remaining work must be written to the plan/status artifact or the task must report `Partial` / `Blocked`.
|
|
95
|
+
Convert vague requests into verifiable outcomes and iterate until verified. Define concrete success criteria before major edits; use brief `Step -> verify` checkpoints for multi-step tasks; for split delivery, maintain a durable roadmap (current slice, later slices, dependencies, owner/trigger, completion condition); prefer evidence-backed completion (tests, command output, reproducible checks). If verification fails, loop on diagnosis and fix before declaring completion. Do not finish with "next plan / later / follow-up" only in prose — remaining work must be written to the plan/status artifact or the task reports `Partial` / `Blocked`.
|
|
150
96
|
|
|
151
97
|
**Minimal check for non-trivial logic.** Any non-trivial change (a branch, a loop, a parser, a data transformation, a money or security path) must leave behind ONE runnable check — the smallest thing that fails if the logic breaks. An inline self-check, a quick `assert`-based demo, or one minimal test. No frameworks, no fixtures, no per-function suites unless asked. Trivial one-liners need none — YAGNI applies to tests too.
|
|
152
98
|
|
|
@@ -157,27 +103,13 @@ Micro template:
|
|
|
157
103
|
Verify: [specific check]
|
|
158
104
|
2. [Step]
|
|
159
105
|
Verify: [specific check]
|
|
160
|
-
3. [Step]
|
|
161
|
-
Verify: [specific check]
|
|
162
106
|
```
|
|
163
107
|
|
|
164
|
-
**Verification discipline
|
|
165
|
-
|
|
166
|
-
- **Test behavior, not implementation.** A test that checks whether a constructor sets properties is worthless. A test that checks whether validation actually rejects bad input is valuable. Focus on the interesting cases.
|
|
167
|
-
- **If you cannot write a test, say why.** "I cannot easily test this because the database calls are tightly coupled to the business logic" is useful information that may signal a need for restructuring. Do not skip testing without an explanation.
|
|
108
|
+
**Verification discipline**: test behavior, not implementation (a test checking whether a constructor sets properties is worthless; one checking whether validation rejects bad input is valuable — focus on interesting cases). If you cannot write a test, say why ("I cannot easily test this because the database calls are tightly coupled to the business logic" may signal a need for restructuring — do not skip testing without an explanation).
|
|
168
109
|
|
|
169
110
|
## 6) Review Feedback Handling
|
|
170
111
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
When receiving code review, QA, CI, or human feedback:
|
|
174
|
-
|
|
175
|
-
1. Read all feedback before editing.
|
|
176
|
-
2. Clarify ambiguous items before partial implementation.
|
|
177
|
-
3. Verify each suggestion against codebase reality.
|
|
178
|
-
4. Apply technically correct feedback one item at a time.
|
|
179
|
-
5. Test each fix individually where practical.
|
|
180
|
-
6. Push back with evidence when feedback is incorrect, obsolete, risky, out of scope, or violates YAGNI.
|
|
112
|
+
Review feedback is technical input, not an order to perform unverified edits. When receiving code review, QA, CI, or human feedback: read all feedback before editing; clarify ambiguous items before partial implementation; verify each suggestion against codebase reality; apply technically correct feedback one item at a time; test each fix individually where practical; push back with evidence when feedback is incorrect, obsolete, risky, out of scope, or violates YAGNI.
|
|
181
113
|
|
|
182
114
|
Feedback priority:
|
|
183
115
|
|
|
@@ -192,22 +124,16 @@ Do not perform agreement. State the technical action, the verification result, o
|
|
|
192
124
|
|
|
193
125
|
## 7) Communication
|
|
194
126
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
- **
|
|
198
|
-
- **
|
|
199
|
-
- **
|
|
200
|
-
- **Match your explanation to context.** If they asked for a REST endpoint, do not explain what REST is. If they asked for a database index, do not explain what indexes do.
|
|
201
|
-
- **Write specific commit messages.** "Fix bug" is useless. "Fix null pointer in user lookup when email contains uppercase chars" tells the next person exactly what happened.
|
|
127
|
+
- **Say what you did and why** — not just a code dump ("moved validation into a separate function because it was duplicated in three places and this makes it testable independently").
|
|
128
|
+
- **Flag concerns proactively** ("this works but makes a DB call per item — if the list grows large this will be slow; want me to batch it?").
|
|
129
|
+
- **Be precise about uncertainty** ("I'm not sure if this library supports streaming responses" is useful; "I think this should work" is not — tell the reviewer exactly what to verify).
|
|
130
|
+
- **Match explanation to context** — do not explain REST to someone who asked for a REST endpoint, or indexes to someone who asked for an index.
|
|
131
|
+
- **Write specific commit messages** — "Fix null pointer in user lookup when email contains uppercase chars", not "Fix bug".
|
|
202
132
|
|
|
203
133
|
## Integration Notes
|
|
204
134
|
|
|
205
135
|
- **SDD implementer reports** (`mstar-sdd`): completion evidence must include TDD triple — test file(s), command, output — in `task-N-report.md`; fix rounds add the same for new/changed tests.
|
|
206
|
-
- This skill must not be used to bypass
|
|
207
|
-
- branch constraints,
|
|
208
|
-
- QC/QA gate definitions,
|
|
209
|
-
- assignment authority,
|
|
210
|
-
- `Done` ownership rules.
|
|
136
|
+
- This skill must not be used to bypass branch constraints, QC/QA gate definitions, assignment authority, or `Done` ownership rules.
|
|
211
137
|
|
|
212
138
|
## Anti-Bloat Rule for Prompt Maintenance
|
|
213
139
|
|
|
@@ -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
|
|