mother-brain 0.6.0 β†’ 0.6.1

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.5.1";
801
+ var VERSION = "0.6.1";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mother-brain",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -600,75 +600,9 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
600
600
 
601
601
  ### 2.2. **Existing Project Onboarding**
602
602
  - When user selects to onboard Mother Brain into an existing project:
603
-
604
- **Step 2.2.1: Deep Repo Analysis**
605
- - Scan ALL files in the directory (not just specific ones)
606
- - Use `glob` and `view` to understand:
607
- - **Project Type**: What kind of project is this? (web app, game, library, CLI, etc.)
608
- - **Tech Stack**: Languages, frameworks, dependencies
609
- - **Architecture**: Folder structure, patterns, modules
610
- - **Features Built**: What functionality already exists?
611
- - **Current State**: Is it working? Partially complete? Early stage?
612
-
613
- - Display findings:
614
- ```
615
- πŸ” Project Analysis Complete
616
-
617
- What I Found:
618
- - Type: [Project type detected]
619
- - Tech Stack: [Languages, frameworks]
620
- - Features Built: [List of detected features]
621
- - Current State: [Assessment of completeness]
622
- ```
623
-
624
- **Step 2.2.2: Vision Extraction (Clarifying Questions)**
625
- - Ask user questions to fill gaps (like vision discovery, but informed by analysis):
626
- - "What is the main goal of this project?"
627
- - "Who is this for? Who will use it?"
628
- - "What problem does this solve?"
629
- - "What inspired this project?" (to trigger domain research)
630
- - "What's the most important thing to get right?"
631
- - "Where are you trying to get to next? What's your next milestone?"
632
-
633
- - Create `.mother-brain/docs/vision.md` with extracted vision
634
-
635
- **Step 2.2.3: Retrospective Roadmap**
636
- - Build roadmap that reflects reality:
637
- - **Phase 0 (Done)**: What's already built (based on repo analysis)
638
- - **Phase 1 (Current)**: What's in progress or next immediate steps
639
- - **Phase 2+**: Future milestones based on user's stated goals
640
-
641
- - Mark completed work as DONE in roadmap
642
- - Identify current position in timeline
643
-
644
- - Create `.mother-brain/docs/roadmap.md`
645
-
646
- **Step 2.2.4: Skill Identification**
647
- - Analyze patterns in existing code
648
- - Identify repetitive work that warrants skills
649
- - Invoke skill-creator for detected patterns
650
-
651
- **Step 2.2.5: Confirmation**
652
- - Display:
653
- ```
654
- βœ… Mother Brain Onboarded!
655
-
656
- πŸ“‹ Vision: Captured
657
- πŸ“Š Roadmap: [X] tasks identified
658
- - [Y] already complete
659
- - [Z] remaining
660
- πŸ› οΈ Skills: [N] identified for creation
661
-
662
- Ready to help you reach your next milestone!
663
- ```
664
-
665
- - Use `ask_user` with choices:
666
- - "Start next task"
667
- - "Review the roadmap"
668
- - "Review the vision"
669
- - "Adjust something before continuing"
670
-
671
- - Proceed to normal workflow (Step 8+)
603
+ - **Read `references/onboarding-workflow.md`** for the full onboarding workflow (Steps 2.2.1–2.2.5)
604
+ - Covers: deep repo analysis, vision extraction, retrospective roadmap, skill identification, confirmation
605
+ - After onboarding completes β†’ proceed to normal workflow (Step 8+)
672
606
 
673
607
  ### 2A. **Improve Mother Brain Menu** (From Any Project)
674
608
  - When user selects "🧠 Improve Mother Brain" from the existing project menu:
@@ -753,217 +687,10 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
753
687
 
754
688
  ### 2A.1 **Send Improvement** (Automatic Multi-Issue Contribution)
755
689
  - When user selects "πŸ“€ Send my local improvements":
756
-
757
- **Purpose**: Automatically detect ALL local Mother Brain improvements, parse learning logs for each distinct improvement, and submit a separate GitHub issue for each one. Handles multiple improvements in one session.
758
-
759
- **AUTOMATIC WORKFLOW (No User Prompts)**:
760
-
761
- **Step 2A.1.1: Gather All Improvement Sources**
762
-
763
- - Collect from THREE sources:
764
-
765
- **Source 1: Learning Log Entries**
766
- - Read `.mother-brain/project-brain.md` or `docs/learning-log.md`
767
- - Parse for individual learning entries (marked by `## [Date]` or similar)
768
- - Each entry = potential improvement
769
- - Extract: date, trigger, learning, resolution
770
-
771
- **Source 2: Core File Changes**
772
- - Get changes to Mother Brain core files:
773
- ```powershell
774
- git diff HEAD -- ".github/skills/mother-brain/SKILL.md"
775
- git diff HEAD -- ".github/skills/child-brain/SKILL.md"
776
- git diff HEAD -- ".github/skills/skill-creator/SKILL.md"
777
- ```
778
- - If files are new/untracked: `git diff /dev/null -- [file]`
779
-
780
- **Source 3: Conversation Context**
781
- - Scan conversation history for:
782
- - Friction points discussed
783
- - Problems reported
784
- - Solutions implemented
785
- - Pattern: "this isn't working" β†’ "fixed by..."
786
-
787
- - **If no improvements found across all sources**:
788
- - Display: "πŸ“­ No local Mother Brain improvements to send."
789
- - Return to Step 2A (Improve Mother Brain Menu)
790
-
791
- **Step 2A.1.1A: Check Issues Tracker (Deduplication)**
792
-
793
- - Check if `.mother-brain/issues-tracker.md` exists
794
- - **If exists**:
795
- - Read file and parse submitted issues list
796
- - Extract issue numbers and titles already submitted
797
- - Store in memory for comparison
798
- - **If doesn't exist**:
799
- - Create empty tracker file with template:
800
- ```markdown
801
- # Mother Brain Issues Tracker
802
-
803
- ## Issues Submitted to GitHub (super-state/mother-brain)
804
-
805
- (No issues submitted yet)
806
- ```
807
-
808
- **Step 2A.1.2: Correlate Learnings with File Changes**
809
-
810
- - For each learning entry found:
811
- 1. Identify which file(s) were modified for this learning
812
- 2. Extract the relevant diff sections (not the whole file diff)
813
- 3. Match learning description to code changes
814
-
815
- - Group by improvement type:
816
- - **Behavioral improvements** β†’ Mother Brain SKILL.md changes
817
- - **Feedback handling** β†’ Child Brain SKILL.md changes
818
- - **Skill creation** β†’ Skill Creator SKILL.md changes
819
-
820
- **Step 2A.1.3: Generate Individual Issues (with Deduplication)**
821
-
822
- - **Before generating issues**: Check each improvement against issues tracker
823
- - Compare improvement title/description against already-submitted issues
824
- - If match found: Skip this improvement
825
- - If no match: Proceed to generate issue
826
-
827
- - Display deduplication results:
828
- ```
829
- πŸ” Checking for duplicate submissions...
830
-
831
- Found [X] improvements:
832
- - [Y] new (will be submitted)
833
- - [Z] already submitted (skipped)
834
- ```
835
-
836
- - **If all improvements already submitted**:
837
- - Display: "βœ… All improvements already submitted! No duplicates created."
838
- - Return to Step 2A (Improve Mother Brain Menu)
839
-
840
- - For EACH NEW (not duplicate) improvement, create a separate issue:
841
-
842
- ```markdown
843
- Title: [Improvement] [Brief title describing THIS specific improvement]
844
-
845
- ## Summary
846
- [2-3 sentences explaining what this specific improvement does]
847
-
848
- ## Problem
849
- [What friction was encountered that triggered this improvement]
850
-
851
- ## Solution
852
- [How Mother Brain addressed the friction]
853
-
854
- ## Changes Made
855
- **File**: [filename] (lines ~X-Y)
856
-
857
- <details>
858
- <summary>View diff</summary>
859
-
860
- ```diff
861
- [relevant diff for THIS improvement only - not entire file]
862
- ```
863
- </details>
864
-
865
- ## Benefits
866
- [How this helps all Mother Brain users]
867
-
868
- ## Testing
869
- [How the improvement was validated]
870
-
871
- ---
872
- *Submitted via Mother Brain v[version]*
873
- ```
874
-
875
- **Step 2A.1.4: Submit Issues via gh CLI**
876
-
877
- - **Pre-flight Check**: Verify gh CLI is available and authenticated
878
- ```powershell
879
- gh --version
880
- gh auth status
881
- ```
882
-
883
- - **If gh CLI available and authenticated**:
884
- - For each generated improvement:
885
- 1. Create GitHub issue using gh CLI:
886
- ```powershell
887
- gh issue create --repo super-state/mother-brain --title "[title]" --body "[body]"
888
- ```
889
- 2. Parse output to get issue number and URL
890
- 3. Collect issue numbers and URLs
891
- 4. Add small delay between submissions (avoid rate limiting): `Start-Sleep -Seconds 2`
892
-
893
- - Target repository: `super-state/mother-brain`
894
- - Detected from: git remote (if configured)
895
- - Fallback: hardcoded default
896
-
897
- - **If gh CLI not installed or not authenticated**:
898
- - **Fallback to manual submission**:
899
- 1. Save each issue to `.mother-brain/github-issues/issue-[N].md`
900
- 2. Display instructions:
901
- ```
902
- ⚠️ gh CLI not available
903
-
904
- To auto-submit improvements, install gh CLI:
905
- https://cli.github.com
906
-
907
- Then authenticate: gh auth login
908
-
909
- πŸ“ Issue content saved to:
910
- - .mother-brain/github-issues/issue-1.md
911
- - .mother-brain/github-issues/issue-2.md
912
-
913
- You can submit these manually at:
914
- https://github.com/super-state/mother-brain/issues/new
915
- ```
916
- 3. Return to main menu with saved files
917
-
918
- **Step 2A.1.5: Update Issues Tracker & Display Results**
919
-
920
- - **Update `.mother-brain/issues-tracker.md`**:
921
- - Add new section for this session (if new issues were created):
922
- ```markdown
923
- ### Session: [Date] - [Context]
924
-
925
- | Issue # | Title | Status | URL |
926
- |---------|-------|--------|-----|
927
- | #[N] | [Title] | βœ… Submitted | [URL] |
928
- ```
929
- - Commit changes to git:
930
- ```powershell
931
- git add .mother-brain/issues-tracker.md
932
- git commit -m "docs: track submitted issues from [session context]"
933
- ```
934
-
935
- - Display summary of ALL submitted issues:
936
- ```
937
- βœ… Improvements Submitted!
938
-
939
- Created [N] new issues:
940
-
941
- πŸ“ #[1]: [title1]
942
- [issue URL]
943
-
944
- πŸ“ #[2]: [title2]
945
- [issue URL]
946
-
947
- πŸ“ #[3]: [title3]
948
- [issue URL]
949
-
950
- [If any were skipped] Skipped [Z] duplicates already submitted
951
-
952
- Your contributions are now visible to maintainers.
953
- Tracker updated: .mother-brain/issues-tracker.md
954
- ```
955
-
956
- - Use `ask_user` with choices:
957
- - "Keep local changes (for further work)"
958
- - "Revert Mother Brain files (clean slate)"
959
-
960
- - **If revert selected**:
961
- ```powershell
962
- git checkout HEAD -- ".github/skills/mother-brain/" ".github/skills/child-brain/" ".github/skills/skill-creator/" "cli/"
963
- ```
964
- - Display: "✨ Local Mother Brain files reverted to clean slate."
965
-
966
- - Return to main menu (Step 2)
690
+ - **Read `references/improvement-pipeline.md`** for the full pipeline (Steps 2A.1.1–2A.1.5)
691
+ - Covers: gather sources (learning log, core file diffs, conversation context), deduplication via issues tracker, correlate learnings with file changes, generate individual GitHub issues, submit via gh CLI (with manual fallback), update tracker
692
+ - Target repository: `super-state/mother-brain`
693
+ - After submission β†’ return to main menu (Step 2)
967
694
 
968
695
  ### 2A.2 **Review Community Improvements** (Maintainer Workflow)
969
696
  - **Access**: Only shown when meta-mode is active (in Mother Brain framework repo)
@@ -1324,92 +1051,10 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
1324
1051
 
1325
1052
  ### 2D. **Release Mother Brain** (Framework Versioning)
1326
1053
  - When user selects "Release Mother Brain" from menu or after eject:
1327
-
1328
- **Purpose**: One-click release - commit, version bump, push, tag, and publish.
1329
-
1330
- **Prerequisite**: Must be in the mother-brain framework folder (not a project folder)
1331
-
1332
- **⚑ MANDATORY RELEASE CHECKLIST (All items MUST be completed)**
1333
-
1334
- Every release MUST update ALL of the following:
1335
- ```
1336
- [ ] cli/package.json - version field
1337
- [ ] cli/src/cli.ts - version constant (if exists)
1338
- [ ] README.md - version badge AND version text
1339
- [ ] Git commit with changes
1340
- [ ] Git tag (v0.0.X)
1341
- [ ] Push to remote (main + tags)
1342
- [ ] GitHub Release (created automatically by workflow)
1343
- [ ] npm publish (triggered by tag push via workflow)
1344
- ```
1345
-
1346
- **β›” BLOCKING RULE**: Do NOT return to menu until ALL items above are completed.
1347
-
1348
- **⚑ ONE-CLICK RELEASE FLOW (No prompts, no menus)**
1349
-
1350
- When user selects "Release Mother Brain", execute ALL of the following automatically:
1351
-
1352
- **Step 2D.1: Verify & Analyze**
1353
- - Check current folder is mother-brain framework folder
1354
- - If in a project folder: Display error and offer to return to framework
1355
- - Run `git status` to verify there are changes to release
1356
- - If no changes: Display "Nothing to release" and return to menu
1357
-
1358
- **Step 2D.2: Auto-Determine Version**
1359
- - Read current version from `cli/package.json`
1360
- - Scan learning-log.md entries since last release tag (if exists)
1361
- - **Auto-determine version bump**:
1362
- - If any entry contains "breaking" or "major" β†’ **major** bump (X.0.0)
1363
- - If any entry contains "feature", "new", "add" β†’ **minor** bump (0.X.0)
1364
- - Otherwise β†’ **patch** bump (0.0.X)
1365
- - Do NOT ask user - auto-decide based on content
1366
-
1367
- **Step 2D.3: Update ALL Version References (MANDATORY)**
1368
- - Update `cli/package.json`: `"version": "[new-version]"`
1369
- - Update `cli/src/cli.ts`: version constant (search for old version, replace with new)
1370
- - Update `README.md`:
1371
- - Find `version-X.X.X-blue` badge and replace with new version
1372
- - Find `**Version**: X.X.X` text and replace with new version
1373
- - **Verify all files updated before proceeding**
1374
-
1375
- **Step 2D.4: Sync Skills to CLI and Agents**
1376
- - Copy `.github/skills/*` to `cli/skills/` (overwrite) β€” for npm package
1377
- - Verify `.agents/skills/` symlinks point to `.github/skills/` β€” for Codex CLI in framework repo
1378
-
1379
- **Step 2D.5: Build CLI**
1380
- - Run `cd cli && npm run build`
1381
- - If build fails: STOP and display error
1382
-
1383
- **Step 2D.6: Execute Git Operations**
1384
- - Stage all changes: `git add -A`
1385
- - Commit: `git commit -m "[type]: [description] (v[version])"`
1386
- - Create tag: `git tag v[version]`
1387
- - **Push to origin (super-state) ONLY**: `git push origin main --tags`
1388
- - **NEVER push to personal fork** - only super-state has npm publish token
1389
-
1390
- **Step 2D.7: Confirmation**
1391
- - Wait for workflow to complete (or check status)
1392
- - Display:
1393
- ```
1394
- βœ… Release v[version] Published!
1395
-
1396
- βœ… cli/package.json updated
1397
- βœ… cli/src/cli.ts updated
1398
- βœ… README.md updated
1399
- βœ… Git tag created and pushed
1400
- βœ… GitHub Release created (via workflow)
1401
- βœ… npm publish triggered (via workflow)
1402
-
1403
- Tag: v[version]
1404
- Release: https://github.com/superdenby/MotherBrain/releases/tag/v[version]
1405
- ```
1406
-
1407
- - Use `ask_user` with choices:
1408
- - "Open release on GitHub"
1409
- - "Return to main menu"
1410
- - "Start new project"
1411
-
1412
- - Handle selection appropriately
1054
+ - **Read `references/release-checklist.md`** for the full release workflow (Steps 2D.1–2D.7)
1055
+ - **⚑ ONE-CLICK RELEASE FLOW**: Verify changes β†’ auto-determine version β†’ update all version references β†’ sync skills β†’ build CLI β†’ git commit/tag/push
1056
+ - **β›” BLOCKING RULE**: Do NOT return to menu until ALL checklist items are completed
1057
+ - **NEVER push to personal fork** β€” only super-state has npm publish token
1413
1058
 
1414
1059
  ### 2E. **Brainstorm Mode** (Thinking Partner)
1415
1060
  - When user selects "Just talk (brainstorm mode)":
@@ -2977,99 +2622,12 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
2977
2622
  - Emphasize learning and iteration mindset
2978
2623
 
2979
2624
  ### 7.6 **Setup Validation & Self-Healing (MANDATORY REFLECTION - BLOCKS COMPLETION)**
2980
- - **Purpose**: This is the REFLECTION step mentioned in RULE 8. It MUST complete before declaring "setup complete".
2981
- - **When to run**: IMMEDIATELY after Step 7.5 displays menu and receives user response, BEFORE proceeding to any next action
2982
- - **Purpose**: Detect and learn from any issues that occurred during the setup flow (Steps 3-7)
2983
-
2984
- **Step 7.6.1: Scan Conversation for Setup Issues**
2985
- - Review the conversation history from Steps 3-7 for:
2986
- - **Build/Tool Failures**: Commands that failed, tools that errored
2987
- - **Skill Creation Failures**: Skills that failed to create or validate
2988
- - **Research Failures**: Web searches that returned no results
2989
- - **File Creation Errors**: Documents that failed to create
2990
- - **Retry Attempts**: Any step that had to be re-run
2991
- - **Partial Completions**: Steps that succeeded but with warnings
2992
-
2993
- - If 0 issues detected: Skip to Step 8 (Task Document Creation) when user selects "Start Task 001"
2994
- - If 1+ issues detected: Proceed with healing
2995
-
2996
- **Step 7.6.2: Layer 1 - Fix Current Project Setup**
2997
- - For each issue found:
2998
- - Identify what failed
2999
- - Determine root cause
3000
- - Apply fix to current project:
3001
- - Re-run failed command/tool
3002
- - Re-create failed file
3003
- - Re-validate failed skill
3004
- - Fix any incomplete setup
3005
- - Continue until all issues resolved
3006
-
3007
- **Step 7.6.3: Layer 2 - Extract Meta-Lessons for Mother Brain**
3008
- - For each issue, ask: "What could Mother Brain do differently to prevent this in ALL future projects?"
3009
- - Categories to consider:
3010
- - **Missing Validation**: Should a validation step exist where it doesn't?
3011
- - **Error Handling Gap**: Should Mother Brain catch and handle this error type?
3012
- - **Workflow Ordering**: Should steps be reordered to prevent this?
3013
- - **Missing Retry Logic**: Should automatic retry be added?
3014
- - **Missing Pre-Checks**: Should a prerequisite check exist?
3015
-
3016
- - Extract project-agnostic principle:
3017
- - ❌ Bad: "Coffee project skill creation failed"
3018
- - βœ… Good: "Skill creation should validate tool permissions before creating files"
3019
-
3020
- **Step 7.6.4: Auto-Apply Mother Brain Updates**
3021
- - For each meta-lesson extracted:
3022
- - Identify which step/section of SKILL.md to update
3023
- - Apply update using edit tool
3024
- - Display what was changed (transparency, not approval)
3025
-
3026
- - Log in `docs/learning-log.md`:
3027
- ```markdown
3028
- ## [Date] - Setup Self-Healing: [Project Name]
3029
- **Issues Found**: [Count]
3030
- **Layer 1 Fixes Applied**:
3031
- - [What was fixed in this project's setup]
3032
- **Layer 2 Meta-Lessons Extracted**:
3033
- - [Project-agnostic principle 1]
3034
- - [Project-agnostic principle 2]
3035
- **Mother Brain Updates Applied**:
3036
- - [Which step/section was updated]
3037
- - [What preventive measure was added]
3038
- **Impact**: Prevents [issue type] in all future projects
3039
- ```
3040
-
3041
- **Step 7.6.5: Display Summary**
3042
- - If issues were found, display:
3043
- ```
3044
- πŸ”§ Setup Validation & Reflection Complete
3045
-
3046
- Found [X] issue(s) during setup - all resolved:
3047
-
3048
- βœ… Project Fixes:
3049
- - [What was fixed in this project]
3050
-
3051
- βœ… Mother Brain Improvements:
3052
- - [Meta-lesson applied for future projects]
3053
-
3054
- βœ… Reflection complete - setup is now truly complete!
3055
- ```
3056
-
3057
- - If no issues found, display:
3058
- ```
3059
- βœ… Reflection Complete
3060
-
3061
- No issues detected during setup.
3062
- All steps executed successfully.
3063
-
3064
- Setup is now complete!
3065
- ```
3066
-
2625
+ - **Read `references/setup-validation.md`** for the full protocol (Steps 7.6.1–7.6.5)
2626
+ - **When to run**: IMMEDIATELY after Step 7.5 menu response, BEFORE proceeding to any next action
2627
+ - **Purpose**: Detect and learn from issues during setup flow (Steps 3-7)
2628
+ - Two-layer approach: Layer 1 fixes current project, Layer 2 extracts meta-lessons for all future projects
2629
+ - If 0 issues β†’ skip to user's selected action; if 1+ issues β†’ heal, then proceed
3067
2630
  - **ONLY AFTER this step completes can you proceed to user's selected action from Step 7.5 menu**
3068
- - This checkpoint ensures learning happens every session, not just when errors occur
3069
-
3070
- - Continue to user's selected action from Step 7.5 menu
3071
-
3072
- **Key Principle**: Every setup run improves Mother Brain for all future projects. Issues are not just fixedβ€”they're learned from.
3073
2631
 
3074
2632
  ### 8. **Task Document Creation**
3075
2633
  - Create `docs/tasks/` directory
@@ -0,0 +1,114 @@
1
+ # Improvement Submission Pipeline
2
+
3
+ Automatically detect ALL local Mother Brain improvements, parse learning logs for each distinct improvement, and submit a separate GitHub issue for each one.
4
+
5
+ ## Step 2A.1.1: Gather All Improvement Sources
6
+
7
+ Collect from THREE sources:
8
+
9
+ ### Source 1: Learning Log Entries
10
+ - Read `.mother-brain/project-brain.md` or `docs/learning-log.md`
11
+ - Parse for individual learning entries (marked by `## [Date]` or similar)
12
+ - Each entry = potential improvement
13
+ - Extract: date, trigger, learning, resolution
14
+
15
+ ### Source 2: Core File Changes
16
+ - Get changes to Mother Brain core files:
17
+ ```powershell
18
+ git diff HEAD -- ".github/skills/mother-brain/SKILL.md"
19
+ git diff HEAD -- ".github/skills/child-brain/SKILL.md"
20
+ git diff HEAD -- ".github/skills/skill-creator/SKILL.md"
21
+ ```
22
+ - If files are new/untracked: `git diff /dev/null -- [file]`
23
+
24
+ ### Source 3: Conversation Context
25
+ - Scan conversation history for:
26
+ - Friction points discussed
27
+ - Problems reported
28
+ - Solutions implemented
29
+ - Pattern: "this isn't working" β†’ "fixed by..."
30
+
31
+ - **If no improvements found across all sources**:
32
+ - Display: "πŸ“­ No local Mother Brain improvements to send."
33
+ - Return to Step 2A (Improve Mother Brain Menu)
34
+
35
+ ## Step 2A.1.1A: Check Issues Tracker (Deduplication)
36
+
37
+ - Check if `.mother-brain/issues-tracker.md` exists
38
+ - **If exists**: Read and parse submitted issues list for comparison
39
+ - **If doesn't exist**: Create empty tracker file
40
+
41
+ ## Step 2A.1.2: Correlate Learnings with File Changes
42
+
43
+ - For each learning entry found:
44
+ 1. Identify which file(s) were modified for this learning
45
+ 2. Extract the relevant diff sections (not the whole file diff)
46
+ 3. Match learning description to code changes
47
+
48
+ - Group by improvement type:
49
+ - **Behavioral improvements** β†’ Mother Brain SKILL.md changes
50
+ - **Feedback handling** β†’ Child Brain SKILL.md changes
51
+ - **Skill creation** β†’ Skill Creator SKILL.md changes
52
+
53
+ ## Step 2A.1.3: Generate Individual Issues (with Deduplication)
54
+
55
+ - Check each improvement against issues tracker β€” skip duplicates
56
+ - For EACH NEW improvement, create a separate issue using this template:
57
+
58
+ ```markdown
59
+ Title: [Improvement] [Brief title describing THIS specific improvement]
60
+
61
+ ## Summary
62
+ [2-3 sentences explaining what this specific improvement does]
63
+
64
+ ## Problem
65
+ [What friction was encountered that triggered this improvement]
66
+
67
+ ## Solution
68
+ [How Mother Brain addressed the friction]
69
+
70
+ ## Changes Made
71
+ **File**: [filename] (lines ~X-Y)
72
+
73
+ <details>
74
+ <summary>View diff</summary>
75
+
76
+ \```diff
77
+ [relevant diff for THIS improvement only - not entire file]
78
+ \```
79
+ </details>
80
+
81
+ ## Benefits
82
+ [How this helps all Mother Brain users]
83
+
84
+ ## Testing
85
+ [How the improvement was validated]
86
+
87
+ ---
88
+ *Submitted via Mother Brain v[version]*
89
+ ```
90
+
91
+ ## Step 2A.1.4: Submit Issues via gh CLI
92
+
93
+ - **Pre-flight Check**: `gh --version && gh auth status`
94
+
95
+ - **If gh CLI available and authenticated**:
96
+ - For each improvement: `gh issue create --repo super-state/mother-brain --title "[title]" --body "[body]"`
97
+ - Parse output for issue number and URL
98
+ - Add `Start-Sleep -Seconds 2` between submissions (rate limiting)
99
+ - Target repository: `super-state/mother-brain`
100
+
101
+ - **If gh CLI not available**:
102
+ - Save each issue to `.mother-brain/github-issues/issue-[N].md`
103
+ - Display instructions for manual submission at https://github.com/super-state/mother-brain/issues/new
104
+
105
+ ## Step 2A.1.5: Update Issues Tracker & Display Results
106
+
107
+ - Update `.mother-brain/issues-tracker.md` with new session entries
108
+ - Commit tracker: `git add .mother-brain/issues-tracker.md && git commit -m "docs: track submitted issues"`
109
+ - Display summary of all submitted issues with numbers and URLs
110
+ - Use `ask_user` with choices:
111
+ - "Keep local changes (for further work)"
112
+ - "Revert Mother Brain files (clean slate)"
113
+ - If revert: `git checkout HEAD -- ".github/skills/mother-brain/" ".github/skills/child-brain/" ".github/skills/skill-creator/" "cli/"`
114
+ - Return to main menu (Step 2)
@@ -0,0 +1,71 @@
1
+ # Existing Project Onboarding Workflow
2
+
3
+ When user selects to onboard Mother Brain into an existing project, follow these steps:
4
+
5
+ ## Step 2.2.1: Deep Repo Analysis
6
+ - Scan ALL files in the directory (not just specific ones)
7
+ - Use `glob` and `view` to understand:
8
+ - **Project Type**: What kind of project is this? (web app, game, library, CLI, etc.)
9
+ - **Tech Stack**: Languages, frameworks, dependencies
10
+ - **Architecture**: Folder structure, patterns, modules
11
+ - **Features Built**: What functionality already exists?
12
+ - **Current State**: Is it working? Partially complete? Early stage?
13
+
14
+ - Display findings:
15
+ ```
16
+ πŸ” Project Analysis Complete
17
+
18
+ What I Found:
19
+ - Type: [Project type detected]
20
+ - Tech Stack: [Languages, frameworks]
21
+ - Features Built: [List of detected features]
22
+ - Current State: [Assessment of completeness]
23
+ ```
24
+
25
+ ## Step 2.2.2: Vision Extraction (Clarifying Questions)
26
+ - Ask user questions to fill gaps (like vision discovery, but informed by analysis):
27
+ - "What is the main goal of this project?"
28
+ - "Who is this for? Who will use it?"
29
+ - "What problem does this solve?"
30
+ - "What inspired this project?" (to trigger domain research)
31
+ - "What's the most important thing to get right?"
32
+ - "Where are you trying to get to next? What's your next milestone?"
33
+
34
+ - Create `.mother-brain/docs/vision.md` with extracted vision
35
+
36
+ ## Step 2.2.3: Retrospective Roadmap
37
+ - Build roadmap that reflects reality:
38
+ - **Phase 0 (Done)**: What's already built (based on repo analysis)
39
+ - **Phase 1 (Current)**: What's in progress or next immediate steps
40
+ - **Phase 2+**: Future milestones based on user's stated goals
41
+
42
+ - Mark completed work as DONE in roadmap
43
+ - Identify current position in timeline
44
+ - Create `.mother-brain/docs/roadmap.md`
45
+
46
+ ## Step 2.2.4: Skill Identification
47
+ - Analyze patterns in existing code
48
+ - Identify repetitive work that warrants skills
49
+ - Invoke skill-creator for detected patterns
50
+
51
+ ## Step 2.2.5: Confirmation
52
+ - Display:
53
+ ```
54
+ βœ… Mother Brain Onboarded!
55
+
56
+ πŸ“‹ Vision: Captured
57
+ πŸ“Š Roadmap: [X] tasks identified
58
+ - [Y] already complete
59
+ - [Z] remaining
60
+ πŸ› οΈ Skills: [N] identified for creation
61
+
62
+ Ready to help you reach your next milestone!
63
+ ```
64
+
65
+ - Use `ask_user` with choices:
66
+ - "Start next task"
67
+ - "Review the roadmap"
68
+ - "Review the vision"
69
+ - "Adjust something before continuing"
70
+
71
+ - Proceed to normal workflow (Step 8+)
@@ -0,0 +1,65 @@
1
+ # Release Checklist β€” Mother Brain Framework
2
+
3
+ One-click release: commit, version bump, push, tag, and publish.
4
+
5
+ **Prerequisite**: Must be in the mother-brain framework folder (not a project folder)
6
+
7
+ ## Mandatory Checklist (ALL items MUST be completed)
8
+
9
+ ```
10
+ [ ] cli/package.json - version field
11
+ [ ] cli/src/cli.ts - version constant (if exists)
12
+ [ ] README.md - version badge AND version text
13
+ [ ] Git commit with changes
14
+ [ ] Git tag (v0.0.X)
15
+ [ ] Push to remote (main + tags)
16
+ [ ] GitHub Release (created automatically by workflow)
17
+ [ ] npm publish (triggered by tag push via workflow)
18
+ ```
19
+
20
+ **β›” BLOCKING RULE**: Do NOT return to menu until ALL items above are completed.
21
+
22
+ ## Step 2D.1: Verify & Analyze
23
+ - Check current folder is mother-brain framework folder
24
+ - If in a project folder: Display error and offer to return to framework
25
+ - Run `git status` to verify there are changes to release
26
+ - If no changes: Display "Nothing to release" and return to menu
27
+
28
+ ## Step 2D.2: Auto-Determine Version
29
+ - Read current version from `cli/package.json`
30
+ - Scan learning-log.md entries since last release tag (if exists)
31
+ - **Auto-determine version bump**:
32
+ - If any entry contains "breaking" or "major" β†’ **major** bump (X.0.0)
33
+ - If any entry contains "feature", "new", "add" β†’ **minor** bump (0.X.0)
34
+ - Otherwise β†’ **patch** bump (0.0.X)
35
+ - Do NOT ask user - auto-decide based on content
36
+
37
+ ## Step 2D.3: Update ALL Version References (MANDATORY)
38
+ - Update `cli/package.json`: `"version": "[new-version]"`
39
+ - Update `cli/src/cli.ts`: version constant (search for old version, replace with new)
40
+ - Update `README.md`:
41
+ - Find `version-X.X.X-blue` badge and replace with new version
42
+ - Find `**Version**: X.X.X` text and replace with new version
43
+ - **Verify all files updated before proceeding**
44
+
45
+ ## Step 2D.4: Sync Skills to CLI and Agents
46
+ - Copy `.github/skills/*` to `cli/skills/` (overwrite) β€” for npm package
47
+ - Verify `.agents/skills/` symlinks point to `.github/skills/` β€” for Codex CLI in framework repo
48
+
49
+ ## Step 2D.5: Build CLI
50
+ - Run `cd cli && npm run build`
51
+ - If build fails: STOP and display error
52
+
53
+ ## Step 2D.6: Execute Git Operations
54
+ - Stage all changes: `git add -A`
55
+ - Commit: `git commit -m "[type]: [description] (v[version])"`
56
+ - Create tag: `git tag v[version]`
57
+ - **Push to origin (super-state) ONLY**: `git push origin main --tags`
58
+ - **NEVER push to personal fork** - only super-state has npm publish token
59
+
60
+ ## Step 2D.7: Confirmation
61
+ - Display release summary with all checkmarks
62
+ - Use `ask_user` with choices:
63
+ - "Open release on GitHub"
64
+ - "Return to main menu"
65
+ - "Start new project"
@@ -0,0 +1,70 @@
1
+ # Setup Validation & Self-Healing Protocol
2
+
3
+ **MANDATORY REFLECTION β€” Blocks setup completion.**
4
+
5
+ This is the REFLECTION step mentioned in RULE 8. It MUST complete before declaring "setup complete".
6
+
7
+ **When to run**: IMMEDIATELY after Step 7.5 menu response, BEFORE proceeding to any next action.
8
+ **Purpose**: Detect and learn from any issues during the setup flow (Steps 3-7).
9
+
10
+ ## Step 7.6.1: Scan Conversation for Setup Issues
11
+ - Review conversation history from Steps 3-7 for:
12
+ - **Build/Tool Failures**: Commands that failed, tools that errored
13
+ - **Skill Creation Failures**: Skills that failed to create or validate
14
+ - **Research Failures**: Web searches that returned no results
15
+ - **File Creation Errors**: Documents that failed to create
16
+ - **Retry Attempts**: Any step that had to be re-run
17
+ - **Partial Completions**: Steps that succeeded but with warnings
18
+
19
+ - If 0 issues detected: Skip to Step 8 when user selects "Start Task 001"
20
+ - If 1+ issues detected: Proceed with healing
21
+
22
+ ## Step 7.6.2: Layer 1 β€” Fix Current Project Setup
23
+ - For each issue found:
24
+ - Identify what failed
25
+ - Determine root cause
26
+ - Apply fix: re-run failed command, re-create failed file, re-validate failed skill
27
+ - Continue until all issues resolved
28
+
29
+ ## Step 7.6.3: Layer 2 β€” Extract Meta-Lessons for Mother Brain
30
+ - For each issue, ask: "What could Mother Brain do differently to prevent this in ALL future projects?"
31
+ - Categories:
32
+ - **Missing Validation**: Should a validation step exist where it doesn't?
33
+ - **Error Handling Gap**: Should Mother Brain catch and handle this error type?
34
+ - **Workflow Ordering**: Should steps be reordered to prevent this?
35
+ - **Missing Retry Logic**: Should automatic retry be added?
36
+ - **Missing Pre-Checks**: Should a prerequisite check exist?
37
+
38
+ - Extract project-agnostic principle:
39
+ - ❌ Bad: "Coffee project skill creation failed"
40
+ - βœ… Good: "Skill creation should validate tool permissions before creating files"
41
+
42
+ ## Step 7.6.4: Auto-Apply Mother Brain Updates
43
+ - For each meta-lesson: identify SKILL.md section to update, apply edit, display changes
44
+ - Log in `docs/learning-log.md`:
45
+ ```markdown
46
+ ## [Date] - Setup Self-Healing: [Project Name]
47
+ **Issues Found**: [Count]
48
+ **Layer 1 Fixes Applied**: [What was fixed]
49
+ **Layer 2 Meta-Lessons Extracted**: [Principles]
50
+ **Mother Brain Updates Applied**: [Steps/sections updated]
51
+ **Impact**: Prevents [issue type] in all future projects
52
+ ```
53
+
54
+ ## Step 7.6.5: Display Summary
55
+ - If issues found:
56
+ ```
57
+ πŸ”§ Setup Validation & Reflection Complete
58
+ Found [X] issue(s) β€” all resolved.
59
+ βœ… Project Fixes: [summary]
60
+ βœ… Mother Brain Improvements: [meta-lessons]
61
+ ```
62
+
63
+ - If no issues:
64
+ ```
65
+ βœ… Reflection Complete β€” No issues detected. Setup is complete!
66
+ ```
67
+
68
+ - **ONLY AFTER this step completes** β†’ proceed to user's selected action from Step 7.5 menu
69
+
70
+ **Key Principle**: Every setup run improves Mother Brain for all future projects. Issues are not just fixedβ€”they're learned from.