substrate-ai 0.1.33 → 0.2.0
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 +33 -63
- package/dist/cli/index.js +4586 -18398
- package/dist/cli/templates/claude-md-substrate-section.md +3 -3
- package/dist/decisions-BBLMsN_c.js +336 -0
- package/dist/decisions-WIsicZiG.js +3 -0
- package/dist/errors-BPqtzQ4U.js +111 -0
- package/dist/event-bus-J-bw-pkp.js +1549 -0
- package/dist/experimenter-BSu2ie3J.js +484 -0
- package/dist/git-utils-BtI5eNoN.js +365 -0
- package/dist/index.d.ts +89 -137
- package/dist/index.js +5 -305
- package/dist/logger-C6n1g8uP.js +119 -0
- package/dist/metrics-BSg8VIHd.js +184 -0
- package/dist/run-CRmhkcwN.js +7 -0
- package/dist/run-DlOWhkIF.js +10725 -0
- package/dist/{upgrade-CS2i2Qy5.js → upgrade-BjYVeC6G.js} +2 -3
- package/dist/{upgrade-CIAel_WS.js → upgrade-rV26kdh3.js} +2 -2
- package/dist/version-manager-impl-9N_519Ey.js +3 -0
- package/dist/{version-manager-impl-CcCP8PzG.js → version-manager-impl-BpVx2DkY.js} +101 -3
- package/package.json +1 -1
- package/packs/bmad/prompts/ux-step-3-journeys.md +3 -3
- package/dist/app-CY3MaJtP.js +0 -6342
- package/dist/cli/templates/parallel.yaml +0 -72
- package/dist/cli/templates/research-then-implement.yaml +0 -103
- package/dist/cli/templates/review-cycle.yaml +0 -91
- package/dist/cli/templates/sequential.yaml +0 -68
- package/dist/config-schema-C9tTMcm1.js +0 -102
- package/dist/version-manager-impl-LhLAyrCL.js +0 -4
package/README.md
CHANGED
|
@@ -50,20 +50,20 @@ The primary way to use Substrate is from inside a Claude Code session. Substrate
|
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
52
|
npm install substrate-ai
|
|
53
|
-
[npx] substrate
|
|
53
|
+
[npx] substrate init
|
|
54
54
|
```
|
|
55
55
|
|
|
56
56
|
This scaffolds CLAUDE.md with a `## Substrate Pipeline` section containing behavioral directives. Claude Code reads this on session start.
|
|
57
57
|
|
|
58
|
-
2. **Start a Claude Code session.** Claude sees the substrate instructions automatically and knows to run `substrate
|
|
58
|
+
2. **Start a Claude Code session.** Claude sees the substrate instructions automatically and knows to run `substrate run --help-agent` on first use to learn the full event protocol, commands, and interaction patterns.
|
|
59
59
|
|
|
60
60
|
3. **Tell Claude what to build.** Claude drives the pipeline conversationally — running stories, parsing structured events, handling escalations, offering to fix review issues, and summarizing results. You stay in control: Claude always asks before re-running failed stories or applying fixes.
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
# What Claude runs under the hood:
|
|
64
|
-
substrate
|
|
65
|
-
substrate
|
|
66
|
-
substrate
|
|
64
|
+
substrate run --events --stories 7-1,7-2 # Structured NDJSON for Claude to parse
|
|
65
|
+
substrate run # Human-readable progress (default)
|
|
66
|
+
substrate run --help-agent # Full protocol reference (<2000 tokens)
|
|
67
67
|
```
|
|
68
68
|
|
|
69
69
|
### Pick Up an Existing BMAD Project
|
|
@@ -83,7 +83,7 @@ Already have a project with BMAD artifacts (from vanilla BMAD, the Beads-based a
|
|
|
83
83
|
|
|
84
84
|
```bash
|
|
85
85
|
npm install substrate-ai
|
|
86
|
-
[npx] substrate
|
|
86
|
+
[npx] substrate init
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
**Then start a Claude Code session and tell it what to do:**
|
|
@@ -100,11 +100,11 @@ Substrate also runs standalone without an AI agent driving it:
|
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
102
|
[npx] substrate brainstorm # Explore your idea
|
|
103
|
-
[npx] substrate
|
|
104
|
-
[npx] substrate
|
|
105
|
-
[npx] substrate
|
|
106
|
-
[npx] substrate
|
|
107
|
-
[npx] substrate
|
|
103
|
+
[npx] substrate init # Set up methodology pack
|
|
104
|
+
[npx] substrate run # Full pipeline: analysis → implement
|
|
105
|
+
[npx] substrate run --from solutioning # Skip to a specific phase
|
|
106
|
+
[npx] substrate resume # Pick up where you left off
|
|
107
|
+
[npx] substrate status # Check pipeline progress
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
The pipeline walks through the full software development lifecycle: analysis, planning, solutioning, and implementation — dispatching agents to build, test, and code-review each story.
|
|
@@ -121,7 +121,7 @@ Substrate dispatches work to CLI-based AI agents running as child processes. It
|
|
|
121
121
|
|
|
122
122
|
All three agents are fully supported as worker targets. Substrate auto-discovers available agents and routes work based on adapter health checks and configuration.
|
|
123
123
|
|
|
124
|
-
> **Note on agent scaffolding:** Separately from worker dispatch, Substrate can also scaffold instruction files that teach an AI agent how to *drive* the pipeline as a front-end. Today, `substrate
|
|
124
|
+
> **Note on agent scaffolding:** Separately from worker dispatch, Substrate can also scaffold instruction files that teach an AI agent how to *drive* the pipeline as a front-end. Today, `substrate init` generates a CLAUDE.md scaffold for Claude Code (see [AI Agent Integration](#ai-agent-integration)). Equivalent scaffolds for Codex (`AGENTS.md`) and Gemini (`GEMINI.md`) are planned.
|
|
125
125
|
|
|
126
126
|
## Pipeline Observability
|
|
127
127
|
|
|
@@ -129,10 +129,10 @@ Substrate provides multiple output modes for monitoring pipeline execution.
|
|
|
129
129
|
|
|
130
130
|
### Human-Readable Progress (default)
|
|
131
131
|
|
|
132
|
-
`substrate
|
|
132
|
+
`substrate run` displays compact, updating progress lines with color:
|
|
133
133
|
|
|
134
134
|
```
|
|
135
|
-
substrate
|
|
135
|
+
substrate run — 6 stories, concurrency 3
|
|
136
136
|
|
|
137
137
|
[create] 7-1 creating story...
|
|
138
138
|
[dev] 7-2 implementing...
|
|
@@ -154,8 +154,8 @@ Pipeline complete: 5 succeeded, 0 failed, 1 escalated
|
|
|
154
154
|
For programmatic consumption, `--events` emits newline-delimited JSON events on stdout:
|
|
155
155
|
|
|
156
156
|
```bash
|
|
157
|
-
[npx] substrate
|
|
158
|
-
[npx] substrate
|
|
157
|
+
[npx] substrate run --events
|
|
158
|
+
[npx] substrate run --events --stories 7-1,7-2
|
|
159
159
|
```
|
|
160
160
|
|
|
161
161
|
Seven event types form a discriminated union on the `type` field:
|
|
@@ -190,7 +190,7 @@ Substrate is designed to be operated by AI agents, not just humans. Two mechanis
|
|
|
190
190
|
### Self-Describing CLI (`--help-agent`)
|
|
191
191
|
|
|
192
192
|
```bash
|
|
193
|
-
[npx] substrate
|
|
193
|
+
[npx] substrate run --help-agent
|
|
194
194
|
```
|
|
195
195
|
|
|
196
196
|
Outputs a machine-optimized markdown prompt fragment (<2000 tokens) that an AI agent can ingest as a system prompt. Generated from the same TypeScript type definitions as the event emitter, so documentation never drifts from implementation. Includes:
|
|
@@ -202,7 +202,7 @@ Outputs a machine-optimized markdown prompt fragment (<2000 tokens) that an AI a
|
|
|
202
202
|
|
|
203
203
|
### CLAUDE.md Scaffold
|
|
204
204
|
|
|
205
|
-
`substrate
|
|
205
|
+
`substrate init` injects a `## Substrate Pipeline` section into your project's CLAUDE.md with behavioral directives for Claude Code:
|
|
206
206
|
|
|
207
207
|
- Instructions to run `--help-agent` on first use
|
|
208
208
|
- Event-driven interaction patterns (escalation handling, fix offers, confirmation requirements)
|
|
@@ -216,28 +216,32 @@ Outputs a machine-optimized markdown prompt fragment (<2000 tokens) that an AI a
|
|
|
216
216
|
| Command | Description |
|
|
217
217
|
|---------|-------------|
|
|
218
218
|
| `substrate brainstorm` | Interactive multi-persona ideation session |
|
|
219
|
-
| `substrate
|
|
220
|
-
| `substrate
|
|
221
|
-
| `substrate
|
|
222
|
-
| `substrate
|
|
223
|
-
| `substrate
|
|
224
|
-
| `substrate
|
|
225
|
-
| `substrate
|
|
226
|
-
| `substrate
|
|
219
|
+
| `substrate init` | Initialize methodology pack for autonomous pipeline |
|
|
220
|
+
| `substrate run` | Run the full pipeline (analysis → implement) |
|
|
221
|
+
| `substrate run --events` | Emit NDJSON event stream on stdout |
|
|
222
|
+
| `substrate run --verbose` | Show full pino log output on stderr |
|
|
223
|
+
| `substrate run --help-agent` | Print agent instruction prompt fragment and exit |
|
|
224
|
+
| `substrate run --from <phase>` | Start from a specific phase |
|
|
225
|
+
| `substrate resume` | Resume an interrupted pipeline run |
|
|
226
|
+
| `substrate status` | Show pipeline run status |
|
|
227
227
|
|
|
228
|
-
###
|
|
228
|
+
### Observability
|
|
229
229
|
|
|
230
230
|
| Command | Description |
|
|
231
231
|
|---------|-------------|
|
|
232
|
+
| `substrate health` | Check pipeline health, stall detection, and process status |
|
|
233
|
+
| `substrate supervisor` | Long-running monitor that kills stalled runs and auto-restarts |
|
|
234
|
+
| `substrate metrics` | Historical pipeline run metrics and cross-run comparison |
|
|
232
235
|
| `substrate monitor status` | View task metrics and agent performance |
|
|
233
236
|
| `substrate monitor report` | Generate a detailed performance report |
|
|
234
|
-
| `substrate cost
|
|
237
|
+
| `substrate cost` | View cost and token usage summary |
|
|
235
238
|
|
|
236
239
|
### Setup
|
|
237
240
|
|
|
238
241
|
| Command | Description |
|
|
239
242
|
|---------|-------------|
|
|
240
|
-
| `substrate
|
|
243
|
+
| `substrate adapters` | List and check available AI agent adapters |
|
|
244
|
+
| `substrate config` | Show, set, export, or import configuration |
|
|
241
245
|
| `substrate --help` | Show all available commands |
|
|
242
246
|
|
|
243
247
|
## Configuration
|
|
@@ -268,40 +272,6 @@ npm run typecheck
|
|
|
268
272
|
npm run lint
|
|
269
273
|
```
|
|
270
274
|
|
|
271
|
-
## Manual Task Graphs
|
|
272
|
-
|
|
273
|
-
For fine-grained control, you can define exactly what agents should do in a YAML task graph:
|
|
274
|
-
|
|
275
|
-
```yaml
|
|
276
|
-
version: "1"
|
|
277
|
-
session:
|
|
278
|
-
name: "my-tasks"
|
|
279
|
-
tasks:
|
|
280
|
-
write-tests:
|
|
281
|
-
name: "Write unit tests"
|
|
282
|
-
prompt: |
|
|
283
|
-
Look at the src/utils/ directory.
|
|
284
|
-
Write comprehensive unit tests for all exported functions.
|
|
285
|
-
type: testing
|
|
286
|
-
agent: claude-code
|
|
287
|
-
update-docs:
|
|
288
|
-
name: "Update README"
|
|
289
|
-
prompt: |
|
|
290
|
-
Read the README.md and verify it accurately describes
|
|
291
|
-
the project. Fix any inaccuracies.
|
|
292
|
-
type: docs
|
|
293
|
-
agent: codex
|
|
294
|
-
depends_on:
|
|
295
|
-
- write-tests
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
```bash
|
|
299
|
-
[npx] substrate start --graph tasks.yaml # Execute the graph
|
|
300
|
-
[npx] substrate plan --graph tasks.yaml # Preview without running
|
|
301
|
-
```
|
|
302
|
-
|
|
303
|
-
Tasks without dependencies run in parallel. Each agent gets its own isolated git worktree.
|
|
304
|
-
|
|
305
275
|
## License
|
|
306
276
|
|
|
307
277
|
MIT
|