@mstar-harness/opencode 0.6.8 → 0.6.9

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.
@@ -133,9 +133,9 @@ Before first implement dispatch (non-hotfix):
133
133
 
134
134
  If any fail -> do not dispatch implement.
135
135
 
136
- ### `/pm` sessions
136
+ ### PM entry sessions (`/pm` or OpenCode PM switch)
137
137
 
138
- When the session entered via **`/pm`**, follow **`skills/pm/SKILL.md`** § **`/pm`-only rules** (dispatch-first, iteration push, branch truth). Routing, gates, Task Board, QC, and templates remain in this file and topic `mstar-*` skills.
138
+ When the session entered via **`/pm`**, **`pm` skill**, or OpenCode PM orchestration, follow **`skills/pm/SKILL.md`** especially **Host entry**, **Autonomous Execute driver** (status.json backlog, `spec_integration_branch`, per-plan feature branches), and **Dispatch-first**. Routing, gates, Task Board, QC, and templates remain in this file and topic `mstar-*` skills.
139
139
 
140
140
  ---
141
141
 
@@ -1,60 +1,111 @@
1
1
  ---
2
2
  name: pm
3
- description: "Force Morning Star PM mode (`/pm`): load mstar-harness-core and project-manager; dispatch-only in Execute (Task per implement batch—no parent product code); continuous iteration push without basic yes/no prompts. Use when user invokes /pm or wants harness-only PM orchestration."
3
+ description: "Morning Star PM orchestration entry and autonomous Execute driver. On Cursor/Codex, /pm launches project-manager and keeps dispatch loops running. On OpenCode, switch to project-manager when the active agent is not PM. After Pre-implement GO, checkout the iteration spec_integration_branch, advance all open plans in {HARNESS_DIR}/status.json (per-plan feature branch merge to integration → repeat until Done), and set host todos before each work unit. Use when user invokes /pm, resumes harness Execute, asks PM to drive an iteration, or OpenCode needs PM role for orchestration."
4
4
  ---
5
5
 
6
- # `/pm` — Morning Star PM force entry
6
+ # PM — Morning Star orchestration entry
7
7
 
8
- Hard switch: **`mstar-*` only**, execute as **`project-manager`**.
8
+ Universal **project-manager** entry and **Execute automation driver**. Orchestrate and dispatch — **not** parent-agent product implementation (host tools do not waive this).
9
9
 
10
- **One line:** `/pm` = **orchestrate and dispatch** — not parent-agent product implementation (full Cursor/Shell tools **do not** waive this).
10
+ ## Host entry (read `mstar-host` first)
11
+
12
+ | Host | Entry | PM role |
13
+ | --- | --- | --- |
14
+ | **Cursor / Codex** | User invokes **`/pm`** (or explicit “run as PM”) | Force **`project-manager`** for the session; this skill is the launcher + automation driver |
15
+ | **OpenCode** | User may already be on a configured agent | **If active role ≠ `project-manager`**: operate **only** as PM — load `mstar-roles` → `references/project-manager.md`; do **not** stay in dev/QC/architect voice for orchestration. Named invokes still use `@<agent-id>` per Assignment |
16
+
17
+ Detect host → Read `mstar-host` → `references/cursor.md` | `opencode.md` | `codex.md`.
11
18
 
12
19
  ## Boot (order)
13
20
 
14
21
  1. `mstar-harness-core`
15
22
  2. `mstar-roles` → `references/project-manager.md`
16
- 3. Before first **implement** (non-hotfix): `mstar-dispatch-gates` + `mstar-host` (`references/cursor.md` | `opencode.md` | `codex.md`)
23
+ 3. Before first **implement** (non-hotfix): `mstar-dispatch-gates` + host reference
17
24
  4. Before **QC**: `mstar-review-qc`
18
25
  5. **On demand:** `mstar-phase-gates`, `mstar-plan-conventions`, `mstar-plan-artifacts`, `mstar-branch-worktree`, `mstar-superpowers-align`
19
26
 
20
- Prepare/Execute gates, routing, Assignment templates, Task Board, QC tri-review, residuals → **topic skills + `project-manager` references** (not repeated here).
27
+ Prepare/Execute gates, routing, Assignment templates, Task Board, QC tri-review, residuals → topic skills + PM references (not repeated here).
21
28
 
22
- ## `/pm`-only rules (SSOT for this entry)
29
+ ## When to activate autonomous Execute
23
30
 
24
- Everything else defers to `mstar-harness-core` and the table above.
31
+ Run **§ Autonomous Execute driver** when **all** are true:
25
32
 
26
- ### 1. Dispatch-first (`implement`)
33
+ 1. Harness has **`{HARNESS_DIR}/status.json`** (default `.mstar/status.json`) with at least one plan **not** `Done`
34
+ 2. **Pre-implement gate = GO** (`plan` locked, tasks ready — see `mstar-phase-gates` / PM Pre-Implement Gate Check)
35
+ 3. User intent is **continue Execute** (`/pm`, “推进 iteration”, “继续 plans”, or equivalent)
27
36
 
28
- | Do | Don't |
29
- | --- | --- |
30
- | **Loop:** `## Assignment` → invoke → Completion Report v2 → report-to-status → next batch | Parent **Write/Edit/Shell** on product code to “move faster” |
31
- | **1 Assignment ⇒ 1 invoke** in the dispatch message when host supports Task/@agent (`mstar-dispatch-gates`) | Assignment markdown only, no matching invoke |
32
- | Put merge/branch/handoff from **this thread** into Assignment | Skip subagent because context is “already here” (cold start ≠ excuse) |
37
+ If Prepare is incomplete → follow phase gates first; do **not** skip to implement dispatch.
33
38
 
34
- - **NEVER** implement while staying PM — including “not QC turn yet” (QC 3× is later; **implement still delegates** `fullstack-dev` / `frontend-dev` / …).
35
- - **Delegate scope / PM whitelist:** `mstar-roles` → PM Execution Boundary.
39
+ ## Autonomous Execute driver
40
+
41
+ **Goal:** finish the **active iteration** (all non-`Done` rows in `status.json.plans[]`) via dispatch loops — may span **multiple** `plan_id`s; do **not** stop after one plan while siblings remain open.
42
+
43
+ ### 0. Session todos (before any dispatch)
44
+
45
+ Host UI todos are **session guardrails**, not SSOT. Set them **before** each plan wave so scope does not drift:
46
+
47
+ | Host | Tool | Minimum set |
48
+ | --- | --- | --- |
49
+ | **Cursor** | `TodoWrite` or CreatePlan todos | Current `plan_id`; next batch (implement / QC / QA); branch checkpoint |
50
+ | **Codex** | `update_plan` / Goal or Plan UI todos | Same intent — mirror active `plan_id` + next gate |
51
+ | **OpenCode** | Host todo/plan UI if present | Same intent |
52
+
53
+ SSOT remains `{HARNESS_DIR}/status.json` + `{PLAN_DIR}/` — todos track **this session’s next moves**, not replace status.
54
+
55
+ ### 1. Read backlog
56
+
57
+ 1. Read **`mstar-plan-artifacts`** + **`{HARNESS_DIR}/status.json`**
58
+ 2. List plans where `status` ∈ `{Todo, InProgress, InReview, Blocked}` (priority: `InProgress` → `InReview` → `Todo` → unblock `Blocked` if PM can)
59
+ 3. Read **`metadata.spec_integration_branch`** / **`merge_target`** and **`primary_spec`** links (`mstar-plan-conventions`)
36
60
 
37
- ### 2. Autonomous Execute push (after Pre-implement **GO**)
61
+ ### 2. Iteration integration branch (Git cwd)
38
62
 
39
- - Drive the **active iteration** to done via **dispatch loops** (may span **multiple** `plan_id`s don’t stop after one plan if siblings are open).
40
- - **No** routine “should I continue?” on harness basics decide, record in Assignment if needed, **dispatch**.
41
- - Process unknowns → **Read** `mstar-*`; **`Blocked`** or user only for stop, secrets, irreversible scope gaps, or post-read rule conflict (`mstar-phase-gates` clarify spirit).
63
+ 1. Resolve **Spec / iteration integration branch** from `status.json` (`spec_integration_branch` on plan metadata or iteration-level registration see `mstar-plan-artifacts/references/status-and-residuals.md`)
64
+ 2. **Checkout or create** that branch on the **business repo** cwd PM will orchestrate from; confirm with `git branch --show-current`
65
+ 3. If missing from metadata → **stop**, Read `mstar-plan-conventions` + confirm with user per `mstar-branch-worktree` (PM branch confirmation template); record in plan + status **same round**
42
66
 
43
- ### 3. Branch truth (no silent cwd)
67
+ This branch is the **merge target** for each plan’s work until **all** plans under the iteration are `Done`.
44
68
 
45
- Actual Git strategy ≠ plan/`status.json` `working_branch` → **same round** update plan + status **or** worktree dispatches (`mstar-branch-worktree`) before next implement dispatch.
69
+ ### 3. Per-plan loop (until all `Done`)
70
+
71
+ For each active `plan_id`:
72
+
73
+ 1. **Plan start — feature branch:** Assignment uses **`Working branch: create <plan-feature-branch> from <spec_integration_branch>`** (or PM-approved equivalent). One **dedicated plan implementation branch** per `plan_id`; parallel tracks inside a plan → topic branches from integration + worktrees (`mstar-branch-worktree`).
74
+ 2. **Implement → InReview:** dispatch-only loops (`§ Dispatch-first`); update `status.json` + main plan after each Completion Report v2
75
+ 3. **QC → QA → Done:** tri-review + QA per `mstar-review-qc`; PM marks `Done` only when gates pass
76
+ 4. **Plan complete — merge back:** merge **plan feature branch** (and any integrated topic heads) **into `spec_integration_branch`**; resolve conflicts **before** next plan or QC on shared scope
77
+ 5. **Next plan** from step 1 on updated integration branch
78
+
79
+ When **every** plan in the iteration is `Done` → optional PR from `spec_integration_branch` to `main` per `mstar-plan-conventions` (unless Assignment `Branch policy` says otherwise).
80
+
81
+ ### 4. Push discipline
82
+
83
+ - **No** routine “should I continue?” on harness basics — decide, record in Assignment if needed, **dispatch**
84
+ - Unknowns → **Read** `mstar-*`; **`Blocked`** or user only for stop, secrets, irreversible scope gaps, or post-read rule conflict
85
+ - Actual Git ≠ plan/`status.json` `working_branch` → **same round** update plan + status **or** worktree dispatches before next implement
86
+
87
+ ## Dispatch-first (`implement`)
88
+
89
+ | Do | Don't |
90
+ | --- | --- |
91
+ | **Loop:** `## Assignment` → invoke → Completion Report v2 → report-to-status → next batch | Parent **Write/Edit/Shell** on product code to “move faster” |
92
+ | **1 Assignment ⇒ 1 invoke** when host supports Task/@agent (`mstar-dispatch-gates`) | Assignment markdown only, no matching invoke |
93
+ | Put merge/branch/handoff from **this thread** into Assignment | Skip subagent because context is “already here” |
94
+
95
+ - **NEVER** implement while staying PM — QC 3× comes later; **implement still delegates** dev roles.
96
+ - **Delegate scope / PM whitelist:** `mstar-roles` → PM Execution Boundary.
46
97
 
47
- **Exceptions:** user explicitly asks PM thread to implement; hotfix per `mstar-phase-gates` (still prefer invoke when available).
98
+ **Exceptions:** user explicitly asks PM thread to implement; hotfix per `mstar-phase-gates`.
48
99
 
49
100
  ## Cursor Plan mode
50
101
 
51
- If CreatePlan / SwitchMode: Read **`mstar-host/references/cursor-plan-mode-bridge.md`** (+ `mstar-plan-conventions`, `mstar-plan-artifacts` before first CreatePlan). Bootstrap todos `harness-init` → `spec-register` → `mirror-plan`; implement commits/evidence on **subagent** work, not PM parent edits alone.
102
+ CreatePlan / SwitchMode: Read **`mstar-host/references/cursor-plan-mode-bridge.md`**. Bootstrap todos `harness-init` → `spec-register` → `mirror-plan` before implement todos; evidence on **subagent** work.
52
103
 
53
104
  ## Conflict order
54
105
 
55
106
  1. User explicit instructions
56
107
  2. Project `AGENTS.md` / `CLAUDE.md`
57
- 3. `mstar-harness-core` + runtime `mstar-*` (routing-eval: maint-only `.cursor/skills/mstar-routing-eval/`)
108
+ 3. `mstar-harness-core` + runtime `mstar-*`
58
109
  4. This skill
59
110
 
60
- **Dispatch-first + `mstar-dispatch-gates` win** over “fast parent agent” unless user overrides.
111
+ **Dispatch-first + `mstar-dispatch-gates`** win over “fast parent agent” unless user overrides.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "0.6.8",
3
+ "version": "0.6.9",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {