brain-dev 2.1.0 → 2.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/bin/lib/commands/discuss.cjs +3 -3
- package/bin/lib/commands/plan.cjs +3 -2
- package/bin/lib/core.cjs +18 -1
- package/bin/templates/executor.md +12 -0
- package/bin/templates/planner.md +6 -0
- package/bin/templates/verifier.md +7 -0
- package/commands/brain/adr.md +10 -3
- package/commands/brain/auto.md +10 -5
- package/commands/brain/complete.md +10 -3
- package/commands/brain/config.md +10 -3
- package/commands/brain/discuss.md +10 -4
- package/commands/brain/execute.md +10 -4
- package/commands/brain/health.md +10 -3
- package/commands/brain/new-project.md +10 -3
- package/commands/brain/new-task.md +11 -12
- package/commands/brain/pause.md +10 -2
- package/commands/brain/plan.md +10 -4
- package/commands/brain/quick.md +10 -5
- package/commands/brain/recover.md +10 -3
- package/commands/brain/story.md +10 -4
- package/commands/brain/verify.md +10 -4
- package/hooks/bootstrap.sh +23 -8
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ const path = require('node:path');
|
|
|
5
5
|
const { readState, writeState, atomicWriteSync } = require('../state.cjs');
|
|
6
6
|
const { parseRoadmap } = require('../roadmap.cjs');
|
|
7
7
|
const { loadTemplate, interpolate } = require('../templates.cjs');
|
|
8
|
-
const { output, error, success } = require('../core.cjs');
|
|
8
|
+
const { output, error, success, pipelineGate } = require('../core.cjs');
|
|
9
9
|
const { generateExpertise } = require('../stack-expert.cjs');
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -230,8 +230,8 @@ function handleSave(args, brainDir, state) {
|
|
|
230
230
|
nextAction: '/brain:plan'
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
success("Context captured.
|
|
234
|
-
output(result,
|
|
233
|
+
success("Context captured.");
|
|
234
|
+
output(result, pipelineGate(`npx brain-dev plan --phase ${phaseNumber}`));
|
|
235
235
|
|
|
236
236
|
return result;
|
|
237
237
|
}
|
|
@@ -8,7 +8,7 @@ const { loadTemplate, interpolate, loadTemplateWithOverlay } = require('../templ
|
|
|
8
8
|
const { getAgent, resolveModel } = require('../agents.cjs');
|
|
9
9
|
const { logEvent } = require('../logger.cjs');
|
|
10
10
|
const { estimateFromPlan, getDefaultBudget, checkBudget } = require('../complexity.cjs');
|
|
11
|
-
const { output, error, success } = require('../core.cjs');
|
|
11
|
+
const { output, error, success, pipelineGate } = require('../core.cjs');
|
|
12
12
|
const { generateExpertise, getDetectedFramework } = require('../stack-expert.cjs');
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -317,7 +317,8 @@ function handleSingle(args, brainDir, state) {
|
|
|
317
317
|
`[brain] Checker enabled: true`,
|
|
318
318
|
result.advocate_enabled ? `[brain] Advocate enabled: true` : '',
|
|
319
319
|
'',
|
|
320
|
-
fullPrompt
|
|
320
|
+
fullPrompt,
|
|
321
|
+
pipelineGate(`npx brain-dev execute --phase ${phaseNumber}`)
|
|
321
322
|
].filter(Boolean);
|
|
322
323
|
output(result, humanLines.join('\n'));
|
|
323
324
|
|
package/bin/lib/core.cjs
CHANGED
|
@@ -59,4 +59,21 @@ function success(msg) {
|
|
|
59
59
|
console.log(`${tag} ${msg}`);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Generate a pipeline gate marker for command output.
|
|
64
|
+
* This is a visual signal telling Claude the exact next command to run.
|
|
65
|
+
* @param {string} nextCommand - The exact command to run next
|
|
66
|
+
* @returns {string}
|
|
67
|
+
*/
|
|
68
|
+
function pipelineGate(nextCommand) {
|
|
69
|
+
return [
|
|
70
|
+
'',
|
|
71
|
+
'--- PIPELINE GATE ---',
|
|
72
|
+
`NEXT COMMAND (mandatory): ${nextCommand}`,
|
|
73
|
+
'Do NOT skip this command. Do NOT improvise. Do NOT start coding.',
|
|
74
|
+
'Copy and run the command above.',
|
|
75
|
+
'--- END GATE ---'
|
|
76
|
+
].join('\n');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
module.exports = { isTTY, output, prefix, error, success, pipelineGate };
|
|
@@ -242,3 +242,15 @@ Include sections:
|
|
|
242
242
|
- On successful completion of all tasks: `## EXECUTION COMPLETE`
|
|
243
243
|
- On failure after retry: `## EXECUTION FAILED`
|
|
244
244
|
- On checkpoint (user input needed): `## CHECKPOINT REACHED`
|
|
245
|
+
|
|
246
|
+
## Pipeline Enforcement Reminders
|
|
247
|
+
|
|
248
|
+
**EXECUTION FAILED:** When you output this marker:
|
|
249
|
+
- The orchestrator will handle recovery (debugger agent or re-execution)
|
|
250
|
+
- Do NOT start debugging manually. Do NOT skip to the next plan.
|
|
251
|
+
- Follow the "Suggested actions" field ONLY.
|
|
252
|
+
|
|
253
|
+
**CHECKPOINT REACHED:** When you output this marker:
|
|
254
|
+
- STOP all implementation work immediately
|
|
255
|
+
- The user MUST be asked via AskUserQuestion — do NOT pick an option yourself
|
|
256
|
+
- Checkpoints exist because a HUMAN decision is required. Never skip them.
|
package/bin/templates/planner.md
CHANGED
|
@@ -196,6 +196,12 @@ If you cannot create a valid plan after **2 attempts** (e.g., checker keeps reje
|
|
|
196
196
|
|
|
197
197
|
Do NOT produce incomplete or low-quality plans. Blocking with clear information is better than a plan that will fail during execution.
|
|
198
198
|
|
|
199
|
+
**When PLANNING BLOCKED is output:**
|
|
200
|
+
- Ask the user for the missing information using AskUserQuestion
|
|
201
|
+
- Do NOT attempt to force a plan through
|
|
202
|
+
- Do NOT rewrite requirements yourself
|
|
203
|
+
- Wait for user input, then re-run /brain:plan
|
|
204
|
+
|
|
199
205
|
## Enriched SUMMARY.md
|
|
200
206
|
|
|
201
207
|
After each plan executes, the executor creates a SUMMARY.md with:
|
|
@@ -220,3 +220,10 @@ When verification is complete, output:
|
|
|
220
220
|
**Gaps:** [count of failed must_haves, or "none"]
|
|
221
221
|
**Human items:** [count of items needing human verification, or "none"]
|
|
222
222
|
```
|
|
223
|
+
|
|
224
|
+
## Pipeline Enforcement
|
|
225
|
+
|
|
226
|
+
**When gaps_found or partial:**
|
|
227
|
+
- Run `/brain:execute` with `--gaps-only` flag to fix specific gaps
|
|
228
|
+
- Do NOT manually fix the files — the executor agent has the context to fix gaps properly
|
|
229
|
+
- Do NOT skip to `/brain:complete` with unresolved gaps
|
package/commands/brain/adr.md
CHANGED
|
@@ -23,9 +23,16 @@ Supports creating new ADRs, listing existing ones, and searching decision histor
|
|
|
23
23
|
</context>
|
|
24
24
|
|
|
25
25
|
<critical-rules>
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
26
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
27
|
+
1. Run `npx brain-dev adr $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
28
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
29
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
30
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
31
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
32
|
+
|
|
33
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
34
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
35
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
29
36
|
</critical-rules>
|
|
30
37
|
|
|
31
38
|
<process>
|
package/commands/brain/auto.md
CHANGED
|
@@ -22,11 +22,16 @@ Each step tells you which agent to spawn and what prompt to use.
|
|
|
22
22
|
</context>
|
|
23
23
|
|
|
24
24
|
<critical-rules>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
26
|
+
1. Run `npx brain-dev execute --auto` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
27
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
28
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
29
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
30
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
31
|
+
|
|
32
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
33
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
34
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
30
35
|
</critical-rules>
|
|
31
36
|
|
|
32
37
|
<process>
|
|
@@ -24,9 +24,16 @@ Ensures all phases are verified before completing.
|
|
|
24
24
|
</context>
|
|
25
25
|
|
|
26
26
|
<critical-rules>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
28
|
+
1. Run `npx brain-dev complete $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
29
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
30
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
31
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
32
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
33
|
+
|
|
34
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
35
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
36
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
30
37
|
</critical-rules>
|
|
31
38
|
|
|
32
39
|
<process>
|
package/commands/brain/config.md
CHANGED
|
@@ -26,9 +26,16 @@ When no subcommand is given, launches an interactive menu.
|
|
|
26
26
|
</context>
|
|
27
27
|
|
|
28
28
|
<critical-rules>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
29
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
30
|
+
1. Run `npx brain-dev config $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
31
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
32
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
33
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
34
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
35
|
+
|
|
36
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
37
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
38
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
32
39
|
</critical-rules>
|
|
33
40
|
|
|
34
41
|
<process>
|
|
@@ -22,10 +22,16 @@ Creates a CONTEXT.md file that feeds into the planning process.
|
|
|
22
22
|
</context>
|
|
23
23
|
|
|
24
24
|
<critical-rules>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
26
|
+
1. Run `npx brain-dev discuss $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
27
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
28
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
29
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
30
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
31
|
+
|
|
32
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
33
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
34
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
29
35
|
</critical-rules>
|
|
30
36
|
|
|
31
37
|
<process>
|
|
@@ -23,10 +23,16 @@ Discovers plans, analyzes dependencies, groups into waves, spawns subagents, and
|
|
|
23
23
|
</context>
|
|
24
24
|
|
|
25
25
|
<critical-rules>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
27
|
+
1. Run `npx brain-dev execute $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
28
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
29
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
30
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
31
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
32
|
+
|
|
33
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
34
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
35
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
30
36
|
</critical-rules>
|
|
31
37
|
|
|
32
38
|
<process>
|
package/commands/brain/health.md
CHANGED
|
@@ -22,9 +22,16 @@ Optionally auto-repairs safe issues with --fix.
|
|
|
22
22
|
</context>
|
|
23
23
|
|
|
24
24
|
<critical-rules>
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
|
|
25
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
26
|
+
1. Run `npx brain-dev health $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
27
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
28
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
29
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
30
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
31
|
+
|
|
32
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
33
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
34
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
28
35
|
</critical-rules>
|
|
29
36
|
|
|
30
37
|
<process>
|
|
@@ -12,9 +12,16 @@ Set up Brain for an existing or new project. Detects your stack, maps the codeba
|
|
|
12
12
|
</objective>
|
|
13
13
|
|
|
14
14
|
<critical-rules>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
16
|
+
1. Run `npx brain-dev new-project` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
17
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
18
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
19
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
20
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
21
|
+
|
|
22
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
23
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
24
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
18
25
|
</critical-rules>
|
|
19
26
|
|
|
20
27
|
<process>
|
|
@@ -22,20 +22,19 @@ Examples: "add payment integration", "refactor auth to JWT", "fix ATS rescoring
|
|
|
22
22
|
</context>
|
|
23
23
|
|
|
24
24
|
<critical-rules>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
26
|
+
1. Run `npx brain-dev new-task "description"` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
27
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
28
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
29
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
30
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
3. The plan step defines the fix + tests
|
|
35
|
-
4. The execute step implements with TDD
|
|
36
|
-
5. The verify step confirms the fix works
|
|
32
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
33
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
34
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
37
35
|
|
|
38
|
-
|
|
36
|
+
BUG WORKFLOW: User describes bug → `npx brain-dev new-task "fix: description"` → discuss (root cause) → plan (fix + tests) → execute (TDD) → verify → complete.
|
|
37
|
+
If too small for full pipeline, suggest `/brain:quick` instead. NEVER skip pipeline silently.
|
|
39
38
|
</critical-rules>
|
|
40
39
|
|
|
41
40
|
<process>
|
package/commands/brain/pause.md
CHANGED
|
@@ -15,8 +15,16 @@ No arguments required. Captures current session state automatically.
|
|
|
15
15
|
</context>
|
|
16
16
|
|
|
17
17
|
<critical-rules>
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
19
|
+
1. Run `npx brain-dev pause` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
20
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
21
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
22
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
23
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
24
|
+
|
|
25
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
26
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
27
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
20
28
|
</critical-rules>
|
|
21
29
|
|
|
22
30
|
<process>
|
package/commands/brain/plan.md
CHANGED
|
@@ -25,10 +25,16 @@ Default flow: Research (if needed) -> Plan -> Verify -> Done.
|
|
|
25
25
|
</context>
|
|
26
26
|
|
|
27
27
|
<critical-rules>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
29
|
+
1. Run `npx brain-dev plan $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
30
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
31
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
32
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
33
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
34
|
+
|
|
35
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
36
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
37
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
32
38
|
</critical-rules>
|
|
33
39
|
|
|
34
40
|
<process>
|
package/commands/brain/quick.md
CHANGED
|
@@ -28,11 +28,16 @@ Use subagent_type "brain-verifier" for verification (--full mode only).
|
|
|
28
28
|
</agents>
|
|
29
29
|
|
|
30
30
|
<critical-rules>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
32
|
+
1. Run `npx brain-dev quick "description"` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
33
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
34
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
35
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
36
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
37
|
+
|
|
38
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
39
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
40
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
36
41
|
</critical-rules>
|
|
37
42
|
|
|
38
43
|
<process>
|
|
@@ -13,9 +13,16 @@ Default mode shows what happened. Use --fix to auto-resume or --rollback to reve
|
|
|
13
13
|
</objective>
|
|
14
14
|
|
|
15
15
|
<critical-rules>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
17
|
+
1. Run `npx brain-dev recover` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
18
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
19
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
20
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
21
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
22
|
+
|
|
23
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
24
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
25
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
19
26
|
</critical-rules>
|
|
20
27
|
|
|
21
28
|
<process>
|
package/commands/brain/story.md
CHANGED
|
@@ -25,10 +25,16 @@ Stories are Brain's primary way to organize significant work. A story creates:
|
|
|
25
25
|
</context>
|
|
26
26
|
|
|
27
27
|
<critical-rules>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
29
|
+
1. Run `npx brain-dev story "title"` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
30
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
31
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
32
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
33
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
34
|
+
|
|
35
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
36
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
37
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
32
38
|
</critical-rules>
|
|
33
39
|
|
|
34
40
|
<process>
|
package/commands/brain/verify.md
CHANGED
|
@@ -23,10 +23,16 @@ Produces a VERIFICATION.md report with pass/gaps/human_needed status.
|
|
|
23
23
|
</context>
|
|
24
24
|
|
|
25
25
|
<critical-rules>
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
PIPELINE ENFORCEMENT (NON-NEGOTIABLE):
|
|
27
|
+
1. Run `npx brain-dev verify $ARGUMENTS` FIRST — before reading code, before analyzing, before suggesting fixes
|
|
28
|
+
2. READ the full output — it contains step-by-step instructions specific to this project's stack
|
|
29
|
+
3. FOLLOW the nextAction field — copy the exact command, do not modify it
|
|
30
|
+
4. If output shows an ERROR: follow the recovery path in the output, do NOT debug manually
|
|
31
|
+
5. If output shows a CHECKPOINT: use AskUserQuestion, do NOT pick options yourself
|
|
32
|
+
|
|
33
|
+
CONSEQUENCE OF SKIPPING: Pipeline tracks state, creates audit trails, spawns specialized agents,
|
|
34
|
+
and injects framework-specific expertise. Skipping it means: no state tracking, no audit trail,
|
|
35
|
+
no specialized agents, no framework guidance, potential data loss in .brain/ state.
|
|
30
36
|
</critical-rules>
|
|
31
37
|
|
|
32
38
|
<process>
|
package/hooks/bootstrap.sh
CHANGED
|
@@ -66,14 +66,29 @@ try {
|
|
|
66
66
|
'',
|
|
67
67
|
'Commands: /brain:new-project, /brain:story, /brain:discuss, /brain:plan, /brain:execute, /brain:verify, /brain:complete, /brain:quick, /brain:new-task, /brain:progress, /brain:pause, /brain:resume, /brain:help, /brain:health, /brain:update, /brain:upgrade, /brain:storm, /brain:adr, /brain:phase, /brain:config, /brain:map, /brain:recover, /brain:dashboard, /brain:auto (or execute --auto)',
|
|
68
68
|
'',
|
|
69
|
-
'
|
|
70
|
-
'
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'
|
|
74
|
-
'
|
|
75
|
-
'
|
|
76
|
-
'
|
|
69
|
+
'PIPELINE RULES (NON-NEGOTIABLE):',
|
|
70
|
+
'',
|
|
71
|
+
'1. ENTRY: When user describes ANY work (bug, feature, task), run the brain command FIRST.',
|
|
72
|
+
' Do NOT read code, run git, or analyze before running: npx brain-dev <command>',
|
|
73
|
+
' If you catch yourself analyzing: STOP, run the CLI, restart with CLI context.',
|
|
74
|
+
'',
|
|
75
|
+
'2. FOLLOW: When brain command outputs, find the nextAction field.',
|
|
76
|
+
' Copy the exact command verbatim. Do NOT interpret, modify, or skip it.',
|
|
77
|
+
' Human text is EXPLANATION. The nextAction field is the INSTRUCTION.',
|
|
78
|
+
'',
|
|
79
|
+
'3. NEVER ESCAPE: If you see EXECUTION FAILED, PLANNING BLOCKED, or gaps_found:',
|
|
80
|
+
' Follow the recovery instructions in that output ONLY.',
|
|
81
|
+
' Do NOT start debugging manually. Do NOT exit the pipeline.',
|
|
82
|
+
'',
|
|
83
|
+
'4. CHECKPOINTS: If you see CHECKPOINT REACHED:',
|
|
84
|
+
' Use AskUserQuestion to ask the user. Do NOT pick an option yourself.',
|
|
85
|
+
'',
|
|
86
|
+
'5. AGENTS: When output says to spawn an agent (brain-planner, brain-executor):',
|
|
87
|
+
' Use the Agent tool with the specified subagent_type. Do NOT execute the prompt yourself.',
|
|
88
|
+
'',
|
|
89
|
+
'6. STATE: Run /brain:progress before suggesting next steps.',
|
|
90
|
+
' For /brain:update, always use: npx brain-dev@latest update',
|
|
91
|
+
' NEVER run brain-dev init after an update.',
|
|
77
92
|
'--- End Brain Context ---'
|
|
78
93
|
];
|
|
79
94
|
console.log(lines.join('\n'));
|