substrate-ai 0.1.0 → 0.1.8

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.npm.md ADDED
@@ -0,0 +1,204 @@
1
+ <p align="center">
2
+ <img src="https://github.com/user-attachments/assets/622dd577-2814-4657-bb28-112ed272486d" alt="Substrate — Autonomous Software Development Pipeline" />
3
+ </p>
4
+
5
+ # Substrate
6
+
7
+ Autonomous software development pipeline powered by multi-agent orchestration. Substrate takes a project idea from concept through analysis, planning, architecture, implementation, and code review — coordinating CLI-based AI agents (Claude Code, Codex, Gemini CLI) to do the work.
8
+
9
+ Substrate follows a modular monolith pattern running as a single Node.js process. The orchestrator never calls LLMs directly — all intelligent work is delegated to CLI agents running as child processes in isolated git worktrees. The autonomous pipeline compiles BMAD methodology workflows into token-efficient agent dispatches.
10
+
11
+ ## Prerequisites
12
+
13
+ - **Node.js** 22.0.0 or later
14
+ - **git** 2.20 or later
15
+ - At least one supported AI CLI agent installed:
16
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) (`claude`)
17
+ - [Codex CLI](https://github.com/openai/codex) (`codex`)
18
+ - Gemini CLI (`gemini`)
19
+
20
+ ## Installation
21
+
22
+ Install as a project dependency:
23
+
24
+ ```bash
25
+ npm install substrate-ai
26
+ ```
27
+
28
+ Or install globally:
29
+
30
+ ```bash
31
+ npm install -g substrate-ai
32
+ ```
33
+
34
+ Verify the installation:
35
+
36
+ ```bash
37
+ npx substrate --version # project install
38
+ substrate --version # global install
39
+ ```
40
+
41
+ ## Quick Start
42
+
43
+ ### Autonomous Pipeline (recommended)
44
+
45
+ Got an idea? Substrate can take it from concept to working code.
46
+
47
+ 1. **Brainstorm** — explore your idea with a multi-persona AI session:
48
+
49
+ ```bash
50
+ substrate brainstorm
51
+ ```
52
+
53
+ 2. **Initialize the pipeline** — set up the methodology pack and decision store:
54
+
55
+ ```bash
56
+ substrate auto init
57
+ ```
58
+
59
+ 3. **Run the full pipeline** — analysis, planning, solutioning, and implementation:
60
+
61
+ ```bash
62
+ substrate auto run
63
+ ```
64
+
65
+ Substrate walks through the entire software development lifecycle autonomously:
66
+ - **Analysis** — generates a product brief from your brainstorm
67
+ - **Planning** — creates a PRD with requirements
68
+ - **Solutioning** — produces architecture, epics, and stories
69
+ - **Implementation** — dispatches agents to build, test, and code-review each story
70
+
71
+ You can start from any phase or resume an interrupted run:
72
+
73
+ ```bash
74
+ substrate auto run --from solutioning # Skip to a specific phase
75
+ substrate auto resume # Pick up where you left off
76
+ substrate auto status # Check pipeline progress
77
+ ```
78
+
79
+ ### Pick Up an Existing BMAD Project
80
+
81
+ Already have a project with BMAD artifacts (vanilla BMAD or the Beads-based ai-toolkit)? Substrate can pick up the remaining implementation work. It reads one directory — `_bmad-output/` — and doesn't care which tool created it.
82
+
83
+ **What Substrate needs from your project:**
84
+
85
+ | File | Required? | Purpose |
86
+ |------|-----------|---------|
87
+ | `_bmad-output/planning-artifacts/epics.md` | Yes | Parsed into per-epic context shards |
88
+ | `_bmad-output/planning-artifacts/architecture.md` | Yes | Tech stack and constraints for agents |
89
+ | `_bmad-output/implementation-artifacts/*.md` | Optional | Existing story files — Substrate skips create-story for any it finds |
90
+ | `package.json` | Optional | Test framework detection |
91
+
92
+ **Three commands:**
93
+
94
+ ```bash
95
+ npm install substrate-ai
96
+ substrate auto init # Seeds context from _bmad-output/
97
+ substrate auto run --stories 5-3,5-4,6-1 # Only the unfinished story keys
98
+ ```
99
+
100
+ For each story, Substrate runs: **create-story** (skipped if story file exists) → **dev-story** (implement) → **code-review** (adversarial review). Non-conflicting stories run in parallel automatically.
101
+
102
+ Substrate does not read `sprint-status.yaml` or `.beads/` — you decide what's left by choosing which story keys to pass.
103
+
104
+ ## Supported Agents
105
+
106
+ | Agent ID | CLI Tool | Billing |
107
+ |----------|----------|---------|
108
+ | `claude-code` | Claude Code | Subscription (Max) or API key |
109
+ | `codex` | Codex CLI | Subscription (ChatGPT Plus/Pro) or API key |
110
+ | `gemini` | Gemini CLI | Subscription or API key |
111
+
112
+ ## Commands
113
+
114
+ ### Pipeline
115
+
116
+ | Command | Description |
117
+ |---------|-------------|
118
+ | `substrate brainstorm` | Interactive multi-persona ideation session |
119
+ | `substrate auto init` | Initialize methodology pack for autonomous pipeline |
120
+ | `substrate auto run` | Run the full pipeline (analysis → implement) |
121
+ | `substrate auto run --from <phase>` | Start from a specific phase |
122
+ | `substrate auto resume` | Resume an interrupted pipeline run |
123
+ | `substrate auto status` | Show pipeline run status |
124
+
125
+ ### Monitoring
126
+
127
+ | Command | Description |
128
+ |---------|-------------|
129
+ | `substrate monitor status` | View task metrics and agent performance |
130
+ | `substrate monitor report` | Generate a detailed performance report |
131
+ | `substrate cost-report` | View cost and token usage summary |
132
+
133
+ ### Setup
134
+
135
+ | Command | Description |
136
+ |---------|-------------|
137
+ | `substrate init` | Initialize project configuration |
138
+ | `substrate --help` | Show all available commands |
139
+
140
+ ## Configuration
141
+
142
+ Substrate reads configuration from `.substrate/config.yaml` in your project root. Run `substrate init` to generate a default config.
143
+
144
+ ## Development
145
+
146
+ ```bash
147
+ # Clone and install
148
+ git clone https://github.com/johnplanow/substrate.git
149
+ cd substrate
150
+ npm install
151
+
152
+ # Build
153
+ npm run build
154
+
155
+ # Run tests
156
+ npm test
157
+
158
+ # Development mode (watch)
159
+ npm run dev
160
+
161
+ # Type check
162
+ npm run typecheck
163
+
164
+ # Lint
165
+ npm run lint
166
+ ```
167
+
168
+ ## Manual Task Graphs
169
+
170
+ For fine-grained control, you can define exactly what agents should do in a YAML task graph:
171
+
172
+ ```yaml
173
+ version: "1"
174
+ session:
175
+ name: "my-tasks"
176
+ tasks:
177
+ write-tests:
178
+ name: "Write unit tests"
179
+ prompt: |
180
+ Look at the src/utils/ directory.
181
+ Write comprehensive unit tests for all exported functions.
182
+ type: testing
183
+ agent: claude-code
184
+ update-docs:
185
+ name: "Update README"
186
+ prompt: |
187
+ Read the README.md and verify it accurately describes
188
+ the project. Fix any inaccuracies.
189
+ type: docs
190
+ agent: codex
191
+ depends_on:
192
+ - write-tests
193
+ ```
194
+
195
+ ```bash
196
+ substrate start --graph tasks.yaml # Execute the graph
197
+ substrate plan --graph tasks.yaml # Preview without running
198
+ ```
199
+
200
+ Tasks without dependencies run in parallel. Each agent gets its own isolated git worktree.
201
+
202
+ ## License
203
+
204
+ MIT
package/dist/cli/index.js CHANGED
@@ -8,7 +8,7 @@ import { fileURLToPath } from "url";
8
8
  import { dirname, extname, isAbsolute, join, relative, resolve } from "path";
9
9
  import { access, mkdir, readFile, readdir, stat, writeFile } from "fs/promises";
10
10
  import { execFile } from "child_process";
11
- import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
11
+ import { existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
12
12
  import yaml, { dump, load } from "js-yaml";
13
13
  import { z } from "zod";
14
14
  import { fileURLToPath as fileURLToPath$1 } from "node:url";
@@ -14632,7 +14632,15 @@ async function main() {
14632
14632
  process.exit(1);
14633
14633
  }
14634
14634
  }
14635
- main();
14635
+ const __cli_filename = fileURLToPath(import.meta.url);
14636
+ const isMainModule = (() => {
14637
+ try {
14638
+ return realpathSync(process.argv[1]) === realpathSync(__cli_filename);
14639
+ } catch {
14640
+ return false;
14641
+ }
14642
+ })();
14643
+ if (isMainModule) main();
14636
14644
 
14637
14645
  //#endregion
14638
14646
  export { createProgram };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.1.0",
3
+ "version": "0.1.8",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -23,6 +23,7 @@
23
23
  "bin": {
24
24
  "substrate": "./dist/cli/index.js"
25
25
  },
26
+ "readme": "README.npm.md",
26
27
  "main": "./dist/index.js",
27
28
  "exports": {
28
29
  ".": {
@@ -39,11 +40,12 @@
39
40
  "dist/**/*.d.ts",
40
41
  "dist/**/*.json",
41
42
  "dist/cli/templates",
42
- "README.md"
43
+ "README.md",
44
+ "README.npm.md"
43
45
  ],
44
46
  "scripts": {
45
47
  "build": "tsdown",
46
- "postbuild": "cp -r src/cli/templates dist/cli/templates",
48
+ "postbuild": "cp -r src/cli/templates dist/cli/templates && sed 's|assets/substrate-header.png|https://github.com/user-attachments/assets/622dd577-2814-4657-bb28-112ed272486d|' README.md > README.npm.md",
47
49
  "dev": "tsx watch src/cli/index.ts",
48
50
  "test": "vitest run --coverage",
49
51
  "test:watch": "vitest",