@rosenfan/matrix 0.1.5 → 0.1.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.
- package/README.md +22 -19
- package/README.zh-CN.md +21 -18
- package/assets/skills/matrix/SKILL.md +6 -5
- package/assets/skills/matrix-archive/SKILL.md +2 -0
- package/assets/skills/matrix-build/SKILL.md +1 -1
- package/assets/skills/matrix-design/SKILL.md +12 -6
- package/assets/skills/matrix-handoff/SKILL.md +89 -0
- package/assets/skills/matrix-handoff/agents/openai.yaml +4 -0
- package/assets/skills/matrix-open/SKILL.md +13 -2
- package/assets/skills/matrix-verify/SKILL.md +4 -4
- package/assets/skills-zh-CN/matrix/SKILL.md +84 -83
- package/assets/skills-zh-CN/matrix-archive/SKILL.md +2 -0
- package/assets/skills-zh-CN/matrix-build/SKILL.md +41 -41
- package/assets/skills-zh-CN/matrix-design/SKILL.md +41 -24
- package/assets/skills-zh-CN/matrix-handoff/SKILL.md +79 -0
- package/assets/skills-zh-CN/matrix-open/SKILL.md +40 -30
- package/package.json +1 -1
- package/src/catalog.js +10 -2
- package/src/cli.js +303 -233
- package/src/distribution.js +1 -1
- package/src/installer.js +45 -45
- package/src/matt-catalog.mjs +35 -33
- package/src/matt.js +122 -127
- package/src/messages.js +46 -37
- package/src/npm-invocation.js +23 -0
- package/src/project-index.js +43 -0
- package/src/runtime-resolver.js +76 -76
- package/src/self-update.js +8 -1
- package/src/ui.js +97 -89
- package/src/workflow.js +36 -4
- package/assets/skills/matrix-claude/SKILL.md +0 -98
- package/assets/skills/matrix-claude/agents/openai.yaml +0 -4
- package/assets/skills-zh-CN/matrix-claude/SKILL.md +0 -33
|
@@ -1,83 +1,84 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: matrix
|
|
3
|
-
description: 启动、恢复并治理持久化的 Matrix 开发工作流。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Matrix
|
|
7
|
-
|
|
8
|
-
以当前仓库的 `.matrix/` 为唯一状态来源;不得从聊天记录推断阶段。
|
|
9
|
-
|
|
10
|
-
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 的 `artifact_language`。规范 Markdown 标题 token 必须保持不变;面向用户的产物正文、说明和 handoff 在 `zh-CN` 时写中文,在 `en` 时写英文。
|
|
11
|
-
|
|
12
|
-
所有 workflow 命令都先执行当前项目 Matrix Skill 自带的 Runtime,使项目兼容性权威优先于不同版本的全局启动器:
|
|
13
|
-
|
|
14
|
-
```powershell
|
|
15
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
全局 `matrix` 命令只负责 init、update 和 bootstrap。受信任的 0.1.4 启动器只会自动委派给版本与 hash 都精确匹配的 0.1.4 项目 Runtime。项目 Runtime 属于不同版本或无法识别版本时仍是项目权威,但必须执行启动器返回的精确直连命令;旧版启动器不具备这项跨版本检查,不能作为项目 workflow 入口。
|
|
19
|
-
|
|
20
|
-
有活动变更时,报告其 phase、冻结的 `orchestration` 以及 Arch 安装完整性,再按 Runtime 结果进入 `next_skill`。没有活动变更时,为开发请求创建简短 kebab-case ID:
|
|
21
|
-
|
|
22
|
-
```powershell
|
|
23
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs init <change-id> --workflow <full|hotfix|tweak> --orchestration <prim|arch> --title "<title>"
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
显式模式优先,否则使用项目 `default_orchestration`。解析后的模式在整个 change 生命周期中不可切换。
|
|
27
|
-
|
|
28
|
-
## 编排模式
|
|
29
|
-
|
|
30
|
-
- **Prim**:各阶段使用 Matrix 自身能力,不依赖 Matt Skills。
|
|
31
|
-
- **Arch**:仅在任务事实满足触发条件时,调用活动 Change 冻结的十项自动能力。Matrix 0.1.
|
|
32
|
-
|
|
33
|
-
两种编排模式使用已选定的 workflow profile:`full` 走 `open → design → build → verify → archive`;`hotfix` 与 `tweak` 共用内部 `lightweight` profile,走 `open → build → verify → archive`,仅证据策略不同。Arch 能力不得写 Matrix 状态、推进阶段、提交、归档或创建竞争工作流。
|
|
34
|
-
|
|
35
|
-
正确安装的 Arch 能力执行失败时,最多允许一次同能力的 Matrix fallback,并记录失败与证据。缺失、修改或不完整的 Arch 安装必须通过 `matrix init --with-mattpocock` 修复,不得切换活动 change 到 Prim。
|
|
36
|
-
|
|
37
|
-
## 恢复
|
|
38
|
-
|
|
39
|
-
只能通过 Runtime 恢复,不得手工修改状态:
|
|
40
|
-
|
|
41
|
-
```powershell
|
|
42
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason design-gap
|
|
43
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return build --reason verification-failed
|
|
44
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason acceptance-or-design-gap
|
|
45
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs abort --reason <requirement-cancelled|superseded|no-longer-valuable|blocked|other>
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Return 会把当前 `verification.md` 轮换至按 revision 编号的证据历史。Archive 等待确认期间若验收或设计改变,只能使用 `archive -> design` 的 `acceptance-or-design-gap` Return。Abort 将终态变更移入 `.matrix/archive/`,但不会撤销工作区代码。
|
|
49
|
-
|
|
50
|
-
任何 mutation 返回 `WORKFLOW_RECOVERY_REQUIRED` 时,停止正常阶段操作并先执行只读诊断:
|
|
51
|
-
|
|
52
|
-
```powershell
|
|
53
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
不得推断恢复目标或策略,只能执行 doctor 返回的精确命令:
|
|
57
|
-
|
|
58
|
-
```powershell
|
|
59
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor --repair --transaction <id> --strategy <continue|rollback>
|
|
60
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor --repair --lock <id>
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## 精确 Contract
|
|
64
|
-
|
|
65
|
-
full 的 `design -> build` 会批准 proposal/design/plan;lightweight 的 `open -> build --confirmed` 只批准紧凑 proposal,并拒绝初始化后、批准前发生的项目实现改动。Contract 后续漂移都会阻断推进。
|
|
66
|
-
|
|
67
|
-
## 可选
|
|
68
|
-
|
|
69
|
-
`$matrix-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
## 显式 Matt handoff
|
|
73
|
-
|
|
74
|
-
Matrix 不嵌套 user-invoked Skill。适用时只解释原因,并让用户显式调用:一次性配置使用 `setup-matt-pocock-skills`,工作流外架构扫描使用 `improve-codebase-architecture`,独立大型候选生成使用 `wayfinder`,上下文边界使用 `handoff`,他人掌握阻塞事实时使用 `to-questionnaire`。`ask-matt`、`grill-with-docs`、`triage`、`to-spec`、`to-tickets`、`grill-me`、`teach`、`wait-what` 保持 standalone。Matrix 不安装也不管理 `implement`
|
|
75
|
-
|
|
76
|
-
## 规则
|
|
77
|
-
|
|
78
|
-
- 阶段只能经 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition` 正向推进。
|
|
79
|
-
- 只能经上述明确的 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs return` 反向推进。
|
|
80
|
-
- 成功 Archive 必须使用两步乐观提交:先运行 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs archive --dry-run`,再将其精确 hash 传给 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs archive --expect-preflight <sha256>`;不得绕过预演。
|
|
81
|
-
- `node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor` 始终只读;transaction 与陈旧锁 repair 必须显式绑定 doctor 报告的 identity,不得手工编辑或删除 `.matrix/transactions/`、`.matrix/workflow.lock`。
|
|
82
|
-
- 重大架构/范围决定和 archive/commit 前应暂停等待用户确认。
|
|
83
|
-
-
|
|
1
|
+
---
|
|
2
|
+
name: matrix
|
|
3
|
+
description: 启动、恢复并治理持久化的 Matrix 开发工作流。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Matrix
|
|
7
|
+
|
|
8
|
+
以当前仓库的 `.matrix/` 为唯一状态来源;不得从聊天记录推断阶段。
|
|
9
|
+
|
|
10
|
+
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 的 `artifact_language`。规范 Markdown 标题 token 必须保持不变;面向用户的产物正文、说明和 handoff 在 `zh-CN` 时写中文,在 `en` 时写英文。
|
|
11
|
+
|
|
12
|
+
所有 workflow 命令都先执行当前项目 Matrix Skill 自带的 Runtime,使项目兼容性权威优先于不同版本的全局启动器:
|
|
13
|
+
|
|
14
|
+
```powershell
|
|
15
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
全局 `matrix` 命令只负责 init、update 和 bootstrap。受信任的 0.1.4 启动器只会自动委派给版本与 hash 都精确匹配的 0.1.4 项目 Runtime。项目 Runtime 属于不同版本或无法识别版本时仍是项目权威,但必须执行启动器返回的精确直连命令;旧版启动器不具备这项跨版本检查,不能作为项目 workflow 入口。
|
|
19
|
+
|
|
20
|
+
有活动变更时,报告其 phase、冻结的 `orchestration` 以及 Arch 安装完整性,再按 Runtime 结果进入 `next_skill`。没有活动变更时,为开发请求创建简短 kebab-case ID:
|
|
21
|
+
|
|
22
|
+
```powershell
|
|
23
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs init <change-id> --workflow <full|hotfix|tweak> --orchestration <prim|arch> --title "<title>"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
显式模式优先,否则使用项目 `default_orchestration`。解析后的模式在整个 change 生命周期中不可切换。
|
|
27
|
+
|
|
28
|
+
## 编排模式
|
|
29
|
+
|
|
30
|
+
- **Prim**:各阶段使用 Matrix 自身能力,不依赖 Matt Skills。
|
|
31
|
+
- **Arch**:仅在任务事实满足触发条件时,调用活动 Change 冻结的十项自动能力。Matrix 0.1.7 审查 Matt Skills v1.3.1 官方 27 项角色,只把其中 25 项兼容 Skill 安装在项目本地;排除 `implement` 与 `implement-spec`。
|
|
32
|
+
|
|
33
|
+
两种编排模式使用已选定的 workflow profile:`full` 走 `open → design → build → verify → archive`;`hotfix` 与 `tweak` 共用内部 `lightweight` profile,走 `open → build → verify → archive`,仅证据策略不同。Arch 能力不得写 Matrix 状态、推进阶段、提交、归档或创建竞争工作流。
|
|
34
|
+
|
|
35
|
+
正确安装的 Arch 能力执行失败时,最多允许一次同能力的 Matrix fallback,并记录失败与证据。缺失、修改或不完整的 Arch 安装必须通过 `matrix init --with-mattpocock` 修复,不得切换活动 change 到 Prim。
|
|
36
|
+
|
|
37
|
+
## 恢复
|
|
38
|
+
|
|
39
|
+
只能通过 Runtime 恢复,不得手工修改状态:
|
|
40
|
+
|
|
41
|
+
```powershell
|
|
42
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason design-gap
|
|
43
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return build --reason verification-failed
|
|
44
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason acceptance-or-design-gap
|
|
45
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs abort --reason <requirement-cancelled|superseded|no-longer-valuable|blocked|other>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Return 会把当前 `verification.md` 轮换至按 revision 编号的证据历史。Archive 等待确认期间若验收或设计改变,只能使用 `archive -> design` 的 `acceptance-or-design-gap` Return。Abort 将终态变更移入 `.matrix/archive/`,但不会撤销工作区代码。
|
|
49
|
+
|
|
50
|
+
任何 mutation 返回 `WORKFLOW_RECOVERY_REQUIRED` 时,停止正常阶段操作并先执行只读诊断:
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
不得推断恢复目标或策略,只能执行 doctor 返回的精确命令:
|
|
57
|
+
|
|
58
|
+
```powershell
|
|
59
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor --repair --transaction <id> --strategy <continue|rollback>
|
|
60
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor --repair --lock <id>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 精确 Contract
|
|
64
|
+
|
|
65
|
+
full 的 `design -> build` 会批准 proposal/design/plan;lightweight 的 `open -> build --confirmed` 只批准紧凑 proposal,并拒绝初始化后、批准前发生的项目实现改动。Contract 后续漂移都会阻断推进。
|
|
66
|
+
|
|
67
|
+
## 可选 agent 交接(Implementation Handoff)
|
|
68
|
+
|
|
69
|
+
`$matrix-handoff` 只在已批准的 Build 中使用,通过 `export --agent <agent-id>` 将 Contract 快照导出为用户选择的实现 agent 的有界任务包(例如 Codex 设计、Claude Code 实现,或 zcode 设计、opencode 实现)。它不拥有阶段推进或验收;由当前 agent 继续实现仍使用原有 Matrix 主流程。
|
|
70
|
+
只有用户明确选择切换实现 agent 时才使用,不得自动插入标准流程。
|
|
71
|
+
|
|
72
|
+
## 显式 Matt handoff
|
|
73
|
+
|
|
74
|
+
Matrix 不嵌套 user-invoked Skill。适用时只解释原因,并让用户显式调用:一次性配置使用 `setup-matt-pocock-skills`,工作流外架构扫描使用 `improve-codebase-architecture`,独立大型候选生成使用 `wayfinder`,上下文边界使用 `handoff`,会话复盘改进 agent 环境使用 `retro`,他人掌握阻塞事实时使用 `to-questionnaire`。`ask-matt`、`grill-with-docs`、`triage`、`to-spec`、`to-tickets`、`grill-me`、`teach`、`wait-what`、`pr` 保持 standalone。Matrix 不安装也不管理 `implement` 与 `implement-spec`;已有副本(含遗留的 `resolving-merge-conflicts`)保留为未管理额外项,活动 Change 内不得建议使用。
|
|
75
|
+
|
|
76
|
+
## 规则
|
|
77
|
+
|
|
78
|
+
- 阶段只能经 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition` 正向推进。
|
|
79
|
+
- 只能经上述明确的 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs return` 反向推进。
|
|
80
|
+
- 成功 Archive 必须使用两步乐观提交:先运行 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs archive --dry-run`,再将其精确 hash 传给 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs archive --expect-preflight <sha256>`;不得绕过预演。
|
|
81
|
+
- `node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor` 始终只读;transaction 与陈旧锁 repair 必须显式绑定 doctor 报告的 identity,不得手工编辑或删除 `.matrix/transactions/`、`.matrix/workflow.lock`。
|
|
82
|
+
- 重大架构/范围决定和 archive/commit 前应暂停等待用户确认。
|
|
83
|
+
- 进入 Build 前(full 在 design guard 之后;lightweight 并入 `transition build --confirmed` 的暂停)必须呈现执行主体选择——当前 agent/原模型继续、用户客户端切换模型、或经 `$matrix-handoff` 切换实现 agent——并将决策随 Contract 记录。
|
|
84
|
+
- shortcut 范围扩大时执行 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason design-gap`;Runtime 将其升级为 full。
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: matrix-build
|
|
3
|
-
description: 用测试优先的纵向切片实现冻结的 Matrix 计划。仅在活动 Matrix 阶段为 build 时使用。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Matrix Build
|
|
7
|
-
|
|
8
|
-
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 与已批准 Contract。full/legacy-full 读取 proposal/design/plan;lightweight 只读取紧凑 proposal,不补写 Design 产物。
|
|
9
|
-
|
|
10
|
-
Build 证据与面向用户的说明使用 `artifact_language`;Runtime 所需英文标题 token 保持不变。
|
|
11
|
-
|
|
12
|
-
## 编排
|
|
13
|
-
|
|
14
|
-
- **Prim**:使用 Matrix 自身实现与测试能力。
|
|
15
|
-
- **Arch**:可测试行为变化时调用 `tdd`;真实失败且根因未知时调用 `diagnosing-bugs`;批准 Contract 修改 agent-facing 指令时调用 `writing-for-agents`;只有 Contract 需要人工执行 shell 步骤时,才用 `wizard` 生成并静态验证脚本,绝不端到端执行或收集秘密。
|
|
16
|
-
|
|
17
|
-
进行中的 merge/rebase 冲突由 Matrix
|
|
18
|
-
|
|
19
|
-
调用前说明能力与原因。companion 不得 commit、review、transition、archive 或扩大范围。正确安装的能力失败时最多执行一次同能力 Matrix fallback,并记录调用、失败、fallback 与证据;安装完整性问题必须停止并修复。
|
|
20
|
-
|
|
21
|
-
## 范围纪律
|
|
22
|
-
|
|
23
|
-
若实现暴露范围或设计变化,停止并执行:
|
|
24
|
-
|
|
25
|
-
```powershell
|
|
26
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason design-gap
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
回到 Design 会清除既有 Contract 批准并轮换当前验证证据;重新进入 Build 必须生成新的批准与新证据。
|
|
30
|
-
|
|
31
|
-
## 流程
|
|
32
|
-
|
|
33
|
-
1. 对可测试的行为变化使用 `tdd` 纵向切片;纯文档或不可观察的机械变更使用相称的静态检查。
|
|
34
|
-
2. 在 `## Build evidence` 记录共同事实;hotfix 另写 `## Reproduction evidence`、`## Root cause`,tweak 另写 `## Scope evidence`。
|
|
35
|
-
3. 运行 Build guard;它同时确认批准的 Contract 仍精确匹配。
|
|
36
|
-
4. 通过后推进至 Verify,并进入 `$matrix-verify`。
|
|
37
|
-
|
|
38
|
-
```powershell
|
|
39
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
|
|
40
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
|
|
41
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: matrix-build
|
|
3
|
+
description: 用测试优先的纵向切片实现冻结的 Matrix 计划。仅在活动 Matrix 阶段为 build 时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Matrix Build
|
|
7
|
+
|
|
8
|
+
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 与已批准 Contract。full/legacy-full 读取 proposal/design/plan;lightweight 只读取紧凑 proposal,不补写 Design 产物。
|
|
9
|
+
|
|
10
|
+
Build 证据与面向用户的说明使用 `artifact_language`;Runtime 所需英文标题 token 保持不变。
|
|
11
|
+
|
|
12
|
+
## 编排
|
|
13
|
+
|
|
14
|
+
- **Prim**:使用 Matrix 自身实现与测试能力。
|
|
15
|
+
- **Arch**:可测试行为变化时调用 `tdd`;真实失败且根因未知时调用 `diagnosing-bugs`;批准 Contract 修改 agent-facing 指令时调用 `writing-for-agents`;只有 Contract 需要人工执行 shell 步骤时,才用 `wizard` 生成并静态验证脚本,绝不端到端执行或收集秘密。
|
|
16
|
+
|
|
17
|
+
进行中的 merge/rebase 冲突由 Matrix 自身治理,不得把生命周期控制交给遗留的 `resolving-merge-conflicts` 副本或任何会自行 stage、continue、commit 的 skill。活动 Change 内不得调用 `implement` 与 `implement-spec`。
|
|
18
|
+
|
|
19
|
+
调用前说明能力与原因。companion 不得 commit、review、transition、archive 或扩大范围。正确安装的能力失败时最多执行一次同能力 Matrix fallback,并记录调用、失败、fallback 与证据;安装完整性问题必须停止并修复。
|
|
20
|
+
|
|
21
|
+
## 范围纪律
|
|
22
|
+
|
|
23
|
+
若实现暴露范围或设计变化,停止并执行:
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason design-gap
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
回到 Design 会清除既有 Contract 批准并轮换当前验证证据;重新进入 Build 必须生成新的批准与新证据。
|
|
30
|
+
|
|
31
|
+
## 流程
|
|
32
|
+
|
|
33
|
+
1. 对可测试的行为变化使用 `tdd` 纵向切片;纯文档或不可观察的机械变更使用相称的静态检查。
|
|
34
|
+
2. 在 `## Build evidence` 记录共同事实;hotfix 另写 `## Reproduction evidence`、`## Root cause`,tweak 另写 `## Scope evidence`。
|
|
35
|
+
3. 运行 Build guard;它同时确认批准的 Contract 仍精确匹配。
|
|
36
|
+
4. 通过后推进至 Verify,并进入 `$matrix-verify`。
|
|
37
|
+
|
|
38
|
+
```powershell
|
|
39
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
|
|
40
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
|
|
41
|
+
```
|
|
@@ -1,24 +1,41 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: matrix-design
|
|
3
|
-
description: 在实现前设计并冻结活动 Matrix 变更。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Matrix Design
|
|
7
|
-
|
|
8
|
-
Design 只用于 full 和可恢复的旧 shortcut change。新的 lightweight hotfix/tweak 从 Open 直接进入 Build,不得为满足 full guard 补写 Design 产物。
|
|
9
|
-
|
|
10
|
-
design 和 plan 正文使用 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 的 `artifact_language`;Runtime 所需英文标题 token 保持不变。
|
|
11
|
-
|
|
12
|
-
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect`、proposal 与冻结 `orchestration`,写入 `design.md`(`## Decisions`、`## Boundaries`、`## Test seams`、`## Risks`)与 `plan.md`(`## Steps`、`## Validation`、`## Stop conditions`)。
|
|
13
|
-
|
|
14
|
-
- **Prim**:使用 Matrix 自身能力调查并设计。
|
|
15
|
-
- **Arch**:仅按事实触发 `domain-modeling`、`research`、`prototype`、`codebase-design`;当 Contract 修改 Skill、`AGENTS.md`、`CLAUDE.md` 或 agent 指针可达文档时触发 `writing-for-agents`。不得机械执行固定序列;每次调用前说明能力与原因。
|
|
16
|
-
|
|
17
|
-
长期有效的领域、ADR 或研究产物遵循仓库约定,关键结论必须同步进入 Matrix design/plan。prototype 默认写入系统临时目录。companion 不得拥有 Matrix 状态或创建竞争计划。重大范围或架构决策须先由用户确认。
|
|
18
|
-
|
|
19
|
-
`wayfinder` 与 `improve-codebase-architecture` 只能作为活动 Design 外的显式 handoff;说明原因后由用户调用,选中的结果可另行进入受治理 Change。
|
|
20
|
-
|
|
21
|
-
```powershell
|
|
22
|
-
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard design
|
|
23
|
-
|
|
24
|
-
|
|
1
|
+
---
|
|
2
|
+
name: matrix-design
|
|
3
|
+
description: 在实现前设计并冻结活动 Matrix 变更。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Matrix Design
|
|
7
|
+
|
|
8
|
+
Design 只用于 full 和可恢复的旧 shortcut change。新的 lightweight hotfix/tweak 从 Open 直接进入 Build,不得为满足 full guard 补写 Design 产物。
|
|
9
|
+
|
|
10
|
+
design 和 plan 正文使用 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 的 `artifact_language`;Runtime 所需英文标题 token 保持不变。
|
|
11
|
+
|
|
12
|
+
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect`、proposal 与冻结 `orchestration`,写入 `design.md`(`## Decisions`、`## Boundaries`、`## Test seams`、`## Risks`)与 `plan.md`(`## Steps`、`## Validation`、`## Stop conditions`)。
|
|
13
|
+
|
|
14
|
+
- **Prim**:使用 Matrix 自身能力调查并设计。
|
|
15
|
+
- **Arch**:仅按事实触发 `domain-modeling`、`research`、`prototype`、`codebase-design`;当 Contract 修改 Skill、`AGENTS.md`、`CLAUDE.md` 或 agent 指针可达文档时触发 `writing-for-agents`。不得机械执行固定序列;每次调用前说明能力与原因。
|
|
16
|
+
|
|
17
|
+
长期有效的领域、ADR 或研究产物遵循仓库约定,关键结论必须同步进入 Matrix design/plan。prototype 默认写入系统临时目录。companion 不得拥有 Matrix 状态或创建竞争计划。重大范围或架构决策须先由用户确认。
|
|
18
|
+
|
|
19
|
+
`wayfinder` 与 `improve-codebase-architecture` 只能作为活动 Design 外的显式 handoff;说明原因后由用户调用,选中的结果可另行进入受治理 Change。
|
|
20
|
+
|
|
21
|
+
```powershell
|
|
22
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard design
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 执行主体确认点(Build 前)
|
|
26
|
+
|
|
27
|
+
`guard design` 通过后、`transition build` 之前,必须暂停并向用户确认执行主体,未确认不得推进:
|
|
28
|
+
|
|
29
|
+
- **选项 A:当前 agent / 原模型继续(默认)**——直接推进:
|
|
30
|
+
```powershell
|
|
31
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition build
|
|
32
|
+
```
|
|
33
|
+
随后进入 `$matrix-build` 在本会话内实现。
|
|
34
|
+
- **选项 B:切换模型、保留本 agent**——用户在自己的客户端完成模型切换(例如设计用强模型、实现用高性价比模型),回到会话确认后按选项 A 推进。Matrix 无法感知客户端模型,只提供强制暂停点。
|
|
35
|
+
- **选项 C:切换执行 agent**——先推进进 Build 批准冻结 Contract,再用 `$matrix-handoff` 为目标 agent 导出有界任务包(例如 Codex 设计、Claude Code 实现,或 zcode 设计、opencode 实现)。实现 agent 完成并补齐 `## Build evidence` 后:
|
|
36
|
+
```powershell
|
|
37
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
|
|
38
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
所选选项必须写入 `design.md` 的 `## Decisions`,随 Contract 冻结。
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: matrix-handoff
|
|
3
|
+
description: 将已批准的 Matrix Contract 导出为受边界约束的通用 agent 任务包(Claude Code、opencode 或其他 agent),不改变 Matrix 工作流状态。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Matrix Handoff(Implementation Handoff)
|
|
7
|
+
|
|
8
|
+
这是可选旁路,不是 Matrix phase。它不得执行 `transition`、`archive`,也不得写入 `matrix.yaml` 或 `events.jsonl`。它只支持匹配的 full 或 legacy-full 三产物 Contract;新的 lightweight hotfix/tweak 不支持导出。
|
|
9
|
+
|
|
10
|
+
人类可读 handoff 内容使用 inspect 的 `artifact_language`;稳定的机器可读标题和 metadata key 保持不变。
|
|
11
|
+
|
|
12
|
+
## 何时使用
|
|
13
|
+
|
|
14
|
+
满足以下条件时使用 `$matrix-handoff`:
|
|
15
|
+
|
|
16
|
+
- 变更已进入 Build,且 `design -> build` 已批准精确 Contract;
|
|
17
|
+
- 你希望由另一个 agent 实现冻结的设计——例如 Codex 设计、Claude Code 实现,或 zcode 设计、opencode 实现;
|
|
18
|
+
- 你需要一份带全部实现细节的有界任务包。
|
|
19
|
+
|
|
20
|
+
## 前置条件
|
|
21
|
+
|
|
22
|
+
导出器写任何内容前先做只读检查:
|
|
23
|
+
|
|
24
|
+
```powershell
|
|
25
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
若结果为 `CONTRACT_CHANGED`、`CONTRACT_UNAPPROVED` 或 `CONTRACT_READ_FAILED`,回到 `$matrix-design`,修订后重新进入 Build 取得新批准。导出只读取批准快照中的 `proposal.md`、`design.md` 与 `plan.md`。
|
|
29
|
+
|
|
30
|
+
## 导出
|
|
31
|
+
|
|
32
|
+
实现 agent 由用户显式选择,通过 `--agent <agent-id>`(kebab-case)传入;可用 `--from <agent-id>` 标注设计方 agent。
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
# 通用 agent 交接:写入 artifacts/handoff-task-<ID>.md
|
|
36
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs export --task-id <ID> --agent opencode
|
|
37
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs export --task-id <ID> --agent claude-code --from codex
|
|
38
|
+
|
|
39
|
+
# 兼容形态(Claude Code):写入 artifacts/claude-task.md
|
|
40
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs export --task-id <ID> --target generic
|
|
41
|
+
|
|
42
|
+
# FnSec:仅在 active.md 含有 NO_ACTIVE_OBJECTIVE 时更新看板
|
|
43
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs export --task-id <ID> --target fnsec --apply-fnsec-board
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`--agent` 与 `--target` 互斥。新交接推荐 `--agent`;`--target generic` 仅为兼容保留。
|
|
47
|
+
|
|
48
|
+
## 任务包内容
|
|
49
|
+
|
|
50
|
+
导出包(`artifacts/handoff-task-<task-id>.md`)的元数据记录 `Implementation actor`(`--agent` 值)与 `Decision owner`(`--from` 值,缺省为 "Matrix change owner"),并包含批准的 Contract hash 与 revision,以及同一冻结快照的 proposal、design、plan。Objective、Allowed/Prohibited work 与 Stop conditions 原样携带——它们与具体 agent 无关。
|
|
51
|
+
|
|
52
|
+
## 实现 agent 完成后
|
|
53
|
+
|
|
54
|
+
继续 `$matrix-verify` 前先核对以下证据:
|
|
55
|
+
|
|
56
|
+
- [ ] `artifacts/verification.md` 存在且含 `## Build evidence`
|
|
57
|
+
- [ ] Build evidence 含具体命令与结果
|
|
58
|
+
- [ ] plan 的 Validation 命令全部执行
|
|
59
|
+
- [ ] `NEEDS_DECISION` 项已解决或已记录
|
|
60
|
+
|
|
61
|
+
证据缺失时,让实现 agent 补齐后再继续。
|
|
62
|
+
|
|
63
|
+
## 恢复 Matrix 工作流
|
|
64
|
+
|
|
65
|
+
实现 agent 完成且证据齐备后:
|
|
66
|
+
|
|
67
|
+
```powershell
|
|
68
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
|
|
69
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
guard 失败则退回实现 agent 补齐缺失证据;通过后进入 `$matrix-verify` 继续验证流程。
|
|
73
|
+
|
|
74
|
+
## 重要约束
|
|
75
|
+
|
|
76
|
+
- 本旁路不改变 Matrix 阶段、workflow 或 guard 结果
|
|
77
|
+
- Matrix 状态停留在 `build`;导出本身不推进阶段
|
|
78
|
+
- 实现 agent 产出的证据必须满足 build guard 条件
|
|
79
|
+
- 成功 transition 到 verify 后,走正常验证流程
|
|
@@ -1,30 +1,40 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: matrix-open
|
|
3
|
-
description: 将开发请求澄清为有证据的 Matrix 提案。
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Matrix Open
|
|
7
|
-
|
|
8
|
-
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 返回的 `profile` 与 `evidence_policy`。
|
|
9
|
-
|
|
10
|
-
proposal 正文使用其中的 `artifact_language`;Runtime 所需的英文标题 token 必须原样保留,仅标题下内容本地化。
|
|
11
|
-
|
|
12
|
-
- full proposal 包含 `## Goal`、`## Scope`、`## Non-goals`、`## Acceptance`、`## Risks`,随后进入 Design。
|
|
13
|
-
- lightweight proposal 在修改项目实现前完整定义 `## Goal`、`## Scope`、`## Non-goals`、`## Approach`、`## Acceptance`、`## Validation`、`## Risks`、`## Upgrade conditions`。
|
|
14
|
-
- hotfix 额外包含 `## Expected behavior`、`## Actual behavior`、`## Reproduction`。
|
|
15
|
-
- tweak 额外包含 `## Current behavior`、`## Preserved behavior`、`## Diff boundary`。
|
|
16
|
-
|
|
17
|
-
- **Prim**:使用 Matrix
|
|
18
|
-
- **Arch
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
1
|
+
---
|
|
2
|
+
name: matrix-open
|
|
3
|
+
description: 将开发请求澄清为有证据的 Matrix 提案。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Matrix Open
|
|
7
|
+
|
|
8
|
+
读取 `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` 返回的 `profile` 与 `evidence_policy`。
|
|
9
|
+
|
|
10
|
+
proposal 正文使用其中的 `artifact_language`;Runtime 所需的英文标题 token 必须原样保留,仅标题下内容本地化。
|
|
11
|
+
|
|
12
|
+
- full proposal 包含 `## Goal`、`## Scope`、`## Non-goals`、`## Acceptance`、`## Risks`,随后进入 Design。
|
|
13
|
+
- lightweight proposal 在修改项目实现前完整定义 `## Goal`、`## Scope`、`## Non-goals`、`## Approach`、`## Acceptance`、`## Validation`、`## Risks`、`## Upgrade conditions`。
|
|
14
|
+
- hotfix 额外包含 `## Expected behavior`、`## Actual behavior`、`## Reproduction`。
|
|
15
|
+
- tweak 额外包含 `## Current behavior`、`## Preserved behavior`、`## Diff boundary`。
|
|
16
|
+
|
|
17
|
+
- **Prim**:使用 Matrix 自身能力进行结构化澄清(目标、范围、非目标、验收标准、风险、时限),并编写提案。
|
|
18
|
+
- **Arch**:Open 开始即说明能力与原因,默认调用 `grilling` 澄清需求;仅在领域词汇、不变量或架构决定不清晰时调用 `domain-modeling`。
|
|
19
|
+
- **豁免澄清**:仅当用户同时满足 (1) 自带清晰的执行计划,(2) 明确说明不需要澄清过程 时,才可跳过澄清;跳过仍必须生成 `clarification.md` 的豁免记录。
|
|
20
|
+
|
|
21
|
+
## 澄清产物(强制)
|
|
22
|
+
|
|
23
|
+
在编写 proposal 之前生成 `<change>/clarification.md`,无论澄清或豁免都必须落盘:
|
|
24
|
+
|
|
25
|
+
- 正常澄清:`## Questions` / `## Answers` / `## Resolved scope`(英文标题 token 固定,正文使用 `artifact_language`);
|
|
26
|
+
- 豁免路径:`## Exemption record`(豁免原因 + 用户计划要点 + proposal 如何采纳该计划)。
|
|
27
|
+
|
|
28
|
+
lightweight(hotfix/tweak)同样适用,但澄清精简为一轮核心问题。该文件是 Open 阶段的证据类产物:不参与 Contract identity 计算,Runtime 不校验其存在;0.1.5 及更早创建、停在 open 的 change 无需补写即可继续推进。
|
|
29
|
+
|
|
30
|
+
若进展被另一人掌握的事实或决定阻塞,说明 `to-questionnaire` 适用的原因并让用户显式调用;Matrix 不得自行嵌套该 wrapper。
|
|
31
|
+
|
|
32
|
+
companion 输出只能作为当前 proposal 的证据,不得创建第二套工作流、提案、确认状态或阶段转换。正确安装的能力失败时最多执行一次同能力 Matrix fallback;安装完整性问题必须修复。
|
|
33
|
+
|
|
34
|
+
```powershell
|
|
35
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard open
|
|
36
|
+
# full
|
|
37
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition design
|
|
38
|
+
# hotfix/tweak,仅在用户明确确认后
|
|
39
|
+
node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition build --confirmed
|
|
40
|
+
```
|
package/package.json
CHANGED
package/src/catalog.js
CHANGED
|
@@ -6,10 +6,10 @@ import { fileURLToPath } from "node:url";
|
|
|
6
6
|
import { MATT_INSTALLABLE_SKILLS, MATT_ROLES } from "./matt-catalog.mjs";
|
|
7
7
|
|
|
8
8
|
export const LANGUAGE_IDS = ["en", "zh-CN"];
|
|
9
|
-
export const PLATFORM_IDS = ["claude-code", "codex"];
|
|
9
|
+
export const PLATFORM_IDS = ["claude-code", "codex", "zcode"];
|
|
10
10
|
export const MATRIX_SKILLS = [
|
|
11
11
|
"matrix", "matrix-open", "matrix-design", "matrix-build", "matrix-verify",
|
|
12
|
-
"matrix-archive", "matrix-hotfix", "matrix-tweak", "matrix-status", "matrix-
|
|
12
|
+
"matrix-archive", "matrix-hotfix", "matrix-tweak", "matrix-status", "matrix-handoff"
|
|
13
13
|
];
|
|
14
14
|
export const MATT_SKILLS = MATT_INSTALLABLE_SKILLS;
|
|
15
15
|
export const UNMANAGED_MATT_SKILLS = MATT_ROLES.incompatible;
|
|
@@ -28,6 +28,14 @@ export const PLATFORMS = {
|
|
|
28
28
|
id: "codex", name: "Codex", skillsCliAgent: "codex",
|
|
29
29
|
skillRoot(base) { return path.join(base, ".agents", "skills"); },
|
|
30
30
|
legacyRoots(base) { return [path.join(base, ".codex", "skills")]; }
|
|
31
|
+
},
|
|
32
|
+
// Agents that read the Agent Skills open-standard directory (.agents/skills)
|
|
33
|
+
// by default — opencode, Kimi Code, and other compatible tools — share the
|
|
34
|
+
// Codex installation and need no dedicated platform entry.
|
|
35
|
+
zcode: {
|
|
36
|
+
id: "zcode", name: "ZCode", skillsCliAgent: "zcode",
|
|
37
|
+
skillRoot(base) { return path.join(base, ".zcode", "skills"); },
|
|
38
|
+
legacyRoots() { return []; }
|
|
31
39
|
}
|
|
32
40
|
};
|
|
33
41
|
|