brain-dev 0.2.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 -23
- package/bin/brain-tools.cjs +8 -0
- package/bin/lib/commands/new-project.cjs +72 -782
- package/bin/lib/commands/new-task.cjs +522 -0
- package/bin/lib/commands/progress.cjs +1 -1
- package/bin/lib/commands/story.cjs +972 -0
- package/bin/lib/commands.cjs +21 -3
- package/bin/lib/state.cjs +47 -1
- package/bin/lib/story-helpers.cjs +439 -0
- package/commands/brain/new-task.md +31 -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,27 +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.
|
|
165
|
+
Auto mode chains: discuss → plan → execute → verify → complete → next phase, with budget limits, stuck detection, and crash recovery built in.
|
|
108
166
|
|
|
109
167
|
## State Machine
|
|
110
168
|
|
|
@@ -134,18 +192,21 @@ No supply chain risk. No transitive vulnerabilities. No `node_modules` bloat.
|
|
|
134
192
|
| Command | Description |
|
|
135
193
|
|---------|-------------|
|
|
136
194
|
| `/brain:init` | Initialize brain in current project |
|
|
137
|
-
| `/brain:new-project` |
|
|
195
|
+
| `/brain:new-project` | Detect project, map codebase, suggest next step |
|
|
138
196
|
| `/brain:help` | Show all available commands |
|
|
139
197
|
|
|
140
198
|
### Lifecycle
|
|
141
199
|
| Command | Description |
|
|
142
200
|
|---------|-------------|
|
|
201
|
+
| `/brain:story` | Start a body of work with research, requirements, roadmap |
|
|
143
202
|
| `/brain:discuss` | Capture architectural decisions |
|
|
144
203
|
| `/brain:plan` | Create verified execution plans |
|
|
145
204
|
| `/brain:execute` | Build according to plans with TDD |
|
|
146
205
|
| `/brain:verify` | 3-level verification against must-haves |
|
|
147
206
|
| `/brain:complete` | Mark phase done, advance to next |
|
|
148
207
|
| `/brain:quick` | Quick task — skip the ceremony |
|
|
208
|
+
| `/brain:new-task` | Significant task — full pipeline |
|
|
209
|
+
| `/brain:phase` | Phase management (add, remove, reorder) |
|
|
149
210
|
|
|
150
211
|
### Session
|
|
151
212
|
| Command | Description |
|
|
@@ -153,6 +214,8 @@ No supply chain risk. No transitive vulnerabilities. No `node_modules` bloat.
|
|
|
153
214
|
| `/brain:progress` | Current status and next action |
|
|
154
215
|
| `/brain:pause` | Save session for later |
|
|
155
216
|
| `/brain:resume` | Restore session context |
|
|
217
|
+
| `/brain:recover` | Detect and recover from crashes |
|
|
218
|
+
| `/brain:dashboard` | Live monitoring dashboard |
|
|
156
219
|
|
|
157
220
|
### Tools
|
|
158
221
|
| Command | Description |
|
|
@@ -162,7 +225,6 @@ No supply chain risk. No transitive vulnerabilities. No `node_modules` bloat.
|
|
|
162
225
|
| `/brain:map` | Deep codebase analysis |
|
|
163
226
|
| `/brain:health` | Self-diagnosis and auto-repair |
|
|
164
227
|
| `/brain:config` | Configuration management |
|
|
165
|
-
| `/brain:phase` | Phase management (add, remove, reorder) |
|
|
166
228
|
|
|
167
229
|
## Requirements
|
|
168
230
|
|
package/bin/brain-tools.cjs
CHANGED
|
@@ -132,6 +132,14 @@ 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
|
+
|
|
139
|
+
case 'new-task':
|
|
140
|
+
await require('./lib/commands/new-task.cjs').run(args.slice(1));
|
|
141
|
+
break;
|
|
142
|
+
|
|
135
143
|
case 'execute':
|
|
136
144
|
if (args.includes('--auto') || args.includes('--dry-run') || args.includes('--stop')) {
|
|
137
145
|
await require('./lib/commands/auto.cjs').run(args.slice(1));
|