@mstar-harness/opencode 0.5.0 → 0.6.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/INSTALL.md +1 -2
- package/dist/mstar.js +2 -6
- package/harness-skills/mstar-dispatch-gates/SKILL.md +2 -2
- package/harness-skills/mstar-harness-core/SKILL.md +8 -3
- package/harness-skills/mstar-harness-core/references/open-harness-principles.md +1 -1
- package/harness-skills/mstar-host/SKILL.md +49 -0
- package/harness-skills/mstar-host/references/codex.md +56 -0
- package/harness-skills/mstar-host/references/cursor-plan-mode-bridge.md +175 -0
- package/harness-skills/mstar-host/references/cursor.md +73 -0
- package/harness-skills/mstar-host/references/opencode.md +58 -0
- package/harness-skills/mstar-host/references/parallel-dispatch.md +42 -0
- package/harness-skills/mstar-roles/SKILL.md +1 -1
- package/harness-skills/mstar-roles/references/architect.md +1 -1
- package/harness-skills/mstar-roles/references/frontend-dev.md +1 -1
- package/harness-skills/mstar-roles/references/fullstack-dev-shared.md +1 -1
- package/harness-skills/mstar-roles/references/ops-engineer.md +1 -1
- package/harness-skills/mstar-roles/references/product-manager.md +1 -1
- package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +4 -4
- package/harness-skills/mstar-roles/references/project-manager.md +3 -3
- package/harness-skills/mstar-roles/references/prompt-engineer.md +1 -1
- package/harness-skills/mstar-roles/references/qa-engineer.md +1 -1
- package/harness-skills/mstar-roles/references/qc-specialist-shared.md +1 -1
- package/harness-skills/mstar-roles/references/writing-specialist.md +1 -1
- package/harness-skills/pm/SKILL.md +9 -0
- package/package.json +1 -2
- package/skills/mstar-host/SKILL.md +0 -131
package/INSTALL.md
CHANGED
|
@@ -25,8 +25,7 @@ Restart OpenCode. The plugin installs from npm and registers Morning Star runtim
|
|
|
25
25
|
|
|
26
26
|
- Keep your role models and permissions in `opencode.json`.
|
|
27
27
|
- The plugin loads **only paths inside the `@mstar-harness/opencode` package**:
|
|
28
|
-
- **`harness-skills/`** — copy of
|
|
29
|
-
- **`skills/`** — packaged OpenCode host adapter (e.g. `mstar-host`).
|
|
28
|
+
- **`harness-skills/`** — copy of repo `skills/` from the release build (`prepublishOnly` runs `bundle-assets` before `bun build`), including **`mstar-host`**.
|
|
30
29
|
- **`harness-agents/`** — copy of repo `agents/` from the same build.
|
|
31
30
|
- It does **not** read `<cwd>/skills` or `<cwd>/agents`, so OpenCode’s `process.cwd()` (your app project root) does not affect harness resolution.
|
|
32
31
|
- Bootstrap prompt entry is injected once with `<IMPORTANT_FOR_HARNESS>`.
|
package/dist/mstar.js
CHANGED
|
@@ -6,17 +6,13 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
|
|
7
7
|
var packageRoot = path.resolve(__dirname2, "..");
|
|
8
8
|
var bundledSkillsDir = path.join(packageRoot, "harness-skills");
|
|
9
|
-
var hostSkillsDir = path.join(packageRoot, "skills");
|
|
10
9
|
var bundledAgentsDir = path.join(packageRoot, "harness-agents");
|
|
11
10
|
var bootstrapAgentsPath = path.join(packageRoot, "AGENTS.md");
|
|
12
11
|
var BOOTSTRAP_MARKER = "IMPORTANT_FOR_HARNESS";
|
|
13
12
|
function resolveSkillPathCandidates() {
|
|
14
|
-
const out = [];
|
|
15
13
|
if (fs.existsSync(bundledSkillsDir))
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
out.push(hostSkillsDir);
|
|
19
|
-
return out;
|
|
14
|
+
return [bundledSkillsDir];
|
|
15
|
+
return [];
|
|
20
16
|
}
|
|
21
17
|
var extractFrontmatterAndBody = (content) => {
|
|
22
18
|
const match = content.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mstar-dispatch-gates
|
|
3
|
-
description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent、`Execute as` 与 `Delegation`、承接方反递归 NEVER 红线、同条消息 N 次 invoke、QC 三审禁止串行 rollout、Assignment 文案≠派发(invoke 条数须对齐)、未齐不发(emit zero until batch-ready)。**必须**在 `@project-manager` 每轮派发、QC 三审并发、双轨 implement、或 leaf 角色疑惑能否 Task 时 Read;所有非 PM 承接方动手前必读反递归与自检。同仓 worktree 与 QC 检出对齐见 `mstar-branch-worktree`。Superpowers 并行短语见 `mstar-superpowers-align`。宿主细则见 `mstar-host-
|
|
3
|
+
description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent、`Execute as` 与 `Delegation`、承接方反递归 NEVER 红线、同条消息 N 次 invoke、QC 三审禁止串行 rollout、Assignment 文案≠派发(invoke 条数须对齐)、未齐不发(emit zero until batch-ready)。**必须**在 `@project-manager` 每轮派发、QC 三审并发、双轨 implement、或 leaf 角色疑惑能否 Task 时 Read;所有非 PM 承接方动手前必读反递归与自检。同仓 worktree 与 QC 检出对齐见 `mstar-branch-worktree`。Superpowers 并行短语见 `mstar-superpowers-align`。宿主细则见 `mstar-host`(`references/parallel-dispatch.md` 与各宿主 reference)。
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Load order(必读顺序)
|
|
@@ -43,7 +43,7 @@ description: Morning Star 派发与委派门禁 —— 仅 PM 可增派 subagent
|
|
|
43
43
|
- **QC 三审硬门禁**:`qc-specialist` / `qc-specialist-2` / `qc-specialist-3` 须**同一条消息**全部发起;只发其中一个 = **`dispatch incomplete`**,不得写「三审已并行启动」。
|
|
44
44
|
- **先自检再发送**:发送前核对「Assignment 条数 = 本条消息中的实际 **派发** 调用条数」。
|
|
45
45
|
- **前置步骤与派发回合分离(防串行 rollout)**:为派发准备的 **`bash` / `read` / `glob` / `grep`**(如 `merge-base`、`Review range`、`git rev-parse`)**不计入** `N` 次派发;可在上一条仅含准备的消息完成。准备完成后,**下一条派发消息**须**一次性**含 **`N` 次** Task / subagent invoke。**禁止**先发 `1` 次、等返回再补发其余 `N-1` 次。
|
|
46
|
-
- **未齐不发(emit zero until batch-ready)**:需并发 `N≥2` 而当前只能发 `1` 条时,本条应发 **`0` 条派发 invoke`**(可继续 read/bash 补齐),**禁止**「先发一个顶一下」;`N` 份 payload 就绪后**单次消息发满 `N
|
|
46
|
+
- **未齐不发(emit zero until batch-ready)**:需并发 `N≥2` 而当前只能发 `1` 条时,本条应发 **`0` 条派发 invoke`**(可继续 read/bash 补齐),**禁止**「先发一个顶一下」;`N` 份 payload 就绪后**单次消息发满 `N`**。见 **`mstar-host`** → `references/parallel-dispatch.md`(具备 invoke / Task / subagent 工具的宿主共用)。
|
|
47
47
|
|
|
48
48
|
### 具名 subagent 宿主:文案分派 ≠ 调度完成
|
|
49
49
|
|
|
@@ -85,14 +85,18 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
|
|
|
85
85
|
| `mstar-coding-behavior` | Think / Simplicity / Surgical / Goal-Driven |
|
|
86
86
|
| `mstar-superpowers-align` | Superpowers × harness 优先级与短语 |
|
|
87
87
|
| `mstar-roles` | 角色正文 hub |
|
|
88
|
+
| `mstar-host` | 宿主适配(自动识别;`references/opencode.md` / `cursor.md` / `codex.md` / `parallel-dispatch.md`) |
|
|
88
89
|
|
|
89
90
|
## 宿主 `mstar-host`
|
|
90
91
|
|
|
92
|
+
Read **`mstar-host`** after this skill; detect host per its table, then Read the matching reference.
|
|
93
|
+
|
|
91
94
|
| 宿主 | 要点 |
|
|
92
95
|
|------|------|
|
|
93
|
-
| OpenCode |
|
|
94
|
-
| Cursor |
|
|
95
|
-
|
|
|
96
|
+
| OpenCode | `question`、`@explore`、named-role invoke → `references/opencode.md` |
|
|
97
|
+
| Cursor | Task 并行 QC;Plan 双写 → `references/cursor.md` · `cursor-plan-mode-bridge.md` |
|
|
98
|
+
| Codex | plugin skills、sandbox/apply_patch/tool discovery;无 invoke 工具时不声称 subagent dispatch → `references/codex.md` |
|
|
99
|
+
| 其它 | 同 `mstar-host` skill;按工具信号选 reference |
|
|
96
100
|
|
|
97
101
|
## 护栏(不变量)
|
|
98
102
|
|
|
@@ -123,6 +127,7 @@ PM 在 Assignment 写 **`Task category`**(主类 + 可选 `secondary`):
|
|
|
123
127
|
| residual 只写 plan 不写 SSOT | `mstar-plan-artifacts` |
|
|
124
128
|
| 角色文件塞流程长文 | 用专题 skill |
|
|
125
129
|
| 无证据宣称完成 | `mstar-coding-behavior` / verification |
|
|
130
|
+
| CreatePlan 不落盘 / 无 `.agents` mirror | `mstar-host` · `cursor-plan-mode-bridge` |
|
|
126
131
|
|
|
127
132
|
## 可选:OpenViking Memory
|
|
128
133
|
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
|
|
71
71
|
## 延伸阅读
|
|
72
72
|
|
|
73
|
-
- 按能力选配 MCP/skills
|
|
73
|
+
- 按能力选配 MCP/skills:OpenCode → `mstar-host` `references/opencode.md`;其它宿主见 `mstar-host` 检测表
|
|
74
74
|
- Superpowers 与门禁对齐:`mstar-superpowers-align`
|
|
75
75
|
- 库文档检索共享协议:`mstar-harness-core` `references/library-docs-protocol.md`
|
|
76
76
|
- 跨角色编码行为准则(轻量、可复用):`mstar-coding-behavior`
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
---
|
|
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/@agent-id invoke, Cursor /pm and CreatePlan/SwitchMode dual-write and Task parallel QC, Codex plugin skills plus sandboxed tools/tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Morning Star Host Adapter
|
|
7
|
+
|
|
8
|
+
Host-specific **capabilities and entry behavior** for Morning Star. Process gates and invariants stay in `mstar-harness-core` and topic `mstar-*` skills.
|
|
9
|
+
|
|
10
|
+
## First action
|
|
11
|
+
|
|
12
|
+
Read **`mstar-harness-core`** before this skill (even when the host injects project `AGENTS.md`).
|
|
13
|
+
|
|
14
|
+
## Default path
|
|
15
|
+
|
|
16
|
+
1. Read `mstar-harness-core`
|
|
17
|
+
2. Read **`mstar-host`** (this skill) and detect host below
|
|
18
|
+
3. Read **`references/<host>.md`** for the active host
|
|
19
|
+
4. Load role via `mstar-roles`
|
|
20
|
+
5. Execute with evidence-first completion checks
|
|
21
|
+
|
|
22
|
+
Load topic skills **on demand** per `mstar-roles` (do not read every `mstar-*` skill by default). Cursor maint routing-eval: `.cursor/skills/mstar-routing-eval/` only.
|
|
23
|
+
|
|
24
|
+
## Detect active host
|
|
25
|
+
|
|
26
|
+
Use **capability signals** (not filesystem paths):
|
|
27
|
+
|
|
28
|
+
| Signal | Host | Next read |
|
|
29
|
+
|--------|------|-----------|
|
|
30
|
+
| **CreatePlan** / **SwitchMode** available | `cursor` | `references/cursor.md`; Plan mode also `references/cursor-plan-mode-bridge.md` |
|
|
31
|
+
| **`question`** tool or PM **`@<agent-id>`** subagent invoke | `opencode` | `references/opencode.md` |
|
|
32
|
+
| **Task** + `subagent_type`, no CreatePlan | `cursor` | `references/cursor.md` |
|
|
33
|
+
| **Codex app/CLI/plugin context**, `functions.*`, `codex_app.*`, `tool_search`, Browser plugin tools | `codex` | `references/codex.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 |
|
|
35
|
+
|
|
36
|
+
## Parallel dispatch (invoke-capable hosts)
|
|
37
|
+
|
|
38
|
+
When PM dispatches **N >= 2** concurrent assignees (QC tri-review, dual-track implement, etc.) and the host exposes actual invoke / Task / subagent tools, read **`references/parallel-dispatch.md`** in the dispatch round (shared with `mstar-dispatch-gates`). Without a callable invoke tool, Assignment Markdown is not dispatch.
|
|
39
|
+
|
|
40
|
+
## Library docs (Context7)
|
|
41
|
+
|
|
42
|
+
Follow `mstar-harness-core` → `references/library-docs-protocol.md`.
|
|
43
|
+
|
|
44
|
+
## Conflict order
|
|
45
|
+
|
|
46
|
+
1. User explicit instructions (this turn)
|
|
47
|
+
2. Project `AGENTS.md` / `CLAUDE.md`
|
|
48
|
+
3. `mstar-harness-core` and related `mstar-*` skills
|
|
49
|
+
4. This `mstar-host` skill and `references/*`
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Codex host reference
|
|
2
|
+
|
|
3
|
+
Load when **`mstar-host`** detection resolves **codex** (Codex app/CLI session, Codex plugin installed from `.codex-plugin/plugin.json`, or Codex tool namespaces such as `functions.*`, `codex_app.*`, `tool_search`, `image_gen`, or Browser plugin tools).
|
|
4
|
+
|
|
5
|
+
Parallel PM dispatch: read **`parallel-dispatch.md`** only when Codex exposes an actual multi-agent / Task-style invocation tool. If no callable invoke tool exists, Assignment Markdown is coordination text only; do **not** claim subagent dispatch.
|
|
6
|
+
|
|
7
|
+
## Codex-only context
|
|
8
|
+
|
|
9
|
+
- Plugin source: `.codex-plugin/plugin.json`.
|
|
10
|
+
- Runtime skills: repo `skills/` mounted by the Codex plugin (`"skills": "./skills/"`).
|
|
11
|
+
- `/pm`: shared force entry via the `pm` skill; after that, role behavior comes from `mstar-roles`.
|
|
12
|
+
- Role files under `agents/` are for hosts that load agent shells; Codex role execution should load `mstar-roles` references directly.
|
|
13
|
+
- Tool and plugin availability can be lazy-loaded or session-dependent. Use the tools actually present in the current session; do not infer capability from documentation alone.
|
|
14
|
+
|
|
15
|
+
## Skill loading
|
|
16
|
+
|
|
17
|
+
1. Read `mstar-harness-core`.
|
|
18
|
+
2. Read `mstar-host` and this Codex reference.
|
|
19
|
+
3. Load `mstar-roles` and the active role reference.
|
|
20
|
+
4. Load topic skills on demand per the role reference.
|
|
21
|
+
|
|
22
|
+
Use skill names in prompts and references. Avoid absolute local paths unless the user is maintaining this repository or the skill is not installed and must be read from the checkout.
|
|
23
|
+
|
|
24
|
+
## Clarify
|
|
25
|
+
|
|
26
|
+
- Codex does not imply an OpenCode-style `question` tool.
|
|
27
|
+
- If a structured user-input tool is available in the active mode, use it for concise 1-3 choice decisions.
|
|
28
|
+
- Otherwise ask one concise Markdown question only after codebase exploration cannot answer it.
|
|
29
|
+
- `update_plan` / local todo UI is session progress only; it does not replace `{PLAN_DIR}` plans or `{HARNESS_DIR}/status.json`.
|
|
30
|
+
|
|
31
|
+
## Dispatch and role execution
|
|
32
|
+
|
|
33
|
+
- **No invoke tool = no dispatch**: printing `## Assignment` does not start another Codex worker.
|
|
34
|
+
- If Codex exposes multi-agent tools, PM may dispatch through those tools and must follow `parallel-dispatch.md`.
|
|
35
|
+
- If no invoke tool is present, use single-session role execution: state the active role, load that role reference, complete the assignment, and return Completion Report v2.
|
|
36
|
+
- QC tri-review is only "parallel" when three distinct callable reviewer sessions are actually launched in one dispatch turn. Without that, run a clearly labeled serial/manual review path or return `Blocked` for PM rerouting.
|
|
37
|
+
- Leaf executors still follow `mstar-dispatch-gates`: no recursive Task/subagent calls unless Assignment says `Delegation: allowed (...)`.
|
|
38
|
+
|
|
39
|
+
## Files, shell, and approvals
|
|
40
|
+
|
|
41
|
+
- Prefer `rg` / `rg --files` for search and `apply_patch` for manual edits.
|
|
42
|
+
- Respect Codex sandbox and approval prompts. If a required command fails because of sandbox or network restrictions, request escalation through the host approval mechanism.
|
|
43
|
+
- Do not edit global Codex plugin metadata, marketplace files, credentials, secrets, or user config without explicit user consent.
|
|
44
|
+
- Browser, image, document, spreadsheet, presentation, and automation capabilities are host tools. Use them only when the user request or verification need calls for them.
|
|
45
|
+
|
|
46
|
+
## Git and final evidence
|
|
47
|
+
|
|
48
|
+
- Git work still follows `mstar-branch-worktree` and the Assignment `Working branch` / `Branch policy`.
|
|
49
|
+
- Codex app git directives, when available, are audit annotations only. Emit them only after the underlying git action succeeds; never use a directive as a substitute for staging, committing, pushing, or PR creation evidence.
|
|
50
|
+
- Completion reports should cite concrete commands, artifacts, and commit lines when required by the Assignment.
|
|
51
|
+
|
|
52
|
+
## Gotchas
|
|
53
|
+
|
|
54
|
+
- Codex plugin install gives skills, not automatic OpenCode-style named role invocations.
|
|
55
|
+
- Tool discovery (`tool_search`) can reveal capabilities, but availability is not authorization; Assignment `Delegation` still controls use.
|
|
56
|
+
- Session plans, chat summaries, and UI todos are not durable harness SSOT unless mirrored to `{HARNESS_DIR}`.
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Cursor Plan Mode × Harness Dual-Write Bridge
|
|
2
|
+
|
|
3
|
+
> **Load order**: Read **`mstar-harness-core`** first, then **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** before the first **CreatePlan** in Plan mode. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-plan-conventions`. On conflict, **`mstar-harness-core`** wins.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
Cursor **Plan mode** uses **CreatePlan** and built-in plan todos for session UX. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.agents/`). This reference defines **dual-write**: mirror every durable plan artifact to the repo; never treat the Cursor plan URI 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. Cursor CreatePlan body and plan todos (session UX mirror)
|
|
15
|
+
|
|
16
|
+
**NEVER** cite only a Cursor 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
|
+
- Cursor **Plan mode** is active (system guidance to use **CreatePlan** / **SwitchMode**).
|
|
21
|
+
- Morning Star plugin or `/pm` is in use (`mstar-host`, `pm` skill, or `rules/mstar-cursor-plan-mode.mdc`).
|
|
22
|
+
|
|
23
|
+
## Before the first CreatePlan
|
|
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` (prefer `.agents/` + `.agents/plans/`).
|
|
27
|
+
3. **Initialize** if absent (see checklist below).
|
|
28
|
+
|
|
29
|
+
### Harness initialization checklist
|
|
30
|
+
|
|
31
|
+
When plan management is required and directories are missing:
|
|
32
|
+
|
|
33
|
+
1. Create `{HARNESS_DIR}` and `{PLAN_DIR}`.
|
|
34
|
+
2. Create `{PLAN_DIR}/reports/`.
|
|
35
|
+
3. Create `{HARNESS_DIR}/archived/residuals/`.
|
|
36
|
+
4. Initialize `{HARNESS_DIR}/status.json` from `mstar-plan-artifacts/templates/status.empty.json` if missing.
|
|
37
|
+
5. Optional: `{HARNESS_DIR}/notes.json` from `templates/notes.empty.json`, `{HARNESS_DIR}/knowledge/README.md`.
|
|
38
|
+
|
|
39
|
+
Reuse legacy `.plans/` or `plans/` only when already present; do not duplicate structures.
|
|
40
|
+
|
|
41
|
+
Full PM checklist: `mstar-roles/references/project-manager/plan-management.md`.
|
|
42
|
+
|
|
43
|
+
## CreatePlan: fixed bootstrap todos (prefix)
|
|
44
|
+
|
|
45
|
+
**Emit these three todos first**, in order, **before** any implement / code todos. Do **not** mark implement todos in progress until all three are **done**.
|
|
46
|
+
|
|
47
|
+
| Todo ID (use in title) | Goal | On-disk outcome |
|
|
48
|
+
|------------------------|------|-----------------|
|
|
49
|
+
| **`harness-init`** | Bootstrap harness tree | `{HARNESS_DIR}/`, `{PLAN_DIR}/`, `reports/`, `archived/residuals/`, `status.json` initialized |
|
|
50
|
+
| **`spec-register`** | Register plan in SSOT | New `plans[]` row in `status.json` (`id`, `status`, `file`, `metadata`); spec stub in `{SPECS_DIR}` or plan frontmatter |
|
|
51
|
+
| **`mirror-plan`** | SSOT main plan file | `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes aligned to CreatePlan body |
|
|
52
|
+
|
|
53
|
+
### `spec-register` minimum fields
|
|
54
|
+
|
|
55
|
+
Add one object to `status.json` → `plans[]`:
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"id": "<plan-id>",
|
|
60
|
+
"status": "Todo",
|
|
61
|
+
"file": ".agents/plans/<plan-id>-<short-name>.md",
|
|
62
|
+
"metadata": {
|
|
63
|
+
"primary_spec": "<spec-id or path if known>",
|
|
64
|
+
"description": "<one-line summary>"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Set `updated_at` on `status.json` to today (`YYYY-MM-DD`). Commit harness files in the **business repo** when the project tracks `.agents/` (default).
|
|
70
|
+
|
|
71
|
+
### `mirror-plan` minimum content
|
|
72
|
+
|
|
73
|
+
- YAML or markdown frontmatter with `plan_id`, title, status (`Todo` / `InProgress` — not `Done` unless PM/QA authority).
|
|
74
|
+
- **Task list** as markdown checkboxes (`- [ ]` / `- [x]`) matching CreatePlan implement todos.
|
|
75
|
+
- Link: “SSOT status: `{HARNESS_DIR}/status.json` → `plans[]` / `residual_findings`.”
|
|
76
|
+
|
|
77
|
+
After **CreatePlan**, keep CreatePlan body and mirror file **in sync** when scope changes (update both in the same coordination round).
|
|
78
|
+
|
|
79
|
+
## CreatePlan body template (copyable)
|
|
80
|
+
|
|
81
|
+
Use this structure in CreatePlan `plan` markdown; mirror the same sections into `{PLAN_DIR}/<plan-id>-<name>.md`.
|
|
82
|
+
|
|
83
|
+
```markdown
|
|
84
|
+
# Plan: <title>
|
|
85
|
+
|
|
86
|
+
**plan_id**: <plan-id>
|
|
87
|
+
**HARNESS_DIR**: .agents/
|
|
88
|
+
**Plan file (SSOT)**: .agents/plans/<plan-id>-<short-name>.md
|
|
89
|
+
**status.json**: .agents/status.json
|
|
90
|
+
|
|
91
|
+
## Prepare gates
|
|
92
|
+
|
|
93
|
+
- specify: [done|n/a]
|
|
94
|
+
- clarify: [done|n/a]
|
|
95
|
+
- plan: [done|in progress]
|
|
96
|
+
|
|
97
|
+
## Tasks (mirror as checkboxes in SSOT plan file)
|
|
98
|
+
|
|
99
|
+
### Bootstrap (fixed prefix — complete before implement)
|
|
100
|
+
|
|
101
|
+
1. harness-init — init .agents/, status.json, reports/, archived/residuals/
|
|
102
|
+
2. spec-register — register plan_id in status.json; spec stub if applicable
|
|
103
|
+
3. mirror-plan — write .agents/plans/<plan-id>-<short-name>.md
|
|
104
|
+
|
|
105
|
+
### Implement
|
|
106
|
+
|
|
107
|
+
- [ ] <task-id-1>: <description>
|
|
108
|
+
- Done when: git commit on Working branch + checkbox [x] in SSOT plan + evidence below
|
|
109
|
+
- [ ] <task-id-2>: ...
|
|
110
|
+
|
|
111
|
+
## Working branch
|
|
112
|
+
|
|
113
|
+
<branch-name or "PM to assign before implement">
|
|
114
|
+
|
|
115
|
+
## Verification
|
|
116
|
+
|
|
117
|
+
- Commands / tests required before InReview
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Implement todo completion gate (every code todo)
|
|
121
|
+
|
|
122
|
+
Embed this checklist **inside each implement todo description** in CreatePlan (and mirror the same text on the matching checkbox line in the SSOT plan file).
|
|
123
|
+
|
|
124
|
+
**Before marking the todo done:**
|
|
125
|
+
|
|
126
|
+
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).
|
|
127
|
+
2. **Plan checkbox**: Set `- [x]` on the matching line in `{PLAN_DIR}/<plan-id>-<name>.md`.
|
|
128
|
+
3. **status.json** (when PM round requires): bump `plans[].status` (e.g. `InProgress`) or append coordination notes per `mstar-plan-artifacts`.
|
|
129
|
+
4. **Evidence**: Record real `git log -1 --oneline` in Completion Report v2 **Git** (or Plan-mode status note if executing as PM in Plan mode).
|
|
130
|
+
|
|
131
|
+
**NEVER**
|
|
132
|
+
|
|
133
|
+
- Mark implement todos done without a commit when tracked files changed.
|
|
134
|
+
- Batch all work into one closing commit unless PM documented an exception.
|
|
135
|
+
- Mark plan-level `Done` in `status.json` without PM/QA authority.
|
|
136
|
+
|
|
137
|
+
Dev-role NEVER rules also apply when executing as implementer: `mstar-roles/references/fullstack-dev-shared.md` (Git NEVER).
|
|
138
|
+
|
|
139
|
+
## SwitchMode → Agent (pre-flight)
|
|
140
|
+
|
|
141
|
+
Before switching from Plan to Agent for implementation (or declaring Plan phase complete):
|
|
142
|
+
|
|
143
|
+
- [ ] `{PLAN_DIR}/<plan-id>-<name>.md` exists on disk
|
|
144
|
+
- [ ] `status.json` contains `plans[]` entry with matching `id` and `file`
|
|
145
|
+
- [ ] Bootstrap todos `harness-init`, `spec-register`, `mirror-plan` are **done**
|
|
146
|
+
- [ ] CreatePlan implement todos reference **task ids** traceable to SSOT plan checkboxes
|
|
147
|
+
- [ ] **Plan Path** for any Assignment uses the SSOT path, not the Cursor plan URI
|
|
148
|
+
|
|
149
|
+
If any item fails → **Blocked**; finish harness sync before implement.
|
|
150
|
+
|
|
151
|
+
## PM in Plan mode (`/pm`)
|
|
152
|
+
|
|
153
|
+
When `/pm` runs under Plan mode:
|
|
154
|
+
|
|
155
|
+
- Load this reference via **`mstar-host`** (Cursor detection) after `mstar-harness-core`.
|
|
156
|
+
- **CreatePlan** todos **must** include the three bootstrap prefix items.
|
|
157
|
+
- Prepare phase (`specify → clarify → plan`) still applies; `mirror-plan` is the harness **`plan`** artifact, not a substitute for clarify.
|
|
158
|
+
- Before QC dispatch, read **`mstar-review-qc`** (unchanged).
|
|
159
|
+
|
|
160
|
+
## Anti-patterns
|
|
161
|
+
|
|
162
|
+
| Anti-pattern | Fix |
|
|
163
|
+
|--------------|-----|
|
|
164
|
+
| CreatePlan only, no `.agents/` files | Run bootstrap todos; Write mirror plan + status.json |
|
|
165
|
+
| Todo done, no commit | Commit per task; paste `git log -1` evidence |
|
|
166
|
+
| Drift between CreatePlan and SSOT plan | Update both in same round |
|
|
167
|
+
| Cursor plan URI as Plan Path | Use `{PLAN_DIR}/...` path |
|
|
168
|
+
| Skip `spec-register` | Add `plans[]` row before implement |
|
|
169
|
+
|
|
170
|
+
## Related skills
|
|
171
|
+
|
|
172
|
+
- `mstar-plan-conventions` — discovery, init, `writing-plans` path gate
|
|
173
|
+
- `mstar-plan-artifacts` — `status.json`, reports, checkboxes, residual
|
|
174
|
+
- `mstar-phase-gates` — Prepare / Execute order
|
|
175
|
+
- `mstar-roles/references/project-manager/dispatch-and-assignment.md` — Checkpoint: commit → Completion Report → Status Update
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Cursor host reference
|
|
2
|
+
|
|
3
|
+
Load when **`mstar-host`** detection resolves **cursor** (CreatePlan / SwitchMode, Task + `subagent_type`, or Cursor `/pm` flow).
|
|
4
|
+
|
|
5
|
+
Parallel PM dispatch: **`parallel-dispatch.md`** (Task tool uses same turn model).
|
|
6
|
+
|
|
7
|
+
## Cursor-only context
|
|
8
|
+
|
|
9
|
+
- Role prompts: `mstar-roles`; **`/pm`** → `project-manager` via `pm` skill + `mstar-roles`.
|
|
10
|
+
- Routing-eval: `.cursor/skills/mstar-routing-eval/` — maint only.
|
|
11
|
+
|
|
12
|
+
## Plan mode × harness dual-write
|
|
13
|
+
|
|
14
|
+
When **Plan mode** is active, **CreatePlan is session UX**; SSOT is **`{HARNESS_DIR}`** (default `.agents/`) — `{PLAN_DIR}/<plan-id>-<name>.md`, `{HARNESS_DIR}/status.json`.
|
|
15
|
+
|
|
16
|
+
Before first **CreatePlan**: Read `mstar-plan-conventions`, `mstar-plan-artifacts`, Prepare gates from `mstar-phase-gates` when not hotfix. Full procedure: **`cursor-plan-mode-bridge.md`**.
|
|
17
|
+
|
|
18
|
+
**Bootstrap CreatePlan todos (prefix, before implement):**
|
|
19
|
+
|
|
20
|
+
| Todo ID | Purpose |
|
|
21
|
+
|---------|---------|
|
|
22
|
+
| `harness-init` | Init `{HARNESS_DIR}`, `{PLAN_DIR}`, `reports/`, `archived/residuals/`, `status.json` |
|
|
23
|
+
| `spec-register` | Register `plan_id` in `status.json.plans[]` + spec stub if applicable |
|
|
24
|
+
| `mirror-plan` | Write SSOT main plan under `{PLAN_DIR}/` |
|
|
25
|
+
|
|
26
|
+
Each **implement todo**: per–task-ID **git commit** on Working branch → SSOT `- [x]` → optional `status.json` sync → `git log -1 --oneline` evidence.
|
|
27
|
+
|
|
28
|
+
Before **SwitchMode → Agent**: mirror plan exists; `status.json` lists `plan_id`; bootstrap todos done. **Never** use only the Cursor plan URI as **Plan Path**.
|
|
29
|
+
|
|
30
|
+
Enforcement: `rules/mstar-cursor-plan-mode.mdc` when plugin active.
|
|
31
|
+
|
|
32
|
+
## `/pm` precedence
|
|
33
|
+
|
|
34
|
+
1. User explicit instructions
|
|
35
|
+
2. Project `AGENTS.md` / `CLAUDE.md`
|
|
36
|
+
3. `mstar-harness-core` and `mstar-*` skills
|
|
37
|
+
4. `mstar-host` + this reference
|
|
38
|
+
|
|
39
|
+
## Task tool (QC tri-review)
|
|
40
|
+
|
|
41
|
+
- Apply **`parallel-dispatch.md`**: prerequisite message may prep only; dispatch message emits **all `N`** Tasks (**3** for tri-review) in **one** message when parallel is required.
|
|
42
|
+
- `subagent_type`: `qc-specialist`, `qc-specialist-2`, `qc-specialist-3`.
|
|
43
|
+
- Identical across three Tasks: **`plan_id`**, **`Review cwd`**, **`Review range` / Diff basis** (`mstar-branch-worktree`, `mstar-dispatch-gates`, `mstar-review-qc`).
|
|
44
|
+
- Parallel QC ≠ different review cwd per reviewer; one integrated HEAD for scope.
|
|
45
|
+
- Status Update may note QC ran via parallel Task subagents.
|
|
46
|
+
|
|
47
|
+
## Supplemental execution modes
|
|
48
|
+
|
|
49
|
+
**Mode A — Single session, multiple roles:** PM writes Assignment; executor states `Acting as role: …` and loads `mstar-roles` reference. QC/QA without Task: same field alignment rules.
|
|
50
|
+
|
|
51
|
+
**Mode B — Multi-window:** One Assignment per chat; first turn loads role via `mstar-roles`; PM consolidates in main thread.
|
|
52
|
+
|
|
53
|
+
**Mode C — Worktrees:** `mstar-branch-worktree` + `mstar-dispatch-gates` for concurrent writers; do not assign different tri-review cwd by default.
|
|
54
|
+
|
|
55
|
+
**No recursive Task in implement subagents:** Task recipient is already `Execute as`; must not re-spawn same dev role. Assignment wins over conflicting outer messages (`Delegation: forbidden`).
|
|
56
|
+
|
|
57
|
+
## Clarify
|
|
58
|
+
|
|
59
|
+
- No `question` tool: structured Markdown or Cursor UI.
|
|
60
|
+
- “Question asked” ≠ clarify done; high-impact ambiguity → `Blocked` or escalation.
|
|
61
|
+
|
|
62
|
+
## Superpowers
|
|
63
|
+
|
|
64
|
+
If no Skill invocation tool: `mstar-superpowers-align` “plugin not installed”; **Read** upstream `SKILL.md` before execution.
|
|
65
|
+
|
|
66
|
+
## Gotchas
|
|
67
|
+
|
|
68
|
+
- Tri-review needs identical `plan_id` and review scope fields.
|
|
69
|
+
- Task parallelism does not relax branch/worktree isolation.
|
|
70
|
+
|
|
71
|
+
## Project rules
|
|
72
|
+
|
|
73
|
+
Project `AGENTS.md` / `CLAUDE.md` upward from cwd override global harness defaults when they conflict with Cursor-side rules; user instructions win.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# OpenCode host reference
|
|
2
|
+
|
|
3
|
+
Load when **`mstar-host`** detection resolves **opencode** (`question` tool, `@<agent-id>` invoke, or OpenCode session).
|
|
4
|
+
|
|
5
|
+
Parallel PM dispatch: **`parallel-dispatch.md`** (read in dispatch rounds).
|
|
6
|
+
|
|
7
|
+
## Role loading
|
|
8
|
+
|
|
9
|
+
- **Role shell**: `agents/<id>.md` referenced by `opencode.json` `agent.<id>` (frontmatter + role binding only).
|
|
10
|
+
- **Role body**: `mstar-roles` `references/<id>.md` (or shared references + parameters).
|
|
11
|
+
- Superpowers conflicts: `mstar-superpowers-align`.
|
|
12
|
+
|
|
13
|
+
## OpenCode-specific capabilities
|
|
14
|
+
|
|
15
|
+
- **Structured clarify**: prefer `question` tool (title, prompt, options, optional custom text). Requires `permission.question` in config (user-maintained; do not edit global config without consent).
|
|
16
|
+
- **Built-in subagents**: `@explore` (read-only), `@general`; subject to `mstar-harness-core` explore boundaries.
|
|
17
|
+
- **Named roles (`@<agent-id>`)**: configured in `opencode.json` `agent.<id>` must be **actually invoked** by PM. Assignment Markdown alone does not open sessions.
|
|
18
|
+
- **Per-role models**: configurable per subagent in `opencode.json`.
|
|
19
|
+
|
|
20
|
+
## Invoke entry
|
|
21
|
+
|
|
22
|
+
Use host subagent / Task / equivalent per **`parallel-dispatch.md`**. OpenCode PM typically uses **`@<agent-id>`** or the host’s subagent entry — same **no tool = no dispatch** rule.
|
|
23
|
+
|
|
24
|
+
## Prepare phase — serial roles still require invoke
|
|
25
|
+
|
|
26
|
+
`mstar-roles` **project-manager** may route `@explore → @product-manager → @architect` **sequentially**. Each handoff still needs a real **host invoke** with Assignment (often **`N = 1`** per dispatch turn). Writing PRD / architecture only in the PM chat when routing assigns **`product-manager`** or **`architect`** is **not** a substitute. Cross-check: `mstar-roles` → `references/project-manager.md` → **§1.1.1a Phase routing pre-flight**.
|
|
27
|
+
|
|
28
|
+
## Gotchas
|
|
29
|
+
|
|
30
|
+
- `question` availability is config-dependent; if unavailable, structured Markdown clarify.
|
|
31
|
+
- `@explore` is orientation only, not role-owned implementation or review deliverables.
|
|
32
|
+
- More MCPs do not replace phase gates or evidence rules.
|
|
33
|
+
|
|
34
|
+
## Session noise control
|
|
35
|
+
|
|
36
|
+
- Large unrelated platform injections (e.g. long ecosystem prompts): prefer on-demand / `alwaysApply: false` when not stack-relevant.
|
|
37
|
+
- One default channel per capability class (search, docs).
|
|
38
|
+
|
|
39
|
+
## Optional MCPs / skills (user-enabled)
|
|
40
|
+
|
|
41
|
+
Aligned with `mstar-harness-core` `references/open-harness-principles.md`. Editing global `opencode.json` requires explicit user consent.
|
|
42
|
+
|
|
43
|
+
| Capability | Purpose | Notes |
|
|
44
|
+
|------|------|------|
|
|
45
|
+
| **Current docs** | Versioned API/libs | Context7-like MCP or equivalent |
|
|
46
|
+
| **Web search** | Time-sensitive / migrations | Avoid duplicate search MCPs |
|
|
47
|
+
| **Code pattern search** | Cross-repo references | e.g. grep.app MCP |
|
|
48
|
+
| **Repo graph** | Impact / PR risk | e.g. GitNexus |
|
|
49
|
+
| **Browser / E2E** | Observable QA evidence | agent-browser, Playwright |
|
|
50
|
+
| **Git workflow** | Atomic commits, branch closure | git-commit, finishing-a-development-branch |
|
|
51
|
+
| **Systematic debugging** | RCA before fix | `mstar-superpowers-align` |
|
|
52
|
+
| **OpenViking memory** | Long-term memory tools | Only if `memsearch` present; `openviking-memory-plugin.md` |
|
|
53
|
+
|
|
54
|
+
**Not recommended**: overlapping search MCPs; extra tools to mask missing harness baseline.
|
|
55
|
+
|
|
56
|
+
## Maintenance boundary
|
|
57
|
+
|
|
58
|
+
Runtime only — do not modify `opencode.json`, `secrets.env`, or `.secrets/*` without explicit user consent.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Parallel dispatch (invoke-capable hosts)
|
|
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`.
|
|
4
|
+
|
|
5
|
+
If the active host has no callable invoke tool, this reference does not create delegation capability: use single-session execution, multi-window handoff, or mark dispatch `Blocked`.
|
|
6
|
+
|
|
7
|
+
## Paste-only failure
|
|
8
|
+
|
|
9
|
+
Printing `## Assignment` in the main thread **without** matching host invocations is **not** delegation; downstream work **does not start**. Parallel dispatch makes this worse (N Assignments printed, zero invokes).
|
|
10
|
+
|
|
11
|
+
## Prerequisite vs dispatch turn
|
|
12
|
+
|
|
13
|
+
- **Prerequisite turn** (optional): `bash` / `read` / `glob` / `grep` to collect facts (`merge-base`, `Review range`, `git rev-parse`, paths). **Do not** emit **any** batch dispatch in this message unless `N = 1` and that single call *is* the dispatch.
|
|
14
|
+
- **Dispatch turn** (when `N ≥ 2`): the **first** message that emits **any** dispatch for the batch must contain **all `N`** invocations. If not ready for all `N`, emit **zero** dispatches — finish prep, then one message with **`N`** calls.
|
|
15
|
+
|
|
16
|
+
## Mandatory order (dispatch turn)
|
|
17
|
+
|
|
18
|
+
1. Finalize all `N` Assignment payloads (after any prerequisite turn).
|
|
19
|
+
2. Count distinct `Execute as` sessions (`N`).
|
|
20
|
+
3. Issue **`N` host invocations first** (subagent / Task / `@agent-id`), each with one Assignment body. For parallel work, **all `N` tool calls in one assistant message** when the host allows.
|
|
21
|
+
4. Optionally post a short **Status Update** after invocations (audit trail only — does not replace step 3).
|
|
22
|
+
|
|
23
|
+
## Hard rules
|
|
24
|
+
|
|
25
|
+
- **Emit zero until batch-ready**: if `N ≥ 2` and only one invoke is possible now, **do not** send that one; complete payloads, then **`N` in one message**.
|
|
26
|
+
- Do not end the dispatch turn until **`N` invocations emitted**, or mark `Blocked` / `dispatch incomplete`.
|
|
27
|
+
- Dual-track implement: **`N = 2` ⇒ two invocations in one message** when parallel is required.
|
|
28
|
+
- Status Update on dispatch turns: **`Subagent invokes issued: N`** (must match Assignment count). If Assignments were written but `N = 0` → **`dispatch failed — paste-only`**; fix next message.
|
|
29
|
+
|
|
30
|
+
## QC tri-review
|
|
31
|
+
|
|
32
|
+
- Launch `qc-specialist`, `qc-specialist-2`, `qc-specialist-3` in **one** dispatch turn (**3** invocations, one message).
|
|
33
|
+
- Do not claim parallel QC unless all three were issued in that turn.
|
|
34
|
+
- Post-dispatch: verify three distinct agent IDs and intended model mapping; on mismatch → invalid dispatch, re-dispatch before consolidation.
|
|
35
|
+
|
|
36
|
+
## Self-check before send
|
|
37
|
+
|
|
38
|
+
1. Required assignments this turn? (`N`)
|
|
39
|
+
2. Prerequisite-only message? → **zero** batch dispatches unless `N = 1`.
|
|
40
|
+
3. Dispatch message contains **exactly `N`** invocation calls?
|
|
41
|
+
4. QC tri-review → **exactly 3** in one dispatch message?
|
|
42
|
+
5. Previous message was prerequisite-only → this message must include **all `N`** (not “QC1 first”).
|
|
@@ -48,7 +48,7 @@ Treat these as baseline dependencies **where the role touches implementation, re
|
|
|
48
48
|
| `mstar-review-qc` | QC workflow, template, verdict, high-risk checks |
|
|
49
49
|
| `mstar-coding-behavior` | Implementation/debug/refactor (**not** PM orchestration-only) |
|
|
50
50
|
| `mstar-superpowers-align` | Superpowers plugin on; Assignment `Superpowers` lines |
|
|
51
|
-
| `mstar-host
|
|
51
|
+
| `mstar-host` | Host-specific behavior (auto-detect; `references/opencode.md` / `cursor.md` / `codex.md`) |
|
|
52
52
|
|
|
53
53
|
### Role → typical topic skills (after `mstar-harness-core`)
|
|
54
54
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**On demand:** `mstar-branch-worktree` (when committing architecture docs to the business repo).
|
|
10
10
|
|
|
11
|
-
**Host:** `mstar-host
|
|
11
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
12
12
|
|
|
13
13
|
## Role Mission
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**On demand:** `mstar-branch-worktree` (repo writes); `mstar-phase-gates` (Execute / hotfix when referenced in assignment).
|
|
10
10
|
|
|
11
|
-
**Host:** `mstar-host
|
|
11
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
12
12
|
|
|
13
13
|
## Role Mission
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ Behavior is shared; track identity is parameterized.
|
|
|
18
18
|
|
|
19
19
|
**On demand:** `mstar-branch-worktree` (repo writes, `Working branch`); `mstar-phase-gates` (Execute / hotfix sections when gate fields are in the assignment).
|
|
20
20
|
|
|
21
|
-
**Host:** `mstar-host
|
|
21
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
22
22
|
|
|
23
23
|
## Role Mission
|
|
24
24
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**On demand:** `mstar-phase-gates` (hotfix compressed path when assignment says hotfix).
|
|
10
10
|
|
|
11
|
-
**Host:** `mstar-host
|
|
11
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
12
12
|
|
|
13
13
|
## Role Mission
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**On demand:** `mstar-branch-worktree` (when committing product docs to the business repo).
|
|
10
10
|
|
|
11
|
-
**Host:** `mstar-host
|
|
11
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
12
12
|
|
|
13
13
|
## Role Mission
|
|
14
14
|
|
|
@@ -7,7 +7,7 @@ The concise gate summary remains in `references/project-manager.md`.
|
|
|
7
7
|
|
|
8
8
|
- Only `project-manager` dispatches subagents.
|
|
9
9
|
- Each independent Assignment requires one matching host invoke.
|
|
10
|
-
- In tool hosts (OpenCode/Cursor Task), Markdown-only Assignment is not dispatch.
|
|
10
|
+
- In tool hosts (OpenCode / Cursor Task / Codex with callable multi-agent tools), Markdown-only Assignment is not dispatch.
|
|
11
11
|
- For parallel batch with `N >= 2`, dispatch turn must emit all `N` invokes in one message when host supports it.
|
|
12
12
|
|
|
13
13
|
## Executor Anti-Recursion Rules
|
|
@@ -115,7 +115,7 @@ For assignees (non-PM):
|
|
|
115
115
|
**Effort note (agent-oriented)**: ...
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
##
|
|
118
|
+
## Host-Specific Note
|
|
119
119
|
|
|
120
|
-
For
|
|
121
|
-
read
|
|
120
|
+
For host behavior details (dispatch turn shape, paste-only failure mode, invoke-count discipline),
|
|
121
|
+
read `mstar-host` → the active host reference and `references/parallel-dispatch.md` as host SSOT for dispatch.
|
|
@@ -4,7 +4,7 @@ Before any non-trivial PM action, read in order:
|
|
|
4
4
|
|
|
5
5
|
1. `mstar-harness-core` (entry, state machine, Task category, skill index)
|
|
6
6
|
2. `mstar-dispatch-gates` + `mstar-phase-gates` (dispatch + Prepare/Execute gates)
|
|
7
|
-
3. Host adapter: `mstar-host
|
|
7
|
+
3. Host adapter: `mstar-host` (detect host; Read `references/opencode.md`, `cursor.md`, or `codex.md`)
|
|
8
8
|
4. `mstar-plan-conventions` (path discovery, init, Spec branch summary)
|
|
9
9
|
5. `mstar-superpowers-align` (when Superpowers plugin is enabled)
|
|
10
10
|
6. `mstar-review-qc` (same coordination round, **before** any QC dispatch)
|
|
@@ -87,14 +87,14 @@ Detailed conflict priority and dev allocation:
|
|
|
87
87
|
|
|
88
88
|
## Host Dispatch Rule (Critical)
|
|
89
89
|
|
|
90
|
-
In invoke-based hosts (OpenCode/Task-
|
|
90
|
+
In invoke-based hosts (OpenCode / Cursor Task / Codex with callable multi-agent tools):
|
|
91
91
|
|
|
92
92
|
- Assignment markdown alone is not dispatch.
|
|
93
93
|
- Each independent Assignment needs one matching invoke.
|
|
94
94
|
- For parallel `N >= 2`, emit all `N` invokes in one dispatch turn when host supports it.
|
|
95
95
|
- Do not claim dispatch completion without matching invokes.
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
Host invoke/dispatch details: `mstar-host` → active host reference and `references/parallel-dispatch.md`.
|
|
98
98
|
|
|
99
99
|
Dispatch mechanics and templates:
|
|
100
100
|
`references/project-manager/dispatch-and-assignment.md`.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
**On demand:** `mstar-plan-artifacts` (closing R# after verified fix); `mstar-phase-gates` (gate checklist when assignment references verification phase).
|
|
10
10
|
|
|
11
|
-
**Host:** `mstar-host
|
|
11
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
12
12
|
|
|
13
13
|
## Role Mission
|
|
14
14
|
|
|
@@ -20,7 +20,7 @@ Behavior is shared; reviewer identity is parameterized.
|
|
|
20
20
|
|
|
21
21
|
**On demand:** `mstar-plan-artifacts` (when PM asks you to cite severity enum for residual registration — QC does not own `status.json` writes).
|
|
22
22
|
|
|
23
|
-
**Host:** `mstar-host
|
|
23
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
24
24
|
|
|
25
25
|
## Role Mission
|
|
26
26
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
**Typically:** `mstar-plan-conventions` (where deliverables land under `{HARNESS_DIR}` / `docs/`); `mstar-plan-artifacts` (when writing under knowledge or plan trees); `mstar-superpowers-align` (when plugin on).
|
|
8
8
|
|
|
9
|
-
**Host:** `mstar-host
|
|
9
|
+
**Host:** `mstar-host` (detect; `references/opencode.md` | `cursor.md` | `codex.md`).
|
|
10
10
|
|
|
11
11
|
## Role Mission
|
|
12
12
|
|
|
@@ -14,6 +14,15 @@ Use `/pm` as a hard switch for the current session: enter Morning Star PM mode u
|
|
|
14
14
|
3. Load `mstar-roles` `project-manager` role reference.
|
|
15
15
|
4. Execute as Morning Star `project-manager` for this thread.
|
|
16
16
|
|
|
17
|
+
## Cursor Plan mode (when CreatePlan / SwitchMode is available)
|
|
18
|
+
|
|
19
|
+
If this session runs in Cursor **Plan mode**:
|
|
20
|
+
|
|
21
|
+
1. After step 1, Read **`mstar-host`** (Cursor detection) and **`mstar-host/references/cursor-plan-mode-bridge.md`**.
|
|
22
|
+
2. Before the first **CreatePlan**, Read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`**.
|
|
23
|
+
3. **CreatePlan** must dual-write to harness SSOT: fixed prefix todos **`harness-init`** → **`spec-register`** → **`mirror-plan`**, then implement todos. Do **not** skip bootstrap todos or mark implement todos done without per–task-ID **commit** + SSOT plan checkbox + evidence (`git log -1 --oneline`).
|
|
24
|
+
4. Before **SwitchMode → Agent**, verify mirror plan file and `status.json` `plan_id` registration per the bridge reference.
|
|
25
|
+
|
|
17
26
|
## Operating baseline
|
|
18
27
|
|
|
19
28
|
- Prefer **`specify → clarify → plan → tasks → delegate`** (align with `mstar-phase-gates`; do not skip `specify`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mstar-harness/opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"main": "./dist/mstar.js",
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
-
"skills",
|
|
16
15
|
"harness-skills",
|
|
17
16
|
"harness-agents",
|
|
18
17
|
"AGENTS.md",
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: mstar-host-opencode
|
|
3
|
-
description: OpenCode host adapter for Morning Star harness. Use this skill whenever running Morning Star in OpenCode, especially for host entry behavior, `opencode.json`-driven role loading, `question`-based structured clarify, `@explore`/`@general` usage boundaries, and PM-triggered named-role invocation (including paste-only dispatch failure: Assignment Markdown without matching subagent/Task tool calls). Always load this after `mstar-harness-core` to keep host behavior aligned with shared gates and routing.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Morning Star × OpenCode Host Adapter
|
|
7
|
-
|
|
8
|
-
This skill defines host adaptation for **Morning Star running in OpenCode** (capabilities, entry behavior, and noise control).
|
|
9
|
-
Neutral process rules and invariants remain authoritative in `mstar-harness-core`.
|
|
10
|
-
|
|
11
|
-
## First Action: Load `mstar-harness-core`
|
|
12
|
-
|
|
13
|
-
Regardless of whether OpenCode injected root `AGENTS.md` via Global Rules, the agent’s **first action** is to read `mstar-harness-core`.
|
|
14
|
-
|
|
15
|
-
## Default path (recommended)
|
|
16
|
-
|
|
17
|
-
Use this default sequence unless a project rule explicitly overrides it:
|
|
18
|
-
|
|
19
|
-
1. Read `mstar-harness-core`
|
|
20
|
-
2. Read current host adapter (`mstar-host-opencode`)
|
|
21
|
-
3. Load role via `mstar-roles`
|
|
22
|
-
4. Execute with evidence-first completion checks
|
|
23
|
-
|
|
24
|
-
## Role loading
|
|
25
|
-
|
|
26
|
-
- **Role shell**: `agents/<id>.md` is referenced by `opencode.json` `agent.<id>`; the file keeps only frontmatter and role binding.
|
|
27
|
-
- **Role body**: stored in `mstar-roles` `references/<id>.md` (or shared references + role parameters).
|
|
28
|
-
- **Plugin orchestration conflict handling**: see `mstar-superpowers-align`.
|
|
29
|
-
|
|
30
|
-
## OpenCode-specific capabilities (other hosts may differ)
|
|
31
|
-
|
|
32
|
-
- **Structured clarify**: prefer built-in `question` tool (title, prompt, options, optional custom text). Requires `permission.question` in config (user-maintained; agent must not edit global config without explicit consent).
|
|
33
|
-
- **Built-in subagents**: e.g., `@explore` (read-only navigation), `@general`; still subject to `mstar-harness-core` boundaries for explore usage.
|
|
34
|
-
- **Named roles (`@<agent-id>`)**: roles configured in `opencode.json` `agent.<id>` must be **actually invoked** by PM through host entry points. Printing Assignment Markdown alone does not create subagent sessions.
|
|
35
|
-
- **Per-role models**: different models can be configured per subagent in `opencode.json`.
|
|
36
|
-
|
|
37
|
-
### OpenCode PM: dispatch order and “no tool = no dispatch” (critical)
|
|
38
|
-
|
|
39
|
-
Some models **only paste** `## Assignment` in the main thread and **never call** the host subagent / Task entry. That is **not** delegation; downstream work **does not start**. Parallel dispatch makes this worse (two Assignments printed, **zero** invokes).
|
|
40
|
-
|
|
41
|
-
**Turn model: prerequisite vs dispatch (prevents “bash then one QC” failure)**
|
|
42
|
-
|
|
43
|
-
- **Prerequisite turn** (optional, any assistant message): use `bash` / `read` / `glob` / `grep` to collect facts (`merge-base`, `Review range`, `git rev-parse`, paths). **Do not** emit **any** subagent/Task **dispatch** for the batch in this same message **unless** `N = 1` and that single tool call *is* the dispatch.
|
|
44
|
-
- **Dispatch turn** (mandatory shape when `N ≥ 2` concurrent assignees): the **first** message where you emit **any** dispatch for that batch must contain **all `N`** host invocations (each with its Assignment body). If you are **not** ready to emit all `N`, emit **zero** dispatches in that message — finish prep, then send **one** message with **`N`** calls.
|
|
45
|
-
|
|
46
|
-
**Mandatory order in the same assistant turn that issues dispatch**
|
|
47
|
-
|
|
48
|
-
1. **Finalize** all `N` Assignment payloads (after any prerequisite turn).
|
|
49
|
-
2. **Count** independent Assignments for this turn (`N` = number of distinct `Execute as` sessions you must open).
|
|
50
|
-
3. **Issue `N` host invocations first** (subagent / Task / equivalent), each carrying **one** Assignment body as the task message. For **parallel** work, put **all `N` tool calls in this single assistant message** when the host allows it.
|
|
51
|
-
4. **Only after** those tool calls, optionally post a short user-facing **Status Update** (may repeat Assignment titles as audit trail — **does not** replace the **`N`** invocations in step 3).
|
|
52
|
-
|
|
53
|
-
**Hard rules**
|
|
54
|
-
|
|
55
|
-
- **Emit zero until batch-ready**: if `N ≥ 2` and you can only issue **one** invoke right now, **do not issue that one** yet; complete the other payloads, then issue **all `N` in one message**. Partial single-invoke sends are **serial rollout**, not parallel launch.
|
|
56
|
-
- **Do not end** the dispatch turn until **`N` invocations have been emitted** (or you explicitly mark `Blocked` / `dispatch incomplete` with host reason and a follow-up plan).
|
|
57
|
-
- **Dual-track implement** (two dev Assignments) uses the **same** rule as QC tri-review: **`N = 2` ⇒ two invocations in one message** when parallel is required — not one invoke “and we’ll do the second later.”
|
|
58
|
-
- In Status Update for dispatch turns, include **`Subagent invokes issued: N`** (must match Assignment count). If `N` is 0 while Assignments were written → state **`dispatch failed — paste-only`** and fix in the **next** message.
|
|
59
|
-
|
|
60
|
-
## OpenCode parallel dispatch contract (critical)
|
|
61
|
-
|
|
62
|
-
When PM dispatches parallel work (especially QC tri-review **or two concurrent implement tracks**), treat "parallel" as a **tool-level requirement**, not only a wording requirement. The **Turn model: prerequisite vs dispatch** rules above apply here too (bash/read prep ≠ partial dispatch).
|
|
63
|
-
|
|
64
|
-
- **Hard rule**: if 2+ subagents must run in parallel, emit all corresponding subagent/task invocations in the **same assistant message**. **Printing two Assignments without two matching tool calls is a failed dispatch**, not partial success.
|
|
65
|
-
- **QC tri-review**: launch `qc-specialist`, `qc-specialist-2`, and `qc-specialist-3` in one dispatch turn (three invocations in one message block).
|
|
66
|
-
- **Failure mode to avoid**: sending only one invocation and planning to send the others later is a serial rollout, not a successful parallel launch.
|
|
67
|
-
- **Completion claim gate**: do not claim "QC tri-review dispatched in parallel" unless all three invocations were issued in that same dispatch turn.
|
|
68
|
-
|
|
69
|
-
Quick self-check before sending:
|
|
70
|
-
1. How many independent assignments are required this turn? (`N`)
|
|
71
|
-
2. Am I in a **prerequisite-only** message? If yes, ensure **zero** batch dispatches here unless `N = 1`.
|
|
72
|
-
3. If this message is the **dispatch** message, does it contain **exactly `N`** invocation calls (not `1` when `N = 3`)?
|
|
73
|
-
4. For QC tri-review, is the count **exactly 3** in **one** message in the dispatch turn?
|
|
74
|
-
5. If the **previous** message was prerequisite-only, this message **must** include all **`N`** dispatches (not “start with QC1 only”).
|
|
75
|
-
|
|
76
|
-
Post-dispatch validation (mandatory for QC tri-review):
|
|
77
|
-
1. Verify the three runtime invocations were started as the intended agent IDs: `qc-specialist`, `qc-specialist-2`, `qc-specialist-3` (not three runs of the same role).
|
|
78
|
-
2. Verify runtime model mapping matches host config intent for each reviewer.
|
|
79
|
-
3. If any role/model mismatch is observed, mark dispatch as invalid, do not enter QC consolidation, and re-dispatch with corrected role/model targeting.
|
|
80
|
-
|
|
81
|
-
### Prepare phase (`specify` / `plan`) — serial roles still require invoke
|
|
82
|
-
|
|
83
|
-
Routing in `mstar-roles` **project-manager** may read `@explore → @product-manager → @architect` **sequentially**. That does **not** waive **no tool = no dispatch**: each handoff still needs a real **host invoke** carrying the Assignment for that `agent.<id>` (often **`N = 1`** per dispatch turn). Writing PRD / acceptance / product specify prose, or architecture / contract sections, only in the primary `project-manager` chat — then claiming “plan directory maintenance” — is **not** a substitute when the routing table assigns those bodies to **`product-manager`** or **`architect`**. Cross-check before advancing phases: `mstar-roles` → `references/project-manager.md` → **§1.1.1a Phase routing pre-flight**.
|
|
84
|
-
|
|
85
|
-
## Gotchas
|
|
86
|
-
|
|
87
|
-
- `question` availability is host-config dependent; if unavailable, fall back to structured Markdown clarify flow.
|
|
88
|
-
- Printing an Assignment in the main thread is not dispatch; PM must actually invoke the target role.
|
|
89
|
-
- Built-in `@explore` remains read-only orientation, not a substitute for role-owned implementation or review deliverables.
|
|
90
|
-
- More MCPs does not fix process gaps; follow `mstar-phase-gates` and evidence rules first.
|
|
91
|
-
- Topic skills load **on demand** per `mstar-roles` (see hub matrix): `mstar-dispatch-gates`, `mstar-phase-gates`, `mstar-branch-worktree`, `mstar-plan-conventions`, `mstar-plan-artifacts`, `mstar-plan-artifacts`, etc.
|
|
92
|
-
|
|
93
|
-
## Shared protocol: library documentation retrieval (Context7)
|
|
94
|
-
|
|
95
|
-
Context7 retrieval is a shared process rule maintained by `mstar-harness-core`.
|
|
96
|
-
Follow: `mstar-harness-core` skill `references/library-docs-protocol.md`.
|
|
97
|
-
|
|
98
|
-
---
|
|
99
|
-
|
|
100
|
-
## Session context and plugin injection (noise control)
|
|
101
|
-
|
|
102
|
-
- **Large platform injections** (for example, long Vercel ecosystem prompts, SessionStart hooks): if unrelated to current stack, they consume context and can conflict with project choices. For non-Vercel projects, disable or make them on-demand (`alwaysApply: false` + explicit trigger description).
|
|
103
|
-
- **Multiple search/docs MCPs**: keep one default channel per capability class.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Optional MCPs / skills by capability
|
|
108
|
-
|
|
109
|
-
This section lists optional enhancements by capability domain, aligned with principles in `mstar-harness-core` `references/open-harness-principles.md` (documentation retrieval, observable verification, structured exploration). User decides whether to enable them; editing global `opencode.json` requires explicit user consent.
|
|
110
|
-
|
|
111
|
-
| Capability | Purpose | Notes |
|
|
112
|
-
|------|------|------|
|
|
113
|
-
| **Current docs** | Reduce hallucination for versioned APIs/libs | Context7-like MCP or equivalent host-configured docs tool |
|
|
114
|
-
| **Web search** | Time-sensitive issues and migration notes | Avoid overlapping multiple search MCPs for the same purpose |
|
|
115
|
-
| **Code pattern search** | Cross-repo implementation references | Example: `https://mcp.grep.app`; skip if equivalent already configured |
|
|
116
|
-
| **Repo graph / impact analysis** | Dependency/call graph and PR risk | Example: GitNexus |
|
|
117
|
-
| **Browser / E2E verification** | User-visible flow validation and evidence capture | agent-browser, Playwright, aligned with QA observable-evidence requirements |
|
|
118
|
-
| **Git workflow** | Atomic commits and branch closure | e.g., `git-commit`, `finishing-a-development-branch` |
|
|
119
|
-
| **Systematic debugging** | RCA before fix | Superpowers `systematic-debugging` (see `mstar-superpowers-align`) |
|
|
120
|
-
| **OpenViking memory** | Long-term semantic memory (`memsearch` / `memread` / `membrowse` / `memcommit`) | **Only if** the `memsearch` tool is present: follow `mstar-harness-core` `references/openviking-memory-plugin.md`; does not override harness gates |
|
|
121
|
-
|
|
122
|
-
### Not recommended
|
|
123
|
-
|
|
124
|
-
- Keeping multiple overlapping search MCPs always enabled.
|
|
125
|
-
- Using more tools to mask phase-gate/process gaps when harness baseline is not yet followed.
|
|
126
|
-
|
|
127
|
-
## Maintenance boundary (separate from runtime skill)
|
|
128
|
-
|
|
129
|
-
This skill should contain only **runtime host adaptation** (capabilities and entry behavior).
|
|
130
|
-
|
|
131
|
-
- Runtime guardrail remains unchanged: agent must not modify `opencode.json`, `secrets.env`, or `.secrets/*` without explicit user consent.
|