brain-dev 0.3.0 → 1.0.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 +85 -53
- package/bin/brain-tools.cjs +4 -0
- package/bin/lib/commands/new-project.cjs +72 -782
- package/bin/lib/commands/progress.cjs +1 -1
- package/bin/lib/commands/story.cjs +972 -0
- package/bin/lib/commands.cjs +12 -3
- package/bin/lib/state.cjs +20 -1
- package/bin/lib/story-helpers.cjs +439 -0
- package/commands/brain/story.md +35 -0
- package/hooks/bootstrap.sh +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -25,7 +25,8 @@ Claude Code is powerful but chaotic. You start building, lose context mid-sessio
|
|
|
25
25
|
Brain adds structure without adding friction:
|
|
26
26
|
|
|
27
27
|
```
|
|
28
|
-
/brain:new-project →
|
|
28
|
+
/brain:new-project → Detects your stack, maps your codebase
|
|
29
|
+
/brain:story → Researches domain, creates roadmap with phases
|
|
29
30
|
/brain:discuss → Captures architectural decisions before coding
|
|
30
31
|
/brain:plan → Creates verified execution plans with TDD
|
|
31
32
|
/brain:execute → Builds with per-task commits and deviation handling
|
|
@@ -44,10 +45,74 @@ npx brain-dev init
|
|
|
44
45
|
That's it. Brain detects your project (Laravel, Next.js, Go, Python — any stack), registers its agents, and is ready.
|
|
45
46
|
|
|
46
47
|
```bash
|
|
47
|
-
/brain:new-project #
|
|
48
|
+
/brain:new-project # Detect project, map codebase, choose next step
|
|
49
|
+
/brain:story "v1.0 MVP" # Start a body of work with research + roadmap
|
|
48
50
|
/brain:progress # Where am I? What's next?
|
|
49
51
|
```
|
|
50
52
|
|
|
53
|
+
## Work Hierarchy
|
|
54
|
+
|
|
55
|
+
Brain provides four levels of work, from lightweight to comprehensive:
|
|
56
|
+
|
|
57
|
+
```
|
|
58
|
+
quick → plan → execute → commit (minutes)
|
|
59
|
+
new-task → discuss → plan → execute → verify (hours)
|
|
60
|
+
story → research → requirements → roadmap → phases (days/weeks)
|
|
61
|
+
new-project → detect → map → suggest next step (one-time setup)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Stories
|
|
65
|
+
|
|
66
|
+
Stories are Brain's primary way to organize significant work. A story = a milestone.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
/brain:story "v1.0 MVP"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Brain researches your domain with 6 parallel agents, generates requirements with REQ-IDs, creates a phased roadmap, then guides execution phase by phase.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
/brain:story --continue # Resume current story step
|
|
76
|
+
/brain:story --list # List all stories
|
|
77
|
+
/brain:story --complete # Complete story, bump version
|
|
78
|
+
/brain:story --status # Show story progress
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
| Flag | What happens |
|
|
82
|
+
|------|-------------|
|
|
83
|
+
| Default | questions → research → requirements → roadmap → activate |
|
|
84
|
+
| `--no-research` | Skip research (codebase already well-known) |
|
|
85
|
+
| `--research` | Force research even if codebase mapped |
|
|
86
|
+
|
|
87
|
+
Stories live in `.brain/stories/`. On activation, ROADMAP.md and REQUIREMENTS.md are copied to `.brain/` root for phase execution.
|
|
88
|
+
|
|
89
|
+
## Significant Tasks
|
|
90
|
+
|
|
91
|
+
For features that need more than a quick fix but less than a full story:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
/brain:new-task "add payment integration with Stripe"
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Brain runs the full pipeline: discuss → plan → execute → verify → complete.
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
/brain:new-task --research "add rate limiting" # With light research
|
|
101
|
+
/brain:new-task --light "fix auth redirect" # Skip discuss + verify
|
|
102
|
+
/brain:new-task --continue # Resume current task
|
|
103
|
+
/brain:new-task --list # List all tasks
|
|
104
|
+
/brain:new-task --promote 1 # Adds task as a phase in ROADMAP.md
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Quick Tasks
|
|
108
|
+
|
|
109
|
+
Not everything needs a full phase. For small, focused work:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
/brain:quick "fix the login redirect bug"
|
|
113
|
+
/brain:quick --full "add rate limiting to API" # With plan checking + verification
|
|
114
|
+
```
|
|
115
|
+
|
|
51
116
|
## How It Works
|
|
52
117
|
|
|
53
118
|
Brain orchestrates **8 specialized agents**, each with a clear role:
|
|
@@ -69,14 +134,14 @@ Brain auto-detects your project on init:
|
|
|
69
134
|
|
|
70
135
|
- **Multi-manifest**: Recognizes Laravel + Vue.js, Django + React, Go + npm — not just the first manifest found
|
|
71
136
|
- **Workspace siblings**: Detects `myapp-mobile/`, `myapp-landing/` alongside `myapp/`
|
|
72
|
-
- **Stack-aware
|
|
137
|
+
- **Stack-aware**: Asks "I detected a Laravel (PHP) + Vue.js frontend. What do you want to do?" instead of generic "What are you building?"
|
|
73
138
|
|
|
74
139
|
## Lifecycle
|
|
75
140
|
|
|
76
141
|
```
|
|
77
|
-
init → new-project → discuss → plan → execute → verify → complete
|
|
78
|
-
|
|
79
|
-
|
|
142
|
+
init → new-project → story → discuss → plan → execute → verify → complete
|
|
143
|
+
↑ │
|
|
144
|
+
└──────────── next story/phase ───────────────┘
|
|
80
145
|
```
|
|
81
146
|
|
|
82
147
|
- **`/brain:pause`** and **`/brain:resume`** preserve session context across conversations
|
|
@@ -84,56 +149,20 @@ init → new-project → discuss → plan → execute → verify → complete
|
|
|
84
149
|
- **`/brain:adr`** auto-creates architecture decision records
|
|
85
150
|
- **`/brain:map`** generates deep codebase documentation
|
|
86
151
|
- **`/brain:health`** self-diagnoses and auto-repairs
|
|
152
|
+
- **`/brain:dashboard`** live monitoring with phase progress, cost, stuck detection
|
|
153
|
+
- **`/brain:recover`** crash detection and recovery
|
|
87
154
|
|
|
88
|
-
##
|
|
155
|
+
## Auto Mode
|
|
89
156
|
|
|
90
|
-
|
|
157
|
+
Run phases autonomously without human intervention:
|
|
91
158
|
|
|
92
159
|
```bash
|
|
93
|
-
/brain:
|
|
160
|
+
/brain:execute --auto # Start autonomous execution
|
|
161
|
+
/brain:execute --auto --dry-run # Preview without executing
|
|
162
|
+
/brain:execute --auto --stop # Stop running auto session
|
|
94
163
|
```
|
|
95
164
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
/brain:quick --full "add rate limiting to API" # With plan checking + verification
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
| Mode | What happens |
|
|
103
|
-
|------|-------------|
|
|
104
|
-
| Default | plan → execute → commit |
|
|
105
|
-
| `--full` | plan → check → execute → verify → commit |
|
|
106
|
-
|
|
107
|
-
Quick tasks live in `.brain/quick/`, separate from phases. Tracked in STATE.md.
|
|
108
|
-
|
|
109
|
-
## Significant Tasks
|
|
110
|
-
|
|
111
|
-
For features that need more than a quick fix but less than a new project:
|
|
112
|
-
|
|
113
|
-
```bash
|
|
114
|
-
/brain:new-task "add payment integration with Stripe"
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Brain runs the full pipeline: discuss → plan → execute → verify → complete.
|
|
118
|
-
|
|
119
|
-
```bash
|
|
120
|
-
/brain:new-task --research "add rate limiting" # With light research
|
|
121
|
-
/brain:new-task --light "fix auth redirect" # Skip discuss + verify
|
|
122
|
-
/brain:new-task --continue # Resume current task
|
|
123
|
-
/brain:new-task --list # List all tasks
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
After completion, promote to your roadmap:
|
|
127
|
-
|
|
128
|
-
```bash
|
|
129
|
-
/brain:new-task --promote 1 # Adds task as a phase in ROADMAP.md
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
| Mode | Pipeline |
|
|
133
|
-
|------|----------|
|
|
134
|
-
| Standard | discuss → plan → execute → verify → complete |
|
|
135
|
-
| `--light` | plan → execute → commit |
|
|
136
|
-
| `--research` | discuss → research → plan → execute → verify → complete |
|
|
165
|
+
Auto mode chains: discuss → plan → execute → verify → complete → next phase, with budget limits, stuck detection, and crash recovery built in.
|
|
137
166
|
|
|
138
167
|
## State Machine
|
|
139
168
|
|
|
@@ -163,19 +192,21 @@ No supply chain risk. No transitive vulnerabilities. No `node_modules` bloat.
|
|
|
163
192
|
| Command | Description |
|
|
164
193
|
|---------|-------------|
|
|
165
194
|
| `/brain:init` | Initialize brain in current project |
|
|
166
|
-
| `/brain:new-project` |
|
|
195
|
+
| `/brain:new-project` | Detect project, map codebase, suggest next step |
|
|
167
196
|
| `/brain:help` | Show all available commands |
|
|
168
197
|
|
|
169
198
|
### Lifecycle
|
|
170
199
|
| Command | Description |
|
|
171
200
|
|---------|-------------|
|
|
201
|
+
| `/brain:story` | Start a body of work with research, requirements, roadmap |
|
|
172
202
|
| `/brain:discuss` | Capture architectural decisions |
|
|
173
203
|
| `/brain:plan` | Create verified execution plans |
|
|
174
204
|
| `/brain:execute` | Build according to plans with TDD |
|
|
175
205
|
| `/brain:verify` | 3-level verification against must-haves |
|
|
176
206
|
| `/brain:complete` | Mark phase done, advance to next |
|
|
177
207
|
| `/brain:quick` | Quick task — skip the ceremony |
|
|
178
|
-
| `/brain:new-task` | Significant task — full pipeline
|
|
208
|
+
| `/brain:new-task` | Significant task — full pipeline |
|
|
209
|
+
| `/brain:phase` | Phase management (add, remove, reorder) |
|
|
179
210
|
|
|
180
211
|
### Session
|
|
181
212
|
| Command | Description |
|
|
@@ -183,6 +214,8 @@ No supply chain risk. No transitive vulnerabilities. No `node_modules` bloat.
|
|
|
183
214
|
| `/brain:progress` | Current status and next action |
|
|
184
215
|
| `/brain:pause` | Save session for later |
|
|
185
216
|
| `/brain:resume` | Restore session context |
|
|
217
|
+
| `/brain:recover` | Detect and recover from crashes |
|
|
218
|
+
| `/brain:dashboard` | Live monitoring dashboard |
|
|
186
219
|
|
|
187
220
|
### Tools
|
|
188
221
|
| Command | Description |
|
|
@@ -192,7 +225,6 @@ No supply chain risk. No transitive vulnerabilities. No `node_modules` bloat.
|
|
|
192
225
|
| `/brain:map` | Deep codebase analysis |
|
|
193
226
|
| `/brain:health` | Self-diagnosis and auto-repair |
|
|
194
227
|
| `/brain:config` | Configuration management |
|
|
195
|
-
| `/brain:phase` | Phase management (add, remove, reorder) |
|
|
196
228
|
|
|
197
229
|
## Requirements
|
|
198
230
|
|
package/bin/brain-tools.cjs
CHANGED
|
@@ -132,6 +132,10 @@ async function main() {
|
|
|
132
132
|
await require('./lib/commands/quick.cjs').run(args.slice(1));
|
|
133
133
|
break;
|
|
134
134
|
|
|
135
|
+
case 'story':
|
|
136
|
+
await require('./lib/commands/story.cjs').run(args.slice(1));
|
|
137
|
+
break;
|
|
138
|
+
|
|
135
139
|
case 'new-task':
|
|
136
140
|
await require('./lib/commands/new-task.cjs').run(args.slice(1));
|
|
137
141
|
break;
|