mother-brain 0.5.1 β†’ 0.5.2

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.5.2";
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.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -597,75 +597,9 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
597
597
 
598
598
  ### 2.2. **Existing Project Onboarding**
599
599
  - When user selects to onboard Mother Brain into an existing project:
600
-
601
- **Step 2.2.1: Deep Repo Analysis**
602
- - Scan ALL files in the directory (not just specific ones)
603
- - Use `glob` and `view` to understand:
604
- - **Project Type**: What kind of project is this? (web app, game, library, CLI, etc.)
605
- - **Tech Stack**: Languages, frameworks, dependencies
606
- - **Architecture**: Folder structure, patterns, modules
607
- - **Features Built**: What functionality already exists?
608
- - **Current State**: Is it working? Partially complete? Early stage?
609
-
610
- - Display findings:
611
- ```
612
- πŸ” Project Analysis Complete
613
-
614
- What I Found:
615
- - Type: [Project type detected]
616
- - Tech Stack: [Languages, frameworks]
617
- - Features Built: [List of detected features]
618
- - Current State: [Assessment of completeness]
619
- ```
620
-
621
- **Step 2.2.2: Vision Extraction (Clarifying Questions)**
622
- - Ask user questions to fill gaps (like vision discovery, but informed by analysis):
623
- - "What is the main goal of this project?"
624
- - "Who is this for? Who will use it?"
625
- - "What problem does this solve?"
626
- - "What inspired this project?" (to trigger domain research)
627
- - "What's the most important thing to get right?"
628
- - "Where are you trying to get to next? What's your next milestone?"
629
-
630
- - Create `.mother-brain/docs/vision.md` with extracted vision
631
-
632
- **Step 2.2.3: Retrospective Roadmap**
633
- - Build roadmap that reflects reality:
634
- - **Phase 0 (Done)**: What's already built (based on repo analysis)
635
- - **Phase 1 (Current)**: What's in progress or next immediate steps
636
- - **Phase 2+**: Future milestones based on user's stated goals
637
-
638
- - Mark completed work as DONE in roadmap
639
- - Identify current position in timeline
640
-
641
- - Create `.mother-brain/docs/roadmap.md`
642
-
643
- **Step 2.2.4: Skill Identification**
644
- - Analyze patterns in existing code
645
- - Identify repetitive work that warrants skills
646
- - Invoke skill-creator for detected patterns
647
-
648
- **Step 2.2.5: Confirmation**
649
- - Display:
650
- ```
651
- βœ… Mother Brain Onboarded!
652
-
653
- πŸ“‹ Vision: Captured
654
- πŸ“Š Roadmap: [X] tasks identified
655
- - [Y] already complete
656
- - [Z] remaining
657
- πŸ› οΈ Skills: [N] identified for creation
658
-
659
- Ready to help you reach your next milestone!
660
- ```
661
-
662
- - Use `ask_user` with choices:
663
- - "Start next task"
664
- - "Review the roadmap"
665
- - "Review the vision"
666
- - "Adjust something before continuing"
667
-
668
- - Proceed to normal workflow (Step 8+)
600
+ - **Read `references/onboarding-workflow.md`** for the full onboarding workflow (Steps 2.2.1–2.2.5)
601
+ - Covers: deep repo analysis, vision extraction, retrospective roadmap, skill identification, confirmation
602
+ - After onboarding completes β†’ proceed to normal workflow (Step 8+)
669
603
 
670
604
  ### 2A. **Improve Mother Brain Menu** (From Any Project)
671
605
  - When user selects "🧠 Improve Mother Brain" from the existing project menu:
@@ -750,217 +684,10 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
750
684
 
751
685
  ### 2A.1 **Send Improvement** (Automatic Multi-Issue Contribution)
752
686
  - When user selects "πŸ“€ Send my local improvements":
753
-
754
- **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.
755
-
756
- **AUTOMATIC WORKFLOW (No User Prompts)**:
757
-
758
- **Step 2A.1.1: Gather All Improvement Sources**
759
-
760
- - Collect from THREE sources:
761
-
762
- **Source 1: Learning Log Entries**
763
- - Read `.mother-brain/project-brain.md` or `docs/learning-log.md`
764
- - Parse for individual learning entries (marked by `## [Date]` or similar)
765
- - Each entry = potential improvement
766
- - Extract: date, trigger, learning, resolution
767
-
768
- **Source 2: Core File Changes**
769
- - Get changes to Mother Brain core files:
770
- ```powershell
771
- git diff HEAD -- ".github/skills/mother-brain/SKILL.md"
772
- git diff HEAD -- ".github/skills/child-brain/SKILL.md"
773
- git diff HEAD -- ".github/skills/skill-creator/SKILL.md"
774
- ```
775
- - If files are new/untracked: `git diff /dev/null -- [file]`
776
-
777
- **Source 3: Conversation Context**
778
- - Scan conversation history for:
779
- - Friction points discussed
780
- - Problems reported
781
- - Solutions implemented
782
- - Pattern: "this isn't working" β†’ "fixed by..."
783
-
784
- - **If no improvements found across all sources**:
785
- - Display: "πŸ“­ No local Mother Brain improvements to send."
786
- - Return to Step 2A (Improve Mother Brain Menu)
787
-
788
- **Step 2A.1.1A: Check Issues Tracker (Deduplication)**
789
-
790
- - Check if `.mother-brain/issues-tracker.md` exists
791
- - **If exists**:
792
- - Read file and parse submitted issues list
793
- - Extract issue numbers and titles already submitted
794
- - Store in memory for comparison
795
- - **If doesn't exist**:
796
- - Create empty tracker file with template:
797
- ```markdown
798
- # Mother Brain Issues Tracker
799
-
800
- ## Issues Submitted to GitHub (super-state/mother-brain)
801
-
802
- (No issues submitted yet)
803
- ```
804
-
805
- **Step 2A.1.2: Correlate Learnings with File Changes**
806
-
807
- - For each learning entry found:
808
- 1. Identify which file(s) were modified for this learning
809
- 2. Extract the relevant diff sections (not the whole file diff)
810
- 3. Match learning description to code changes
811
-
812
- - Group by improvement type:
813
- - **Behavioral improvements** β†’ Mother Brain SKILL.md changes
814
- - **Feedback handling** β†’ Child Brain SKILL.md changes
815
- - **Skill creation** β†’ Skill Creator SKILL.md changes
816
-
817
- **Step 2A.1.3: Generate Individual Issues (with Deduplication)**
818
-
819
- - **Before generating issues**: Check each improvement against issues tracker
820
- - Compare improvement title/description against already-submitted issues
821
- - If match found: Skip this improvement
822
- - If no match: Proceed to generate issue
823
-
824
- - Display deduplication results:
825
- ```
826
- πŸ” Checking for duplicate submissions...
827
-
828
- Found [X] improvements:
829
- - [Y] new (will be submitted)
830
- - [Z] already submitted (skipped)
831
- ```
832
-
833
- - **If all improvements already submitted**:
834
- - Display: "βœ… All improvements already submitted! No duplicates created."
835
- - Return to Step 2A (Improve Mother Brain Menu)
836
-
837
- - For EACH NEW (not duplicate) improvement, create a separate issue:
838
-
839
- ```markdown
840
- Title: [Improvement] [Brief title describing THIS specific improvement]
841
-
842
- ## Summary
843
- [2-3 sentences explaining what this specific improvement does]
844
-
845
- ## Problem
846
- [What friction was encountered that triggered this improvement]
847
-
848
- ## Solution
849
- [How Mother Brain addressed the friction]
850
-
851
- ## Changes Made
852
- **File**: [filename] (lines ~X-Y)
853
-
854
- <details>
855
- <summary>View diff</summary>
856
-
857
- ```diff
858
- [relevant diff for THIS improvement only - not entire file]
859
- ```
860
- </details>
861
-
862
- ## Benefits
863
- [How this helps all Mother Brain users]
864
-
865
- ## Testing
866
- [How the improvement was validated]
867
-
868
- ---
869
- *Submitted via Mother Brain v[version]*
870
- ```
871
-
872
- **Step 2A.1.4: Submit Issues via gh CLI**
873
-
874
- - **Pre-flight Check**: Verify gh CLI is available and authenticated
875
- ```powershell
876
- gh --version
877
- gh auth status
878
- ```
879
-
880
- - **If gh CLI available and authenticated**:
881
- - For each generated improvement:
882
- 1. Create GitHub issue using gh CLI:
883
- ```powershell
884
- gh issue create --repo super-state/mother-brain --title "[title]" --body "[body]"
885
- ```
886
- 2. Parse output to get issue number and URL
887
- 3. Collect issue numbers and URLs
888
- 4. Add small delay between submissions (avoid rate limiting): `Start-Sleep -Seconds 2`
889
-
890
- - Target repository: `super-state/mother-brain`
891
- - Detected from: git remote (if configured)
892
- - Fallback: hardcoded default
893
-
894
- - **If gh CLI not installed or not authenticated**:
895
- - **Fallback to manual submission**:
896
- 1. Save each issue to `.mother-brain/github-issues/issue-[N].md`
897
- 2. Display instructions:
898
- ```
899
- ⚠️ gh CLI not available
900
-
901
- To auto-submit improvements, install gh CLI:
902
- https://cli.github.com
903
-
904
- Then authenticate: gh auth login
905
-
906
- πŸ“ Issue content saved to:
907
- - .mother-brain/github-issues/issue-1.md
908
- - .mother-brain/github-issues/issue-2.md
909
-
910
- You can submit these manually at:
911
- https://github.com/super-state/mother-brain/issues/new
912
- ```
913
- 3. Return to main menu with saved files
914
-
915
- **Step 2A.1.5: Update Issues Tracker & Display Results**
916
-
917
- - **Update `.mother-brain/issues-tracker.md`**:
918
- - Add new section for this session (if new issues were created):
919
- ```markdown
920
- ### Session: [Date] - [Context]
921
-
922
- | Issue # | Title | Status | URL |
923
- |---------|-------|--------|-----|
924
- | #[N] | [Title] | βœ… Submitted | [URL] |
925
- ```
926
- - Commit changes to git:
927
- ```powershell
928
- git add .mother-brain/issues-tracker.md
929
- git commit -m "docs: track submitted issues from [session context]"
930
- ```
931
-
932
- - Display summary of ALL submitted issues:
933
- ```
934
- βœ… Improvements Submitted!
935
-
936
- Created [N] new issues:
937
-
938
- πŸ“ #[1]: [title1]
939
- [issue URL]
940
-
941
- πŸ“ #[2]: [title2]
942
- [issue URL]
943
-
944
- πŸ“ #[3]: [title3]
945
- [issue URL]
946
-
947
- [If any were skipped] Skipped [Z] duplicates already submitted
948
-
949
- Your contributions are now visible to maintainers.
950
- Tracker updated: .mother-brain/issues-tracker.md
951
- ```
952
-
953
- - Use `ask_user` with choices:
954
- - "Keep local changes (for further work)"
955
- - "Revert Mother Brain files (clean slate)"
956
-
957
- - **If revert selected**:
958
- ```powershell
959
- git checkout HEAD -- ".github/skills/mother-brain/" ".github/skills/child-brain/" ".github/skills/skill-creator/" "cli/"
960
- ```
961
- - Display: "✨ Local Mother Brain files reverted to clean slate."
962
-
963
- - Return to main menu (Step 2)
687
+ - **Read `references/improvement-pipeline.md`** for the full pipeline (Steps 2A.1.1–2A.1.5)
688
+ - 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
689
+ - Target repository: `super-state/mother-brain`
690
+ - After submission β†’ return to main menu (Step 2)
964
691
 
965
692
  ### 2A.2 **Review Community Improvements** (Maintainer Workflow)
966
693
  - **Access**: Only shown when meta-mode is active (in Mother Brain framework repo)
@@ -1321,92 +1048,10 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
1321
1048
 
1322
1049
  ### 2D. **Release Mother Brain** (Framework Versioning)
1323
1050
  - When user selects "Release Mother Brain" from menu or after eject:
1324
-
1325
- **Purpose**: One-click release - commit, version bump, push, tag, and publish.
1326
-
1327
- **Prerequisite**: Must be in the mother-brain framework folder (not a project folder)
1328
-
1329
- **⚑ MANDATORY RELEASE CHECKLIST (All items MUST be completed)**
1330
-
1331
- Every release MUST update ALL of the following:
1332
- ```
1333
- [ ] cli/package.json - version field
1334
- [ ] cli/src/cli.ts - version constant (if exists)
1335
- [ ] README.md - version badge AND version text
1336
- [ ] Git commit with changes
1337
- [ ] Git tag (v0.0.X)
1338
- [ ] Push to remote (main + tags)
1339
- [ ] GitHub Release (created automatically by workflow)
1340
- [ ] npm publish (triggered by tag push via workflow)
1341
- ```
1342
-
1343
- **β›” BLOCKING RULE**: Do NOT return to menu until ALL items above are completed.
1344
-
1345
- **⚑ ONE-CLICK RELEASE FLOW (No prompts, no menus)**
1346
-
1347
- When user selects "Release Mother Brain", execute ALL of the following automatically:
1348
-
1349
- **Step 2D.1: Verify & Analyze**
1350
- - Check current folder is mother-brain framework folder
1351
- - If in a project folder: Display error and offer to return to framework
1352
- - Run `git status` to verify there are changes to release
1353
- - If no changes: Display "Nothing to release" and return to menu
1354
-
1355
- **Step 2D.2: Auto-Determine Version**
1356
- - Read current version from `cli/package.json`
1357
- - Scan learning-log.md entries since last release tag (if exists)
1358
- - **Auto-determine version bump**:
1359
- - If any entry contains "breaking" or "major" β†’ **major** bump (X.0.0)
1360
- - If any entry contains "feature", "new", "add" β†’ **minor** bump (0.X.0)
1361
- - Otherwise β†’ **patch** bump (0.0.X)
1362
- - Do NOT ask user - auto-decide based on content
1363
-
1364
- **Step 2D.3: Update ALL Version References (MANDATORY)**
1365
- - Update `cli/package.json`: `"version": "[new-version]"`
1366
- - Update `cli/src/cli.ts`: version constant (search for old version, replace with new)
1367
- - Update `README.md`:
1368
- - Find `version-X.X.X-blue` badge and replace with new version
1369
- - Find `**Version**: X.X.X` text and replace with new version
1370
- - **Verify all files updated before proceeding**
1371
-
1372
- **Step 2D.4: Sync Skills to CLI and Agents**
1373
- - Copy `.github/skills/*` to `cli/skills/` (overwrite) β€” for npm package
1374
- - Verify `.agents/skills/` symlinks point to `.github/skills/` β€” for Codex CLI in framework repo
1375
-
1376
- **Step 2D.5: Build CLI**
1377
- - Run `cd cli && npm run build`
1378
- - If build fails: STOP and display error
1379
-
1380
- **Step 2D.6: Execute Git Operations**
1381
- - Stage all changes: `git add -A`
1382
- - Commit: `git commit -m "[type]: [description] (v[version])"`
1383
- - Create tag: `git tag v[version]`
1384
- - **Push to origin (super-state) ONLY**: `git push origin main --tags`
1385
- - **NEVER push to personal fork** - only super-state has npm publish token
1386
-
1387
- **Step 2D.7: Confirmation**
1388
- - Wait for workflow to complete (or check status)
1389
- - Display:
1390
- ```
1391
- βœ… Release v[version] Published!
1392
-
1393
- βœ… cli/package.json updated
1394
- βœ… cli/src/cli.ts updated
1395
- βœ… README.md updated
1396
- βœ… Git tag created and pushed
1397
- βœ… GitHub Release created (via workflow)
1398
- βœ… npm publish triggered (via workflow)
1399
-
1400
- Tag: v[version]
1401
- Release: https://github.com/superdenby/MotherBrain/releases/tag/v[version]
1402
- ```
1403
-
1404
- - Use `ask_user` with choices:
1405
- - "Open release on GitHub"
1406
- - "Return to main menu"
1407
- - "Start new project"
1408
-
1409
- - Handle selection appropriately
1051
+ - **Read `references/release-checklist.md`** for the full release workflow (Steps 2D.1–2D.7)
1052
+ - **⚑ ONE-CLICK RELEASE FLOW**: Verify changes β†’ auto-determine version β†’ update all version references β†’ sync skills β†’ build CLI β†’ git commit/tag/push
1053
+ - **β›” BLOCKING RULE**: Do NOT return to menu until ALL checklist items are completed
1054
+ - **NEVER push to personal fork** β€” only super-state has npm publish token
1410
1055
 
1411
1056
  ### 2E. **Brainstorm Mode** (Thinking Partner)
1412
1057
  - When user selects "Just talk (brainstorm mode)":
@@ -2797,99 +2442,12 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
2797
2442
  - Emphasize learning and iteration mindset
2798
2443
 
2799
2444
  ### 7.6 **Setup Validation & Self-Healing (MANDATORY REFLECTION - BLOCKS COMPLETION)**
2800
- - **Purpose**: This is the REFLECTION step mentioned in RULE 8. It MUST complete before declaring "setup complete".
2801
- - **When to run**: IMMEDIATELY after Step 7.5 displays menu and receives user response, BEFORE proceeding to any next action
2802
- - **Purpose**: Detect and learn from any issues that occurred during the setup flow (Steps 3-7)
2803
-
2804
- **Step 7.6.1: Scan Conversation for Setup Issues**
2805
- - Review the conversation history from Steps 3-7 for:
2806
- - **Build/Tool Failures**: Commands that failed, tools that errored
2807
- - **Skill Creation Failures**: Skills that failed to create or validate
2808
- - **Research Failures**: Web searches that returned no results
2809
- - **File Creation Errors**: Documents that failed to create
2810
- - **Retry Attempts**: Any step that had to be re-run
2811
- - **Partial Completions**: Steps that succeeded but with warnings
2812
-
2813
- - If 0 issues detected: Skip to Step 8 (Task Document Creation) when user selects "Start Task 001"
2814
- - If 1+ issues detected: Proceed with healing
2815
-
2816
- **Step 7.6.2: Layer 1 - Fix Current Project Setup**
2817
- - For each issue found:
2818
- - Identify what failed
2819
- - Determine root cause
2820
- - Apply fix to current project:
2821
- - Re-run failed command/tool
2822
- - Re-create failed file
2823
- - Re-validate failed skill
2824
- - Fix any incomplete setup
2825
- - Continue until all issues resolved
2826
-
2827
- **Step 7.6.3: Layer 2 - Extract Meta-Lessons for Mother Brain**
2828
- - For each issue, ask: "What could Mother Brain do differently to prevent this in ALL future projects?"
2829
- - Categories to consider:
2830
- - **Missing Validation**: Should a validation step exist where it doesn't?
2831
- - **Error Handling Gap**: Should Mother Brain catch and handle this error type?
2832
- - **Workflow Ordering**: Should steps be reordered to prevent this?
2833
- - **Missing Retry Logic**: Should automatic retry be added?
2834
- - **Missing Pre-Checks**: Should a prerequisite check exist?
2835
-
2836
- - Extract project-agnostic principle:
2837
- - ❌ Bad: "Coffee project skill creation failed"
2838
- - βœ… Good: "Skill creation should validate tool permissions before creating files"
2839
-
2840
- **Step 7.6.4: Auto-Apply Mother Brain Updates**
2841
- - For each meta-lesson extracted:
2842
- - Identify which step/section of SKILL.md to update
2843
- - Apply update using edit tool
2844
- - Display what was changed (transparency, not approval)
2845
-
2846
- - Log in `docs/learning-log.md`:
2847
- ```markdown
2848
- ## [Date] - Setup Self-Healing: [Project Name]
2849
- **Issues Found**: [Count]
2850
- **Layer 1 Fixes Applied**:
2851
- - [What was fixed in this project's setup]
2852
- **Layer 2 Meta-Lessons Extracted**:
2853
- - [Project-agnostic principle 1]
2854
- - [Project-agnostic principle 2]
2855
- **Mother Brain Updates Applied**:
2856
- - [Which step/section was updated]
2857
- - [What preventive measure was added]
2858
- **Impact**: Prevents [issue type] in all future projects
2859
- ```
2860
-
2861
- **Step 7.6.5: Display Summary**
2862
- - If issues were found, display:
2863
- ```
2864
- πŸ”§ Setup Validation & Reflection Complete
2865
-
2866
- Found [X] issue(s) during setup - all resolved:
2867
-
2868
- βœ… Project Fixes:
2869
- - [What was fixed in this project]
2870
-
2871
- βœ… Mother Brain Improvements:
2872
- - [Meta-lesson applied for future projects]
2873
-
2874
- βœ… Reflection complete - setup is now truly complete!
2875
- ```
2876
-
2877
- - If no issues found, display:
2878
- ```
2879
- βœ… Reflection Complete
2880
-
2881
- No issues detected during setup.
2882
- All steps executed successfully.
2883
-
2884
- Setup is now complete!
2885
- ```
2886
-
2445
+ - **Read `references/setup-validation.md`** for the full protocol (Steps 7.6.1–7.6.5)
2446
+ - **When to run**: IMMEDIATELY after Step 7.5 menu response, BEFORE proceeding to any next action
2447
+ - **Purpose**: Detect and learn from issues during setup flow (Steps 3-7)
2448
+ - Two-layer approach: Layer 1 fixes current project, Layer 2 extracts meta-lessons for all future projects
2449
+ - If 0 issues β†’ skip to user's selected action; if 1+ issues β†’ heal, then proceed
2887
2450
  - **ONLY AFTER this step completes can you proceed to user's selected action from Step 7.5 menu**
2888
- - This checkpoint ensures learning happens every session, not just when errors occur
2889
-
2890
- - Continue to user's selected action from Step 7.5 menu
2891
-
2892
- **Key Principle**: Every setup run improves Mother Brain for all future projects. Issues are not just fixedβ€”they're learned from.
2893
2451
 
2894
2452
  ### 8. **Task Document Creation**
2895
2453
  - 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.