@mstar-harness/opencode 1.5.6 → 1.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/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ All notable changes to the `@mstar-harness/opencode` package are documented in t
|
|
|
4
4
|
|
|
5
5
|
The monorepo root [CHANGELOG.md](../../CHANGELOG.md) summarizes cross-surface releases.
|
|
6
6
|
|
|
7
|
+
## 1.6.0
|
|
8
|
+
|
|
9
|
+
- Version alignment with harness **1.6.0** (no OpenCode plugin change in this release; ZCode host surface is added at the harness/CLI layer, not bundled into the OpenCode package).
|
|
10
|
+
|
|
11
|
+
See root [CHANGELOG.md](../../CHANGELOG.md) **1.6.0**.
|
|
12
|
+
|
|
7
13
|
## 1.5.6
|
|
8
14
|
|
|
9
15
|
- Version alignment with harness **1.5.6** (bundled skills: `Findings cleanup: zero-residual` mode).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mstar-host
|
|
3
|
-
description: Morning Star host adapter (OpenCode, Cursor, Codex, Kimi). Use after mstar-harness-core whenever host entry, clarify, dispatch, or plan UX differs by platform - OpenCode question/task-tool subagent invoke, Cursor /pm and CreatePlan/SwitchMode dual-write and Task parallel QC, Codex plugin skills plus Plan/Goal Mode, Kimi Agent/AgentSwarm with built-in subagent types only (coder/explore/plan) and role-in-prompt binding, sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
|
|
3
|
+
description: Morning Star host adapter (OpenCode, Cursor, Codex, Kimi, ZCode). Use after mstar-harness-core whenever host entry, clarify, dispatch, or plan UX differs by platform - OpenCode question/task-tool subagent invoke, Cursor /pm and CreatePlan/SwitchMode dual-write and Task parallel QC, Codex plugin skills plus Plan/Goal Mode, Kimi Agent/AgentSwarm with built-in subagent types only (coder/explore/plan) and role-in-prompt binding, ZCode Agent/AskUserQuestion/EnterPlanMode with built-in subagent types and role-in-prompt binding, sandboxed tools, and tool discovery. Auto-detect host from session tools; then Read references/<host>.md. Always load after mstar-harness-core.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Morning Star Host Adapter
|
|
@@ -32,7 +32,8 @@ Use **capability signals** (not filesystem paths):
|
|
|
32
32
|
| **Task** + `subagent_type`, no CreatePlan | `cursor` | `references/cursor.md` |
|
|
33
33
|
| **Codex app/CLI/plugin context**, `/plan`, `/goal`, Goal tools, `functions.*`, `codex_app.*`, `tool_search`, Browser plugin tools | `codex` | `references/codex.md`; Plan/Goal mode also `references/codex-plan-goal-mode-bridge.md` |
|
|
34
34
|
| **`Agent`** / **`AgentSwarm`** / **`AskUserQuestion`** / **`EnterPlanMode`**, Kimi plugin (`.kimi-plugin/plugin.json`), `/morning-star-harness:*` commands | `kimi` | `references/kimi.md`; Plan mode also `references/kimi-plan-mode-bridge.md` |
|
|
35
|
-
|
|
|
35
|
+
| **`Agent`** / **`AskUserQuestion`** / **`EnterPlanMode`** / **`TodoWrite`**, no `AgentSwarm`, ZCode plugin (`.zcode-plugin/plugin.json`), `/morning-star-harness:*` commands | `zcode` | `references/zcode.md`; Plan mode also `references/zcode-plan-mode-bridge.md` |
|
|
36
|
+
| Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, **`codex.md`**, **`kimi.md`**, and **`zcode.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
|
|
36
37
|
|
|
37
38
|
## Parallel dispatch (invoke-capable hosts)
|
|
38
39
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# ZCode Plan Mode × Harness Dual-Write Bridge
|
|
2
|
+
|
|
3
|
+
> **Load order**: Read **`mstar-harness-core`** first, then **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** when Plan mode is active. Path symbols `{HARNESS_DIR}`, `{PLAN_DIR}`, `{SPECS_DIR}` are defined in `mstar-plan-conventions`. On conflict, **`mstar-harness-core`** wins.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
ZCode **Plan mode** (`EnterPlanMode` / `ExitPlanMode`) uses read-only exploration for design and a plan approval gate before implementation. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`). This reference defines **dual-write**: mirror durable plan artifacts to the repo; never treat the ZCode session todo list 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. ZCode `TodoWrite` UI (session UX mirror)
|
|
15
|
+
|
|
16
|
+
**NEVER** cite only a session todo list 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
|
+
- ZCode **Plan mode** is active (`EnterPlanMode` succeeded).
|
|
21
|
+
- Morning Star plugin is installed (`.zcode-plugin/plugin.json` skills loaded) or **`/morning-star-harness:pm`** / **`pm` skill** is in use.
|
|
22
|
+
|
|
23
|
+
## Before entering Plan mode
|
|
24
|
+
|
|
25
|
+
1. **Read** (minimum): `mstar-plan-conventions`, `mstar-plan-artifacts` (SKILL.md); Prepare gates from `mstar-phase-gates` if not hotfix.
|
|
26
|
+
2. **Discover** `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions`.
|
|
27
|
+
3. **Initialize** if absent: `{HARNESS_DIR}/`, `{PLAN_DIR}/`, `status.json` from `mstar-plan-artifacts/templates/status.empty.json`, `archived/residuals/`, Morning Star process-artifact gitignore set (see `mstar-plan-conventions` SKILL.md「Git 跟踪策略」).
|
|
28
|
+
|
|
29
|
+
## Plan mode workflow (dual-write)
|
|
30
|
+
|
|
31
|
+
| Step | ZCode session | Harness SSOT |
|
|
32
|
+
|------|---------------|--------------|
|
|
33
|
+
| Enter | `EnterPlanMode` — explore read-only | Ensure `{HARNESS_DIR}` exists; register `plan_id` in `status.json` when known |
|
|
34
|
+
| Design | Draft plan content; surface via `ExitPlanMode` plan text | Mirror main plan to `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes |
|
|
35
|
+
| Clarify | `AskUserQuestion` for blocking ambiguity only | Record decisions in plan / spec when durable |
|
|
36
|
+
| Exit | `ExitPlanMode` — user approves plan to implement | SSOT plan locked; `status.json` row updated |
|
|
37
|
+
| Implement | Agent mode resumes | Per-task commits, Working branch, dispatch per `mstar-dispatch-gates` |
|
|
38
|
+
|
|
39
|
+
`TodoWrite` and ZCode UI todos are **session progress only** — sync meaningful state to SSOT plan checkboxes and `status.json` when coordination requires it.
|
|
40
|
+
|
|
41
|
+
## ExitPlanMode gate
|
|
42
|
+
|
|
43
|
+
Do **not** treat ExitPlanMode approval as Morning Star **Done**. Implementation still follows phase gates, per-task commits, QC, and QA per the SSOT plan.
|
|
44
|
+
|
|
45
|
+
## `mstar-iteration` Phase 1
|
|
46
|
+
|
|
47
|
+
When iteration Phase 1 runs in Plan mode:
|
|
48
|
+
|
|
49
|
+
- Use **one** plan session; iterate the **same** plan content and SSOT mirror in place (feedback-driven edits).
|
|
50
|
+
- Do **not** run Review & Edit, commit integration branch, or dispatch implementers until the user approves via `ExitPlanMode` (or explicit go-ahead after plan lock).
|
|
51
|
+
- After approval: reload `mstar-harness-core` + `zcode.md`; resume as `project-manager` orchestration.
|
|
52
|
+
|
|
53
|
+
## Enforcement
|
|
54
|
+
|
|
55
|
+
Conflict with harness invariants → **`mstar-harness-core`** wins. Full Cursor CreatePlan bridge detail lives in `cursor-plan-mode-bridge.md` when hosts differ; ZCode uses this lighter Enter/Exit bridge only.
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
# ZCode host reference
|
|
2
|
+
|
|
3
|
+
Load when **`mstar-host`** detection resolves **zcode** (ZCode client session, `.zcode-plugin/plugin.json` plugin installed, `Agent` / `AskUserQuestion` / `EnterPlanMode` / `TodoWrite` tools, or `/morning-star-harness:*` plugin commands).
|
|
4
|
+
|
|
5
|
+
Plan mode: read **`zcode-plan-mode-bridge.md`** when `EnterPlanMode` / `ExitPlanMode` is active.
|
|
6
|
+
|
|
7
|
+
Parallel PM dispatch: read **`parallel-dispatch.md`** when dispatching **N ≥ 2** concurrent `Agent` invocations.
|
|
8
|
+
|
|
9
|
+
## ZCode-only context
|
|
10
|
+
|
|
11
|
+
- Plugin manifest: **`.zcode-plugin/plugin.json`** (plugin root is the **repo root**; paths stay `./skills/`, `./commands/`, `./agents/`).
|
|
12
|
+
- Runtime skills: repo `skills/` mounted by the plugin (`"skills": "./skills/"`).
|
|
13
|
+
- Plugin commands: repo `commands/` → `/morning-star-harness:<name>` (e.g. `/morning-star-harness:iteration-start`).
|
|
14
|
+
- Plugin agents: repo `agents/*.md` (role frontmatter `name` + `description`); ZCode reads them as subagent definitions but **does not** expose custom named `subagent_type` values for Morning Star roles (see C5).
|
|
15
|
+
- **No `sessionStart.skill`** (ZCode has no Kimi-style session auto-load) — enter PM manually via **`/morning-star-harness:pm`** or the **`pm`** skill, then **Read next** → `mstar-harness-core` → `project-manager.md`.
|
|
16
|
+
- Install (user-scoped, recommended): `npx @mstar-harness/cli init --target zcode --scope global`, then in ZCode **Settings → Plugin Management → Discover** install **morning-star-harness** from the **mstar-local** marketplace (or add `github:btspoony/mstar-harness` as a marketplace directly).
|
|
17
|
+
- Plugins are **user-scoped** (all projects); managed copy lives under `~/.zcode/cli/plugins/` after install.
|
|
18
|
+
- Project `.agents/skills/` symlinks are **not** required when using the plugin — commands and skills come from the plugin mount.
|
|
19
|
+
|
|
20
|
+
## Skill loading
|
|
21
|
+
|
|
22
|
+
1. On entry: invoke **`pm`** (via `/morning-star-harness:pm` or `/skill:pm`) → **Read next** loads `mstar-harness-core`, then `mstar-roles` → `project-manager.md` when PM is active.
|
|
23
|
+
2. Read `mstar-host` and this ZCode reference.
|
|
24
|
+
3. If Plan mode is active, read `zcode-plan-mode-bridge.md`.
|
|
25
|
+
4. Load `mstar-roles` and the active role reference.
|
|
26
|
+
5. Load topic skills on demand per the role reference.
|
|
27
|
+
|
|
28
|
+
Use skill names in prompts and references. Avoid absolute local paths unless maintaining this repository or skills are not installed.
|
|
29
|
+
|
|
30
|
+
## Tools map (default agent)
|
|
31
|
+
|
|
32
|
+
| ZCode tool | Harness use |
|
|
33
|
+
|------------|-------------|
|
|
34
|
+
| **Agent** | Primary dispatch — delegate one subagent task (`subagent_type`: built-in profiles such as `general-purpose` / `Explore`) |
|
|
35
|
+
| **AskUserQuestion** | Structured clarify (1–4 questions, 2–4 options each); prefer over free-form when choices are known |
|
|
36
|
+
| **EnterPlanMode** / **ExitPlanMode** | Plan mode entry/approval → **`zcode-plan-mode-bridge.md`** |
|
|
37
|
+
| **TodoWrite** | Session UX only; mirror to SSOT plan / `status.json` when durable |
|
|
38
|
+
| **Bash** | Commands, git, tests — evidence per `mstar-coding-behavior` |
|
|
39
|
+
| **Read** | File reads (text + images) |
|
|
40
|
+
| **Edit** / **Write** | Edits |
|
|
41
|
+
| **Glob** / **Grep** | Search (prefer over shell find/grep) |
|
|
42
|
+
| **WebSearch** / **WebFetch** | External docs / facts |
|
|
43
|
+
| **TaskOutput** / **TaskStop** | Long-running task management when present |
|
|
44
|
+
|
|
45
|
+
OpenCode-style `question`/`task`, Cursor **Task**, and Kimi **AgentSwarm** are **not** ZCode tools — do not assume them.
|
|
46
|
+
|
|
47
|
+
## Role agents (C5 — hard constraint)
|
|
48
|
+
|
|
49
|
+
ZCode ships **built-in subagent types only** (e.g. `general-purpose`, `Explore`). Valid **`subagent_type`** values are the host's built-in profiles:
|
|
50
|
+
|
|
51
|
+
| `subagent_type` | ZCode profile | Harness mapping |
|
|
52
|
+
|-----------------|---------------|-----------------|
|
|
53
|
+
| `Explore` | Read-only exploration | Orientation, codebase survey, Prepare explore passes |
|
|
54
|
+
| `general-purpose` | General implementation / research | **All other Morning Star roles** (`product-manager`, `fullstack-dev`, `qc-specialist`, …) |
|
|
55
|
+
|
|
56
|
+
Morning Star role ids (`project-manager`, `fullstack-dev`, `qc-specialist`, …) are **not** valid `subagent_type` values. Although `agents/*.md` are read by ZCode, the host does not register them as callable named agent types the way Codex TOML or Cursor `subagent_type` role ids do.
|
|
57
|
+
|
|
58
|
+
### Role binding in prompt (C5b — required)
|
|
59
|
+
|
|
60
|
+
Because ZCode cannot bind roles via agent config, every dispatch **must** carry the played Morning Star role in the **Assignment** and in the **`Agent` prompt**:
|
|
61
|
+
|
|
62
|
+
1. **`Execute as: <role-id>`** in Assignment (harness routing SSOT).
|
|
63
|
+
2. **`Act as <role-id>`** (or equivalent) at the top of the Agent prompt.
|
|
64
|
+
3. **Skill load list** — instruct the subagent to read `mstar-roles` → `references/<role-id>.md` (or shared reference + parameters) and topic skills per that reference.
|
|
65
|
+
4. **`subagent_type`** — pick from the host's built-in profiles only (typically `general-purpose`; `Explore` for read-only orientation).
|
|
66
|
+
|
|
67
|
+
Paste-only Assignment without an **`Agent`** call is **not** dispatch.
|
|
68
|
+
|
|
69
|
+
### Assignment / Agent-prompt template
|
|
70
|
+
|
|
71
|
+
```markdown
|
|
72
|
+
## Assignment
|
|
73
|
+
|
|
74
|
+
**Execute as**: fullstack-dev
|
|
75
|
+
**Delegation**: forbidden
|
|
76
|
+
**Working branch**: feat/example
|
|
77
|
+
**Plan Path**: .mstar/plans/20260717-example.md
|
|
78
|
+
|
|
79
|
+
**IDENTITY:** You ARE `fullstack-dev`. Act as `fullstack-dev` for this task.
|
|
80
|
+
Load: `mstar-harness-core` → `mstar-host` → `zcode.md` → `mstar-roles` → `references/fullstack-dev-shared.md` → topic skills per that reference.
|
|
81
|
+
|
|
82
|
+
<task body>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
PM dispatch invocation (same turn):
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
Agent(
|
|
89
|
+
subagent_type: "general-purpose",
|
|
90
|
+
description: "<short task label>",
|
|
91
|
+
prompt: "<full Assignment body including Act as + skill load>"
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
For **`Explore`** orientation:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
Agent(subagent_type: "Explore", description: "...", prompt: "... Act as explore-only orientation; Execute as: n/a ...")
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## PM dispatch (`Agent`)
|
|
102
|
+
|
|
103
|
+
Harness **dispatch** on ZCode = **one or more `Agent` tool calls** with correct **`subagent_type`** and role-bound prompts.
|
|
104
|
+
|
|
105
|
+
| Harness | ZCode |
|
|
106
|
+
|---------|-------|
|
|
107
|
+
| `Execute as: <role-id>` | Role id in Assignment + **Act as** + skill load in **Agent** prompt |
|
|
108
|
+
| `subagent_type` for invoke | built-in profiles only (typically `general-purpose`; `Explore` for read-only) |
|
|
109
|
+
| 1 Assignment ⇒ 1 invoke | **1 `Agent`** call with full Assignment prompt |
|
|
110
|
+
| Parallel batch **N** | **N `Agent`** calls in **one assistant message** |
|
|
111
|
+
| No `Agent` call | **Not dispatched** — paste-only / `dispatch incomplete` |
|
|
112
|
+
|
|
113
|
+
### QC default
|
|
114
|
+
|
|
115
|
+
- **`Execution mode: sdd`**: **N=3** `Agent` calls (`qc-specialist`, `qc-specialist-2`, `qc-specialist-3`) — each prompt **Act as** the respective QC role, all `subagent_type: "general-purpose"`.
|
|
116
|
+
- **`inline`**: **N=1** per `parallel-dispatch.md`.
|
|
117
|
+
|
|
118
|
+
Cannot emit required **N** → **`Blocked`**.
|
|
119
|
+
|
|
120
|
+
### SDD implement (serial)
|
|
121
|
+
|
|
122
|
+
- **`Execution mode: sdd`**: one implementer **`Agent`** per task id; task reviewer = new **`Agent`** (no sticky resume unless host adds it later).
|
|
123
|
+
- **Never** multiple implementer Agents in one message for the same plan.
|
|
124
|
+
|
|
125
|
+
## Clarify
|
|
126
|
+
|
|
127
|
+
- Prefer **`AskUserQuestion`** for 1–3 high-impact choices with known options.
|
|
128
|
+
- Fallback: one concise Markdown question after codebase exploration cannot answer it.
|
|
129
|
+
- `AskUserQuestion` for plan approval is wrong in Plan mode — use **`ExitPlanMode`** for plan sign-off.
|
|
130
|
+
- "Question asked" ≠ clarify done; blocking ambiguity → **`Blocked`** or escalation.
|
|
131
|
+
|
|
132
|
+
## Commands and skills paths
|
|
133
|
+
|
|
134
|
+
| Surface | Path / invocation |
|
|
135
|
+
|---------|-------------------|
|
|
136
|
+
| Plugin skills | `/skill:<skill-name>` or auto-load from `skills/` via plugin |
|
|
137
|
+
| Plugin commands | `/morning-star-harness:iteration-start` etc. |
|
|
138
|
+
| Session entry | `/morning-star-harness:pm` or `/skill:pm` → `mstar-harness-core` via pm **Read next** |
|
|
139
|
+
|
|
140
|
+
## Files, shell, and approvals
|
|
141
|
+
|
|
142
|
+
- Prefer **Glob** / **Grep** for search; **Write** / **Edit** for edits.
|
|
143
|
+
- Respect ZCode permission prompts for destructive operations.
|
|
144
|
+
- Do not edit `~/.zcode/` credentials, managed plugin copies, or user secrets without explicit consent.
|
|
145
|
+
|
|
146
|
+
## Git and final evidence
|
|
147
|
+
|
|
148
|
+
- Git work follows `mstar-branch-worktree` and Assignment **Working branch** / **Branch policy**.
|
|
149
|
+
- Completion reports cite concrete commands, artifacts, and commit lines when required.
|
|
150
|
+
|
|
151
|
+
## Gotchas
|
|
152
|
+
|
|
153
|
+
- Plugin install materializes source under `~/.zcode/cli/plugins/` — edit the harness checkout + reinstall to pick up harness changes.
|
|
154
|
+
- Session todos (`TodoWrite`) are not durable SSOT unless mirrored to `{HARNESS_DIR}`.
|
|
155
|
+
- No custom ZCode agent profiles for Morning Star roles — role binding is **always** prompt + skill load (C5b).
|
|
156
|
+
- ZCode has no `sessionStart.skill`; new sessions do **not** auto-load PM — invoke `/morning-star-harness:pm` or `/skill:pm` manually.
|