@rosenfan/matrix 0.1.1 → 0.1.3

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 (38) hide show
  1. package/.claude/skills/matrix/SKILL.md +60 -17
  2. package/.claude/skills/matrix/agents/openai.yaml +4 -4
  3. package/.claude/skills/matrix/scripts/matrix_claude.py +3 -158
  4. package/.claude/skills/matrix/scripts/matrix_state.py +53 -107
  5. package/.claude/skills/matrix-archive/SKILL.md +23 -13
  6. package/.claude/skills/matrix-build/SKILL.md +24 -35
  7. package/.claude/skills/matrix-claude/SKILL.md +26 -24
  8. package/.claude/skills/matrix-design/SKILL.md +29 -26
  9. package/.claude/skills/matrix-hotfix/SKILL.md +8 -8
  10. package/.claude/skills/matrix-open/SKILL.md +25 -18
  11. package/.claude/skills/matrix-status/SKILL.md +3 -2
  12. package/.claude/skills/matrix-tweak/SKILL.md +8 -8
  13. package/.claude/skills/matrix-verify/SKILL.md +21 -30
  14. package/LICENSE +21 -21
  15. package/README.md +294 -255
  16. package/README.zh-CN.md +293 -255
  17. package/assets/skills-zh-CN/matrix/SKILL.md +80 -25
  18. package/assets/skills-zh-CN/matrix-archive/SKILL.md +33 -9
  19. package/assets/skills-zh-CN/matrix-build/SKILL.md +36 -10
  20. package/assets/skills-zh-CN/matrix-claude/SKILL.md +31 -28
  21. package/assets/skills-zh-CN/matrix-design/SKILL.md +19 -10
  22. package/assets/skills-zh-CN/matrix-hotfix/SKILL.md +8 -8
  23. package/assets/skills-zh-CN/matrix-open/SKILL.md +22 -7
  24. package/assets/skills-zh-CN/matrix-status/SKILL.md +15 -14
  25. package/assets/skills-zh-CN/matrix-tweak/SKILL.md +8 -8
  26. package/assets/skills-zh-CN/matrix-verify/SKILL.md +26 -10
  27. package/bin/matrix.js +15 -15
  28. package/package.json +56 -56
  29. package/src/catalog.js +92 -87
  30. package/src/cli.js +159 -101
  31. package/src/distribution.js +281 -186
  32. package/src/installer.js +45 -45
  33. package/src/matt.js +45 -45
  34. package/src/messages.js +33 -33
  35. package/src/self-update.js +81 -0
  36. package/src/ui.js +89 -89
  37. package/src/workflow-transaction.js +622 -0
  38. package/src/workflow.js +787 -82
package/README.md CHANGED
@@ -1,273 +1,312 @@
1
- # Matrix Workflow
1
+ # Matrix Workflow
2
+
3
+ An evidence-driven development workflow with Prim and Arch orchestration, inspired by [Comet](https://github.com/rpamis/comet). Matrix can work with its own capabilities or conditionally invoke a verified cohort of [Matt Pocock's agent skills](https://github.com/mattpocock/skills) without giving up lifecycle ownership.
4
+
5
+ English | **[中文](./README.zh-CN.md)**
6
+
7
+ <p align="center">
8
+ <img src="./assets/matrix-workflow-poster-en.svg" alt="Matrix Workflow" width="100%">
9
+ </p>
10
+
11
+ ---
12
+
13
+ ## Table of Contents
14
+
15
+ - [Why Matrix?](#why-matrix)
16
+ - [What It Does](#what-it-does)
17
+ - [Prerequisites](#prerequisites)
18
+ - [Installation](#installation)
19
+ - [Quick Start](#quick-start)
20
+ - [Workflow Phases](#workflow-phases)
21
+ - [How It Works](#how-it-works)
22
+ - [Workflow Types](#workflow-types)
23
+ - [Integration with Matt Pocock's Skills](#integration-with-matt-pococks-skills)
24
+ - [License](#license)
25
+
26
+ ---
27
+
28
+ ## Why Matrix
29
+
30
+ [Matt Pocock's skills](https://github.com/mattpocock/skills) provide focused capabilities such as `/grilling`, `/tdd`, and `/code-review`. Using independent tools without a lifecycle owner leads to common problems:
31
+
32
+ - **No process memory**: You grill, then implement, but there's no record of what was decided
33
+ - **Phase confusion**: Did we finish design? Are we in build? Hard to tell after context loss
34
+ - **Silent scope creep**: Requirements change mid-build without returning to design
35
+ - **Missing evidence**: "Looks done" without verification proof
36
+
37
+ Matrix solves this with one deterministic state machine, explicit phases, guard conditions, and artifact tracking — inspired by [Comet](https://github.com/rpamis/comet)'s phase-based approach. Skills can assist a phase, but Matrix always owns the lifecycle.
38
+
39
+ ---
40
+
41
+ ## What It Does
42
+
43
+ Matrix provides two capability-orchestration modes over two centrally defined workflow profiles:
2
44
 
3
- A structured workflow orchestrator for [Matt Pocock's Claude Code skills](https://github.com/mattpocock/skills), inspired by [Comet](https://github.com/rpamis/comet). It enforces evidence-based phase transitions to standardize your development process when using these skills.
4
-
5
- English | **[中文](./README.zh-CN.md)**
6
-
7
- <p align="center">
8
- <img src="./assets/matrix-workflow-poster-en.svg" alt="Matrix Workflow" width="100%">
9
- </p>
10
-
11
- ---
12
-
13
- ## Table of Contents
14
-
15
- - [Why Matrix?](#why-matrix)
16
- - [What It Does](#what-it-does)
17
- - [Prerequisites](#prerequisites)
18
- - [Installation](#installation)
19
- - [Quick Start](#quick-start)
20
- - [Workflow Phases](#workflow-phases)
21
- - [How It Works](#how-it-works)
22
- - [Workflow Types](#workflow-types)
23
- - [Integration with Matt Pocock's Skills](#integration-with-matt-pococks-skills)
24
- - [License](#license)
25
-
26
- ---
27
-
28
- ## Why Matrix
29
-
30
- [Matt Pocock's skills](https://github.com/mattpocock/skills) are excellent individual tools — `/grill-with-docs` for requirements, `/tdd` for test-driven development, `/implement` for execution. But using them in isolation leads to common problems:
31
-
32
- - **No process memory**: You grill, then implement, but there's no record of what was decided
33
- - **Phase confusion**: Did we finish design? Are we in build? Hard to tell after context loss
34
- - **Silent scope creep**: Requirements change mid-build without returning to design
35
- - **Missing evidence**: "Looks done" without verification proof
36
-
37
- Matrix solves this by wrapping these skills into a deterministic state machine with explicit phases, guard conditions, and artifact tracking — inspired by [Comet](https://github.com/rpamis/comet)'s phase-based approach.
38
-
39
- ---
40
-
41
- ## What It Does
42
-
43
- Matrix orchestrates Matt Pocock's skills into a structured workflow:
44
-
45
- ```
46
- open → design → build → verify → archive
47
- ↓ ↓ ↓ ↓ ↓
48
- grill plan implement tdd commit
49
- design review
50
- ```
51
-
52
- Each phase:
53
- - Has specific deliverables (artifacts)
54
- - Has guard conditions that must pass
55
- - Logs all transitions
56
- - Survives context loss (state on disk)
57
-
58
- ---
59
-
60
- ## Prerequisites
61
-
62
- - [Claude Code](https://docs.anthropic.com/claude-code) and/or Codex installed
63
- - Node.js 18+ (for the installer)
64
- - Python is optional during the compatibility window; new installations run the bundled Node workflow runtime.
65
-
66
- ---
67
-
68
- ## Installation
69
-
70
- Install the Matrix CLI once:
71
-
72
- ```bash
73
- npm install --global @rosenfan/matrix
74
45
  ```
75
-
76
- Then initialize Matrix inside any project:
77
-
78
- ```bash
79
- cd /path/to/your/project
80
- matrix init
81
- ```
82
-
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
+ ```
52
+
53
+ Recovery paths are controlled Runtime intents:
54
+
55
+ ```text
56
+ build --design-gap--------------------> design
57
+ verify --verification-failed-----------> build
58
+ verify --acceptance-or-design-gap------> design
59
+ any active phase --abort--------------> aborted
60
+ ```
61
+
62
+ Each phase:
63
+ - Has specific deliverables (artifacts)
64
+ - Has guard conditions that must pass
65
+ - Logs all transitions
66
+ - Survives context loss (state on disk)
67
+
68
+ ---
69
+
70
+ ## Prerequisites
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.
76
+
77
+ ---
78
+
79
+ ## Installation
80
+
81
+ Install the Matrix CLI once:
82
+
83
+ ```bash
84
+ npm install --global @rosenfan/matrix
85
+ ```
86
+
87
+ Then initialize Matrix inside any project:
88
+
89
+ ```bash
90
+ cd /path/to/your/project
91
+ matrix init
92
+ ```
93
+
83
94
  The interactive setup lets you:
84
-
85
- - Choose English or Chinese, project or global scope, and Claude Code, Codex, or both
86
- - Copy skills (recommended) or symlink them for local development
87
- - Safely update an existing installation with an automatic backup
88
- - Install Matt Pocock's companion skills in the same flow
89
-
95
+
96
+ - Choose English or Chinese, project or global scope, and Claude Code, Codex, or both
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
100
+ - Choose **Prim** or **Arch** as the project default without disabling the other available mode
101
+
90
102
  For automation and CI:
91
-
92
- ```bash
93
- # Safe non-interactive installation for both verified platforms
94
- matrix init --yes --platform claude-code --platform codex --with-mattpocock
95
-
96
- # Preview exactly what would change (including backups) without writing
97
- matrix init --platform codex --dry-run --json
98
-
103
+
104
+ ```bash
105
+ # Safe non-interactive installation for both verified platforms
106
+ matrix init --yes --platform claude-code --platform codex --with-mattpocock
107
+
108
+ # Explicitly select the project default
109
+ matrix init --yes --with-mattpocock --default-orchestration arch
110
+
111
+ # Preview exactly what would change (including backups) without writing
112
+ matrix init --platform codex --dry-run --json
113
+
99
114
  # Inspect Matrix ownership, Matt Skills inheritance, and the selected platform
100
115
  matrix doctor --platform codex
101
116
  ```
102
117
 
103
- Until the npm package is published, install directly from GitHub:
118
+ Update an initialized project:
104
119
 
105
120
  ```bash
106
- npm install --global github:Rosenfan/Matrix
107
- ```
121
+ # Check for a newer Matrix CLI, confirm the plan, then refresh this project's installed assets
122
+ matrix update
108
123
 
109
- Matrix installs:
110
- - `matrix/` — Entry point and state management
111
- - `matrix-open/` — Open phase (uses `/grill-with-docs`)
112
- - `matrix-design/` — Design phase (uses `/prototype`, `/research`)
113
- - `matrix-build/` — Build phase (uses `/implement`, `/tdd`)
114
- - `matrix-verify/` — Verify phase (uses `/code-review`)
115
- - `matrix-archive/` — Archive phase
116
- - `matrix-hotfix/` — Shortcut for small bugs
117
- - `matrix-tweak/` — Shortcut for bounded changes
118
- - `matrix-status/` — Check current state
119
- - `matrix-claude/` — Optional: export for Claude Code
120
-
121
- ---
122
-
123
- ## Quick Start
124
-
125
- In Claude Code:
124
+ # Offline or local-development refresh: skip the npm registry and use the current CLI package
125
+ matrix update --skip-self-update
126
126
 
127
+ # Non-interactive update after CI has explicitly authorized writes
128
+ matrix update --yes
127
129
  ```
128
- $matrix I want to add user authentication
129
- ```
130
-
131
- Matrix will:
132
- 1. Initialize a change with workflow type `full`
133
- 2. Enter `open` phase → invokes `/grill-with-docs` to clarify requirements
134
- 3. Create `proposal.md` with Goal, Scope, Acceptance, Risks
135
- 4. Guard check: are all sections substantive?
136
- 5. If pass → transition to `design`
137
130
 
138
- ---
139
-
140
- ## Workflow Phases
141
-
142
- | Phase | Matt Pocock Skills Used | Deliverables | Guard Condition |
143
- |-------|-------------------------|--------------|-----------------|
144
- | **open** | `/grill-with-docs` (auto-invokes `/grilling` + `/domain-modeling`) | `proposal.md`, `CONTEXT.md`, ADRs | Goal, Scope, Acceptance, Risks present |
145
- | **design** | `/domain-modeling` → `/research` → `/wayfinder` → `/prototype` → `/codebase-design` | `design.md`, `plan.md` | Decisions, Test seams, Steps documented |
146
- | **build** | `/implement` (auto-invokes `/tdd` + `/code-review`), `/diagnosing-bugs`, `/resolving-merge-conflicts` | Code, `verification.md` | Plan exists, build evidence recorded |
147
- | **verify** | `/code-review` (two-axis: Standards + Spec), `/improve-codebase-architecture` | Test & review evidence | Test and review evidence present |
148
- | **archive** | — | Git commit | Verify guard passed |
149
-
150
- ---
151
-
152
- ## How It Works
153
-
154
- State is stored in `.matrix/`:
155
-
156
- ```
157
- .matrix/
158
- ├── active.json # Current change ID
159
- ├── config.yaml
160
- ├── changes/
161
- │ └── <change-id>/
162
- │ ├── matrix.yaml # Phase, workflow, timestamps
163
- │ ├── run-state.json
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:
136
+
137
+ ```bash
138
+ npm install --global github:Rosenfan/Matrix
139
+ ```
140
+
141
+ Matrix installs:
142
+ - `matrix/` — Entry point and state management
143
+ - `matrix-open/` — Open phase and canonical proposal
144
+ - `matrix-design/` — Design, plan, and Contract approval
145
+ - `matrix-build/` — Bounded implementation and build evidence
146
+ - `matrix-verify/` — Test and two-axis review evidence
147
+ - `matrix-archive/` — Archive phase
148
+ - `matrix-hotfix/` — Shortcut for small bugs
149
+ - `matrix-tweak/` — Shortcut for bounded changes
150
+ - `matrix-status/` — Check current state
151
+ - `matrix-claude/` — Optional: export for Claude Code
152
+
153
+ ---
154
+
155
+ ## Quick Start
156
+
157
+ In Claude Code:
158
+
159
+ ```
160
+ $matrix I want to add user authentication
161
+ ```
162
+
163
+ Matrix will:
164
+ 1. Initialize a change with workflow type `full` and frozen orchestration `prim|arch`
165
+ 2. Enter `open`; Prim works directly, while Arch invokes only proven requirement triggers
166
+ 3. Create `proposal.md` with Goal, Scope, Non-goals, Acceptance, Risks
167
+ 4. Guard check: are all sections substantive?
168
+ 5. If pass → transition to `design`
169
+
170
+ ---
171
+
172
+ ## Workflow Phases
173
+
174
+ | Phase | Arch capabilities (triggered, not a fixed sequence) | Deliverables | Guard Condition |
175
+ |-------|------------------------------------------------------|--------------|-----------------|
176
+ | **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 |
180
+ | **archive** | None; Matrix-owned in both modes | Archive record | Verify guard passed |
181
+
182
+ ---
183
+
184
+ ## How It Works
185
+
186
+ State is stored in `.matrix/`:
187
+
188
+ ```
189
+ .matrix/
190
+ ├── active.json # Current change ID
191
+ ├── config.yaml
192
+ ├── changes/
193
+ │ └── <change-id>/
194
+ │ ├── matrix.yaml # Canonical workflow, orchestration, phase, status, revision
195
+ │ ├── workspace-baseline.json # Lightweight implementation-order boundary
164
196
  │ ├── events.jsonl
165
- │ └── artifacts/
166
- │ ├── proposal.md
167
- │ ├── design.md
168
- │ ├── plan.md
169
- │ └── verification.md
170
- └── archive/
171
- ```
172
-
173
- The state machine enforces transitions:
174
-
175
- ```bash
176
- # Check guard
177
- python .claude/skills/matrix/scripts/matrix_state.py guard open
178
-
197
+ │ └── artifacts/
198
+ │ ├── proposal.md
199
+ │ ├── design.md
200
+ │ ├── plan.md
201
+ │ ├── verification.md
202
+ │ └── evidence-history/
203
+ └── archive/
204
+ ```
205
+
206
+ The state machine enforces transitions:
207
+
208
+ ```bash
209
+ # Check guard
210
+ matrix workflow guard open
211
+
179
212
  # Advance (only if guard passes)
180
- python .claude/skills/matrix/scripts/matrix_state.py transition design
181
- ```
182
-
183
- ---
184
-
185
- ## Workflow Types
186
-
187
- | Type | When to Use | Phases |
188
- |------|-------------|--------|
189
- | **full** | New features, architecture changes | All 5 phases |
190
- | **hotfix** | Reproducible small bugs | Simplified: open → build → verify → archive |
213
+ matrix workflow transition design
214
+
215
+ # Lightweight: approve the compact proposal and enter Build
216
+ matrix workflow transition build --confirmed
217
+
218
+ # Return from verification failure; stale evidence is retained in history
219
+ matrix workflow return build --reason verification-failed
220
+
221
+ # Abort without deleting artifacts or undoing worktree changes
222
+ matrix workflow abort --reason requirement-cancelled
223
+
224
+ # Final Archive is a mandatory two-step optimistic commit
225
+ matrix workflow archive --dry-run
226
+ matrix workflow archive --expect-preflight <sha256-returned-by-dry-run>
227
+ # hotfix/tweak commit command additionally carries --confirmed
228
+
229
+ # Diagnose an interrupted Workflow without writing
230
+ matrix workflow doctor
231
+
232
+ # Repair only the exact transaction or stale lock reported by doctor
233
+ matrix workflow doctor --repair --transaction <id> --strategy <continue|rollback>
234
+ matrix workflow doctor --repair --lock <id>
235
+ ```
236
+
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.
238
+
239
+ ---
240
+
241
+ ## Workflow Types
242
+
243
+ | Type | When to Use | Phases |
244
+ |------|-------------|--------|
245
+ | **full** | New features, architecture changes | All 5 phases |
246
+ | **hotfix** | Reproducible small bugs | Simplified: open → build → verify → archive |
191
247
  | **tweak** | Bounded changes, no API/schema impact | Simplified: open → build → verify → archive |
192
248
 
193
- ---
194
-
195
- ## Special Feature: matrix-claude
196
-
197
- **Default usage**: Just use the main workflow (`$matrix`). Whether you're using Codex or Claude Code, the standard flow works for both:
198
-
199
- ```
200
- $matrix → open → design → build → verify → archive
201
- ```
202
-
203
- **When to use `$matrix-claude`**: Only when you want to **split the work across tools** — use Codex for design, then hand off to Claude Code for implementation.
204
-
205
- | Scenario | What to Do |
206
- |----------|------------|
207
- | Use one tool for everything (default) | Just use `$matrix`, no extra steps |
208
- | Codex designs + Codex implements | Standard flow: design → build → verify |
209
- | Codex designs + Claude Code implements | design → `$matrix-claude` → Claude Code → verify |
210
-
211
- ### How matrix-claude Works
212
-
213
- 1. Design phase completes, guard passes
214
- 2. Run `$matrix-claude` → exports frozen design as `artifacts/claude-task.md`
215
- 3. Claude Code reads the task package and implements
216
- 4. Claude Code produces evidence in `artifacts/verification.md`
217
- 5. Return to Matrix: build guard → verify → archive
218
-
219
- The sidecar does NOT change Matrix state. It's a pure export — like taking a snapshot of the design for another tool to consume.
220
-
221
- ---
222
-
223
- ## Integration with Matt Pocock's Skills
224
-
225
- Matrix is designed to work **on top of** Matt Pocock's skills, not replace them. Here's how they map:
226
-
227
- ### open Phase
228
-
229
- | Skill | How Matrix Uses It |
230
- |-------|-------------------|
231
- | `/grill-with-docs` | Main skill: runs `/grilling` + `/domain-modeling` to clarify requirements |
232
- | `/grilling` | Stress-tests the plan through relentless Q&A |
233
- | `/domain-modeling` | Establishes shared vocabulary, creates `CONTEXT.md` and ADRs |
234
-
235
- ### design Phase (Recommended Order)
236
-
237
- | Order | Skill | How Matrix Uses It |
238
- |-------|-------|-------------------|
239
- | 1 | `/domain-modeling` | Establish or refine domain vocabulary from the proposal |
240
- | 2 | `/research` | Investigate external APIs, docs, specs (runs in background) |
241
- | 3 | `/wayfinder` | Explore complex codebase structure and dependencies |
242
- | 4 | `/prototype` | Validate design questions with throwaway experiments |
243
- | 5 | `/codebase-design` | Define module boundaries, interfaces, test seams |
244
-
245
- ### build Phase
246
-
247
- | Skill | How Matrix Uses It |
248
- |-------|-------------------|
249
- | `/implement` | Main skill: executes plan with TDD, then runs code review, then commits |
250
- | `/tdd` | Auto-invoked by `/implement`: red-green-refactor at pre-agreed seams |
251
- | `/diagnosing-bugs` | On failure: builds tight feedback loop before fixing |
252
- | `/resolving-merge-conflicts` | On merge conflicts: systematic resolution |
253
-
254
- ### verify Phase
255
-
256
- | Skill | How Matrix Uses It |
257
- |-------|-------------------|
258
- | `/code-review` | Two-axis review: **Standards** (coding conventions) + **Spec** (requirements fidelity) |
259
- | `/improve-codebase-architecture` | Optional: scan for shallow-module deepening opportunities |
260
-
261
- ---
262
-
263
- **Key difference**: Matt Pocock's skills are individual tools. Matrix adds:
264
- - **State persistence**: Survives context loss
265
- - **Phase enforcement**: Can't skip design and jump to build
266
- - **Evidence requirements**: Guards check for artifacts, not assertions
267
- - **Transition logging**: Full audit trail of phase changes
268
-
269
- ---
270
-
271
- ## License
272
-
273
- [MIT](./LICENSE)
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
+
251
+ ---
252
+
253
+ ## Special Feature: matrix-claude
254
+
255
+ **Default usage**: Just use the main workflow (`$matrix`). Whether you're using Codex or Claude Code, the standard flow works for both:
256
+
257
+ ```
258
+ $matrix → open → design → build → verify → archive
259
+ ```
260
+
261
+ **When to use `$matrix-claude`**: Only when you want to **split the work across tools** — use Codex for design, then hand off to Claude Code for implementation.
262
+
263
+ | Scenario | What to Do |
264
+ |----------|------------|
265
+ | Use one tool for everything (default) | Just use `$matrix`, no extra steps |
266
+ | Codex designs + Codex implements | Standard flow: design → build → verify |
267
+ | Codex designs + Claude Code implements | design → `$matrix-claude` → Claude Code → verify |
268
+
269
+ ### How matrix-claude Works
270
+
271
+ 1. Design phase completes, guard passes
272
+ 2. Run `$matrix-claude` → exports frozen design as `artifacts/claude-task.md`
273
+ 3. Claude Code reads the task package and implements
274
+ 4. Claude Code produces evidence in `artifacts/verification.md`
275
+ 5. Return to Matrix: build guard → verify → archive
276
+
277
+ The sidecar does NOT change Matrix state. It's a pure export — like taking a snapshot of the design for another tool to consume.
278
+
279
+ ---
280
+
281
+ ## Integration with Matt Pocock's Skills
282
+
283
+ Prim uses Matrix's own capability. Arch uses one initialization-verified cohort of ten atomic capabilities:
284
+
285
+ | Phase | Capability | Trigger |
286
+ |---|---|---|
287
+ | open | `/grilling` | Material ambiguity or explicit stress-test request |
288
+ | open/design | `/domain-modeling` | Unclear vocabulary, invariants, or architectural decisions |
289
+ | design | `/research` | Required external facts are unavailable in the repository |
290
+ | design | `/wayfinder` | Module ownership or dependency seams are unknown |
291
+ | design | `/prototype` | A material design question needs disposable evidence |
292
+ | design | `/codebase-design` | A deep-module, interface, or test-seam decision remains |
293
+ | build | `/tdd` | Observable behavior changes at a testable seam |
294
+ | 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 |
296
+ | verify | `/code-review` | Standards and Spec review evidence is required |
297
+
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.
299
+
300
+ ---
301
+
302
+ **Key difference**: Matt Pocock's skills are individual tools. Matrix adds:
303
+ - **State persistence**: Survives context loss
304
+ - **Phase enforcement**: Full cannot skip Design; lightweight cannot edit implementation before its confirmed Open Contract
305
+ - **Evidence requirements**: Guards check for artifacts, not assertions
306
+ - **Transition logging**: Full audit trail of phase changes
307
+
308
+ ---
309
+
310
+ ## License
311
+
312
+ [MIT](./LICENSE)