@mstar-harness/opencode 0.6.5 → 0.6.7

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.
@@ -5,13 +5,17 @@ tools:
5
5
  edit: true
6
6
  bash: true
7
7
  permission:
8
- # `edit` covers write/patch/multiedit. Only `.md` under resolved `{PLAN_DIR}/reports/` (three possible roots — match project layout).
8
+ # `edit` covers write/patch/multiedit. Only `.md` under resolved `{PLAN_DIR}/reports/` (default + legacy roots).
9
9
  edit:
10
10
  "*": deny
11
+ ".mstar/plans/reports/*.md": allow
12
+ ".mstar/plans/reports/**/*.md": allow
11
13
  ".agents/plans/reports/*.md": allow
12
14
  ".agents/plans/reports/**/*.md": allow
13
15
  ".plans/reports/*.md": allow
14
16
  ".plans/reports/**/*.md": allow
17
+ ".worktrees/**/.mstar/plans/reports/*.md": allow
18
+ ".worktrees/**/.mstar/plans/reports/**/*.md": allow
15
19
  ".worktrees/**/.agents/plans/reports/*.md": allow
16
20
  ".worktrees/**/.agents/plans/reports/**/*.md": allow
17
21
  ".worktrees/**/.plans/reports/*.md": allow
@@ -5,13 +5,17 @@ tools:
5
5
  edit: true
6
6
  bash: true
7
7
  permission:
8
- # `edit` covers write/patch/multiedit. Only `.md` under resolved `{PLAN_DIR}/reports/` (three possible roots — match project layout).
8
+ # `edit` covers write/patch/multiedit. Only `.md` under resolved `{PLAN_DIR}/reports/` (default + legacy roots).
9
9
  edit:
10
10
  "*": deny
11
+ ".mstar/plans/reports/*.md": allow
12
+ ".mstar/plans/reports/**/*.md": allow
11
13
  ".agents/plans/reports/*.md": allow
12
14
  ".agents/plans/reports/**/*.md": allow
13
15
  ".plans/reports/*.md": allow
14
16
  ".plans/reports/**/*.md": allow
17
+ ".worktrees/**/.mstar/plans/reports/*.md": allow
18
+ ".worktrees/**/.mstar/plans/reports/**/*.md": allow
15
19
  ".worktrees/**/.agents/plans/reports/*.md": allow
16
20
  ".worktrees/**/.agents/plans/reports/**/*.md": allow
17
21
  ".worktrees/**/.plans/reports/*.md": allow
@@ -5,13 +5,17 @@ tools:
5
5
  edit: true
6
6
  bash: true
7
7
  permission:
8
- # `edit` covers write/patch/multiedit. Only `.md` under resolved `{PLAN_DIR}/reports/` (three possible roots — match project layout).
8
+ # `edit` covers write/patch/multiedit. Only `.md` under resolved `{PLAN_DIR}/reports/` (default + legacy roots).
9
9
  edit:
10
10
  "*": deny
11
+ ".mstar/plans/reports/*.md": allow
12
+ ".mstar/plans/reports/**/*.md": allow
11
13
  ".agents/plans/reports/*.md": allow
12
14
  ".agents/plans/reports/**/*.md": allow
13
15
  ".plans/reports/*.md": allow
14
16
  ".plans/reports/**/*.md": allow
17
+ ".worktrees/**/.mstar/plans/reports/*.md": allow
18
+ ".worktrees/**/.mstar/plans/reports/**/*.md": allow
15
19
  ".worktrees/**/.agents/plans/reports/*.md": allow
16
20
  ".worktrees/**/.agents/plans/reports/**/*.md": allow
17
21
  ".worktrees/**/.plans/reports/*.md": allow
@@ -129,7 +129,7 @@ Read **`mstar-host`** after this skill; detect host per its table, then Read the
129
129
  | residual 只写 plan 不写 SSOT | `mstar-plan-artifacts` |
130
130
  | 角色文件塞流程长文 | 用专题 skill |
131
131
  | 无证据宣称完成 | `mstar-coding-behavior` / verification |
132
- | CreatePlan 不落盘 / 无 `.agents` mirror | `mstar-host` · `cursor-plan-mode-bridge` |
132
+ | CreatePlan 不落盘 / 无 `{HARNESS_DIR}` mirror | `mstar-host` · `cursor-plan-mode-bridge` |
133
133
  | 临时方案 / 后续计划只写在对话里 | `mstar-phase-gates` · Durable Roadmap Gate |
134
134
 
135
135
  ## 可选:OpenViking Memory
@@ -1,6 +1,6 @@
1
1
  ---
2
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.
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 Plan/Goal Mode, 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
@@ -30,7 +30,7 @@ Use **capability signals** (not filesystem paths):
30
30
  | **CreatePlan** / **SwitchMode** available | `cursor` | `references/cursor.md`; Plan mode also `references/cursor-plan-mode-bridge.md` |
31
31
  | **`question`** tool or PM **`@<agent-id>`** subagent invoke | `opencode` | `references/opencode.md` |
32
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` |
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
  | Still ambiguous | - | Read sections in **`cursor.md`**, **`opencode.md`**, and **`codex.md`** that match tools you have; **`mstar-harness-core` wins** on conflict |
35
35
 
36
36
  ## Parallel dispatch (invoke-capable hosts)
@@ -0,0 +1,103 @@
1
+ # Codex Plan / Goal Mode x Harness Bridge
2
+
3
+ > **Load order**: Read **`mstar-harness-core`** first, then **`mstar-host`** and **`references/codex.md`**. When plan management is required, also read **`mstar-plan-conventions`** and **`mstar-plan-artifacts`** before creating or claiming any durable plan state. On conflict, **`mstar-harness-core`** wins.
4
+
5
+ ## Purpose
6
+
7
+ Codex **Plan Mode** (`/plan`) and **Goal Mode** (`/goal`) are host collaboration surfaces:
8
+
9
+ - **Plan Mode** helps shape a plan inside the active Codex conversation.
10
+ - **Goal Mode** attaches a persistent objective and success criteria to the active thread.
11
+
12
+ Morning Star durable state still lives under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`). This reference prevents Codex session plans, UI todos, goal text, or goal completion from replacing the harness SSOT.
13
+
14
+ ## Priority (hard)
15
+
16
+ 1. User explicit instructions (this turn)
17
+ 2. Project `AGENTS.md` / `CLAUDE.md`
18
+ 3. **`{HARNESS_DIR}` / `{PLAN_DIR}` / `status.json`** (harness SSOT)
19
+ 4. Codex Goal Mode objective / progress controls
20
+ 5. Codex Plan Mode output, `update_plan`, UI todos, chat summaries
21
+
22
+ **NEVER** cite only a Codex goal, session plan, UI todo, or chat summary in Assignment **Plan Path**, **Context Loaded**, or Completion Report when `{PLAN_DIR}/<plan-id>-<name>.md` should exist.
23
+
24
+ ## When this applies
25
+
26
+ - Codex Plan Mode is active (`/plan`, Plan collaboration mode, or host guidance says planning-only).
27
+ - Codex Goal Mode is active (`/goal`, host goal controls, or goal tools such as `create_goal`, `get_goal`, `update_goal`).
28
+ - Morning Star plugin or `/pm` is in use under Codex.
29
+
30
+ ## Codex Plan Mode
31
+
32
+ Use Plan Mode to clarify, inspect, compare approaches, and draft the harness plan. Do **not** treat Plan Mode output as a durable artifact.
33
+
34
+ Before implementation or PM dispatch:
35
+
36
+ 1. Discover `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions`.
37
+ 2. Ensure `{HARNESS_DIR}/status.json` exists or initialize it via `mstar-plan-artifacts` templates.
38
+ 3. Register a `plans[]` row in `status.json` when a Morning Star plan is needed.
39
+ 4. Write `{PLAN_DIR}/<plan-id>-<name>.md` with task checkboxes, branch policy, verification, and roadmap / deferred scope when applicable.
40
+ 5. Use the SSOT plan path in Assignment and Completion Report evidence.
41
+
42
+ Allowed in Plan Mode: exploration, clarify questions, spec/plan drafting, `.mstar/` initialization, SSOT plan/status edits, PM routing decisions.
43
+
44
+ Not allowed by default in Plan Mode: product implementation, test implementation, QC execution, QA execution, deployment, or ops changes. Switch to normal execution or dispatch through an actual callable subagent/multi-agent tool first.
45
+
46
+ ## Codex Goal Mode
47
+
48
+ Goal text is useful as the top-level objective and success criteria, but it is **not** a Morning Star plan, status ledger, PM Assignment, QC report, or QA Done authority.
49
+
50
+ When starting or receiving a Goal Mode objective:
51
+
52
+ 1. If the goal is implementation-sized or long-running, create or update the harness SSOT (`status.json` + `{PLAN_DIR}` plan) before implementation.
53
+ 2. Mirror the goal's success criteria into the SSOT plan as acceptance / verification criteria.
54
+ 3. If the goal changes, update both Goal Mode text/progress and the SSOT plan/status in the same coordination round.
55
+ 4. If the goal conflicts with the SSOT, pause or report **Blocked** until PM/user resolves scope.
56
+
57
+ ### Goal completion gate
58
+
59
+ Only mark a Codex goal complete when all applicable harness gates are satisfied:
60
+
61
+ - Required plan checkboxes are complete in `{PLAN_DIR}`.
62
+ - `status.json` reflects the current lifecycle state.
63
+ - Required commits exist on the authorized branch.
64
+ - Verification evidence is recorded.
65
+ - QC/QA authority has passed when the plan requires InReview / Done gates.
66
+
67
+ If the host asks to complete a goal but harness Done authority is missing, report **Blocked** and list the missing artifacts or gate decisions. Do not call a goal-completion tool as a substitute for PM/QC/QA evidence.
68
+
69
+ ## Resume / compaction
70
+
71
+ Codex can resume threads and compact context. On resume, before editing product code:
72
+
73
+ 1. Reload `mstar-harness-core` -> `mstar-host` -> `references/codex.md` -> this bridge.
74
+ 2. If Goal Mode is active, read the current goal and compare it with `{HARNESS_DIR}/status.json` and the active SSOT plan.
75
+ 3. Treat `.mstar/` as durable truth over chat summaries or UI todos.
76
+ 4. If the active role or Assignment is missing, resume as PM for coordination and dispatch only.
77
+
78
+ ## `/pm` under Codex Plan / Goal Mode
79
+
80
+ When `/pm` runs under Plan or Goal Mode:
81
+
82
+ - `/pm` is still the force entry into Morning Star PM behavior.
83
+ - Prepare phase (`specify -> clarify -> plan`) still applies unless the task qualifies for a documented hotfix path.
84
+ - Goal Mode can hold the high-level objective, but PM must still write Assignment with `Execute as`, `Delegation`, branch policy, SSOT `Plan Path`, and evidence requirements.
85
+ - Without an actual callable subagent/multi-agent tool, Assignment Markdown is coordination text only; execute serially in-session or report Blocked for rerouting.
86
+
87
+ ## Anti-patterns
88
+
89
+ | Anti-pattern | Fix |
90
+ |--------------|-----|
91
+ | `/plan` output only, no `{HARNESS_DIR}` files | Write SSOT plan + `status.json` entry before implementation |
92
+ | `update_plan` todo done, no commit/evidence | Commit or record required evidence before completion |
93
+ | Goal objective treated as Done authority | Check harness plan/status/QC/QA gates first |
94
+ | Goal changed but `.mstar/` still has old scope | Update Goal Mode and SSOT in the same round |
95
+ | Resume starts coding from chat summary | Reload harness context and SSOT plan/status first |
96
+ | Assignment Plan Path points at Codex transcript/goal | Use `{PLAN_DIR}/...` path |
97
+
98
+ ## Related skills
99
+
100
+ - `mstar-plan-conventions` - discover `{HARNESS_DIR}`, `{PLAN_DIR}`, legacy layouts
101
+ - `mstar-plan-artifacts` - `status.json`, plan checkboxes, reports, residuals
102
+ - `mstar-phase-gates` - Prepare / Execute and Done authority
103
+ - `mstar-dispatch-gates` - Assignment, Delegation, anti-recursion
@@ -1,6 +1,8 @@
1
1
  # Codex host reference
2
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).
3
+ Load when **`mstar-host`** detection resolves **codex** (Codex app/CLI session, Codex plugin installed from `.codex-plugin/plugin.json`, Codex custom agents linked from `codex/agents/*.toml`, or Codex tool namespaces such as `functions.*`, `codex_app.*`, `tool_search`, `image_gen`, or Browser plugin tools).
4
+
5
+ Plan / Goal Mode: read **`codex-plan-goal-mode-bridge.md`** when Codex Plan Mode (`/plan`) or Goal Mode (`/goal`, goal tools, or goal progress controls) is active. Codex session plans, UI todos, and goal text are not durable harness SSOT.
4
6
 
5
7
  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
8
 
@@ -8,16 +10,18 @@ Parallel PM dispatch: read **`parallel-dispatch.md`** only when Codex exposes an
8
10
 
9
11
  - Plugin source: `.codex-plugin/plugin.json`.
10
12
  - Runtime skills: repo `skills/` mounted by the Codex plugin (`"skills": "./skills/"`).
13
+ - Custom agent source: repo `codex/agents/*.toml`; CLI/manual install links these into `~/.codex/agents/` or project `.codex/agents/`.
11
14
  - `/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.
15
+ - Role files under root `agents/` are for hosts that load OpenCode/Cursor-style agent shells; Codex uses `codex/agents/*.toml` and still loads `mstar-roles` references directly.
13
16
  - 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
17
 
15
18
  ## Skill loading
16
19
 
17
20
  1. Read `mstar-harness-core`.
18
21
  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.
22
+ 3. If Plan Mode or Goal Mode is active, read `codex-plan-goal-mode-bridge.md`.
23
+ 4. Load `mstar-roles` and the active role reference.
24
+ 5. Load topic skills on demand per the role reference.
21
25
 
22
26
  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
27
 
@@ -27,11 +31,12 @@ Use skill names in prompts and references. Avoid absolute local paths unless the
27
31
  - If a structured user-input tool is available in the active mode, use it for concise 1-3 choice decisions.
28
32
  - Otherwise ask one concise Markdown question only after codebase exploration cannot answer it.
29
33
  - `update_plan` / local todo UI is session progress only; it does not replace `{PLAN_DIR}` plans or `{HARNESS_DIR}/status.json`.
34
+ - Codex Goal Mode objective is completion criteria for the host thread, not Morning Star Done authority; mirror it into the SSOT plan when the work is implementation-sized.
30
35
 
31
36
  ## Dispatch and role execution
32
37
 
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`.
38
+ - **No invoke tool / no linked custom agent = no dispatch**: printing `## Assignment` does not start another Codex worker.
39
+ - If Codex exposes custom-agent / multi-agent tools and matching Morning Star agents are linked, PM may dispatch through those tools and must follow `parallel-dispatch.md`.
35
40
  - 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
41
  - 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
42
  - Leaf executors still follow `mstar-dispatch-gates`: no recursive Task/subagent calls unless Assignment says `Delegation: allowed (...)`.
@@ -51,6 +56,6 @@ Use skill names in prompts and references. Avoid absolute local paths unless the
51
56
 
52
57
  ## Gotchas
53
58
 
54
- - Codex plugin install gives skills, not automatic OpenCode-style named role invocations.
59
+ - Codex plugin install gives skills; Morning Star role subagents require custom agent TOML files linked from `codex/agents/`.
55
60
  - 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}`.
61
+ - Session plans, Goal Mode text, chat summaries, and UI todos are not durable harness SSOT unless mirrored to `{HARNESS_DIR}`.
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## Purpose
6
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.
7
+ Cursor **Plan mode** uses **CreatePlan** and built-in plan todos for session UX. Morning Star **SSOT** lives on disk under **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.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
8
 
9
9
  ## Priority (hard)
10
10
 
@@ -23,7 +23,7 @@ Cursor **Plan mode** uses **CreatePlan** and built-in plan todos for session UX.
23
23
  ## Before the first CreatePlan
24
24
 
25
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/`).
26
+ 2. **Discover** `{HARNESS_DIR}` / `{PLAN_DIR}` per `mstar-plan-conventions` (prefer `.mstar/` + `.mstar/plans/`; reuse legacy `.agents/` only when already present and `.mstar/` is absent).
27
27
  3. **Initialize** if absent (see checklist below).
28
28
 
29
29
  ### Harness initialization checklist
@@ -58,7 +58,7 @@ Add one object to `status.json` → `plans[]`:
58
58
  {
59
59
  "id": "<plan-id>",
60
60
  "status": "Todo",
61
- "file": ".agents/plans/<plan-id>-<short-name>.md",
61
+ "file": ".mstar/plans/<plan-id>-<short-name>.md",
62
62
  "metadata": {
63
63
  "primary_spec": "<spec-id or path if known>",
64
64
  "description": "<one-line summary>"
@@ -66,7 +66,7 @@ Add one object to `status.json` → `plans[]`:
66
66
  }
67
67
  ```
68
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).
69
+ Set `updated_at` on `status.json` to today (`YYYY-MM-DD`). Commit harness files in the **business repo** when the project tracks `{HARNESS_DIR}` (default).
70
70
 
71
71
  ### `mirror-plan` minimum content
72
72
 
@@ -85,9 +85,9 @@ Use this structure in CreatePlan `plan` markdown; mirror the same sections into
85
85
  # Plan: <title>
86
86
 
87
87
  **plan_id**: <plan-id>
88
- **HARNESS_DIR**: .agents/
89
- **Plan file (SSOT)**: .agents/plans/<plan-id>-<short-name>.md
90
- **status.json**: .agents/status.json
88
+ **HARNESS_DIR**: .mstar/
89
+ **Plan file (SSOT)**: .mstar/plans/<plan-id>-<short-name>.md
90
+ **status.json**: .mstar/status.json
91
91
 
92
92
  ## Prepare gates
93
93
 
@@ -107,9 +107,9 @@ Use this structure in CreatePlan `plan` markdown; mirror the same sections into
107
107
 
108
108
  ### Bootstrap (fixed prefix — complete before implement)
109
109
 
110
- 1. harness-init — init .agents/, status.json, reports/, archived/residuals/
110
+ 1. harness-init — init .mstar/, status.json, reports/, archived/residuals/
111
111
  2. spec-register — register plan_id in status.json; spec stub if applicable
112
- 3. mirror-plan — write .agents/plans/<plan-id>-<short-name>.md
112
+ 3. mirror-plan — write .mstar/plans/<plan-id>-<short-name>.md
113
113
 
114
114
  ### Implement
115
115
 
@@ -187,7 +187,7 @@ When `/pm` runs under Plan mode:
187
187
 
188
188
  | Anti-pattern | Fix |
189
189
  |--------------|-----|
190
- | CreatePlan only, no `.agents/` files | Run bootstrap todos; Write mirror plan + status.json |
190
+ | CreatePlan only, no `{HARNESS_DIR}` files | Run bootstrap todos; Write mirror plan + status.json |
191
191
  | Todo done, no commit | Commit per task; paste `git log -1` evidence |
192
192
  | Drift between CreatePlan and SSOT plan | Update both in same round |
193
193
  | Cursor plan URI as Plan Path | Use `{PLAN_DIR}/...` path |
@@ -11,7 +11,7 @@ Parallel PM dispatch: **`parallel-dispatch.md`** (Task tool uses same turn model
11
11
 
12
12
  ## Plan mode × harness dual-write
13
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`.
14
+ When **Plan mode** is active, **CreatePlan is session UX**; SSOT is **`{HARNESS_DIR}`** (default `.mstar/`, legacy `.agents/`) — `{PLAN_DIR}/<plan-id>-<name>.md`, `{HARNESS_DIR}/status.json`.
15
15
 
16
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
17
 
@@ -22,10 +22,10 @@
22
22
 
23
23
  ## `{ITERATION_DIR}`(可选·迭代/版本级 compass)
24
24
 
25
- - **物理路径**:`**{ITERATION_DIR}/**`(推荐布局下常为 `**.agents/iterations/**`,与 `{KNOWLEDGE_DIR}`、`{PLAN_DIR}` 并列)。
25
+ - **物理路径**:`**{ITERATION_DIR}/**`(推荐布局下常为 `**.mstar/iterations/**`,与 `{KNOWLEDGE_DIR}`、`{PLAN_DIR}` 并列;legacy 项目可继续为 `.agents/iterations/`)。
26
26
  - **放什么**:某一**交付版本或迭代**的范围、里程碑、验收、风险、program 备注;命名示例 `v1.15-delivery-compass-v1.md`、`*-program-compass-*.md`;遗留非标准 `v1.*` 规划快照可保留于此并列入索引。
27
27
  - **不放什么**:可跨版本复用的实现 SSOT(进 `{KNOWLEDGE_DIR}`);冻结产品/API 规范(进 `{SPECS_DIR}`);单 plan 的 QC 留档(进 `{PLAN_DIR}/reports/`)。
28
- - **索引**:**必须**维护 `**{ITERATION_DIR}/README.md**`:至少 **Document**、**Version / iteration**、**Description**;可按「Delivery compasses」与「Legacy artifacts」分表(参考 Nexus `.agents/iterations/README.md`)。
28
+ - **索引**:**必须**维护 `**{ITERATION_DIR}/README.md**`:至少 **Document**、**Version / iteration**、**Description**;可按「Delivery compasses」与「Legacy artifacts」分表。
29
29
  - **与 plan 的链接**:在 `**plans[].metadata**` 中可用 `**iteration_compass**`(单文件)或 `**iteration_refs**`(`string[]`)登记仓库内相对路径;PM 在 Assignment 点名本轮须读的 compass。
30
30
  - **维护**:`@product-manager` / `@architect` 起草;`**@project-manager**` 维护 README 与 metadata 挂接;compass 定稿后**少改多版本**(新版本优先新文件名 `v<N>` 或新 compass 文件)。
31
31
 
@@ -44,7 +44,7 @@
44
44
 
45
45
  ## 与 `status.json` 的链接
46
46
 
47
- - 某 plan 的**权威设计输入**在知识库、迭代 compass 或规格目录中时,在 `**plans[].metadata**` 中登记路径,推荐使用已列标准键:`**primary_spec**`(单文件)、`**spec_refs**`(`string[]`)、`**iteration_compass**` / `**iteration_refs**`(迭代级,可选)。路径为**仓库内相对路径**(推荐布局下常写作 `**.agents/knowledge/....md**`、`**.agents/iterations/....md**` 或 `**.agents/specs/....md**`;兼容旧目录时也可为 `**.agents/designs/....md**`)。
47
+ - 某 plan 的**权威设计输入**在知识库、迭代 compass 或规格目录中时,在 `**plans[].metadata**` 中登记路径,推荐使用已列标准键:`**primary_spec**`(单文件)、`**spec_refs**`(`string[]`)、`**iteration_compass**` / `**iteration_refs**`(迭代级,可选)。路径为**仓库内相对路径**(推荐布局下常写作 `**.mstar/knowledge/....md**`、`**.mstar/iterations/....md**` 或 `**.mstar/specs/....md**`;兼容旧目录时也可为 `.agents/...`)。
48
48
  - 执行方在 **implement 前**须按 metadata 读取这些文件,并与主 plan 核对;不得在未读链接文档的情况下**静默偏离**其中已写明的决策(若需偏离,先回写 knowledge 或 plan 并走 PM/architect 门禁)。
49
49
 
50
50
  ## 维护规则
@@ -83,4 +83,4 @@
83
83
 
84
84
  **维护**:`**@project-manager`**(或与 Assignment 一致的可写角色);`**@qc-specialist***` 宿主白名单通常**不含**本目录——审查结论仍以 `**reports/`** 为准,散文由 PM/实现方据结论整理。
85
85
 
86
- **关闭与归档**:当该条从 **open 列表**(根级 **`residual_findings[<plan-id>]`**;若仅存 legacy 侧则从该处)移除并**追加**至 `**{HARNESS_DIR}/archived/residuals/<plan-id>.json`** 时,应将对应 `**.md**` 一并收口:可迁入 `**{HARNESS_DIR}/archived/knowledge/**`(若视为历史考据)、或团队约定的 `**{HARNESS_DIR}/archived/residuals/**` 子路径(与 `**.json**` 同批变更可追溯);并在归档条目的 `**closure_evidence` / `closure_note**`(或团队约定字段)中**写明散文最终路径**。勿长期保留「JSON 已关闭而散文仍留在 `residuals/` 且声称仍 open」的状态。
86
+ **关闭与归档**:当该条从 **open 列表**(根级 **`residual_findings[<plan-id>]`**;若仅存 legacy 侧则从该处)移除并**追加**至 `**{HARNESS_DIR}/archived/residuals/<plan-id>.json`** 时,应将对应 `**.md**` 一并收口:可迁入 `**{HARNESS_DIR}/archived/knowledge/**`(若视为历史考据)、或团队约定的 `**{HARNESS_DIR}/archived/residuals/**` 子路径(与 `**.json**` 同批变更可追溯);并在归档条目的 `**closure_evidence` / `closure_note**`(或团队约定字段)中**写明散文最终路径**。勿长期保留「JSON 已关闭而散文仍留在 `residuals/` 且声称仍 open」的状态。
@@ -44,7 +44,7 @@
44
44
  - **并行 vs 串行**:不同 `plan_id` **相互独立**时,可 **并行**派发多组三审(每组各自的 Assignment 与 `reports/<plan-id>/`);若 PM 选择串行,须在 Status Update 写明顺序——**每组仍须完整三审 + QA**,不是「一个大 QC」混审。
45
45
  - **读 skill**:书写或派发 QC 相关 Assignment 前,PM **必须** Read **`mstar-review-qc`** skill(`mstar-plan-conventions` 不重复 QC 清单与 verdict 规则)。见 `mstar-plan-conventions` SKILL.md **QC pre-dispatch gate** 与 **InReview 与 QC+QA** 小节。
46
46
 
47
- **QC 落盘与宿主权限**:`@qc-specialist` / `@qc-specialist-2` / `@qc-specialist-3` 在支持路径白名单的宿主上(如 OpenCode 的 **`permission.edit`**),**仅可** Write/Edit **`{PLAN_DIR}/reports/`** 下 **`.md`**(全局 agent 提示词中已配置 `.agents/plans/reports/**`、`.plans/reports/**`、`plans/reports/**` 相对路径)。报告文件**必须**以 YAML **frontmatter** 开头(键见各 QC agent 提示词)。**若** 项目的 `{PLAN_DIR}` 不落在上述三种根下,须在**项目级**宿主配置(如 OpenCode)中为 QC 角色追加对应的 `edit` allow 规则。
47
+ **QC 落盘与宿主权限**:`@qc-specialist` / `@qc-specialist-2` / `@qc-specialist-3` 在支持路径白名单的宿主上(如 OpenCode 的 **`permission.edit`**),**仅可** Write/Edit **`{PLAN_DIR}/reports/`** 下 **`.md`**(全局 agent 提示词中已配置 `.mstar/plans/reports/**`、`.agents/plans/reports/**`、`.plans/reports/**`、`plans/reports/**` 相对路径)。报告文件**必须**以 YAML **frontmatter** 开头(键见各 QC agent 提示词)。**若** 项目的 `{PLAN_DIR}` 不落在上述根下,须在**项目级**宿主配置(如 OpenCode)中为 QC 角色追加对应的 `edit` allow 规则。
48
48
 
49
49
  **QC 报告与 Git**:报告落盘后,各 QC 角色须在业务仓内对**本次报告文件**执行 **`git add` + `git commit`**(细则与 bash 权限见 `agents/qc-specialist*.md`);**禁止**仅落盘不提交导致 `clone` 后不可见。**PM / architect / product-manager** 对 **`{HARNESS_DIR}`** / **`{PLAN_DIR}`** 与主 plan 的创建与更新亦须在业务仓内 **commit**(见 `agents/project-manager.md` Plan 初始化与 PM 职责、`agents/architect.md` / `agents/product-manager.md` Git 小节)。
50
50
 
@@ -241,10 +241,10 @@ Prefer **`archived/residuals/`**; migrate and delete history key when possible.
241
241
  ### Query open and archived (examples)
242
242
 
243
243
  ```bash
244
- # Replace .agents with your resolved {HARNESS_DIR}.
245
- jq '.residual_findings["01-data-infrastructure"] // .metadata.residual_findings["01-data-infrastructure"]' .agents/status.json
246
- jq '.entries[] | select(.id == "R1")' .agents/archived/residuals/01-data-infrastructure.json
247
- bash skills/mstar-plan-artifacts/scripts/tech-debt-rollup.sh .agents/status.json
244
+ # Replace .mstar with your resolved {HARNESS_DIR}; legacy projects may use .agents.
245
+ jq '.residual_findings["01-data-infrastructure"] // .metadata.residual_findings["01-data-infrastructure"]' .mstar/status.json
246
+ jq '.entries[] | select(.id == "R1")' .mstar/archived/residuals/01-data-infrastructure.json
247
+ bash skills/mstar-plan-artifacts/scripts/tech-debt-rollup.sh .mstar/status.json
248
248
  ```
249
249
 
250
250
  (`//` right-hand side = legacy read path.)
@@ -277,8 +277,8 @@ Append-only log for merge closure, batch archive, `tech_debt_summary` refresh, e
277
277
  **Compute (canonical):** run the read-only script (do **not** hand-count):
278
278
 
279
279
  ```bash
280
- # From repo root; pass path to status.json if not .agents/status.json
281
- bash skills/mstar-plan-artifacts/scripts/tech-debt-rollup.sh .agents/status.json
280
+ # From repo root; pass path to status.json if not .mstar/status.json
281
+ bash skills/mstar-plan-artifacts/scripts/tech-debt-rollup.sh .mstar/status.json
282
282
  ```
283
283
 
284
284
  - Prints computed `total_open`, `by_severity`, `by_target`, `by_plan`.
@@ -328,11 +328,11 @@ Before merge/PR, **`@project-manager`** (or delegate) should verify: `plans[].st
328
328
 
329
329
  - Read: accept `id` or `plan_id`.
330
330
  - Write: one canonical key (prefer `id`).
331
- - Document canonical key in `.agents/AGENTS.md` if migrating.
331
+ - Document canonical key in `{HARNESS_DIR}/AGENTS.md` if migrating.
332
332
 
333
333
  ## Common queries
334
334
 
335
335
  ```bash
336
- jq '.plans[] | select(.id == "01-data-infrastructure")' .agents/status.json
337
- jq '.residual_findings["01-data-infrastructure"] // .metadata.residual_findings["01-data-infrastructure"]' .agents/status.json
336
+ jq '.plans[] | select(.id == "01-data-infrastructure")' .mstar/status.json
337
+ jq '.residual_findings["01-data-infrastructure"] // .metadata.residual_findings["01-data-infrastructure"]' .mstar/status.json
338
338
  ```
@@ -3,7 +3,7 @@
3
3
  # Does not write status.json — PM applies output manually.
4
4
  set -euo pipefail
5
5
 
6
- STATUS_FILE="${1:-.agents/status.json}"
6
+ STATUS_FILE="${1:-.mstar/status.json}"
7
7
 
8
8
  if [[ ! -f "$STATUS_FILE" ]]; then
9
9
  echo "error: status file not found: $STATUS_FILE" >&2
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mstar-plan-conventions
3
- description: Morning Star (启明星) harness 计划目录约定 —— `{HARNESS_DIR}` / `{PLAN_DIR}` / `{ITERATION_DIR}` / `{KNOWLEDGE_DIR}` / `{SPECS_DIR}` 发现与初始化、`docs/` 与 harness 子树边界、未启用 plan 时的工作方式、Spec 集成分支与多 Plan 实现分支(merge 靶与 PR 合 main)、Superpowers `writing-plans` 落盘门限、工期预估(agent-oriented)。**必须**在读写 `.agents/`、初始化 harness、编排含 plan 的任务、或对齐 `metadata.primary_spec` 时 Read;`@project-manager` 开 plan 任务前必读。plan 文件 / status / residual / reports / knowledge → **`mstar-plan-artifacts`**;分支与 QC 检出 → **`mstar-branch-worktree`**。
3
+ description: Morning Star (启明星) harness 计划目录约定 —— `{HARNESS_DIR}` / `{PLAN_DIR}` / `{ITERATION_DIR}` / `{KNOWLEDGE_DIR}` / `{SPECS_DIR}` 发现与初始化(默认 `.mstar/`,兼容 `.agents/`)、`docs/` 与 harness 子树边界、未启用 plan 时的工作方式、Spec 集成分支与多 Plan 实现分支(merge 靶与 PR 合 main)、Superpowers `writing-plans` 落盘门限、工期预估(agent-oriented)。**必须**在读写 `.mstar/` / `.agents/`、初始化 harness、编排含 plan 的任务、或对齐 `metadata.primary_spec` 时 Read;`@project-manager` 开 plan 任务前必读。plan 文件 / status / residual / reports / knowledge → **`mstar-plan-artifacts`**;分支与 QC 检出 → **`mstar-branch-worktree`**。
4
4
  ---
5
5
 
6
6
  ## Load order(必读顺序)
@@ -17,7 +17,7 @@ description: Morning Star (启明星) harness 计划目录约定 —— `{HARNES
17
17
 
18
18
  | 符号 | 默认 |
19
19
  |------|------|
20
- | `{HARNESS_DIR}` | `.agents/` |
20
+ | `{HARNESS_DIR}` | `.mstar/` |
21
21
  | `{PLAN_DIR}` | `{HARNESS_DIR}/plans/` |
22
22
  | `{ITERATION_DIR}` | `{HARNESS_DIR}/iterations/` |
23
23
  | `{KNOWLEDGE_DIR}` | `{HARNESS_DIR}/knowledge/` |
@@ -25,11 +25,12 @@ description: Morning Star (启明星) harness 计划目录约定 —— `{HARNES
25
25
 
26
26
  ### 解析顺序(找到即停)
27
27
 
28
- 1. `.agents/` → `{HARNESS_DIR}=.agents/`, `{PLAN_DIR}=.agents/plans/`
29
- 2. 否则 `.plans/` 或 `plans/` 遗留同目录 `{HARNESS_DIR}={PLAN_DIR}`
30
- 3. 皆无 未启用 plan;进度走对话与 Completion Report
28
+ 1. `.mstar/` → `{HARNESS_DIR}=.mstar/`, `{PLAN_DIR}=.mstar/plans/`
29
+ 2. 否则 `.agents/` → legacy `{HARNESS_DIR}=.agents/`, `{PLAN_DIR}=.agents/plans/`
30
+ 3. 否则 `.plans/` `plans/` 遗留同目录 `{HARNESS_DIR}={PLAN_DIR}`
31
+ 4. 皆无 → 未启用 plan;进度走对话与 Completion Report
31
32
 
32
- 并存时 **`.agents/` 优先**。
33
+ 并存时 **`.mstar/` 优先**;仅当项目已有 `.agents/` 且无 `.mstar/` 时继续沿用 `.agents/`。
33
34
 
34
35
  `{SPECS_DIR}`:有 `specs/` 用之;否则 `designs/`;皆无则建议新建 `specs/`。
35
36
 
@@ -49,11 +50,11 @@ description: Morning Star (启明星) harness 计划目录约定 —— `{HARNES
49
50
 
50
51
  PM 在需要持久化追踪时:
51
52
 
52
- 1. 建 `.agents/`、`plans/`、`status.json`(空模板见 **`mstar-plan-artifacts/templates/status.empty.json`**)
53
+ 1. 建 `.mstar/`、`plans/`、`status.json`(空模板见 **`mstar-plan-artifacts/templates/status.empty.json`**)
53
54
  2. 可选 `notes.json`(模板 **`mstar-plan-artifacts/templates/notes.empty.json`**)、`reports/README.md`、`knowledge/`、`iterations/`、`specs/`
54
55
  3. Git:团队交付 **勿** ignore 整个 `{HARNESS_DIR}`(handoff 需 clone 可达)
55
56
 
56
- 步骤与 `.agents/AGENTS.md` 分层 → **`references/harness-bootstrap-and-agents-layering.md`**。
57
+ 步骤与 `{HARNESS_DIR}/AGENTS.md` 分层 → **`references/harness-bootstrap-and-agents-layering.md`**。
57
58
 
58
59
  ## Spec 驱动的分支模型(多 Plan · 同一 Spec)
59
60
 
@@ -12,12 +12,12 @@
12
12
 
13
13
  ## Bootstrap 最小步骤
14
14
 
15
- 1. 创建 `{HARNESS_DIR}`(推荐 `.agents/`)与 `{PLAN_DIR}`(推荐 `.agents/plans/`)。
15
+ 1. 创建 `{HARNESS_DIR}`(推荐 `.mstar/`)与 `{PLAN_DIR}`(推荐 `.mstar/plans/`)。
16
16
  2. 初始化 `status.json`:从 **`mstar-plan-artifacts/templates/status.empty.json`** 复制;residual canonical 见 **`mstar-plan-artifacts` SKILL.md**;字段与生命周期见 **`mstar-plan-artifacts/references/status-and-residuals.md`**。
17
17
  3. 初始化可选 `notes.json`(**`mstar-plan-artifacts/templates/notes.empty.json`**)与 `plans/reports/README.md`。
18
18
  4. 可选:创建 `{ITERATION_DIR}`(`iterations/` + `README.md`)与 `{KNOWLEDGE_DIR}`(`knowledge/` + `README.md`);内容边界见 `mstar-plan-conventions` SKILL.md 与 `references/knowledge-and-designs.md`。
19
- 5. 创建 `.agents/AGENTS.md`(harness 子树规则):符号表可复述 `{HARNESS_DIR}`、`{PLAN_DIR}`、`{ITERATION_DIR}`、`{KNOWLEDGE_DIR}`、`{SPECS_DIR}` 与 `docs/` 分工(参考 Nexus `.agents/AGENTS.md`)。
20
- 6. 校准根 `AGENTS.md`:只保留仓库级长期约束,显式引用 `.agents/AGENTS.md` 作为 harness SSOT。
19
+ 5. 创建 `{HARNESS_DIR}/AGENTS.md`(harness 子树规则):符号表可复述 `{HARNESS_DIR}`、`{PLAN_DIR}`、`{ITERATION_DIR}`、`{KNOWLEDGE_DIR}`、`{SPECS_DIR}` 与 `docs/` 分工;新项目推荐 `.mstar/AGENTS.md`,已有项目可继续使用 `.agents/AGENTS.md`。
20
+ 6. 校准根 `AGENTS.md`:只保留仓库级长期约束,显式引用 `{HARNESS_DIR}/AGENTS.md` 作为 harness SSOT。
21
21
  7. 仅在确有稳定边界时新增目录级 `AGENTS.md`(如 `contracts/`、`gateway/`、`sdk/`)。
22
22
 
23
23
  ## 三层 `AGENTS.md` 职责切分
@@ -27,7 +27,7 @@
27
27
  - 放:仓库身份、技术边界、构建/测试接口、安全与分支策略、规格路由表。
28
28
  - 不放:动态状态、当前批次进展、R# 明细、QC 单次结论。
29
29
 
30
- ### `.agents/AGENTS.md`(harness 层)
30
+ ### `{HARNESS_DIR}/AGENTS.md`(harness 层)
31
31
 
32
32
  - 放:`{HARNESS_DIR}`/`{PLAN_DIR}`/`{ITERATION_DIR}`/`{KNOWLEDGE_DIR}`/`{SPECS_DIR}` 契约、`docs/` 与 harness 子树内容边界、状态推进门禁、QC/QA 对齐规则、residual 生命周期、Done compaction profile。
33
33
  - 不放:语言/框架编码细节、业务模块实现约束。
@@ -56,7 +56,7 @@
56
56
  1. Current user instruction
57
57
  2. Root `AGENTS.md`
58
58
  3. This file
59
- 4. `.agents/AGENTS.md`
59
+ 4. `{HARNESS_DIR}/AGENTS.md`
60
60
 
61
61
  ## Boundary Rules
62
62
  - ...
@@ -74,7 +74,7 @@
74
74
  修正:迁移到 `status.json` 的 `plans[].metadata` 与 `notes.json`。
75
75
 
76
76
  - 反模式:每个子目录复制一份完整 harness 规则。
77
- 修正:保留一行引用 `.agents/AGENTS.md`,仅写本目录增量约束。
77
+ 修正:保留一行引用 `{HARNESS_DIR}/AGENTS.md`,仅写本目录增量约束。
78
78
 
79
79
  - 反模式:目录级规则未声明 Source Priority,冲突时不可裁决。
80
80
  修正:统一四级优先级模板并在每个目录级文件开头声明。
@@ -7,8 +7,8 @@ Use this reference for `{HARNESS_DIR}` / `{PLAN_DIR}` initialization, status syn
7
7
  Follow `mstar-plan-conventions` for canonical discovery.
8
8
  Preferred layout:
9
9
 
10
- - `{HARNESS_DIR}`: `.agents/`
11
- - `{PLAN_DIR}`: `.agents/plans/`
10
+ - `{HARNESS_DIR}`: `.mstar/` by default; existing `.agents/` projects remain valid.
11
+ - `{PLAN_DIR}`: `.mstar/plans/` by default; existing `.agents/plans/` projects remain valid.
12
12
 
13
13
  Legacy fallbacks:
14
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mstar-harness/opencode",
3
- "version": "0.6.5",
3
+ "version": "0.6.7",
4
4
  "description": "Morning Star harness OpenCode plugin (skills bootstrap and agent loading).",
5
5
  "license": "MIT",
6
6
  "repository": {