@rosenfan/matrix 0.1.3 → 0.1.5

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 (54) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +72 -63
  3. package/README.zh-CN.md +70 -61
  4. package/{.claude → assets}/skills/matrix/SKILL.md +81 -86
  5. package/{.claude → assets}/skills/matrix/agents/openai.yaml +4 -4
  6. package/{.claude → assets}/skills/matrix/scripts/matrix_claude.py +11 -11
  7. package/{.claude → assets}/skills/matrix/scripts/matrix_state.py +60 -60
  8. package/assets/skills/matrix/scripts/test_matrix_claude.py +69 -0
  9. package/assets/skills/matrix/scripts/test_matrix_state.py +69 -0
  10. package/{.claude → assets}/skills/matrix-archive/SKILL.md +27 -27
  11. package/{.claude/skills/matrix-hotfix → assets/skills/matrix-archive}/agents/openai.yaml +4 -4
  12. package/{.claude → assets}/skills/matrix-build/SKILL.md +41 -38
  13. package/{.claude/skills/matrix-archive → assets/skills/matrix-build}/agents/openai.yaml +4 -4
  14. package/{.claude → assets}/skills/matrix-claude/SKILL.md +93 -93
  15. package/{.claude → assets}/skills/matrix-claude/agents/openai.yaml +4 -4
  16. package/{.claude → assets}/skills/matrix-design/SKILL.md +69 -67
  17. package/{.claude → assets}/skills/matrix-design/agents/openai.yaml +4 -4
  18. package/{.claude → assets}/skills/matrix-hotfix/SKILL.md +7 -7
  19. package/{.claude/skills/matrix-build → assets/skills/matrix-hotfix}/agents/openai.yaml +4 -4
  20. package/{.claude → assets}/skills/matrix-open/SKILL.md +26 -24
  21. package/assets/skills/matrix-open/agents/openai.yaml +4 -0
  22. package/{.claude → assets}/skills/matrix-status/SKILL.md +14 -14
  23. package/{.claude → assets}/skills/matrix-status/agents/openai.yaml +4 -4
  24. package/{.claude → assets}/skills/matrix-tweak/SKILL.md +7 -7
  25. package/assets/skills/matrix-tweak/agents/openai.yaml +4 -0
  26. package/assets/skills/matrix-verify/SKILL.md +89 -0
  27. package/assets/skills/matrix-verify/agents/openai.yaml +4 -0
  28. package/assets/skills-zh-CN/matrix/SKILL.md +27 -27
  29. package/assets/skills-zh-CN/matrix-archive/SKILL.md +10 -10
  30. package/assets/skills-zh-CN/matrix-build/SKILL.md +13 -11
  31. package/assets/skills-zh-CN/matrix-claude/SKILL.md +10 -10
  32. package/assets/skills-zh-CN/matrix-design/SKILL.md +12 -10
  33. package/assets/skills-zh-CN/matrix-hotfix/SKILL.md +1 -1
  34. package/assets/skills-zh-CN/matrix-open/SKILL.md +18 -16
  35. package/assets/skills-zh-CN/matrix-status/SKILL.md +3 -3
  36. package/assets/skills-zh-CN/matrix-tweak/SKILL.md +1 -1
  37. package/assets/skills-zh-CN/matrix-verify/SKILL.md +25 -9
  38. package/bin/matrix.js +15 -15
  39. package/package.json +4 -13
  40. package/src/catalog.js +110 -92
  41. package/src/cli.js +138 -80
  42. package/src/distribution.js +379 -253
  43. package/src/installer.js +4 -4
  44. package/src/matt-catalog.mjs +67 -0
  45. package/src/matt.js +91 -9
  46. package/src/messages.js +14 -10
  47. package/src/runtime-resolver.js +76 -0
  48. package/src/self-update.js +2 -2
  49. package/src/workflow-transaction.js +9 -5
  50. package/src/workflow.js +688 -429
  51. package/.claude/skills/matrix-open/agents/openai.yaml +0 -4
  52. package/.claude/skills/matrix-tweak/agents/openai.yaml +0 -4
  53. package/.claude/skills/matrix-verify/SKILL.md +0 -73
  54. package/.claude/skills/matrix-verify/agents/openai.yaml +0 -4
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Rosen
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rosen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -40,14 +40,14 @@ Matrix solves this with one deterministic state machine, explicit phases, guard
40
40
 
41
41
  ## What It Does
42
42
 
43
- Matrix provides two capability-orchestration modes over two centrally defined workflow profiles:
44
-
45
- ```
46
- full: open → design → build → verify → archive
47
- hotfix/tweak lightweight: open ─────────→ build → verify → archive
48
-
49
- Prim: Matrix performs phase work itself
50
- Arch: Matrix invokes verified atomic Skills only when task facts trigger them
43
+ Matrix provides two capability-orchestration modes over two centrally defined workflow profiles:
44
+
45
+ ```
46
+ full: open → design → build → verify → archive
47
+ hotfix/tweak lightweight: open ─────────→ build → verify → archive
48
+
49
+ Prim: Matrix performs phase work itself
50
+ Arch: Matrix invokes verified atomic Skills only when task facts trigger them
51
51
  ```
52
52
 
53
53
  Recovery paths are controlled Runtime intents:
@@ -69,10 +69,10 @@ Each phase:
69
69
 
70
70
  ## Prerequisites
71
71
 
72
- - [Claude Code](https://docs.anthropic.com/claude-code) and/or Codex installed as the Skill host
73
- - Node.js 18+ and `npm` on `PATH` (for the Matrix CLI)
74
- - Python is optional during the compatibility window; new installations use the bundled Node workflow runtime.
75
- - Git is only needed when installing from GitHub or contributing to Matrix.
72
+ - [Claude Code](https://docs.anthropic.com/claude-code) and/or Codex installed as the Skill host
73
+ - Node.js 18+ and `npm` on `PATH` (for the Matrix CLI)
74
+ - Python is optional during the compatibility window; new installations use the bundled Node workflow runtime.
75
+ - Git is only needed when installing from GitHub or contributing to Matrix.
76
76
 
77
77
  ---
78
78
 
@@ -91,15 +91,15 @@ cd /path/to/your/project
91
91
  matrix init
92
92
  ```
93
93
 
94
- The interactive setup lets you:
94
+ The interactive setup lets you:
95
95
 
96
- - Choose English or Chinese, project or global scope, and Claude Code, Codex, or both
96
+ - Choose English or Chinese, project or global Matrix discovery scope, and Claude Code, Codex, or both
97
97
  - Copy skills (recommended) or symlink them for local development
98
- - Safely reconfigure an existing installation with an automatic backup
99
- - Install Matt Pocock's companion skills in the same flow
98
+ - Safely reconfigure an existing installation with an automatic backup
99
+ - Review all 25 official Matt Skills v1.2.3 roles and install the 23 compatible Skills into the target project
100
100
  - Choose **Prim** or **Arch** as the project default without disabling the other available mode
101
101
 
102
- For automation and CI:
102
+ For automation and CI:
103
103
 
104
104
  ```bash
105
105
  # Safe non-interactive installation for both verified platforms
@@ -108,31 +108,36 @@ matrix init --yes --platform claude-code --platform codex --with-mattpocock
108
108
  # Explicitly select the project default
109
109
  matrix init --yes --with-mattpocock --default-orchestration arch
110
110
 
111
+ # Replace locally modified Matt Skills only after an explicit backup authorization
112
+ matrix init --yes --with-mattpocock --force-matt
113
+
111
114
  # Preview exactly what would change (including backups) without writing
112
115
  matrix init --platform codex --dry-run --json
113
116
 
114
- # Inspect Matrix ownership, Matt Skills inheritance, and the selected platform
115
- matrix doctor --platform codex
116
- ```
117
-
118
- Update an initialized project:
119
-
120
- ```bash
121
- # Check for a newer Matrix CLI, confirm the plan, then refresh this project's installed assets
122
- matrix update
123
-
124
- # Offline or local-development refresh: skip the npm registry and use the current CLI package
125
- matrix update --skip-self-update
126
-
127
- # Non-interactive update after CI has explicitly authorized writes
128
- matrix update --yes
129
- ```
130
-
131
- `matrix update` preserves the installation's scope, platforms, language, mode, and orchestration. It first validates a newer npm package in isolation, then re-runs the new CLI to refresh project assets. npm and project assets are separate transactions: if asset refresh fails after a CLI upgrade, run `matrix update --skip-self-update` to retry. Use `matrix init` to change installation choices, and `matrix doctor` for read-only diagnosis.
132
-
133
- The language selected by `matrix init` controls the prose in new Matrix artifacts. Markdown headings required by Matrix guards remain stable English tokens; the artifact body is Chinese for `zh-CN` and English for `en`. A change freezes this language at creation time.
134
-
135
- To install directly from GitHub instead of npm:
117
+ # Inspect Matrix ownership, project-local Matt compatibility, and the selected platform
118
+ matrix doctor --platform codex
119
+ ```
120
+
121
+ Update an initialized project:
122
+
123
+ ```bash
124
+ # Check for a newer Matrix CLI, confirm the plan, then refresh this project's installed assets
125
+ matrix update
126
+
127
+ # Offline or local-development refresh: skip the npm registry and use the current CLI package
128
+ matrix update --skip-self-update
129
+
130
+ # Non-interactive update after CI has explicitly authorized writes
131
+ matrix update --yes
132
+ ```
133
+
134
+ `matrix update` preserves the installation's scope, platforms, language, mode, and orchestration. It first validates a newer npm package in isolation, then re-runs the new CLI to refresh Matrix assets. It never downloads, installs, repairs, or deletes Matt Skills; after the Matrix update it reports the local Matt compatibility status and, when needed, points to `matrix init . --with-mattpocock`. npm and project assets are separate transactions: if asset refresh fails after a CLI upgrade, run `matrix update --skip-self-update` to retry.
135
+
136
+ Matrix 0.1.5 is bound to Matt Skills v1.2.3 at commit `6acc160e4e0cd062dbbbd7a1b26ae92855edf07e`. `matrix init --with-mattpocock` always uses that exact archive and its reviewed 23-Skill compatible manifest, even if upstream has a newer release. The two official but incompatible Skills, `implement` and raw `resolving-merge-conflicts`, are not Matrix-managed or installed. Matrix scope controls Matrix Skill discovery only: Matt Skills and `.matrix/matt-installation.json` are always project-local. Global Matt copies are preserved but never used to complete project readiness.
137
+
138
+ The language selected by `matrix init` controls the prose in new Matrix artifacts. Markdown headings required by Matrix guards remain stable English tokens; the artifact body is Chinese for `zh-CN` and English for `en`. A change freezes this language at creation time.
139
+
140
+ To install directly from GitHub instead of npm:
136
141
 
137
142
  ```bash
138
143
  npm install --global github:Rosenfan/Matrix
@@ -174,9 +179,9 @@ Matrix will:
174
179
  | Phase | Arch capabilities (triggered, not a fixed sequence) | Deliverables | Guard Condition |
175
180
  |-------|------------------------------------------------------|--------------|-----------------|
176
181
  | **open** | `/grilling`, `/domain-modeling` | `proposal.md`; optional repository-standard context/ADR evidence | Goal, Scope, Non-goals, Acceptance, Risks present |
177
- | **design** | `/domain-modeling`, `/research`, `/wayfinder`, `/prototype`, `/codebase-design` | `design.md`, `plan.md` | Decisions, Test seams, Steps documented |
178
- | **build** | `/tdd`, `/diagnosing-bugs`, `/resolving-merge-conflicts` | Code, `verification.md` | Exact approved Contract matches; build evidence recorded |
179
- | **verify** | `/code-review` | Test & review evidence | Test and review evidence present |
182
+ | **design** | `/domain-modeling`, `/research`, `/prototype`, `/codebase-design`, conditional `/writing-for-agents` | `design.md`, `plan.md` | Decisions, Test seams, Steps documented |
183
+ | **build** | `/tdd`, `/diagnosing-bugs`, conditional `/writing-for-agents` and generate-only `/wizard` | Code, `verification.md` | Exact approved Contract matches; build evidence recorded |
184
+ | **verify** | `/code-review` | Test evidence, two-axis review, Arch receipt | Evidence is substantive; Arch receipt matches the current Contract, review, and workspace |
180
185
  | **archive** | None; Matrix-owned in both modes | Archive record | Verify guard passed |
181
186
 
182
187
  ---
@@ -191,9 +196,9 @@ State is stored in `.matrix/`:
191
196
  ├── config.yaml
192
197
  ├── changes/
193
198
  │ └── <change-id>/
194
- │ ├── matrix.yaml # Canonical workflow, orchestration, phase, status, revision
195
- │ ├── workspace-baseline.json # Lightweight implementation-order boundary
196
- │ ├── events.jsonl
199
+ │ ├── matrix.yaml # Canonical workflow, orchestration, phase, status, revision
200
+ │ ├── workspace-baseline.json # Lightweight implementation-order boundary
201
+ │ ├── events.jsonl
197
202
  │ └── artifacts/
198
203
  │ ├── proposal.md
199
204
  │ ├── design.md
@@ -209,12 +214,12 @@ The state machine enforces transitions:
209
214
  # Check guard
210
215
  matrix workflow guard open
211
216
 
212
- # Advance (only if guard passes)
213
- matrix workflow transition design
214
-
215
- # Lightweight: approve the compact proposal and enter Build
216
- matrix workflow transition build --confirmed
217
-
217
+ # Advance (only if guard passes)
218
+ matrix workflow transition design
219
+
220
+ # Lightweight: approve the compact proposal and enter Build
221
+ matrix workflow transition build --confirmed
222
+
218
223
  # Return from verification failure; stale evidence is retained in history
219
224
  matrix workflow return build --reason verification-failed
220
225
 
@@ -223,8 +228,8 @@ matrix workflow abort --reason requirement-cancelled
223
228
 
224
229
  # Final Archive is a mandatory two-step optimistic commit
225
230
  matrix workflow archive --dry-run
226
- matrix workflow archive --expect-preflight <sha256-returned-by-dry-run>
227
- # hotfix/tweak commit command additionally carries --confirmed
231
+ matrix workflow archive --expect-preflight <sha256-returned-by-dry-run>
232
+ # hotfix/tweak commit command additionally carries --confirmed
228
233
 
229
234
  # Diagnose an interrupted Workflow without writing
230
235
  matrix workflow doctor
@@ -234,7 +239,7 @@ matrix workflow doctor --repair --transaction <id> --strategy <continue|rollback
234
239
  matrix workflow doctor --repair --lock <id>
235
240
  ```
236
241
 
237
- `matrix.yaml` is the only canonical workflow/orchestration/phase/status/revision record, using `matrix/change/v2`. Full approval binds the exact bytes of proposal/design/plan. Lightweight approval binds the compact proposal, requires explicit confirmation, and compares the project with its initialization baseline so implementation cannot precede approval. Contract drift blocks later phases. Final Archive uses a read-only dry-run and hash-bound commit; shortcut workflows additionally require explicit confirmation. Multi-file mutations remain protected by durable journals.
242
+ `matrix.yaml` is the only canonical workflow/orchestration/phase/status/revision record, using `matrix/change/v2`. Full approval binds the exact bytes of proposal/design/plan. Lightweight approval binds the compact proposal, requires explicit confirmation, and compares the project with its initialization baseline so implementation cannot precede approval. Contract drift blocks later phases. Final Archive uses a read-only dry-run and hash-bound commit; shortcut workflows additionally require explicit confirmation. Multi-file mutations remain protected by durable journals.
238
243
 
239
244
  ---
240
245
 
@@ -244,10 +249,10 @@ matrix workflow doctor --repair --lock <id>
244
249
  |------|-------------|--------|
245
250
  | **full** | New features, architecture changes | All 5 phases |
246
251
  | **hotfix** | Reproducible small bugs | Simplified: open → build → verify → archive |
247
- | **tweak** | Bounded changes, no API/schema impact | Simplified: open → build → verify → archive |
248
-
249
- Hotfix and tweak reference the same internal `lightweight` transition profile. They differ only in routing and evidence: hotfix requires reproduction/root-cause/regression evidence; tweak requires behavior-boundary, diff, and scope-review evidence.
250
-
252
+ | **tweak** | Bounded changes, no API/schema impact | Simplified: open → build → verify → archive |
253
+
254
+ Hotfix and tweak reference the same internal `lightweight` transition profile. They differ only in routing and evidence: hotfix requires reproduction/root-cause/regression evidence; tweak requires behavior-boundary, diff, and scope-review evidence.
255
+
251
256
  ---
252
257
 
253
258
  ## Special Feature: matrix-claude
@@ -280,28 +285,32 @@ The sidecar does NOT change Matrix state. It's a pure export — like taking a s
280
285
 
281
286
  ## Integration with Matt Pocock's Skills
282
287
 
283
- Prim uses Matrix's own capability. Arch uses one initialization-verified cohort of ten atomic capabilities:
288
+ Prim uses Matrix's own capability. Matrix reviews all 25 official Matt v1.2.3 roles, installs the 23 compatible Skills, and lets Arch automatically invoke only this reviewed ten-capability cohort:
284
289
 
285
290
  | Phase | Capability | Trigger |
286
291
  |---|---|---|
287
292
  | open | `/grilling` | Material ambiguity or explicit stress-test request |
288
293
  | open/design | `/domain-modeling` | Unclear vocabulary, invariants, or architectural decisions |
289
294
  | design | `/research` | Required external facts are unavailable in the repository |
290
- | design | `/wayfinder` | Module ownership or dependency seams are unknown |
291
295
  | design | `/prototype` | A material design question needs disposable evidence |
292
296
  | design | `/codebase-design` | A deep-module, interface, or test-seam decision remains |
297
+ | design/build | `/writing-for-agents` | The Contract changes agent-facing instructions or pointer-reached documents |
293
298
  | build | `/tdd` | Observable behavior changes at a testable seam |
294
299
  | build | `/diagnosing-bugs` | An actual failure exists and root cause is unknown |
295
- | build | `/resolving-merge-conflicts` | A merge or rebase conflict is in progress |
300
+ | build | `/wizard` | The Contract requires generated human-run shell steps; Matrix never runs them end-to-end |
296
301
  | verify | `/code-review` | Standards and Spec review evidence is required |
297
302
 
298
- `grill-with-docs`, `implement`, and `improve-codebase-architecture` are not Matrix-managed or automatically invoked. Existing user-installed copies are preserved as unmanaged extras. A companion never transitions, commits, archives, or writes Matrix state.
303
+ Matrix may recommend but never nest these user-invoked handoffs: `setup-matt-pocock-skills`, `improve-codebase-architecture`, `wayfinder`, `handoff`, and `to-questionnaire`. The user explicitly runs them outside the active phase; selected output may enter a governed Change.
304
+
305
+ Arch records a Runtime-managed review receipt after `code-review`, binding its fixed point and committed HEAD diff to the current Contract, review evidence, and workspace. A normal `code-review` receipt requires a clean candidate worktree outside Matrix-managed assets. When Git has no usable baseline, the committed diff is empty, staged/unstaged/untracked candidate files still exist, or the correctly installed capability fails, Matrix may perform one explicitly labelled same-capability fallback for that revision. The `uncommitted-worktree` fallback binds both the fixed point and a content hash of the complete worktree candidate. Installation-integrity failures never fall back. A heading or self-description without the matching receipt cannot advance Verify.
306
+
307
+ Installed standalone Skills are `ask-matt`, `grill-with-docs`, `triage`, `to-spec`, `to-tickets`, `grill-me`, `teach`, and `wait-what`. `implement` and raw `resolving-merge-conflicts` are incompatible because they can take over TDD/review/staging/commit effects owned by Matrix, so 0.1.5 neither installs nor manages them. Pre-existing copies are preserved and reported as unmanaged extras. Installation never grants automatic invocation, and no companion may transition, commit, archive, recover, or write Matrix state.
299
308
 
300
309
  ---
301
310
 
302
311
  **Key difference**: Matt Pocock's skills are individual tools. Matrix adds:
303
312
  - **State persistence**: Survives context loss
304
- - **Phase enforcement**: Full cannot skip Design; lightweight cannot edit implementation before its confirmed Open Contract
313
+ - **Phase enforcement**: Full cannot skip Design; lightweight cannot edit implementation before its confirmed Open Contract
305
314
  - **Evidence requirements**: Guards check for artifacts, not assertions
306
315
  - **Transition logging**: Full audit trail of phase changes
307
316
 
package/README.zh-CN.md CHANGED
@@ -40,14 +40,14 @@ Matrix 通过唯一的确定性状态机解决这些问题 —— 包含明确
40
40
 
41
41
  ## 它做了什么
42
42
 
43
- Matrix 在集中定义的两种 workflow profile 上提供两种能力编排:
44
-
45
- ```
46
- full: open → design → build → verify → archive
47
- hotfix/tweak lightweight:open ─────────→ build → verify → archive
48
-
49
- Prim:Matrix 使用自身能力
50
- Arch:仅在任务事实满足触发条件时调用已验证的原子 Skill
43
+ Matrix 在集中定义的两种 workflow profile 上提供两种能力编排:
44
+
45
+ ```
46
+ full: open → design → build → verify → archive
47
+ hotfix/tweak lightweight:open ─────────→ build → verify → archive
48
+
49
+ Prim:Matrix 使用自身能力
50
+ Arch:仅在任务事实满足触发条件时调用已验证的原子 Skill
51
51
  ```
52
52
 
53
53
  恢复路径由 Runtime 受控执行:
@@ -69,10 +69,10 @@ verify --acceptance-or-design-gap------> design
69
69
 
70
70
  ## 前置条件
71
71
 
72
- - 已安装 [Claude Code](https://docs.anthropic.com/claude-code) 和/或 Codex,作为 Skill 宿主
73
- - Node.js 18+,且 `npm` 已加入 PATH(用于 Matrix CLI)
74
- - Python 仅在兼容窗口内的旧适配器路径使用;新安装使用内置 Node workflow runtime
75
- - Git 仅在从 GitHub 安装或参与 Matrix 开发时需要
72
+ - 已安装 [Claude Code](https://docs.anthropic.com/claude-code) 和/或 Codex,作为 Skill 宿主
73
+ - Node.js 18+,且 `npm` 已加入 PATH(用于 Matrix CLI)
74
+ - Python 仅在兼容窗口内的旧适配器路径使用;新安装使用内置 Node workflow runtime
75
+ - Git 仅在从 GitHub 安装或参与 Matrix 开发时需要
76
76
 
77
77
  ---
78
78
 
@@ -93,10 +93,10 @@ matrix init
93
93
 
94
94
  交互式初始化支持:
95
95
 
96
- - 选择安装到当前项目或全局
96
+ - 选择 Matrix Skill 发现入口安装到当前项目或全局
97
97
  - 复制 skills(推荐)或为本地开发创建符号链接
98
- - 安全地重新配置已有安装,并自动备份被替换的 Matrix 文件
99
- - 在同一流程中安装 Matt Pocock 的配套 skills
98
+ - 安全地重新配置已有安装,并自动备份被替换的 Matrix 文件
99
+ - 审查 Matt Skills v1.2.3 官方 25 项角色,并在目标项目安装其中 23 项兼容 Skill
100
100
  - 选择 Prim 或 Arch 作为项目默认值,且不禁用另一种可用模式
101
101
 
102
102
  自动化或 CI 环境可以使用:
@@ -108,28 +108,33 @@ matrix init --yes --with-mattpocock
108
108
  # 显式选择项目默认编排
109
109
  matrix init --yes --with-mattpocock --default-orchestration arch
110
110
 
111
- # 检查安装完整性和运行环境
112
- matrix doctor
113
- ```
114
-
115
- 更新已经初始化的项目:
116
-
117
- ```bash
118
- # 检查新版 Matrix CLI,确认计划后更新 CLI 并同步当前项目资产
119
- matrix update
120
-
121
- # 离线或本地开发:不访问 npm registry,只用当前 CLI 同步资产
122
- matrix update --skip-self-update
123
-
124
- # 已在自动化中明确授权写入
125
- matrix update --yes
126
- ```
127
-
128
- `matrix update` 会保留既有安装的 scope、平台、语言、mode 与 orchestration。它先隔离验证 npm 新包,再由新 CLI 同步项目资产。npm 与项目资产是两个事务:若 CLI 已更新但资产同步失败,可运行 `matrix update --skip-self-update` 重试。修改安装选择请使用 `matrix init`;只读诊断请使用 `matrix doctor`。
129
-
130
- `matrix init` 选择的语言决定新 Matrix 产物的正文语言:`zh-CN` 使用中文、`en` 使用英文。Runtime 守卫依赖的 Markdown 英文标题 token 保持不变;每个 change 在创建时冻结该语言。
131
-
132
- 也可以直接从 GitHub 安装,而不是 npm:
111
+ # 只有明确授权备份后才替换被本地修改的 Matt Skills
112
+ matrix init --yes --with-mattpocock --force-matt
113
+
114
+ # 检查安装完整性和运行环境
115
+ matrix doctor
116
+ ```
117
+
118
+ 更新已经初始化的项目:
119
+
120
+ ```bash
121
+ # 检查新版 Matrix CLI,确认计划后更新 CLI 并同步当前项目资产
122
+ matrix update
123
+
124
+ # 离线或本地开发:不访问 npm registry,只用当前 CLI 同步资产
125
+ matrix update --skip-self-update
126
+
127
+ # 已在自动化中明确授权写入
128
+ matrix update --yes
129
+ ```
130
+
131
+ `matrix update` 会保留既有安装的 scope、平台、语言、mode 与 orchestration。它先隔离验证 npm 新包,再由新 CLI 同步 Matrix 资产;它绝不下载、安装、修复或删除 Matt Skills。Matrix 更新完成后只读报告项目 Matt 兼容状态,必要时提示 `matrix init . --with-mattpocock`。npm 与项目资产是两个事务:若 CLI 已更新但资产同步失败,可运行 `matrix update --skip-self-update` 重试。
132
+
133
+ Matrix 0.1.5 固定对应 Matt Skills v1.2.3,commit 为 `6acc160e4e0cd062dbbbd7a1b26ae92855edf07e`。即使上游已有新版,`matrix init --with-mattpocock` 仍使用该确切 archive 与经过审查的 23 项兼容 manifest。官方角色中的 `implement` 与 raw `resolving-merge-conflicts` 不兼容,因此 Matrix 不安装也不管理它们。Matrix scope 只控制 Matrix Skill 的发现位置;Matt Skills 与 `.matrix/matt-installation.json` 始终属于目标项目。全局 Matt 副本会保留,但绝不用于补齐项目 readiness。
134
+
135
+ `matrix init` 选择的语言决定新 Matrix 产物的正文语言:`zh-CN` 使用中文、`en` 使用英文。Runtime 守卫依赖的 Markdown 英文标题 token 保持不变;每个 change 在创建时冻结该语言。
136
+
137
+ 也可以直接从 GitHub 安装,而不是 npm:
133
138
 
134
139
  ```bash
135
140
  npm install --global github:Rosenfan/Matrix
@@ -171,9 +176,9 @@ Matrix 将会:
171
176
  | 阶段 | Arch 能力(按事实触发,不是固定序列) | 交付物 | 守卫条件 |
172
177
  |------|----------------------------------------|--------|----------|
173
178
  | **open** | `/grilling`、`/domain-modeling` | `proposal.md`;可选仓库约定的 context/ADR 证据 | 目标、范围、验收标准、风险存在 |
174
- | **design** | `/domain-modeling`、`/research`、`/wayfinder`、`/prototype`、`/codebase-design` | `design.md`、`plan.md` | 决策、测试点、步骤已记录 |
175
- | **build** | `/tdd`、`/diagnosing-bugs`、`/resolving-merge-conflicts` | 代码、`verification.md` | 已批准的精确 Contract 匹配,且已记录构建证据 |
176
- | **verify** | `/code-review` | 测试和审查证据 | 测试和审查证据存在 |
179
+ | **design** | `/domain-modeling`、`/research`、`/prototype`、`/codebase-design`、条件触发的 `/writing-for-agents` | `design.md`、`plan.md` | 决策、测试点、步骤已记录 |
180
+ | **build** | `/tdd`、`/diagnosing-bugs`、条件触发的 `/writing-for-agents` 与仅生成的 `/wizard` | 代码、`verification.md` | 已批准的精确 Contract 匹配,且已记录构建证据 |
181
+ | **verify** | `/code-review` | 测试证据、双轴审查、Arch 回执 | 证据内容充分;Arch 回执匹配当前 Contract、审查正文和工作区 |
177
182
  | **archive** | 无;两种模式均由 Matrix 拥有 | 归档记录 | 验证守卫通过 |
178
183
 
179
184
  ---
@@ -188,9 +193,9 @@ Matrix 将会:
188
193
  ├── config.yaml
189
194
  ├── changes/
190
195
  │ └── <change-id>/
191
- │ ├── matrix.yaml # 唯一 workflow、orchestration、阶段、状态与 revision 事实
192
- │ ├── workspace-baseline.json # lightweight 的实施顺序边界
193
- │ ├── events.jsonl
196
+ │ ├── matrix.yaml # 唯一 workflow、orchestration、阶段、状态与 revision 事实
197
+ │ ├── workspace-baseline.json # lightweight 的实施顺序边界
198
+ │ ├── events.jsonl
194
199
  │ └── artifacts/
195
200
  │ ├── proposal.md
196
201
  │ ├── design.md
@@ -206,12 +211,12 @@ Matrix 将会:
206
211
  # 检查守卫
207
212
  matrix workflow guard open
208
213
 
209
- # 推进(仅在守卫通过时)
210
- matrix workflow transition design
211
-
212
- # lightweight:确认紧凑 proposal 后进入 Build
213
- matrix workflow transition build --confirmed
214
-
214
+ # 推进(仅在守卫通过时)
215
+ matrix workflow transition design
216
+
217
+ # lightweight:确认紧凑 proposal 后进入 Build
218
+ matrix workflow transition build --confirmed
219
+
215
220
  # 验证失败时返回 Build;旧证据保留在历史目录
216
221
  matrix workflow return build --reason verification-failed
217
222
 
@@ -220,8 +225,8 @@ matrix workflow abort --reason requirement-cancelled
220
225
 
221
226
  # 最终归档强制使用两步乐观提交
222
227
  matrix workflow archive --dry-run
223
- matrix workflow archive --expect-preflight <dry-run-返回的-sha256>
224
- # hotfix/tweak 的提交命令还必须带 --confirmed
228
+ matrix workflow archive --expect-preflight <dry-run-返回的-sha256>
229
+ # hotfix/tweak 的提交命令还必须带 --confirmed
225
230
 
226
231
  # 只读诊断中断的 Workflow
227
232
  matrix workflow doctor
@@ -231,7 +236,7 @@ matrix workflow doctor --repair --transaction <id> --strategy <continue|rollback
231
236
  matrix workflow doctor --repair --lock <id>
232
237
  ```
233
238
 
234
- `matrix.yaml` 仍是 workflow、orchestration、阶段、状态与 revision 的唯一事实来源。full 批准 proposal/design/plan 的精确字节;lightweight 批准紧凑 proposal,要求明确确认,并与初始化工作区基线比较,阻止先实现后补方案。Contract 漂移会阻断后续阶段。最终 Archive 仍使用只读 dry-run 与 hash-bound commit,shortcut 还要求明确确认;所有多文件 mutation 继续受持久 journal 保护。
239
+ `matrix.yaml` 仍是 workflow、orchestration、阶段、状态与 revision 的唯一事实来源。full 批准 proposal/design/plan 的精确字节;lightweight 批准紧凑 proposal,要求明确确认,并与初始化工作区基线比较,阻止先实现后补方案。Contract 漂移会阻断后续阶段。最终 Archive 仍使用只读 dry-run 与 hash-bound commit,shortcut 还要求明确确认;所有多文件 mutation 继续受持久 journal 保护。
235
240
 
236
241
  ---
237
242
 
@@ -241,10 +246,10 @@ matrix workflow doctor --repair --lock <id>
241
246
  |------|----------|------|
242
247
  | **full** | 新功能、架构变更 | 全部 5 个阶段 |
243
248
  | **hotfix** | 可复现的小型 Bug | 简化:open → build → verify → archive |
244
- | **tweak** | 有界变更,无 API/架构影响 | 简化:open → build → verify → archive |
245
-
246
- hotfix 与 tweak 引用同一个内部 `lightweight` 迁移 profile,只在入口和证据上区分:hotfix 要求复现、根因、回归证据;tweak 要求行为边界、diff 与范围审查证据。
247
-
249
+ | **tweak** | 有界变更,无 API/架构影响 | 简化:open → build → verify → archive |
250
+
251
+ hotfix 与 tweak 引用同一个内部 `lightweight` 迁移 profile,只在入口和证据上区分:hotfix 要求复现、根因、回归证据;tweak 要求行为边界、diff 与范围审查证据。
252
+
248
253
  ---
249
254
 
250
255
  ## 特别功能:matrix-claude
@@ -277,28 +282,32 @@ $matrix → open → design → build → verify → archive
277
282
 
278
283
  ## 与 Matt Pocock Skills 的集成
279
284
 
280
- Prim 使用 Matrix 自身能力。Arch 使用初始化时验证的十项原子能力:
285
+ Prim 使用 Matrix 自身能力。Matrix 会审查 Matt v1.2.3 官方 25 项角色,安装其中 23 项兼容 Skill,但 Arch 只自动调用以下十项经过审查的能力:
281
286
 
282
287
  | 阶段 | 能力 | 触发条件 |
283
288
  |---|---|---|
284
289
  | open | `/grilling` | 存在重大歧义或用户明确要求压力测试 |
285
290
  | open/design | `/domain-modeling` | 词汇、不变量或架构决定不清晰 |
286
291
  | design | `/research` | 仓库内无法获得必需的外部事实 |
287
- | design | `/wayfinder` | 模块归属或依赖接缝未知 |
288
292
  | design | `/prototype` | 重大设计问题需要一次性实验证据 |
289
293
  | design | `/codebase-design` | 深模块、接口或测试接缝决定尚未完成 |
294
+ | design/build | `/writing-for-agents` | Contract 修改 agent-facing 指令或指针可达文档 |
290
295
  | build | `/tdd` | 可测试接缝上的可观察行为发生变化 |
291
296
  | build | `/diagnosing-bugs` | 存在真实失败且根因未知 |
292
- | build | `/resolving-merge-conflicts` | 正在发生 merge/rebase 冲突 |
297
+ | build | `/wizard` | Contract 需要生成人工执行的 shell 步骤;Matrix 不端到端运行 |
293
298
  | verify | `/code-review` | 需要 Standards 与 Spec 双轴证据 |
294
299
 
295
- `grill-with-docs`、`implement`、`improve-codebase-architecture` 不受 Matrix 管理,也不会自动调用。用户已安装的副本会作为非受管额外 Skill 保留。companion 不得推进、提交、归档或写 Matrix 状态。
300
+ Matrix 可以推荐但绝不嵌套以下 user-invoked handoff:`setup-matt-pocock-skills`、`improve-codebase-architecture`、`wayfinder`、`handoff`、`to-questionnaire`。它们由用户在活动阶段外显式运行,选中的结果可以再进入受治理 Change。
301
+
302
+ Arch 在 `code-review` 后记录由 Runtime 管理的审查回执,把 fixed point 与已提交的 HEAD diff 绑定到当前 Contract、审查正文和工作区。正常的 `code-review` 回执要求 Matrix 管理资产之外的候选工作区是干净的。无可用 Git 基线、已提交 diff 为空、仍存在 staged/unstaged/untracked 候选,或正确安装的 capability 真实失败时,Matrix 可为该 revision 执行一次明确标记的同能力 fallback;其中 `uncommitted-worktree` 会同时绑定 fixed point 与完整工作区候选的内容 hash。安装完整性失败不得 fallback。只有标题或自述、但没有匹配回执时,Verify 不能推进。
303
+
304
+ 安装但保持 standalone 的 Skill 是 `ask-matt`、`grill-with-docs`、`triage`、`to-spec`、`to-tickets`、`grill-me`、`teach`、`wait-what`。`implement` 与 raw `resolving-merge-conflicts` 可能接管 Matrix 所有的 TDD、review、stage 或 commit 副作用,因此 0.1.5 不安装也不管理它们;已有副本会被保留并报告为未管理额外项。安装不代表自动调用;任何 companion 都不得推进、提交、归档、恢复或写 Matrix 状态。
296
305
 
297
306
  ---
298
307
 
299
308
  **关键区别**:Matt Pocock 的 skills 是独立工具。Matrix 增加了:
300
309
  - **状态持久化**:可承受上下文丢失
301
- - **阶段强制**:full 不能跳过 Design;lightweight 不能在确认 Open Contract 前修改实现
310
+ - **阶段强制**:full 不能跳过 Design;lightweight 不能在确认 Open Contract 前修改实现
302
311
  - **证据要求**:守卫检查产物,而非断言
303
312
  - **转换日志**:完整的阶段变更审计记录
304
313