@mstar-harness/opencode 1.0.0 → 1.0.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.
Files changed (31) hide show
  1. package/CHANGELOG.md +254 -0
  2. package/README.md +62 -0
  3. package/harness-commands/iteration-drive.md +18 -8
  4. package/harness-commands/iteration-start.md +13 -14
  5. package/harness-commands/mstar-bootstrap.md +4 -5
  6. package/harness-skills/mstar-compound/SKILL.md +24 -2
  7. package/harness-skills/mstar-compound-refresh/SKILL.md +1 -1
  8. package/harness-skills/mstar-dispatch-gates/SKILL.md +3 -2
  9. package/harness-skills/mstar-host/references/codex.md +1 -1
  10. package/harness-skills/mstar-host/references/cursor.md +17 -1
  11. package/harness-skills/mstar-host/references/opencode.md +3 -0
  12. package/harness-skills/mstar-host/references/parallel-dispatch.md +1 -1
  13. package/harness-skills/mstar-iteration/SKILL.md +58 -16
  14. package/harness-skills/mstar-iteration/references/iteration-artifact-boundaries.md +94 -0
  15. package/harness-skills/mstar-iteration/references/iteration-compass-template.md +15 -0
  16. package/harness-skills/mstar-iteration/references/iteration-corpus-hygiene.md +51 -0
  17. package/harness-skills/mstar-iteration/references/iteration-workspace-readme-template.md +29 -0
  18. package/harness-skills/mstar-plan-artifacts/references/knowledge-and-designs.md +24 -13
  19. package/harness-skills/mstar-plan-conventions/references/artifact-storage-paths.md +3 -0
  20. package/harness-skills/mstar-roles/references/architect.md +1 -1
  21. package/harness-skills/mstar-roles/references/product-manager.md +1 -1
  22. package/harness-skills/mstar-roles/references/project-manager/dispatch-and-assignment.md +15 -0
  23. package/harness-skills/mstar-roles/references/project-manager.md +8 -2
  24. package/harness-skills/mstar-roles/references/writing-specialist.md +1 -0
  25. package/harness-skills/mstar-sdd/SKILL.md +13 -5
  26. package/harness-skills/mstar-sdd/references/file-handoffs.md +3 -0
  27. package/harness-skills/mstar-sdd/references/implementer-continuation-prompt.md +44 -0
  28. package/harness-skills/mstar-sdd/references/implementer-prompt.md +3 -1
  29. package/harness-skills/mstar-sdd/references/sticky-implementer-session.md +103 -0
  30. package/harness-skills/pm/SKILL.md +20 -45
  31. package/package.json +4 -2
@@ -0,0 +1,44 @@
1
+ # Implementer continuation prompt (sticky session)
2
+
3
+ Use when PM continues **`SDD implementer session: sticky`** for Task N>1. Host: **resume** same agent when supported (`sticky-implementer-session.md`).
4
+
5
+ ```
6
+ Task / subagent:
7
+ resume: [HOST_AGENT_ID from implementer-session.json]
8
+ description: "SDD continue Task N: <name>"
9
+ model: [same tier as session start unless PM upgrades]
10
+ prompt: |
11
+ <SUBAGENT-STOP> Skip PM orchestration skills. You are a leaf implementer continuing a sticky SDD session.</SUBAGENT-STOP>
12
+
13
+ Continue as the same implementer on plan <plan-id>, Working branch: <branch>.
14
+
15
+ ## Completed (do not redo)
16
+
17
+ Read: [SDD_DIR]/progress.md and [SDD_DIR]/implementer-session.json
18
+
19
+ ## This task
20
+
21
+ Task N: <name>
22
+
23
+ Read first — your spec (verbatim): [BRIEF_FILE]
24
+
25
+ ## Context not in the brief
26
+
27
+ [Interfaces from earlier tasks only if not already in your session]
28
+
29
+ ## Report file
30
+
31
+ Write your full report to: [REPORT_FILE]
32
+
33
+ ## Your job
34
+
35
+ 1. Implement exactly what this brief specifies (prior tasks are done)
36
+ 2. Run tests; commit on Working branch
37
+ 3. Write report file; return short summary only
38
+
39
+ ## When stuck
40
+
41
+ Report BLOCKED or NEEDS_CONTEXT — PM may reset session to fresh.
42
+ ```
43
+
44
+ First task on a plan uses **`implementer-prompt.md`** (not this file).
@@ -1,6 +1,8 @@
1
1
  # Implementer subagent prompt template
2
2
 
3
- Use when PM dispatches an SDD implementer (`mstar-sdd`).
3
+ Use when PM dispatches an SDD implementer (`mstar-sdd`) — **first task** or **`SDD implementer session: fresh`**.
4
+
5
+ For **sticky** continuation (task 2+), use **`implementer-continuation-prompt.md`** instead.
4
6
 
5
7
  ```
6
8
  Task / subagent:
@@ -0,0 +1,103 @@
1
+ # Sticky implementer session (SDD token optimization)
2
+
3
+ Reuse the **same implementer subagent** across multiple tasks in one plan when tasks are tightly coupled, same `Execute as` role, and same `Working branch`. **L2 task reviewers stay fresh per task** — do not sticky reviewers.
4
+
5
+ SSOT for mode selection and host resume → this file. Per-task artifacts → **`file-handoffs.md`**.
6
+
7
+ ## When to use
8
+
9
+ | `SDD implementer session` | Use |
10
+ |---------------------------|-----|
11
+ | **`fresh`** (default) | Independent tasks, module boundaries, different dev tracks, or first task on a plan |
12
+ | **`sticky`** | Same `fullstack-dev` (or same role id), sequential tasks on one branch, strong file/context continuity (e.g. T3+T4 daemon stderr + DB reset) |
13
+
14
+ **Prefer `sticky`** on iteration-drive Phase 2 when PM will dispatch many tasks to the same dev on one plan feature branch.
15
+
16
+ ## Assignment fields (implement dispatch)
17
+
18
+ ```markdown
19
+ **Execution mode**: sdd
20
+ **SDD implementer session**: sticky | fresh
21
+ **SDD dir**: `{HARNESS_DIR}/sdd/<plan-id>/`
22
+ **Model tier**: standard
23
+ **Execute as**: fullstack-dev
24
+ **Working branch**: <branch>
25
+ **Covers task**: N | N–M # single task id for this dispatch turn
26
+ ```
27
+
28
+ - **Task 1** (or first task after `fresh` reset): `SDD implementer session: fresh` or `sticky` (starts sticky ledger).
29
+ - **Task 2+** with sticky: `SDD implementer session: sticky` + host **resume** (Cursor) or continuation prompt (fallback).
30
+
31
+ ## Session ledger: `implementer-session.json`
32
+
33
+ PM writes/updates at `{SDD_DIR}/implementer-session.json` when starting or continuing sticky mode:
34
+
35
+ ```json
36
+ {
37
+ "plan_id": "<plan-id>",
38
+ "execute_as": "fullstack-dev",
39
+ "session_mode": "sticky",
40
+ "host": "cursor",
41
+ "host_agent_id": "<agent-id from first Task return — required for resume>",
42
+ "working_branch": "feature/...",
43
+ "started_task": 1,
44
+ "last_task": 1,
45
+ "started_at": "2026-07-07T00:00:00Z"
46
+ }
47
+ ```
48
+
49
+ After each completed task review, PM sets `last_task` to N. **Do not** resume if `host_agent_id` is missing — fall back to `fresh` for that task.
50
+
51
+ ## Per-task loop (sticky implementer)
52
+
53
+ Same as default SDD for artifacts and L2 review; only implementer dispatch differs:
54
+
55
+ 1. `task-brief` → `{SDD_DIR}/task-N-brief.md`
56
+ 2. Record `BASE_SHA`
57
+ 3. **Implementer dispatch**
58
+ - **First task** (`fresh` or sticky start): normal Task/subagent invoke → save `host_agent_id` to ledger
59
+ - **Next tasks** (`sticky`): host **resume** with same `host_agent_id` + continuation prompt (`implementer-prompt.md` § Continuation)
60
+ 4. On `DONE` → `review-package` → **fresh** task reviewer (never resume reviewer)
61
+ 5. Append `progress.md`; update ledger `last_task`
62
+ 6. Next task
63
+
64
+ **Still required per task:** commit, `task-N-report.md`, task-level diff, task reviewer, `progress.md` line.
65
+
66
+ ## When to reset to `fresh`
67
+
68
+ Start a **new** implementer session (`session_mode: fresh` or new ledger) when any:
69
+
70
+ - `BLOCKED` / `NEEDS_CONTEXT` not resolved in one continuation turn
71
+ - `Execute as` role changes (`fullstack-dev` → `fullstack-dev-2`)
72
+ - `Working branch` changes
73
+ - Host does not support resume (OpenCode without resume → use **micro-batch** or `fresh`)
74
+ - Context clearly degraded (implementer confuses prior tasks) — PM judgment
75
+ - Switching from another dev track mid-plan
76
+
77
+ Delete or archive `implementer-session.json` when resetting.
78
+
79
+ ## Micro-batch fallback (no host resume)
80
+
81
+ When resume is unavailable, PM may dispatch **one** implementer for **2–3** tightly coupled tasks:
82
+
83
+ - Prompt lists `task-N-brief.md` … `task-M-brief.md` and matching report paths only
84
+ - Implementer completes tasks **in order** in one session
85
+ - PM still runs **per-task** `review-package` + **fresh** task reviewer after each task (or after batch if PM documents per-task SHAs in Assignment)
86
+
87
+ Max **3** tasks per micro-batch without user override. See `project-manager.md` batch sizing.
88
+
89
+ ## Host mapping
90
+
91
+ | Host | Sticky implementer |
92
+ |------|-------------------|
93
+ | **Cursor** | `Task` with `resume: <host_agent_id>` — **`mstar-host/references/cursor.md`** § SDD sticky |
94
+ | **OpenCode** | Resume only if task tool supports it; else micro-batch or `fresh` per task |
95
+ | **Codex** | Thread resume only when callable multi-agent tool documents agent id; else micro-batch or `fresh` |
96
+
97
+ ## PM NEVER (sticky)
98
+
99
+ - Resume task **reviewer** sessions — reviewers stay fresh per task
100
+ - Parallel sticky implementers on the same branch
101
+ - Resume without updating `implementer-session.json` / `progress.md`
102
+ - Skip per-task review because implementer "remembers" prior tasks
103
+ - Paste full plan into continuation prompt — only new brief path + report path
@@ -1,59 +1,34 @@
1
1
  ---
2
2
  name: pm
3
- description: "Morning Star PM orchestration entry. On Cursor/Codex, /pm launches project-manager. On OpenCode, switch to project-manager when the active agent is not PM. The autonomous Execute flow (per-plan dispatch, iteration management, compound) lives in mstar-iteration this skill covers PM role identity, host entry, dispatch-first rules, and host-specific concerns."
3
+ description: "PM entry shim force project-manager orchestration when user invokes /pm or this skill (Codex and Cursor). General per-plan PM work: this skill + project-manager.md. Formal iteration lifecycle on Cursor/OpenCode: commands (iteration-start, iteration-drive, mstar-bootstrap). Boot, routing, dispatch SSOT mstar-roles/references/project-manager.md and topic mstar-* skills not here."
4
4
  ---
5
5
 
6
- # PM Morning Star orchestration entry
6
+ # PM (entry shim)
7
7
 
8
- **PM role launcher and host adapter.** Iteration flow (start → Execute → close) → **`mstar-iteration`** (canonical SSOT). This skill handles: PM role identity per host, boot order, dispatch-first rules, Cursor Plan mode.
8
+ **Thin launcher only.** Boot lists, iteration phases, Assignment templates, and SDD loops are **not** maintained in this file.
9
9
 
10
- ## Host entry (read `mstar-host` first)
10
+ ## Host entry
11
11
 
12
- | Host | Entry | PM role |
13
- | --- | --- | --- |
14
- | **Cursor / Codex** | User invokes **`/pm`** (or explicit "run as PM") | Force **`project-manager`** for the session |
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. Host invoke: task tool **`subagent`** matching Assignment `Execute as` (see `mstar-host` → `opencode.md`); Assignment body uses **plain role ids** |
12
+ | Host | Use |
13
+ |------|-----|
14
+ | **Codex** | **`/pm`** or this skill **`project-manager`** for the session |
15
+ | **Cursor** | **`/pm`** or this skill general PM orchestration (single-plan, hotfix, QC waves, dispatch) **without** starting an iteration. Formal iteration **`commands/`** below |
16
+ | **OpenCode** | Same as Cursor when no command: **`project-manager`** via `mstar-roles` → `references/project-manager.md` |
16
17
 
17
- Detect host Read `mstar-host` `references/cursor.md` | `opencode.md` | `codex.md`.
18
+ **Iteration commands** (optional; carry their own Boot): `iteration-start`, `iteration-drive`, `mstar-bootstrap` use when running Phase 1–5 iteration lifecycle, not required for ordinary PM work.
18
19
 
19
- ## Boot (order)
20
+ Detect host → **`mstar-host`** → `references/codex.md` | `cursor.md` | `opencode.md`.
20
21
 
21
- 1. `mstar-harness-core`
22
- 2. `mstar-roles` → `references/project-manager.md`
23
- 3. Before first **implement** dispatch: `mstar-dispatch-gates` + host reference
24
- 4. Before **QC**: `mstar-review-qc`
25
- 5. **SDD implement** (`Execution mode: sdd`): `mstar-sdd` before first implement dispatch
26
- 6. **Iteration flow** (start / Execute / close): **`mstar-iteration`** — canonical SSOT for per-plan dispatch loop, integration branch, compound round. Do **not** re-describe the flow in this skill.
27
- 7. **On demand:** `mstar-phase-gates`, `mstar-plan-conventions`, `mstar-plan-artifacts`, `mstar-branch-worktree`, `mstar-skill-authoring` for skill work
28
-
29
- Prepare/Execute gates, routing, Assignment templates, Task Board, QC (SDD → tri; inline → single), residuals, compound → topic skills + PM references (not repeated here).
30
-
31
- ## Dispatch-first (`implement`)
32
-
33
- | Do | Don't |
34
- | --- | --- |
35
- | **Loop:** `## Assignment` → invoke → Completion Report v2 → report-to-status → next batch | Parent **Write/Edit/Shell** on product code to "move faster" |
36
- | **1 Assignment ⇒ 1 invoke** when host supports Task/subagent (`mstar-dispatch-gates`) | Assignment markdown only, no matching invoke |
37
- | Put merge/branch/handoff from **this thread** into Assignment | Skip subagent because context is "already here" |
38
-
39
- - **NEVER** implement while staying PM — SDD ends with **plan QC tri** (N=3); **implement still delegates** dev + task reviewer subagents.
40
- - **Delegate scope / PM whitelist:** `mstar-roles` → PM Execution Boundary.
22
+ ## Read next (in order)
41
23
 
42
- **Exceptions:** user explicitly asks PM thread to implement; hotfix per `mstar-phase-gates`.
43
-
44
- ## Iteration
45
-
46
- Formal iteration(Phase 1 → Phase 2 → Phase 3)→ **`mstar-iteration`** only. Do not duplicate phase gates, branch policy, or close checklists here.
47
-
48
- ## Cursor Plan mode
49
-
50
- 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.
24
+ 1. `mstar-harness-core`
25
+ 2. `mstar-roles` → **`references/project-manager.md`** — required reading list, routing, dispatch-first, iteration branch policy
26
+ 3. Topic skills **on demand** per that file and the active workflow (`mstar-dispatch-gates`, `mstar-iteration`, `mstar-sdd`, `mstar-review-qc`, …)
51
27
 
52
- ## Conflict order
28
+ ## Three rules (everything else is a pointer)
53
29
 
54
- 1. User explicit instructions
55
- 2. Project `AGENTS.md` / `CLAUDE.md`
56
- 3. `mstar-harness-core` + runtime `mstar-*`
57
- 4. This skill
30
+ 1. **Delegate** PM does not implement, QC, or QA in-thread (`project-manager.md` Execution Boundary; hotfix → `mstar-phase-gates`).
31
+ 2. **Dispatch** when host has invoke/Task tools: **1 Assignment ⇒ 1 invoke** (`mstar-dispatch-gates`). Markdown alone is not dispatch.
32
+ 3. **SSOT** — iteration lifecycle → **`mstar-iteration`** (or **`commands/`** on Cursor/OpenCode); Cursor Plan mode → **`mstar-host/references/cursor-plan-mode-bridge.md`**.
58
33
 
59
- **Dispatch-first + `mstar-dispatch-gates`** win over "fast parent agent" unless user overrides.
34
+ Conflict: user instructions → project `AGENTS.md` / `CLAUDE.md` `mstar-harness-core` this file.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -16,7 +16,9 @@
16
16
  "harness-agents",
17
17
  "harness-commands",
18
18
  "AGENTS.md",
19
- "INSTALL.md"
19
+ "INSTALL.md",
20
+ "README.md",
21
+ "CHANGELOG.md"
20
22
  ],
21
23
  "scripts": {
22
24
  "bundle-assets": "bun run scripts/bundle-harness-assets.ts",