mother-brain 0.0.27 → 0.0.32
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 +1 -1
- package/package.json +1 -1
- package/skills/mother-brain/SKILL.md +246 -44
package/dist/cli.js
CHANGED
|
@@ -653,7 +653,7 @@ async function uninstall(options) {
|
|
|
653
653
|
// src/cli.ts
|
|
654
654
|
import { exec as exec3 } from "child_process";
|
|
655
655
|
var program = new Command();
|
|
656
|
-
var VERSION = "0.0.
|
|
656
|
+
var VERSION = "0.0.32";
|
|
657
657
|
program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI").version(VERSION);
|
|
658
658
|
program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
|
|
659
659
|
program.command("update").description("Update Mother Brain skills to the latest version").action(update);
|
package/package.json
CHANGED
|
@@ -487,6 +487,24 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
487
487
|
1. Read installed version from file
|
|
488
488
|
2. Check npm for latest: `npm view mother-brain version --json 2>$null`
|
|
489
489
|
3. If newer version available:
|
|
490
|
+
|
|
491
|
+
**STEP A: Capture Local Improvements FIRST (before updating)**
|
|
492
|
+
- Check if user modified Mother Brain skills:
|
|
493
|
+
- Compare `.github/skills/mother-brain/SKILL.md` to npm version
|
|
494
|
+
- Use `git diff --stat` if available, or file size/hash comparison
|
|
495
|
+
- If modifications detected:
|
|
496
|
+
```
|
|
497
|
+
📤 You've made improvements to Mother Brain!
|
|
498
|
+
|
|
499
|
+
Before updating, I'll submit your changes as suggestions.
|
|
500
|
+
```
|
|
501
|
+
- Run Step 2A.1 flow (automatic improvement submission):
|
|
502
|
+
- Extract diff/changes from local vs npm version
|
|
503
|
+
- Create GitHub issue on superdenby/MotherBrain
|
|
504
|
+
- Display: "✅ Improvement submitted as issue #[N]"
|
|
505
|
+
- Store improvement record in `.mother-brain/improvements-submitted.json`
|
|
506
|
+
|
|
507
|
+
**STEP B: Update to Latest Version**
|
|
490
508
|
- Run PowerShell to fetch and replace skills in one operation:
|
|
491
509
|
```powershell
|
|
492
510
|
# Create temp dir, download, extract, copy skills, cleanup
|
|
@@ -504,11 +522,23 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
504
522
|
@{version=$latest} | ConvertTo-Json | Set-Content ".mother-brain\version.json"
|
|
505
523
|
Remove-Item $temp -Recurse -Force
|
|
506
524
|
```
|
|
525
|
+
|
|
526
|
+
**STEP C: Preserve Project-Specific Files (NEVER overwritten)**
|
|
527
|
+
- These are NEVER touched during update:
|
|
528
|
+
- `.mother-brain/` folder (all project state)
|
|
529
|
+
- `.mother-brain/project-brain.md` (project learnings)
|
|
530
|
+
- `.mother-brain/docs/` (vision, roadmap, tasks)
|
|
531
|
+
- `.github/skills/` files that are NOT mother-brain/child-brain/skill-creator
|
|
532
|
+
- Project-specific skills remain untouched
|
|
533
|
+
|
|
534
|
+
**STEP D: Restart Required**
|
|
507
535
|
- **CRITICAL: After updating, STOP and display restart message**:
|
|
508
536
|
```
|
|
509
537
|
⚠️ Mother Brain Updated to v[latest]
|
|
510
538
|
|
|
511
|
-
|
|
539
|
+
✅ Your improvements have been submitted as suggestions
|
|
540
|
+
✅ Your project files are preserved
|
|
541
|
+
✅ New Mother Brain skills installed
|
|
512
542
|
|
|
513
543
|
👉 Please run /mother-brain again to use the new features.
|
|
514
544
|
```
|
|
@@ -527,6 +557,16 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
527
557
|
|
|
528
558
|
**If project exists:**
|
|
529
559
|
- Load session state from `docs/session-state.json`
|
|
560
|
+
|
|
561
|
+
- **Git Check (ensure git is available)**:
|
|
562
|
+
- Check if `.git` folder exists in project root
|
|
563
|
+
- If NOT exists:
|
|
564
|
+
```
|
|
565
|
+
⚠️ Git repository not found - initializing...
|
|
566
|
+
```
|
|
567
|
+
- Run: `git init && git add . && git commit -m "Initialize git for Mother Brain"`
|
|
568
|
+
- Display: "✅ Git repository initialized"
|
|
569
|
+
- Git is required for improvement submissions and change tracking
|
|
530
570
|
|
|
531
571
|
- Display welcome back message:
|
|
532
572
|
```
|
|
@@ -1276,7 +1316,23 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
1276
1316
|
|
|
1277
1317
|
**Purpose**: One-click release - commit, version bump, push, tag, and publish.
|
|
1278
1318
|
|
|
1279
|
-
**Prerequisite**: Must be in the mother-brain folder (not a project folder)
|
|
1319
|
+
**Prerequisite**: Must be in the mother-brain framework folder (not a project folder)
|
|
1320
|
+
|
|
1321
|
+
**⚡ MANDATORY RELEASE CHECKLIST (All items MUST be completed)**
|
|
1322
|
+
|
|
1323
|
+
Every release MUST update ALL of the following:
|
|
1324
|
+
```
|
|
1325
|
+
[ ] cli/package.json - version field
|
|
1326
|
+
[ ] cli/src/cli.ts - version constant (if exists)
|
|
1327
|
+
[ ] README.md - version badge AND version text
|
|
1328
|
+
[ ] Git commit with changes
|
|
1329
|
+
[ ] Git tag (v0.0.X)
|
|
1330
|
+
[ ] Push to remote (main + tags)
|
|
1331
|
+
[ ] GitHub Release (created automatically by workflow)
|
|
1332
|
+
[ ] npm publish (triggered by tag push via workflow)
|
|
1333
|
+
```
|
|
1334
|
+
|
|
1335
|
+
**⛔ BLOCKING RULE**: Do NOT return to menu until ALL items above are completed.
|
|
1280
1336
|
|
|
1281
1337
|
**⚡ ONE-CLICK RELEASE FLOW (No prompts, no menus)**
|
|
1282
1338
|
|
|
@@ -1289,38 +1345,51 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
1289
1345
|
- If no changes: Display "Nothing to release" and return to menu
|
|
1290
1346
|
|
|
1291
1347
|
**Step 2D.2: Auto-Determine Version**
|
|
1292
|
-
- Read current version from `package.json`
|
|
1293
|
-
- Scan learning-log.md entries since last release tag
|
|
1348
|
+
- Read current version from `cli/package.json`
|
|
1349
|
+
- Scan learning-log.md entries since last release tag (if exists)
|
|
1294
1350
|
- **Auto-determine version bump**:
|
|
1295
1351
|
- If any entry contains "breaking" or "major" → **major** bump (X.0.0)
|
|
1296
1352
|
- If any entry contains "feature", "new", "add" → **minor** bump (0.X.0)
|
|
1297
1353
|
- Otherwise → **patch** bump (0.0.X)
|
|
1298
1354
|
- Do NOT ask user - auto-decide based on content
|
|
1299
1355
|
|
|
1300
|
-
**Step 2D.3:
|
|
1301
|
-
-
|
|
1302
|
-
-
|
|
1303
|
-
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1356
|
+
**Step 2D.3: Update ALL Version References (MANDATORY)**
|
|
1357
|
+
- Update `cli/package.json`: `"version": "[new-version]"`
|
|
1358
|
+
- Update `cli/src/cli.ts`: version constant (search for old version, replace with new)
|
|
1359
|
+
- Update `README.md`:
|
|
1360
|
+
- Find `version-X.X.X-blue` badge and replace with new version
|
|
1361
|
+
- Find `**Version**: X.X.X` text and replace with new version
|
|
1362
|
+
- **Verify all files updated before proceeding**
|
|
1363
|
+
|
|
1364
|
+
**Step 2D.4: Sync Skills to CLI**
|
|
1365
|
+
- Copy `.github/skills/*` to `cli/skills/` (overwrite)
|
|
1366
|
+
|
|
1367
|
+
**Step 2D.5: Build CLI**
|
|
1368
|
+
- Run `cd cli && npm run build`
|
|
1369
|
+
- If build fails: STOP and display error
|
|
1370
|
+
|
|
1371
|
+
**Step 2D.6: Execute Git Operations**
|
|
1372
|
+
- Stage all changes: `git add -A`
|
|
1373
|
+
- Commit: `git commit -m "[type]: [description] (v[version])"`
|
|
1374
|
+
- Create tag: `git tag v[version]`
|
|
1375
|
+
- **Push to origin (super-state) ONLY**: `git push origin main --tags`
|
|
1376
|
+
- **NEVER push to personal fork** - only super-state has npm publish token
|
|
1377
|
+
|
|
1378
|
+
**Step 2D.7: Confirmation**
|
|
1379
|
+
- Wait for workflow to complete (or check status)
|
|
1313
1380
|
- Display:
|
|
1314
1381
|
```
|
|
1315
1382
|
✅ Release v[version] Published!
|
|
1316
1383
|
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1384
|
+
✅ cli/package.json updated
|
|
1385
|
+
✅ cli/src/cli.ts updated
|
|
1386
|
+
✅ README.md updated
|
|
1387
|
+
✅ Git tag created and pushed
|
|
1388
|
+
✅ GitHub Release created (via workflow)
|
|
1389
|
+
✅ npm publish triggered (via workflow)
|
|
1322
1390
|
|
|
1323
|
-
|
|
1391
|
+
Tag: v[version]
|
|
1392
|
+
Release: https://github.com/superdenby/MotherBrain/releases/tag/v[version]
|
|
1324
1393
|
```
|
|
1325
1394
|
|
|
1326
1395
|
- Use `ask_user` with choices:
|
|
@@ -1860,22 +1929,37 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
1860
1929
|
|
|
1861
1930
|
- **Note**: Project-specific skills created during Step 6 go in project's `.github/skills/`. Core skills are accessed from the framework.
|
|
1862
1931
|
|
|
1863
|
-
**Step 3.6.4: Initialize Git (
|
|
1864
|
-
-
|
|
1865
|
-
-
|
|
1866
|
-
-
|
|
1867
|
-
-
|
|
1932
|
+
**Step 3.6.4: Initialize Git (MANDATORY)**
|
|
1933
|
+
- Git is REQUIRED for Mother Brain to function properly:
|
|
1934
|
+
- Improvement submissions require git diff
|
|
1935
|
+
- Version tracking requires git tags
|
|
1936
|
+
- Change detection requires git status
|
|
1868
1937
|
|
|
1869
|
-
-
|
|
1938
|
+
- Check if git is already initialized:
|
|
1870
1939
|
```powershell
|
|
1871
|
-
|
|
1872
|
-
git init
|
|
1873
|
-
git add .
|
|
1874
|
-
git commit -m "Initial project setup from Mother Brain"
|
|
1940
|
+
$gitExists = Test-Path (Join-Path "[project-path]" ".git")
|
|
1875
1941
|
```
|
|
1876
1942
|
|
|
1943
|
+
- If git already exists:
|
|
1944
|
+
- Display: "✅ Git repository detected"
|
|
1945
|
+
- Skip initialization
|
|
1946
|
+
|
|
1947
|
+
- If git does NOT exist:
|
|
1948
|
+
- Initialize automatically:
|
|
1949
|
+
```powershell
|
|
1950
|
+
Set-Location "[project-path]"
|
|
1951
|
+
git init
|
|
1952
|
+
git add .
|
|
1953
|
+
git commit -m "Initial project setup from Mother Brain"
|
|
1954
|
+
```
|
|
1955
|
+
- Display: "✅ Git repository initialized"
|
|
1956
|
+
|
|
1957
|
+
- Use `ask_user` with choices:
|
|
1958
|
+
- "Continue (git is ready)"
|
|
1959
|
+
- "I want to connect to a remote repository"
|
|
1960
|
+
|
|
1877
1961
|
- If user wants to connect existing repo:
|
|
1878
|
-
- Ask for repo URL
|
|
1962
|
+
- Ask for repo URL with `ask_user` freeform
|
|
1879
1963
|
- `git remote add origin [url]`
|
|
1880
1964
|
|
|
1881
1965
|
**Step 3.6.5: Switch Context to Project Folder**
|
|
@@ -2827,24 +2911,26 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
2827
2911
|
- Update task document with final status
|
|
2828
2912
|
- Update roadmap checklist
|
|
2829
2913
|
|
|
2830
|
-
**⚠️ CRITICAL: After marking task complete,
|
|
2914
|
+
**⚠️ CRITICAL: After marking task complete, proceed through Steps 10B, 10C, and optionally 10D before reaching Step 11.**
|
|
2831
2915
|
|
|
2832
|
-
**⛔ BLOCKING GATE -
|
|
2916
|
+
**⛔ BLOCKING GATE - Steps 10B and 10C are MANDATORY:**
|
|
2833
2917
|
```
|
|
2834
2918
|
Task marked complete by user
|
|
2835
2919
|
↓
|
|
2836
|
-
[STOP] Run Step 10B (Post-Task Reflection) ←
|
|
2920
|
+
[STOP] Run Step 10B (Post-Task Reflection) ← Friction analysis via Child Brain
|
|
2921
|
+
↓
|
|
2922
|
+
[STOP] Run Step 10C (Project Brain Checkpoint) ← Update living documentation
|
|
2837
2923
|
↓
|
|
2838
|
-
|
|
2924
|
+
IF last task in phase → Run Step 10D (Phase Feedback Checkpoint)
|
|
2839
2925
|
↓
|
|
2840
2926
|
ONLY THEN proceed to Step 11 (Next Action Menu)
|
|
2841
2927
|
```
|
|
2842
2928
|
|
|
2843
|
-
**DO NOT skip
|
|
2844
|
-
1. Scan
|
|
2845
|
-
2.
|
|
2846
|
-
3.
|
|
2847
|
-
4. Only AFTER
|
|
2929
|
+
**DO NOT skip Steps 10B or 10C.** Even if the task had no issues:
|
|
2930
|
+
1. Step 10B: Scan for friction, invoke Child Brain if found
|
|
2931
|
+
2. Step 10C: Update project documentation silently
|
|
2932
|
+
3. Step 10D: If phase complete, gather user feedback
|
|
2933
|
+
4. Only AFTER all checkpoints → proceed to Step 11
|
|
2848
2934
|
|
|
2849
2935
|
### 10A. **Friction Analysis via Child Brain**
|
|
2850
2936
|
- When user provides negative/adjustment feedback in task validation:
|
|
@@ -2941,10 +3027,126 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
|
|
|
2941
3027
|
🛠️ SKILLS: [Created/updated - or "No skill changes"]
|
|
2942
3028
|
```
|
|
2943
3029
|
|
|
2944
|
-
Proceed to Step
|
|
3030
|
+
Proceed to Step 10C (Project Brain Checkpoint)
|
|
2945
3031
|
|
|
2946
3032
|
**Key Principle**: Child Brain handles ALL learning analysis. Mother Brain only orchestrates when to invoke it.
|
|
2947
3033
|
|
|
3034
|
+
### 10C. **Project Brain Checkpoint** (Living Documentation)
|
|
3035
|
+
- **When to run**: After Step 10B (Post-Task Reflection) completes
|
|
3036
|
+
- **Purpose**: Silently update project documentation to ensure project stays on track
|
|
3037
|
+
|
|
3038
|
+
**Step 10C.1: Check Project Alignment (Silent)**
|
|
3039
|
+
|
|
3040
|
+
- Compare current progress against vision:
|
|
3041
|
+
1. Load `vision.md` - what user wanted
|
|
3042
|
+
2. Load `roadmap.md` - what's planned
|
|
3043
|
+
3. Check completed tasks - what's been delivered
|
|
3044
|
+
4. Identify gaps or drift
|
|
3045
|
+
|
|
3046
|
+
**Step 10C.2: Update Living Documentation**
|
|
3047
|
+
|
|
3048
|
+
Create/update these files in `.mother-brain/docs/` as needed:
|
|
3049
|
+
|
|
3050
|
+
- **`research/[topic].md`** - Domain research findings
|
|
3051
|
+
- Add research conducted during this task
|
|
3052
|
+
- Note sources, best practices discovered
|
|
3053
|
+
- Flag areas needing more research
|
|
3054
|
+
|
|
3055
|
+
- **`requirements.md`** - Discovered requirements
|
|
3056
|
+
- Add requirements that emerged during task
|
|
3057
|
+
- Note user preferences revealed
|
|
3058
|
+
- Track implicit requirements from feedback
|
|
3059
|
+
|
|
3060
|
+
- **`data-models.md`** - Identified data structures
|
|
3061
|
+
- Document data structures used/needed
|
|
3062
|
+
- Track schema evolution
|
|
3063
|
+
- Note relationships discovered
|
|
3064
|
+
|
|
3065
|
+
- **`user-needs.md`** - User requirements discovered
|
|
3066
|
+
- Track what user actually needs (vs. wants)
|
|
3067
|
+
- Note workflow preferences
|
|
3068
|
+
- Document pain points addressed
|
|
3069
|
+
|
|
3070
|
+
- **`questions.md`** - Open questions and gaps
|
|
3071
|
+
- What's unclear about the vision?
|
|
3072
|
+
- What decisions need user input?
|
|
3073
|
+
- What technical research is needed?
|
|
3074
|
+
|
|
3075
|
+
**Step 10C.3: Feed Discoveries into Vision**
|
|
3076
|
+
|
|
3077
|
+
- If significant new understanding emerged:
|
|
3078
|
+
- Update `vision.md` with new discoveries
|
|
3079
|
+
- Mark section as "Updated after Task [X]"
|
|
3080
|
+
- Keep vision as living document, not static
|
|
3081
|
+
|
|
3082
|
+
- Display only if updates made:
|
|
3083
|
+
```
|
|
3084
|
+
📘 Project documentation updated
|
|
3085
|
+
```
|
|
3086
|
+
|
|
3087
|
+
**Step 10C.4: Check Phase Completion**
|
|
3088
|
+
|
|
3089
|
+
- Detect if this was the last task in current phase:
|
|
3090
|
+
- Load roadmap, count remaining tasks in phase
|
|
3091
|
+
- If 0 remaining → trigger **Step 10D (Phase Feedback Checkpoint)**
|
|
3092
|
+
|
|
3093
|
+
- If more tasks remain in phase:
|
|
3094
|
+
- Proceed to Step 11 (Next Action Menu)
|
|
3095
|
+
|
|
3096
|
+
### 10D. **Phase Feedback Checkpoint** (User Reflection)
|
|
3097
|
+
- **When to run**: When last task in a phase is completed
|
|
3098
|
+
- **Purpose**: Gather user feedback before proceeding to next phase
|
|
3099
|
+
|
|
3100
|
+
**Step 10D.1: Celebrate Phase Completion**
|
|
3101
|
+
|
|
3102
|
+
- Display:
|
|
3103
|
+
```
|
|
3104
|
+
🎉 Phase [Name] Complete!
|
|
3105
|
+
|
|
3106
|
+
What was delivered:
|
|
3107
|
+
- [Task 1] - [Brief description]
|
|
3108
|
+
- [Task 2] - [Brief description]
|
|
3109
|
+
- [Task 3] - [Brief description]
|
|
3110
|
+
|
|
3111
|
+
Before we move to [Next Phase Name], I'd like your feedback.
|
|
3112
|
+
```
|
|
3113
|
+
|
|
3114
|
+
**Step 10D.2: Gather User Feedback**
|
|
3115
|
+
|
|
3116
|
+
- Use `ask_user` with freeform enabled:
|
|
3117
|
+
```
|
|
3118
|
+
Now that you've seen Phase [Name] in action:
|
|
3119
|
+
|
|
3120
|
+
1. What's working well?
|
|
3121
|
+
2. What isn't quite right?
|
|
3122
|
+
3. Any new ideas or changes in direction?
|
|
3123
|
+
|
|
3124
|
+
(This helps me understand your evolving vision)
|
|
3125
|
+
```
|
|
3126
|
+
|
|
3127
|
+
**Step 10D.3: Research Refresh**
|
|
3128
|
+
|
|
3129
|
+
- Based on user feedback:
|
|
3130
|
+
- Research any new domains/technologies mentioned
|
|
3131
|
+
- Update skill candidates if new needs identified
|
|
3132
|
+
- Store findings in `research/` folder
|
|
3133
|
+
|
|
3134
|
+
**Step 10D.4: Update Roadmap if Needed**
|
|
3135
|
+
|
|
3136
|
+
- If user feedback suggests changes:
|
|
3137
|
+
- Offer to adjust roadmap
|
|
3138
|
+
- Add new tasks if needed
|
|
3139
|
+
- Reprioritize based on feedback
|
|
3140
|
+
|
|
3141
|
+
- Display:
|
|
3142
|
+
```
|
|
3143
|
+
📘 Feedback incorporated
|
|
3144
|
+
|
|
3145
|
+
[Summary of what was learned/changed]
|
|
3146
|
+
```
|
|
3147
|
+
|
|
3148
|
+
- Proceed to Step 11 (Next Action Menu)
|
|
3149
|
+
|
|
2948
3150
|
### 11. **Next Action Menu**
|
|
2949
3151
|
- After task completion, use `ask_user` with choices:
|
|
2950
3152
|
- After task completion, use `ask_user` with choices:
|