@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
@@ -1,44 +1,47 @@
1
- ---
2
- name: matrix-build
3
- description: Implement the frozen active Matrix plan with test-first vertical slices. Use when the active Matrix phase is build.
4
- ---
5
-
1
+ ---
2
+ name: matrix-build
3
+ description: Implement the frozen active Matrix plan with test-first vertical slices. Use when the active Matrix phase is build.
4
+ ---
5
+
6
6
  # Matrix Build
7
7
 
8
- Run `matrix workflow inspect` and implement only its approved Contract. Full and `legacy-full` read proposal/design/plan. `lightweight` reads the approved compact proposal and must not backfill Design artifacts.
8
+ Run `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` and implement only its approved Contract. Full and `legacy-full` read proposal/design/plan. `lightweight` reads the approved compact proposal and must not backfill Design artifacts.
9
9
 
10
10
  Write build evidence and user-facing explanations in `artifact_language`; preserve any Runtime-required English heading tokens.
11
-
12
- ## Prim
13
-
14
- Use Matrix's own implementation and test discipline.
15
-
16
- ## Arch
17
-
18
- - invoke `tdd` when the change modifies observable behavior at a testable seam;
19
- - invoke `diagnosing-bugs` only when an actual failure exists and root cause is not established;
20
- - invoke `resolving-merge-conflicts` only for an in-progress merge or rebase conflict.
21
-
22
- Announce each triggered capability and reason. No companion may commit, review, transition, archive, or broaden scope. A correctly installed capability gets at most one Matrix-owned fallback for that same capability; record the Skill, failure, fallback, and evidence. Installation-integrity failure stops the phase.
23
-
24
- ## Scope Discipline
25
-
11
+
12
+ ## Prim
13
+
14
+ Use Matrix's own implementation and test discipline.
15
+
16
+ ## Arch
17
+
18
+ - invoke `tdd` when the change modifies observable behavior at a testable seam;
19
+ - invoke `diagnosing-bugs` only when an actual failure exists and root cause is not established;
20
+ - invoke `writing-for-agents` when the approved Contract changes agent-facing instructions;
21
+ - invoke `wizard` only to generate and statically verify human-run shell steps required by the Contract; never execute the wizard end-to-end or collect secrets.
22
+
23
+ Resolve an in-progress merge/rebase through Matrix-owned conflict handling. Do not invoke raw `resolving-merge-conflicts`, because it can stage, continue, and commit outside Matrix lifecycle ownership. Never invoke `implement` inside an active Change.
24
+
25
+ Announce each triggered capability and reason. No companion may commit, review, transition, archive, or broaden scope. A correctly installed capability gets at most one Matrix-owned fallback for that same capability; record the Skill, failure, fallback, and evidence. Installation-integrity failure stops the phase.
26
+
27
+ ## Scope Discipline
28
+
26
29
  If implementation exposes a scope or design change, **stop and run**; a lightweight change is upgraded to full by this Return:
27
-
28
- ```powershell
29
- matrix workflow return design --reason design-gap
30
- ```
31
-
32
- Then enter `$matrix-design`; do not amend the plan silently. The Runtime preserves old verification evidence in revision history and requires fresh evidence after the redesigned plan returns to Build.
33
-
34
- ## Process
35
-
36
- 1. Implement the approved plan in bounded vertical slices.
37
- 2. Use only triggered Arch capabilities.
30
+
31
+ ```powershell
32
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs return design --reason design-gap
33
+ ```
34
+
35
+ Then enter `$matrix-design`; do not amend the plan silently. The Runtime preserves old verification evidence in revision history and requires fresh evidence after the redesigned plan returns to Build.
36
+
37
+ ## Process
38
+
39
+ 1. Implement the approved plan in bounded vertical slices.
40
+ 2. Use only triggered Arch capabilities.
38
41
  3. Record common facts under `## Build evidence`. Hotfix also requires `## Reproduction evidence` and `## Root cause`; tweak also requires `## Scope evidence`.
39
- 4. Run the guard and transition, then enter `$matrix-verify`.
40
-
41
- ```powershell
42
- matrix workflow guard build
43
- matrix workflow transition verify
44
- ```
42
+ 4. Run the guard and transition, then enter `$matrix-verify`.
43
+
44
+ ```powershell
45
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
46
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
47
+ ```
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Matrix Workflow"
3
- short_description: "Persistent development workflow stage"
4
- default_prompt: "Use $name to continue a Matrix development workflow."
1
+ interface:
2
+ display_name: "Matrix Workflow"
3
+ short_description: "Persistent development workflow stage"
4
+ default_prompt: "Use $name to continue a Matrix development workflow."
@@ -1,98 +1,98 @@
1
- ---
2
- name: matrix-claude
3
- description: Export a frozen Matrix design as a bounded Claude Code task package without changing Matrix workflow state. Use when Codex should design and Claude Code should implement.
4
- ---
5
-
1
+ ---
2
+ name: matrix-claude
3
+ description: Export a frozen Matrix design as a bounded Claude Code task package without changing Matrix workflow state. Use when Codex should design and Claude Code should implement.
4
+ ---
5
+
6
6
  # Matrix Claude Handoff
7
7
 
8
8
  This is an optional Matrix sidecar, not a Matrix phase. It must not call `transition`, `archive`, or write `matrix.yaml` or `events.jsonl`. It supports only a matching full or legacy-full three-artifact Contract; new lightweight hotfix/tweak changes are intentionally unsupported.
9
9
 
10
10
  Use `artifact_language` from inspect for human-readable handoff text while retaining the stable machine-readable headings and metadata keys.
11
-
12
- ## When to Use
13
-
14
- Use `$matrix-claude` when:
15
- - The active change is in Build and the Design -> Build transition has approved the contract
16
- - You want Claude Code (instead of Codex) to implement the design
17
- - You need a bounded task package with all implementation details
18
-
19
- ## Preconditions
20
-
21
- The exporter performs this read-only check before writing anything:
22
-
23
- ```powershell
24
- matrix workflow guard build
25
- ```
26
-
27
- If `matrix` is genuinely absent from PATH, use the bundled runtime from the installed root Matrix Skill. Do not fall back when the primary command starts and returns an error.
28
-
29
- If the build guard reports `CONTRACT_CHANGED` or `CONTRACT_UNAPPROVED`, return to `$matrix-design` and approve a new contract through Build. The exporter reads the approved bytes of `proposal.md`, `design.md`, and `plan.md`; it does not invent missing facts.
30
-
31
- ## Export
32
-
33
- Treat explicit invocation of `$matrix-claude` as the user's choice of Claude Code as the implementation actor. Generate the package with the deterministic exporter; it refuses a non-matching approved contract and does not alter Matrix state.
34
-
35
- ```powershell
36
- # Generic project: only exports a Matrix artifact.
37
- matrix workflow export --task-id <ID> --target generic
38
-
39
- # FnSec: exports its formal task package. Add --apply-fnsec-board only when
40
- # active.md is NO_ACTIVE_OBJECTIVE; an existing task is never overwritten.
41
- matrix workflow export --task-id <ID> --target fnsec --apply-fnsec-board
42
- ```
43
-
44
- ## Task Package Contents
45
-
46
- The exported package (`artifacts/claude-task.md`) contains everything Claude Code needs to implement and produce evidence for `$matrix-verify`:
47
-
48
- 1. **Task ID, execution actor, and approved contract hash**: Claude Code and the exact approved snapshot
49
- 2. **Objective and acceptance criteria** — copied from `proposal.md`
50
- 3. **In-scope and out-of-scope boundaries** — from `proposal.md`
51
- 4. **Frozen design decisions** — from `design.md` (Decisions, Boundaries, Test seams)
52
- 5. **Ordered implementation plan** — from `plan.md` (Steps, Validation)
53
- 6. **Allowed and prohibited files/actions** — to prevent scope creep
54
- 7. **Required commands** — test, lint, typecheck, build commands to run
55
- 8. **Stop conditions** — ambiguity, scope expansion, failing acceptance, design conflict
56
- 9. **Required evidence for verify**:
57
- - Changed files list
58
- - Commands and their outputs
59
- - Test results (pass/fail)
60
- - Build evidence
61
- - Residual risks
62
- - `NEEDS_DECISION` items (if any)
63
-
64
- ## After Claude Code Completes
65
-
66
- When Claude Code returns results, verify that the following evidence is present before proceeding to `$matrix-verify`:
67
-
68
- - [ ] `artifacts/verification.md` exists with `## Build evidence` section
69
- - [ ] Build evidence includes concrete commands and outcomes
70
- - [ ] All tests in the plan's validation section have been run
71
- - [ ] Any `NEEDS_DECISION` items have been resolved or documented
72
-
73
- If evidence is missing, ask Claude Code to补充 before proceeding.
74
-
75
- ## Resuming Matrix Workflow
76
-
77
- After Claude Code completes and evidence is present:
78
-
79
- 1. Run build guard to verify evidence:
80
- ```powershell
81
- matrix workflow guard build
82
- ```
83
-
84
- 2. If guard passes, transition to verify:
85
- ```powershell
86
- matrix workflow transition verify
87
- ```
88
-
89
- 3. Enter `$matrix-verify` to继续验证流程
90
-
91
- If the build guard fails, return to Claude Code to补充 missing evidence.
92
-
93
- ## Important Notes
94
-
95
- - This sidecar does NOT change Matrix phase, workflow, or guard result
96
- - The Matrix state remains in `build` phase; export itself does not advance it
97
- - Claude Code must produce evidence that satisfies the build guard conditions
98
- - After successful transition to verify, the normal verify流程 continues
11
+
12
+ ## When to Use
13
+
14
+ Use `$matrix-claude` when:
15
+ - The active change is in Build and the Design -> Build transition has approved the contract
16
+ - You want Claude Code (instead of Codex) to implement the design
17
+ - You need a bounded task package with all implementation details
18
+
19
+ ## Preconditions
20
+
21
+ The exporter performs this read-only check before writing anything:
22
+
23
+ ```powershell
24
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
25
+ ```
26
+
27
+ If `matrix` is genuinely absent from PATH, use the bundled runtime from the installed root Matrix Skill. Do not fall back when the primary command starts and returns an error.
28
+
29
+ If the build guard reports `CONTRACT_CHANGED` or `CONTRACT_UNAPPROVED`, return to `$matrix-design` and approve a new contract through Build. The exporter reads the approved bytes of `proposal.md`, `design.md`, and `plan.md`; it does not invent missing facts.
30
+
31
+ ## Export
32
+
33
+ Treat explicit invocation of `$matrix-claude` as the user's choice of Claude Code as the implementation actor. Generate the package with the deterministic exporter; it refuses a non-matching approved contract and does not alter Matrix state.
34
+
35
+ ```powershell
36
+ # Generic project: only exports a Matrix artifact.
37
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs export --task-id <ID> --target generic
38
+
39
+ # FnSec: exports its formal task package. Add --apply-fnsec-board only when
40
+ # active.md is NO_ACTIVE_OBJECTIVE; an existing task is never overwritten.
41
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs export --task-id <ID> --target fnsec --apply-fnsec-board
42
+ ```
43
+
44
+ ## Task Package Contents
45
+
46
+ The exported package (`artifacts/claude-task.md`) contains everything Claude Code needs to implement and produce evidence for `$matrix-verify`:
47
+
48
+ 1. **Task ID, execution actor, and approved contract hash**: Claude Code and the exact approved snapshot
49
+ 2. **Objective and acceptance criteria** — copied from `proposal.md`
50
+ 3. **In-scope and out-of-scope boundaries** — from `proposal.md`
51
+ 4. **Frozen design decisions** — from `design.md` (Decisions, Boundaries, Test seams)
52
+ 5. **Ordered implementation plan** — from `plan.md` (Steps, Validation)
53
+ 6. **Allowed and prohibited files/actions** — to prevent scope creep
54
+ 7. **Required commands** — test, lint, typecheck, build commands to run
55
+ 8. **Stop conditions** — ambiguity, scope expansion, failing acceptance, design conflict
56
+ 9. **Required evidence for verify**:
57
+ - Changed files list
58
+ - Commands and their outputs
59
+ - Test results (pass/fail)
60
+ - Build evidence
61
+ - Residual risks
62
+ - `NEEDS_DECISION` items (if any)
63
+
64
+ ## After Claude Code Completes
65
+
66
+ When Claude Code returns results, verify that the following evidence is present before proceeding to `$matrix-verify`:
67
+
68
+ - [ ] `artifacts/verification.md` exists with `## Build evidence` section
69
+ - [ ] Build evidence includes concrete commands and outcomes
70
+ - [ ] All tests in the plan's validation section have been run
71
+ - [ ] Any `NEEDS_DECISION` items have been resolved or documented
72
+
73
+ If evidence is missing, ask Claude Code to补充 before proceeding.
74
+
75
+ ## Resuming Matrix Workflow
76
+
77
+ After Claude Code completes and evidence is present:
78
+
79
+ 1. Run build guard to verify evidence:
80
+ ```powershell
81
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
82
+ ```
83
+
84
+ 2. If guard passes, transition to verify:
85
+ ```powershell
86
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
87
+ ```
88
+
89
+ 3. Enter `$matrix-verify` to继续验证流程
90
+
91
+ If the build guard fails, return to Claude Code to补充 missing evidence.
92
+
93
+ ## Important Notes
94
+
95
+ - This sidecar does NOT change Matrix phase, workflow, or guard result
96
+ - The Matrix state remains in `build` phase; export itself does not advance it
97
+ - Claude Code must produce evidence that satisfies the build guard conditions
98
+ - After successful transition to verify, the normal verify流程 continues
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Matrix Claude Handoff"
3
- short_description: "Export frozen Matrix design as a Claude Code task"
4
- default_prompt: "Use $matrix-claude to prepare a Claude Code task package."
1
+ interface:
2
+ display_name: "Matrix Claude Handoff"
3
+ short_description: "Export frozen Matrix design as a Claude Code task"
4
+ default_prompt: "Use $matrix-claude to prepare a Claude Code task package."
@@ -1,71 +1,73 @@
1
- ---
2
- name: matrix-design
3
- description: Design and freeze the active Matrix change before implementation. Use when the active Matrix phase is design or when build scope requires redesign.
4
- ---
5
-
1
+ ---
2
+ name: matrix-design
3
+ description: Design and freeze the active Matrix change before implementation. Use when the active Matrix phase is design or when build scope requires redesign.
4
+ ---
5
+
6
6
  # Matrix Design
7
7
 
8
8
  Design is used by `full` and resumable legacy shortcut changes only. A new lightweight hotfix/tweak moves directly from Open to Build and must not create Design artifacts merely to satisfy the full guard.
9
9
 
10
- Use `artifact_language` from `matrix workflow inspect` for all design and plan prose. Keep Runtime-required English heading tokens unchanged.
11
-
12
- Run `matrix workflow inspect`, read the active proposal and frozen `orchestration`, then write `artifacts/design.md` with `## Decisions`, `## Boundaries`, `## Test seams`, and `## Risks`; write `artifacts/plan.md` with `## Steps`, `## Validation`, and `## Stop conditions`.
13
-
14
- ## Prim
15
-
16
- Use Matrix's own capability to investigate the repository and design the change.
17
-
18
- ## Arch
19
-
20
- Invoke only capabilities whose task-fact trigger is proven:
21
-
22
- - `domain-modeling` for unclear vocabulary, invariants, or architectural decisions;
23
- - `research` when required external facts cannot be established from the repository;
24
- - `wayfinder` when module ownership or dependency seams are unknown;
25
- - `prototype` when a material design decision needs disposable empirical evidence;
26
- - `codebase-design` when a deep-module, interface, or test-seam decision remains.
27
-
28
- Order follows actual dependencies; never run a fixed companion sequence. Announce each invocation and reason. A correctly installed capability gets at most one same-capability Matrix fallback; installation-integrity failure stops the phase.
29
-
30
- Long-lived domain, ADR, or research artifacts follow repository conventions, and material conclusions must be synchronized into the canonical design or plan. Prototypes default to an OS temporary directory unless the approved design promotes a project path. Companion output cannot own Matrix state or create a competing plan.
31
-
32
- ## Process
33
-
34
- 1. Establish repository facts and resolve only triggered design questions.
35
- 2. Write and synchronize the canonical Matrix design and plan.
36
- 3. Confirm material architecture choices with the user before freezing.
37
- 4. Run the guard, then choose the implementation actor.
38
-
39
- ```powershell
40
- matrix workflow guard design
41
- ```
42
-
43
- ## Implementation Decision Point
44
-
45
- After the design guard passes, the user chooses:
46
-
47
- ### Option A: Continue with Codex (default)
48
-
49
- Run transition and enter `$matrix-build`:
50
-
51
- ```powershell
52
- matrix workflow transition build
53
- ```
54
-
55
- Then enter `$matrix-build` to implement directly in this session.
56
-
57
- ### Option B: Use Claude Code for implementation
58
-
59
- First approve the frozen contract by transitioning to Build, then run `$matrix-claude` to export a bounded task package. This:
60
- - Does not change the Build phase or state beyond the preceding transition
61
- - Creates `artifacts/claude-task.md` with all implementation details
62
- - Includes acceptance criteria, test seams, and required commands
63
-
64
- After Claude Code completes and returns results, run the Build guard and enter `$matrix-verify`:
65
-
66
- ```powershell
67
- matrix workflow guard build
68
- matrix workflow transition verify
69
- ```
70
-
71
- Then enter `$matrix-verify` to verify the implementation.
10
+ Use `artifact_language` from `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` for all design and plan prose. Keep Runtime-required English heading tokens unchanged.
11
+
12
+ Run `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect`, read the active proposal and frozen `orchestration`, then write `artifacts/design.md` with `## Decisions`, `## Boundaries`, `## Test seams`, and `## Risks`; write `artifacts/plan.md` with `## Steps`, `## Validation`, and `## Stop conditions`.
13
+
14
+ ## Prim
15
+
16
+ Use Matrix's own capability to investigate the repository and design the change.
17
+
18
+ ## Arch
19
+
20
+ Invoke only capabilities whose task-fact trigger is proven:
21
+
22
+ - `domain-modeling` for unclear vocabulary, invariants, or architectural decisions;
23
+ - `research` when required external facts cannot be established from the repository;
24
+ - `prototype` when a material design decision needs disposable empirical evidence;
25
+ - `codebase-design` when a deep-module, interface, or test-seam decision remains;
26
+ - `writing-for-agents` when the Contract creates or changes Skills, `AGENTS.md`, `CLAUDE.md`, or documents reached through agent pointers.
27
+
28
+ Order follows actual dependencies; never run a fixed companion sequence. Announce each invocation and reason. A correctly installed capability gets at most one same-capability Matrix fallback; installation-integrity failure stops the phase.
29
+
30
+ Long-lived domain, ADR, or research artifacts follow repository conventions, and material conclusions must be synchronized into the canonical design or plan. Prototypes default to an OS temporary directory unless the approved design promotes a project path. Companion output cannot own Matrix state or create a competing plan.
31
+
32
+ `wayfinder` and `improve-codebase-architecture` are explicit handoffs outside the active Design. Recommend one only when its purpose fits, then let the user invoke it; a selected result may enter a separate governed Change.
33
+
34
+ ## Process
35
+
36
+ 1. Establish repository facts and resolve only triggered design questions.
37
+ 2. Write and synchronize the canonical Matrix design and plan.
38
+ 3. Confirm material architecture choices with the user before freezing.
39
+ 4. Run the guard, then choose the implementation actor.
40
+
41
+ ```powershell
42
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard design
43
+ ```
44
+
45
+ ## Implementation Decision Point
46
+
47
+ After the design guard passes, the user chooses:
48
+
49
+ ### Option A: Continue with Codex (default)
50
+
51
+ Run transition and enter `$matrix-build`:
52
+
53
+ ```powershell
54
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition build
55
+ ```
56
+
57
+ Then enter `$matrix-build` to implement directly in this session.
58
+
59
+ ### Option B: Use Claude Code for implementation
60
+
61
+ First approve the frozen contract by transitioning to Build, then run `$matrix-claude` to export a bounded task package. This:
62
+ - Does not change the Build phase or state beyond the preceding transition
63
+ - Creates `artifacts/claude-task.md` with all implementation details
64
+ - Includes acceptance criteria, test seams, and required commands
65
+
66
+ After Claude Code completes and returns results, run the Build guard and enter `$matrix-verify`:
67
+
68
+ ```powershell
69
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard build
70
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition verify
71
+ ```
72
+
73
+ Then enter `$matrix-verify` to verify the implementation.
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Matrix Workflow"
3
- short_description: "Persistent development workflow stage"
4
- default_prompt: "Use $name to continue a Matrix development workflow."
1
+ interface:
2
+ display_name: "Matrix Workflow"
3
+ short_description: "Persistent development workflow stage"
4
+ default_prompt: "Use $name to continue a Matrix development workflow."
@@ -1,8 +1,8 @@
1
- ---
2
- name: matrix-hotfix
3
- description: Run a constrained Matrix workflow for a reproducible small bug. Use for a bug fix that has no material architecture, API, schema, or multi-module coordination impact.
4
- ---
5
-
6
- # Matrix Hotfix
7
-
1
+ ---
2
+ name: matrix-hotfix
3
+ description: Run a constrained Matrix workflow for a reproducible small bug. Use for a bug fix that has no material architecture, API, schema, or multi-module coordination impact.
4
+ ---
5
+
6
+ # Matrix Hotfix
7
+
8
8
  Start through `$matrix` with workflow `hotfix`. It uses the shared lightweight lifecycle `open → build → verify → archive`; there is no separate hotfix state machine. Before Build, record expected/actual behavior and a reproducible failure signal, present the compact Contract, and wait for confirmation. Build records reproduction and root-cause evidence; Verify records regression evidence. If the bug requires architecture, public API, schema, or broad coordination, use controlled Return to upgrade the change to full.
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Matrix Workflow"
3
- short_description: "Persistent development workflow stage"
4
- default_prompt: "Use $name to continue a Matrix development workflow."
1
+ interface:
2
+ display_name: "Matrix Workflow"
3
+ short_description: "Persistent development workflow stage"
4
+ default_prompt: "Use $name to continue a Matrix development workflow."
@@ -1,11 +1,11 @@
1
- ---
2
- name: matrix-open
3
- description: Open or resume the Matrix open phase by clarifying a development request into an evidence-backed proposal. Use after $matrix initializes a change or when the active Matrix phase is open.
4
- ---
5
-
1
+ ---
2
+ name: matrix-open
3
+ description: Open or resume the Matrix open phase by clarifying a development request into an evidence-backed proposal. Use after $matrix initializes a change or when the active Matrix phase is open.
4
+ ---
5
+
6
6
  # Matrix Open
7
7
 
8
- Run `matrix workflow inspect` and follow its `profile` and `evidence_policy`.
8
+ Run `node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect` and follow its `profile` and `evidence_policy`.
9
9
 
10
10
  Use its `artifact_language` for all proposal prose. Keep the required English heading tokens exactly as specified for Runtime guards; only the text beneath them is localized.
11
11
 
@@ -13,28 +13,30 @@ Use its `artifact_language` for all proposal prose. Keep the required English he
13
13
  - **lightweight**: produce the complete compact Contract before editing project implementation. Include `## Goal`, `## Scope`, `## Non-goals`, `## Approach`, `## Acceptance`, `## Validation`, `## Risks`, and `## Upgrade conditions`.
14
14
  - **hotfix evidence**: also include `## Expected behavior`, `## Actual behavior`, and `## Reproduction`.
15
15
  - **tweak evidence**: also include `## Current behavior`, `## Preserved behavior`, and `## Diff boundary`.
16
-
17
- ## Prim
18
-
19
- Use Matrix's own capability to clarify the request and write the proposal.
20
-
21
- ## Arch
22
-
23
- Invoke `grilling` only when material ambiguity remains or the user asks to stress-test the request. Invoke `domain-modeling` only when domain vocabulary, invariants, or an architectural decision is unclear. Announce the capability and reason before invoking it; selecting Arch already authorizes triggered capabilities.
24
-
25
- Companion output is evidence for the Matrix proposal. It must not create another workflow, proposal, confirmation state, or phase transition. If a correctly installed capability fails, perform at most one Matrix-owned fallback for that same capability and record the failure and evidence. Installation-integrity failures require `matrix init --with-mattpocock` and are not eligible for fallback.
26
-
27
- ## Process
28
-
29
- 1. Resolve only ambiguities required by the active workflow.
30
- 2. Write the canonical proposal and synchronize material companion conclusions into it.
16
+
17
+ ## Prim
18
+
19
+ Use Matrix's own capability to clarify the request and write the proposal.
20
+
21
+ ## Arch
22
+
23
+ Invoke `grilling` only when material ambiguity remains or the user asks to stress-test the request. Invoke `domain-modeling` only when domain vocabulary, invariants, or an architectural decision is unclear. Announce the capability and reason before invoking it; selecting Arch already authorizes triggered capabilities.
24
+
25
+ If progress is blocked by facts or decisions owned by another person, explain why `to-questionnaire` fits and ask the user to invoke it. Do not invoke the wrapper yourself.
26
+
27
+ Companion output is evidence for the Matrix proposal. It must not create another workflow, proposal, confirmation state, or phase transition. If a correctly installed capability fails, perform at most one Matrix-owned fallback for that same capability and record the failure and evidence. Installation-integrity failures require `matrix init --with-mattpocock` and are not eligible for fallback.
28
+
29
+ ## Process
30
+
31
+ 1. Resolve only ambiguities required by the active workflow.
32
+ 2. Write the canonical proposal and synchronize material companion conclusions into it.
31
33
  3. For full, ask for confirmation when scope or risk is material, then enter Design.
32
34
  4. For lightweight, always present the compact Contract and wait for explicit confirmation before entering Build.
33
35
 
34
36
  ```powershell
35
- matrix workflow guard open
37
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs guard open
36
38
  # full
37
- matrix workflow transition design
39
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition design
38
40
  # hotfix/tweak, only after explicit confirmation
39
- matrix workflow transition build --confirmed
41
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs transition build --confirmed
40
42
  ```
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Matrix Workflow"
3
+ short_description: "Persistent development workflow stage"
4
+ default_prompt: "Use $name to continue a Matrix development workflow."
@@ -1,15 +1,15 @@
1
- ---
2
- name: matrix-status
3
- description: Inspect the active Matrix workflow and report its disk-backed phase, guard result, and recovery command. Use when the user asks for Matrix status, next step, or to resume interrupted Matrix work.
4
- ---
5
-
6
- # Matrix Status
7
-
8
- Run the same Matrix state kernel used by the main entry and every phase Skill:
9
-
10
- ```powershell
11
- matrix workflow inspect
12
- matrix workflow doctor
13
- ```
14
-
1
+ ---
2
+ name: matrix-status
3
+ description: Inspect the active Matrix workflow and report its disk-backed phase, guard result, and recovery command. Use when the user asks for Matrix status, next step, or to resume interrupted Matrix work.
4
+ ---
5
+
6
+ # Matrix Status
7
+
8
+ Run the same Matrix state kernel used by the main entry and every phase Skill:
9
+
10
+ ```powershell
11
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs inspect
12
+ node <matrix-skill-directory>/scripts/matrix-runtime.mjs doctor
13
+ ```
14
+
15
15
  Report the returned change id, workflow, `profile`, `evidence_policy`, frozen `orchestration`, phase, guard result, `next_skill`, Workflow health, unfinished transactions, available strategies, and exact recovery commands. If Arch integrity fails, identify the affected platform/Skill facts and report `matrix init --with-mattpocock`; do not reinterpret the change as Prim. Both commands are read-only. Do not infer status from conversation history, run `--repair`, or modify state. If the guard is failing, name the missing evidence and direct the user to the current phase Skill.
@@ -1,4 +1,4 @@
1
- interface:
2
- display_name: "Matrix Status"
3
- short_description: "Inspect and recover active Matrix workflow state"
4
- default_prompt: "Use $matrix-status to inspect the active Matrix workflow."
1
+ interface:
2
+ display_name: "Matrix Status"
3
+ short_description: "Inspect and recover active Matrix workflow state"
4
+ default_prompt: "Use $matrix-status to inspect the active Matrix workflow."
@@ -1,8 +1,8 @@
1
- ---
2
- name: matrix-tweak
3
- description: Run a lightweight Matrix workflow for a bounded small development change. Use for a small request with no schema, public API, architecture, or cross-module coordination impact.
4
- ---
5
-
6
- # Matrix Tweak
7
-
1
+ ---
2
+ name: matrix-tweak
3
+ description: Run a lightweight Matrix workflow for a bounded small development change. Use for a small request with no schema, public API, architecture, or cross-module coordination impact.
4
+ ---
5
+
6
+ # Matrix Tweak
7
+
8
8
  Start through `$matrix` with workflow `tweak`. It uses the shared lightweight lifecycle `open → build → verify → archive`; there is no separate tweak state machine or Design phase. Before editing implementation, define current/preserved behavior, the diff boundary, acceptance, and validation in the compact proposal, present it, and wait for confirmation. Build and Verify must prove scope and diff alignment. Use controlled Return to upgrade to full when the change crosses module, API, schema, or architecture boundaries.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Matrix Workflow"
3
+ short_description: "Persistent development workflow stage"
4
+ default_prompt: "Use $name to continue a Matrix development workflow."