@mstar-harness/opencode 0.5.1 → 0.6.1
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 -4
- 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-plan-artifacts/SKILL.md +19 -18
- package/harness-skills/mstar-plan-artifacts/references/status-and-residuals.md +164 -220
- package/harness-skills/mstar-plan-artifacts/scripts/tech-debt-rollup.sh +115 -0
- package/harness-skills/mstar-plan-artifacts/templates/README.md +1 -1
- 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/routing-and-dev-allocation.md +17 -11
- package/harness-skills/mstar-roles/references/project-manager.md +7 -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 +1 -1
- package/package.json +1 -2
- package/skills/mstar-host/SKILL.md +0 -131
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Read-only rollup of open residual_findings into tech_debt_summary aggregates.
|
|
3
|
+
# Does not write status.json — PM applies output manually.
|
|
4
|
+
set -euo pipefail
|
|
5
|
+
|
|
6
|
+
STATUS_FILE="${1:-.agents/status.json}"
|
|
7
|
+
|
|
8
|
+
if [[ ! -f "$STATUS_FILE" ]]; then
|
|
9
|
+
echo "error: status file not found: $STATUS_FILE" >&2
|
|
10
|
+
exit 1
|
|
11
|
+
fi
|
|
12
|
+
|
|
13
|
+
if ! command -v jq >/dev/null 2>&1; then
|
|
14
|
+
echo "error: jq is required" >&2
|
|
15
|
+
exit 1
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
# Merge canonical + legacy maps (canonical keys win). Legacy "warning" -> low.
|
|
19
|
+
# Skip entries with lifecycle != open (default open when omitted).
|
|
20
|
+
read -r -d '' JQ_FILTER <<'JQEOF' || true
|
|
21
|
+
def norm_sev:
|
|
22
|
+
if . == "warning" then "low"
|
|
23
|
+
elif . == null or . == "" then "medium"
|
|
24
|
+
else .
|
|
25
|
+
end;
|
|
26
|
+
|
|
27
|
+
def is_open:
|
|
28
|
+
(.lifecycle // "open") == "open";
|
|
29
|
+
|
|
30
|
+
(.residual_findings // {}) as $canon
|
|
31
|
+
| (.metadata.residual_findings // {}) as $legacy
|
|
32
|
+
| ($canon + $legacy) as $merged
|
|
33
|
+
| [
|
|
34
|
+
$merged
|
|
35
|
+
| to_entries[]
|
|
36
|
+
| .key as $plan
|
|
37
|
+
| .value[]
|
|
38
|
+
| select(is_open)
|
|
39
|
+
| . + { _plan_id: $plan }
|
|
40
|
+
] as $items
|
|
41
|
+
| {
|
|
42
|
+
total_open: ($items | length),
|
|
43
|
+
by_severity: (
|
|
44
|
+
["critical", "high", "medium", "low", "nit"]
|
|
45
|
+
| map(. as $s
|
|
46
|
+
| { ($s): ([$items[] | select((.severity | norm_sev) == $s)] | length) })
|
|
47
|
+
| add
|
|
48
|
+
),
|
|
49
|
+
by_target: (
|
|
50
|
+
$items
|
|
51
|
+
| map(.target // "unspecified")
|
|
52
|
+
| group_by(.)
|
|
53
|
+
| map({ key: .[0], value: length })
|
|
54
|
+
| from_entries
|
|
55
|
+
),
|
|
56
|
+
by_plan: (
|
|
57
|
+
$items
|
|
58
|
+
| group_by(._plan_id)
|
|
59
|
+
| map({ key: .[0]._plan_id, value: length })
|
|
60
|
+
| from_entries
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
JQEOF
|
|
64
|
+
|
|
65
|
+
COMPUTED=$(jq -c "$JQ_FILTER" "$STATUS_FILE")
|
|
66
|
+
STORED=$(jq -c '.metadata.tech_debt_summary // null' "$STATUS_FILE")
|
|
67
|
+
|
|
68
|
+
echo "=== tech_debt_summary (computed from open residual_findings) ==="
|
|
69
|
+
echo "$COMPUTED" | jq '.'
|
|
70
|
+
|
|
71
|
+
echo ""
|
|
72
|
+
echo "=== stored metadata.tech_debt_summary ==="
|
|
73
|
+
if [[ "$STORED" == "null" ]]; then
|
|
74
|
+
echo "(none)"
|
|
75
|
+
else
|
|
76
|
+
echo "$STORED" | jq '.'
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
echo ""
|
|
80
|
+
echo "=== consistency check ==="
|
|
81
|
+
|
|
82
|
+
compare_field() {
|
|
83
|
+
local field="$1"
|
|
84
|
+
local computed stored
|
|
85
|
+
computed=$(echo "$COMPUTED" | jq -c ".$field")
|
|
86
|
+
if [[ "$STORED" == "null" ]]; then
|
|
87
|
+
echo "DRIFT: no stored tech_debt_summary (computed $field = $computed)"
|
|
88
|
+
return 1
|
|
89
|
+
fi
|
|
90
|
+
stored=$(echo "$STORED" | jq -c ".$field // null")
|
|
91
|
+
if [[ "$computed" == "$stored" ]]; then
|
|
92
|
+
echo "PASS: $field"
|
|
93
|
+
return 0
|
|
94
|
+
fi
|
|
95
|
+
echo "DRIFT: $field"
|
|
96
|
+
echo " computed: $computed"
|
|
97
|
+
echo " stored: $stored"
|
|
98
|
+
return 1
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
FAIL=0
|
|
102
|
+
compare_field total_open || FAIL=1
|
|
103
|
+
compare_field by_severity || FAIL=1
|
|
104
|
+
compare_field by_target || FAIL=1
|
|
105
|
+
compare_field by_plan || FAIL=1
|
|
106
|
+
|
|
107
|
+
if [[ "$FAIL" -eq 0 ]]; then
|
|
108
|
+
echo ""
|
|
109
|
+
echo "OVERALL: PASS"
|
|
110
|
+
exit 0
|
|
111
|
+
fi
|
|
112
|
+
|
|
113
|
+
echo ""
|
|
114
|
+
echo "OVERALL: DRIFT — refresh metadata.tech_debt_summary in status.json"
|
|
115
|
+
exit 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Plan harness file templates
|
|
2
2
|
|
|
3
|
-
Copy these into `{HARNESS_DIR}` when bootstrapping a project. Path symbols (`{HARNESS_DIR}`, `{PLAN_DIR}`, …) → **`mstar-plan-conventions`**. Field semantics and residual lifecycle → **`mstar-plan-artifacts/references/status-and-residuals.md`**.
|
|
3
|
+
Copy these into `{HARNESS_DIR}` when bootstrapping a project. Path symbols (`{HARNESS_DIR}`, `{PLAN_DIR}`, …) → **`mstar-plan-conventions`**. Field semantics and residual lifecycle → **`mstar-plan-artifacts/references/status-and-residuals.md`**. Optional rollup: **`../scripts/tech-debt-rollup.sh`** (read-only; see that reference).
|
|
4
4
|
|
|
5
5
|
| File | Copy to | Notes |
|
|
6
6
|
|------|---------|--------|
|
|
@@ -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.
|
|
@@ -37,35 +37,41 @@ When multiple routes apply, set one `Primary` route in Assignment and treat othe
|
|
|
37
37
|
|
|
38
38
|
## Dev Triangle Balance (`fullstack-dev` / `fullstack-dev-2` / `frontend-dev`)
|
|
39
39
|
|
|
40
|
+
### Default: spread backend/fullstack work across both tracks
|
|
41
|
+
|
|
42
|
+
When **>=2 independent** backend/fullstack units exist (on the task board or across sequential batches):
|
|
43
|
+
|
|
44
|
+
- **Parallel (preferred)** when units are parallelizable: dispatch **`fullstack-dev` + `fullstack-dev-2`** with explicit module boundaries and branch/worktree isolation.
|
|
45
|
+
- **Sequential rotation** when work is not concurrent: alternate `Execute as` between `fullstack-dev` and `fullstack-dev-2` by task/batch order (round-robin).
|
|
46
|
+
|
|
47
|
+
**Independence gate:** do **not** split genuinely dependent or sequential work across two dev IDs just to use both tracks.
|
|
48
|
+
|
|
49
|
+
**Single-id path needs justification:** collapsing >=2 independent units onto one backend-capable dev id requires `Dev owner tie-break: single id — <reason>` and Pre-Implement `single_stream_justified: yes` with that reason.
|
|
50
|
+
|
|
40
51
|
### When `frontend-dev` is required
|
|
41
52
|
|
|
42
53
|
- Task category is `visual`, or acceptance depends on page/component/interaction/a11y/frontend performance.
|
|
43
54
|
- UI-bearing fullstack work defaults to split ownership (`frontend-dev` for UI, `fullstack-dev` for API/domain).
|
|
44
55
|
|
|
45
|
-
### When `fullstack-dev-2` is required
|
|
56
|
+
### When `fullstack-dev-2` is required (concurrent dual-track)
|
|
46
57
|
|
|
47
58
|
Use a second implementation track when **any** applies:
|
|
48
59
|
|
|
49
60
|
- Task board has >=2 independently parallelizable implementation units.
|
|
50
61
|
- Medium+ fullstack scope and PM/user expects wall-clock acceleration.
|
|
51
|
-
-
|
|
62
|
+
- One fullstack track is overloaded while another independent module exists.
|
|
52
63
|
|
|
53
64
|
### `single-stream` clarification
|
|
54
65
|
|
|
55
|
-
`Dev routing: single-stream` means no concurrent multi-write dev tracks in this round
|
|
66
|
+
`Dev routing: single-stream` means no concurrent multi-write dev tracks **in this round**.
|
|
56
67
|
It does **not** force all future batches to one fixed developer ID.
|
|
57
68
|
|
|
58
|
-
###
|
|
59
|
-
|
|
60
|
-
If multiple equivalent non-UI units can be assigned to either `fullstack-dev` or `fullstack-dev-2`,
|
|
61
|
-
default owner tie-break is round-robin by task order unless there is a documented override reason.
|
|
62
|
-
|
|
63
|
-
Allowed override reasons:
|
|
69
|
+
### Allowed override to single backend-capable dev id
|
|
64
70
|
|
|
65
71
|
- User explicitly locks owner
|
|
66
|
-
- Module ownership/continuity
|
|
72
|
+
- Module ownership / continuity on one track
|
|
67
73
|
- Hotfix stop-bleeding
|
|
68
|
-
- Only one active write track in this round
|
|
74
|
+
- Only one active write track in this round (true dependency, not preference)
|
|
69
75
|
|
|
70
76
|
Document override as `Dev owner tie-break: single id — <reason>`.
|
|
71
77
|
|
|
@@ -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)
|
|
@@ -73,6 +73,8 @@ Pick one `Primary` route per Assignment; attach additional gates as needed.
|
|
|
73
73
|
Detailed conflict priority and dev allocation:
|
|
74
74
|
`references/project-manager/routing-and-dev-allocation.md`.
|
|
75
75
|
|
|
76
|
+
**Dev spread default:** when the task board has **>=2 independent** backend/fullstack units, prefer **`fullstack-dev` + `fullstack-dev-2`** (parallel with boundaries) or **round-robin** owners across sequential batches. Using a single backend-capable dev id for multiple independent units requires documented justification (`single_stream_justified` in Pre-Implement Gate Check).
|
|
77
|
+
|
|
76
78
|
---
|
|
77
79
|
|
|
78
80
|
## Non-Bypass Constraints
|
|
@@ -87,14 +89,14 @@ Detailed conflict priority and dev allocation:
|
|
|
87
89
|
|
|
88
90
|
## Host Dispatch Rule (Critical)
|
|
89
91
|
|
|
90
|
-
In invoke-based hosts (OpenCode/Task-
|
|
92
|
+
In invoke-based hosts (OpenCode / Cursor Task / Codex with callable multi-agent tools):
|
|
91
93
|
|
|
92
94
|
- Assignment markdown alone is not dispatch.
|
|
93
95
|
- Each independent Assignment needs one matching invoke.
|
|
94
96
|
- For parallel `N >= 2`, emit all `N` invokes in one dispatch turn when host supports it.
|
|
95
97
|
- Do not claim dispatch completion without matching invokes.
|
|
96
98
|
|
|
97
|
-
|
|
99
|
+
Host invoke/dispatch details: `mstar-host` → active host reference and `references/parallel-dispatch.md`.
|
|
98
100
|
|
|
99
101
|
Dispatch mechanics and templates:
|
|
100
102
|
`references/project-manager/dispatch-and-assignment.md`.
|
|
@@ -170,6 +172,7 @@ Anti-patterns:
|
|
|
170
172
|
- Q10: Is Delegation consistent with Superpowers usage?
|
|
171
173
|
- Q11: For non-trivial plan, is PM Task Board published with coverage?
|
|
172
174
|
- Q12: In invoke-based hosts, were matching invokes actually issued?
|
|
175
|
+
- Q13: With **>=2 independent** backend/fullstack units, are owners spread across `fullstack-dev` and `fullstack-dev-2` (parallel or rotated), or is `single_stream_justified: yes` recorded with a real reason?
|
|
173
176
|
|
|
174
177
|
---
|
|
175
178
|
|
|
@@ -202,6 +205,7 @@ Hard block when:
|
|
|
202
205
|
- Non-trivial plan has required field = `no`
|
|
203
206
|
- Harness-active non-hotfix flow lacks on-disk main plan or status registration
|
|
204
207
|
- `Task category: quick` is used on non-trivial work
|
|
208
|
+
- **>=2 independent** backend/fullstack units on the task board but `single_stream_justified: no` with no spread across `fullstack-dev` / `fullstack-dev-2` and no documented single-id override
|
|
205
209
|
|
|
206
210
|
---
|
|
207
211
|
|
|
@@ -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
|
|
|
@@ -18,7 +18,7 @@ Use `/pm` as a hard switch for the current session: enter Morning Star PM mode u
|
|
|
18
18
|
|
|
19
19
|
If this session runs in Cursor **Plan mode**:
|
|
20
20
|
|
|
21
|
-
1. After step 1, Read **`mstar-host
|
|
21
|
+
1. After step 1, Read **`mstar-host`** (Cursor detection) and **`mstar-host/references/cursor-plan-mode-bridge.md`**.
|
|
22
22
|
2. Before the first **CreatePlan**, Read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`**.
|
|
23
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
24
|
4. Before **SwitchMode → Agent**, verify mirror plan file and `status.json` `plan_id` registration per the bridge reference.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mstar-harness/opencode",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.1",
|
|
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.
|