@rosenfan/matrix 0.1.5 → 0.1.6
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 +14 -13
- package/README.zh-CN.md +14 -13
- package/assets/skills/matrix/SKILL.md +4 -3
- package/assets/skills/matrix-design/SKILL.md +12 -6
- package/assets/skills/matrix-handoff/SKILL.md +89 -0
- package/assets/skills/matrix-open/SKILL.md +13 -2
- package/assets/skills-zh-CN/matrix/SKILL.md +84 -83
- 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 +1 -1
- package/src/cli.js +303 -233
- package/src/distribution.js +1 -1
- package/src/matt-catalog.mjs +1 -1
- 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/self-update.js +8 -1
- package/src/ui.js +97 -89
- package/src/workflow.js +25 -2
- package/assets/skills/matrix-claude/SKILL.md +0 -98
- package/assets/skills-zh-CN/matrix-claude/SKILL.md +0 -33
- /package/assets/skills/{matrix-claude → matrix-handoff}/agents/openai.yaml +0 -0
|
@@ -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
|
@@ -9,7 +9,7 @@ export const LANGUAGE_IDS = ["en", "zh-CN"];
|
|
|
9
9
|
export const PLATFORM_IDS = ["claude-code", "codex"];
|
|
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;
|