mother-brain 0.7.4 → 0.7.5
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/dist/cli.js
CHANGED
|
@@ -798,7 +798,7 @@ async function uninstall(options) {
|
|
|
798
798
|
// src/cli.ts
|
|
799
799
|
import { exec as exec3 } from "child_process";
|
|
800
800
|
var program = new Command();
|
|
801
|
-
var VERSION = "0.7.
|
|
801
|
+
var VERSION = "0.7.5";
|
|
802
802
|
program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI and Codex CLI").version(VERSION);
|
|
803
803
|
program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
|
|
804
804
|
program.command("update").description("Update Mother Brain skills to the latest version").action(update);
|
package/package.json
CHANGED
|
@@ -382,17 +382,17 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
|
|
|
382
382
|
- Proceed immediately to Step 2 (Detect Project State)
|
|
383
383
|
|
|
384
384
|
### 2. **Detect Project State & Show Progress**
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
385
|
+
|
|
386
|
+
- Runs version check, meta-mode detection, fast startup optimization, auto-update with improvement capture, and artifact scanning.
|
|
387
|
+
- **Read `references/state-detection.md`** for the full detection procedure (version check, meta-mode, fast startup, auto-update Steps A–D, artifact list)
|
|
388
|
+
- After detection completes, display the appropriate menu below based on project state:
|
|
389
389
|
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
390
|
+
**If project exists:**
|
|
391
|
+
- Load session state from `.mother-brain/session-state.json`
|
|
392
|
+
|
|
393
|
+
- **Git Check (ensure git is available)**:
|
|
394
|
+
- Check if `.git` folder exists in project root
|
|
395
|
+
- If NOT exists:
|
|
396
396
|
```
|
|
397
397
|
⚠️ Git repository not found - initializing...
|
|
398
398
|
```
|
|
@@ -424,11 +424,11 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
|
|
|
424
424
|
- **If "I have a new idea"**: Jump to **Step 2F: Idea Capture & Prioritization**
|
|
425
425
|
- **If "Improve Mother Brain"**: Jump to **Step 2A: Improve Mother Brain Menu**
|
|
426
426
|
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
427
|
+
**If existing project WITHOUT Mother Brain artifacts (ONBOARDING):**
|
|
428
|
+
- Detect: Files exist in directory, but NO `.mother-brain/` folder (Mother Brain not installed here)
|
|
429
|
+
- Display:
|
|
430
|
+
```
|
|
431
|
+
🧠 I see an existing project here!
|
|
432
432
|
|
|
433
433
|
I can help you manage this project using the Mother Brain framework.
|
|
434
434
|
I'll scan your codebase, understand what you've built, and help you
|
|
@@ -439,12 +439,19 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
|
|
|
439
439
|
- "Yes, onboard Mother Brain into this project"
|
|
440
440
|
- "No, start fresh (ignore existing files)"
|
|
441
441
|
|
|
442
|
-
|
|
442
|
+
- **If user selects onboarding**: Jump to **Step 2.2: Existing Project Onboarding**
|
|
443
443
|
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
444
|
+
**If Mother Brain is installed but this folder is scaffolding-only (NEW PROJECT):**
|
|
445
|
+
- Detect:
|
|
446
|
+
- `.mother-brain/session-state.json` exists AND its project is unset (e.g., `project: null`)
|
|
447
|
+
- `.mother-brain/docs/vision.md` does NOT exist
|
|
448
|
+
- Repo root contains only Mother Brain scaffolding (e.g., `.mother-brain/`, `.github/`, `.agents/`, `AGENTS.md`, optional `.git/`)
|
|
449
|
+
- Treat this as a **new project** (show the new-project welcome flow below). Do NOT show onboarding.
|
|
450
|
+
|
|
451
|
+
**If new project (empty directory or user chose fresh start):**
|
|
452
|
+
- Display welcome:
|
|
453
|
+
```
|
|
454
|
+
🧠 Welcome to Mother Brain!
|
|
448
455
|
|
|
449
456
|
I'm your AI project companion. Tell me what you want to build,
|
|
450
457
|
and I'll help you make it real—step by step.
|
|
@@ -11,22 +11,41 @@
|
|
|
11
11
|
npm view mother-brain version --json 2>$null
|
|
12
12
|
```
|
|
13
13
|
- Compare against:
|
|
14
|
-
- If in framework repo: `cli/package.json` version field
|
|
15
|
-
- If in project: `.mother-brain/version.json`
|
|
14
|
+
- If in framework repo: `cli/package.json` version field (source repo version)
|
|
15
|
+
- If in project: `.mother-brain/version.json` installed field (installed/tracked version)
|
|
16
16
|
- **If newer version exists**:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
- **If in a project folder** (has `.mother-brain/version.json`):
|
|
18
|
+
```
|
|
19
|
+
⚠️ Mother Brain Update Available
|
|
20
|
+
|
|
21
|
+
Installed: v[current]
|
|
22
|
+
Latest: v[npm version]
|
|
23
|
+
|
|
24
|
+
Update recommended before continuing.
|
|
25
|
+
```
|
|
26
|
+
- Use `ask_user` with choices:
|
|
27
|
+
- "Update now (recommended)"
|
|
28
|
+
- "Skip this time"
|
|
29
|
+
- **If "Update now"**: Run `npx -y mother-brain update`, then continue
|
|
30
|
+
- **If "Skip"**: Continue but note version mismatch
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
- **If in the Mother Brain framework repo** (source code checkout):
|
|
33
|
+
```
|
|
34
|
+
⚠️ Mother Brain Release Ahead of This Checkout
|
|
35
|
+
|
|
36
|
+
Repo version (cli/package.json): v[current]
|
|
37
|
+
Latest release (npm): v[npm version]
|
|
38
|
+
|
|
39
|
+
This usually means your local checkout hasn’t been pulled to the latest tag yet.
|
|
40
|
+
```
|
|
41
|
+
- Use `ask_user` with choices:
|
|
42
|
+
- "Fetch tags + pull latest framework changes (recommended)"
|
|
43
|
+
- "Skip this time"
|
|
44
|
+
- **If "Fetch tags + pull"**:
|
|
45
|
+
- Run `git fetch --tags origin`
|
|
46
|
+
- Run `git pull --ff-only origin main`
|
|
47
|
+
- Then continue detection
|
|
48
|
+
- **If "Skip"**: Continue but note mismatch
|
|
30
49
|
- **If current or check fails**: Continue silently
|
|
31
50
|
|
|
32
51
|
**🧬 META-MODE DETECTION (AFTER VERSION CHECK)**:
|
|
@@ -37,6 +56,8 @@
|
|
|
37
56
|
4. If ALL of these exist → we are in the Mother Brain framework repo
|
|
38
57
|
|
|
39
58
|
- **If in Mother Brain framework repo**:
|
|
59
|
+
- Refresh tags before reporting "last release" (quiet):
|
|
60
|
+
- Run `git fetch --tags origin`
|
|
40
61
|
- Check `.mother-brain/meta-mode.json` for existing meta session state
|
|
41
62
|
- Display:
|
|
42
63
|
```
|
|
@@ -77,11 +98,34 @@
|
|
|
77
98
|
- **If NOT in framework repo**: Continue with normal detection below
|
|
78
99
|
|
|
79
100
|
**⚡ FAST STARTUP OPTIMIZATION (MANDATORY)**:
|
|
80
|
-
- **Single file check first**: Check ONLY `.mother-brain/session-state.json`
|
|
101
|
+
- **Single file check first**: Check ONLY `.mother-brain/session-state.json`
|
|
102
|
+
- If it exists: Mother Brain is installed in this folder (NOT necessarily an "existing project")
|
|
103
|
+
- If it does not exist: treat as "no Mother Brain artifacts" (possible onboarding or brand-new folder)
|
|
81
104
|
- **Parallel tool calls**: When multiple checks are needed, run them in ONE response (not sequentially)
|
|
82
105
|
- **Lazy loading**: Only load vision.md, roadmap.md, README.md when actually needed (not at startup)
|
|
83
106
|
- **Minimal detection**: For new project detection, a single glob for `.mother-brain/` is sufficient
|
|
84
107
|
- Goal: User sees menu within 1-2 tool calls, not 6+
|
|
108
|
+
|
|
109
|
+
**🧩 SCAFFOLDING-ONLY DETECTION (CRITICAL - fixes false "existing project" onboarding)**
|
|
110
|
+
- A freshly created folder can look like an "existing project" after `mother-brain init` because init creates:
|
|
111
|
+
- `.mother-brain/session-state.json` (with `project: null`)
|
|
112
|
+
- `.mother-brain/version.json`
|
|
113
|
+
- `.github/skills/*`
|
|
114
|
+
- `.agents/skills/*`
|
|
115
|
+
- `AGENTS.md`
|
|
116
|
+
- `.git/` (if git init is performed)
|
|
117
|
+
- **Rule**: If the folder contains ONLY Mother Brain scaffolding, treat it as a **new project** (show the new-project welcome flow), NOT onboarding.
|
|
118
|
+
- Detect scaffolding-only as:
|
|
119
|
+
1. `.mother-brain/session-state.json` exists AND its JSON has `project: null` (or no project name)
|
|
120
|
+
2. `.mother-brain/docs/vision.md` does NOT exist
|
|
121
|
+
3. The repo root contains no "real project files" beyond:
|
|
122
|
+
- `.mother-brain/`
|
|
123
|
+
- `.github/`
|
|
124
|
+
- `.agents/`
|
|
125
|
+
- `.git/`
|
|
126
|
+
- `AGENTS.md`
|
|
127
|
+
- If all true → show **New Project** welcome menu (Step 2 new project)
|
|
128
|
+
- If false → proceed with normal project/onboarding detection
|
|
85
129
|
|
|
86
130
|
**📦 AUTO-UPDATE CHECK (on startup, if project exists)**:
|
|
87
131
|
- If `.mother-brain/version.json` exists:
|
|
@@ -109,4 +153,4 @@
|
|
|
109
153
|
- `.mother-brain/docs/roadmap.md` - Current roadmap (load only when needed)
|
|
110
154
|
- `.mother-brain/docs/tasks/` - Task documentation folder
|
|
111
155
|
- `.github/skills/` - Project-specific skills
|
|
112
|
-
|
|
156
|
+
|