mother-brain 0.0.32 β†’ 0.0.34

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
@@ -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.32";
656
+ var VERSION = "0.0.34";
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mother-brain",
3
- "version": "0.0.32",
3
+ "version": "0.0.34",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -837,109 +837,121 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
837
837
 
838
838
  - **If "Back to project"**: Return to main menu (Step 2)
839
839
 
840
- ### 2A.1 **Send Improvement** (Automatic One-Click Contribution)
840
+ ### 2A.1 **Send Improvement** (Automatic Multi-Issue Contribution)
841
841
  - When user selects "πŸ“€ Send my local improvements":
842
842
 
843
- **Purpose**: Automatically detect local Mother Brain improvements, gather context from learning logs, and submit a fully-formed GitHub issue in one click. No questions asked - just send.
843
+ **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.
844
844
 
845
845
  **AUTOMATIC WORKFLOW (No User Prompts)**:
846
846
 
847
- **Step 2A.1.1: Auto-Detect Local Changes**
847
+ **Step 2A.1.1: Gather All Improvement Sources**
848
848
 
849
- - Silently scan for changes to core files:
849
+ - Collect from THREE sources:
850
+
851
+ **Source 1: Learning Log Entries**
852
+ - Read `.mother-brain/project-brain.md` or `docs/learning-log.md`
853
+ - Parse for individual learning entries (marked by `## [Date]` or similar)
854
+ - Each entry = potential improvement
855
+ - Extract: date, trigger, learning, resolution
856
+
857
+ **Source 2: Core File Changes**
858
+ - Get changes to Mother Brain core files:
850
859
  ```powershell
851
- git diff --name-only HEAD -- ".github/skills/mother-brain/" ".github/skills/child-brain/" ".github/skills/skill-creator/" "cli/"
852
- git status --porcelain -- ".github/skills/mother-brain/" ".github/skills/child-brain/" ".github/skills/skill-creator/" "cli/"
860
+ git diff HEAD -- ".github/skills/mother-brain/SKILL.md"
861
+ git diff HEAD -- ".github/skills/child-brain/SKILL.md"
862
+ git diff HEAD -- ".github/skills/skill-creator/SKILL.md"
853
863
  ```
864
+ - If files are new/untracked: `git diff /dev/null -- [file]`
854
865
 
855
- - **Core files checked**:
856
- - `.github/skills/mother-brain/SKILL.md`
857
- - `.github/skills/child-brain/SKILL.md`
858
- - `.github/skills/skill-creator/SKILL.md`
859
- - `cli/src/**/*`
860
- - `cli/package.json`
866
+ **Source 3: Conversation Context**
867
+ - Scan conversation history for:
868
+ - Friction points discussed
869
+ - Problems reported
870
+ - Solutions implemented
871
+ - Pattern: "this isn't working" β†’ "fixed by..."
861
872
 
862
- - **If no changes detected**:
863
- - Display: "πŸ“­ No local Mother Brain changes to send. Make improvements first, then come back here."
873
+ - **If no improvements found across all sources**:
874
+ - Display: "πŸ“­ No local Mother Brain improvements to send."
864
875
  - Return to Step 2A (Improve Mother Brain Menu)
865
876
 
866
- **Step 2A.1.2: Auto-Generate Diff Summary**
867
-
868
- - For each changed file, get the diff silently
869
- - AI generates a human-readable summary:
870
- - What was changed
871
- - Why it was changed (inferred from diff context)
872
- - Expected benefit
877
+ **Step 2A.1.2: Correlate Learnings with File Changes**
873
878
 
874
- **Step 2A.1.3: Auto-Extract Learning Context**
879
+ - For each learning entry found:
880
+ 1. Identify which file(s) were modified for this learning
881
+ 2. Extract the relevant diff sections (not the whole file diff)
882
+ 3. Match learning description to code changes
875
883
 
876
- - Check `.mother-brain/project-brain.md` for recent learnings:
877
- - Extract last 3-5 relevant learning entries
878
- - Focus on friction that triggered Mother Brain improvements
884
+ - Group by improvement type:
885
+ - **Behavioral improvements** β†’ Mother Brain SKILL.md changes
886
+ - **Feedback handling** β†’ Child Brain SKILL.md changes
887
+ - **Skill creation** β†’ Skill Creator SKILL.md changes
879
888
 
880
- - Check conversation history for:
881
- - What friction was encountered
882
- - How it was resolved
883
- - What insight led to the improvement
889
+ **Step 2A.1.3: Generate Individual Issues**
884
890
 
885
- **Step 2A.1.4: Auto-Create GitHub Issue**
891
+ - For EACH distinct improvement, create a separate issue:
886
892
 
887
- - Generate complete issue automatically:
888
- ```markdown
889
- Title: [Improvement] [AI-generated brief title from changes]
890
-
891
- ## Summary
892
- [AI-generated summary explaining the improvement in 2-3 sentences]
893
-
894
- ## Changes
895
- [Collapsible diff for each file]
896
- <details>
897
- <summary>[filename] - [brief description]</summary>
898
-
899
- ```diff
900
- [actual diff]
901
- ```
902
- </details>
903
-
904
- ## Why This Improvement
905
- **Friction Encountered:**
906
- [Extracted from learning log - what problem was faced]
907
-
908
- **Resolution:**
909
- [How the improvement addresses the friction]
910
-
911
- **Expected Benefit:**
912
- [How this helps all Mother Brain users]
913
-
914
- ## Learning Log Context
915
- [Relevant excerpts from project-brain.md that led to this improvement]
916
-
917
- ---
918
- *Submitted automatically via Mother Brain v[version]*
919
- ```
893
+ ```markdown
894
+ Title: [Improvement] [Brief title describing THIS specific improvement]
920
895
 
921
- - Create issue using GitHub MCP:
922
- ```
923
- github-mcp-server: create_issue
924
- owner: [Mother Brain repo owner from git remote]
925
- repo: [Mother Brain repo name]
926
- title: [Generated title]
927
- body: [Generated body]
928
- labels: ["improvement", "community-contribution"]
929
- ```
896
+ ## Summary
897
+ [2-3 sentences explaining what this specific improvement does]
898
+
899
+ ## Problem
900
+ [What friction was encountered that triggered this improvement]
901
+
902
+ ## Solution
903
+ [How Mother Brain addressed the friction]
904
+
905
+ ## Changes Made
906
+ **File**: [filename] (lines ~X-Y)
907
+
908
+ <details>
909
+ <summary>View diff</summary>
910
+
911
+ ```diff
912
+ [relevant diff for THIS improvement only - not entire file]
913
+ ```
914
+ </details>
915
+
916
+ ## Benefits
917
+ [How this helps all Mother Brain users]
930
918
 
931
- **Step 2A.1.5: Confirm and Offer Revert**
919
+ ## Testing
920
+ [How the improvement was validated]
932
921
 
933
- - Display success message:
922
+ ---
923
+ *Submitted via Mother Brain v[version]*
924
+ ```
925
+
926
+ **Step 2A.1.4: Submit Issues (Batch)**
927
+
928
+ - For each generated improvement:
929
+ 1. Create GitHub issue using MCP
930
+ 2. Collect issue numbers and URLs
931
+ 3. Add small delay between submissions (avoid rate limiting)
932
+
933
+ - Target repository: `super-state/mother-brain`
934
+ - Detected from: git remote (if configured)
935
+ - Fallback: hardcoded default
936
+
937
+ **Step 2A.1.5: Display Results**
938
+
939
+ - Display summary of ALL submitted issues:
934
940
  ```
935
- βœ… Improvement Submitted!
941
+ βœ… Improvements Submitted!
942
+
943
+ Created [N] issues:
944
+
945
+ πŸ“ #[1]: [title1]
946
+ [issue URL]
936
947
 
937
- Issue #[number]: [title]
938
- [issue URL]
948
+ πŸ“ #[2]: [title2]
949
+ [issue URL]
939
950
 
940
- Changes detected:
941
- β€’ [file1] - [brief change description]
942
- β€’ [file2] - [brief change description]
951
+ πŸ“ #[3]: [title3]
952
+ [issue URL]
953
+
954
+ Your contributions are now visible to maintainers.
943
955
  ```
944
956
 
945
957
  - Use `ask_user` with choices:
@@ -1875,61 +1887,44 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
1875
1887
 
1876
1888
  - Proceed to Step 3.6 (Project Folder Setup)
1877
1889
 
1878
- ### 3.6. **Project Folder Setup** (MANDATORY - Framework vs Project Separation)
1890
+ ### 3.6. **Initialize Mother Brain in Current Directory** (MANDATORY)
1879
1891
 
1880
- **Purpose**: Create a separate folder for the project so that:
1881
- - Project commits go to project repo (not mother-brain)
1882
- - Mother Brain folder stays clean for framework development
1883
- - Skills are copied so they work in the project
1892
+ **Purpose**: Set up Mother Brain in the user's current working directory
1893
+ - Works like `npm init` or `git init` - operates where you are
1894
+ - Creates `.mother-brain/` for project state and documentation
1895
+ - Creates `.github/skills/` for project-specific skills (created as needed)
1884
1896
 
1885
1897
  **CRITICAL ORDERING RULE**:
1886
- - Step 3.6 (Project Folder Setup) MUST run BEFORE creating any project files (vision.md, roadmap.md, etc.)
1887
- - NEVER create `.mother-brain/` folder or project files in the framework folder
1888
- - The correct order is: Vision Discovery (questions only) β†’ Step 3.6 (create project folder) β†’ Step 4 (create vision.md in project folder)
1889
-
1890
- **Step 3.6.1: Determine Project Location**
1891
- - Derive project folder name from vision (kebab-case, e.g., "coffee-discovery-app")
1892
- - Default location: Sibling folder `../[project-name]/`
1898
+ - Step 3.6 MUST run BEFORE creating any project files (vision.md, roadmap.md, etc.)
1899
+ - The correct order is: Vision Discovery (questions only) β†’ Step 3.6 (initialize) β†’ Step 4 (create vision.md)
1893
1900
 
1901
+ **Step 3.6.1: Confirm Current Directory**
1902
+ - Display current working directory to user
1894
1903
  - Use `ask_user` with choices:
1895
- - "[project-name] folder next to mother-brain (recommended)"
1896
- - "I'll specify a custom location"
1897
- - "Keep in current folder (framework testing mode)"
1898
-
1899
- **If custom location**: Ask for path with `ask_user` freeform
1904
+ - "Yes, set up Mother Brain here"
1905
+ - "No, let me change directories first"
1900
1906
 
1901
- **If "Keep in current folder"**:
1902
- - Display warning: "⚠️ Framework Testing Mode - commits will go to mother-brain repo"
1903
- - Skip to Step 4 (Vision Document Creation)
1907
+ - If user says no:
1908
+ - Display: "Please `cd` to your desired project directory and run `/mother-brain` again."
1909
+ - STOP execution
1904
1910
 
1905
- **Step 3.6.2: Create Project Folder**
1906
- - Create the project directory:
1911
+ **Step 3.6.2: Create Project Structure**
1912
+ - Create Mother Brain folders in current directory:
1907
1913
  ```powershell
1908
- New-Item -ItemType Directory -Path "[project-path]" -Force
1914
+ New-Item -ItemType Directory -Path ".mother-brain" -Force
1915
+ New-Item -ItemType Directory -Path ".mother-brain/docs" -Force
1916
+ New-Item -ItemType Directory -Path ".mother-brain/docs/tasks" -Force
1917
+ New-Item -ItemType Directory -Path ".mother-brain/docs/research" -Force
1918
+ New-Item -ItemType Directory -Path ".github/skills" -Force
1909
1919
  ```
1910
1920
 
1911
- **Step 3.6.3: Create Project Skill Structure**
1912
- - Create `.github/skills/` folder in project (for project-specific skills)
1913
- - **DO NOT copy core framework skills** (mother-brain, child-brain, skill-creator):
1914
- - These stay in the framework folder only
1915
- - They are invoked from framework, not duplicated
1916
- - Avoids sync issues and confusion about authoritative versions
1917
-
1918
- - Copy these files/folders to the new project:
1919
- - `docs/learning-log.md` (or create empty if doesn't exist)
1920
- - `.gitignore` (if exists)
1921
-
1922
- - Do NOT copy:
1923
- - `.github/skills/` core skills (mother-brain, child-brain, skill-creator)
1924
- - `README.md` (will create project-specific one)
1925
- - `CONTRIBUTING.md`, `CODE_OF_CONDUCT.md` (framework-specific)
1926
- - `package.json` (framework-specific)
1927
-
1928
- - Create empty `.mother-brain/` folder for project docs
1929
-
1930
- - **Note**: Project-specific skills created during Step 6 go in project's `.github/skills/`. Core skills are accessed from the framework.
1921
+ - Create initial version tracking:
1922
+ ```powershell
1923
+ $version = "[current-mother-brain-version]"
1924
+ @{version=$version; initialized=(Get-Date -Format "o")} | ConvertTo-Json | Set-Content ".mother-brain/version.json"
1925
+ ```
1931
1926
 
1932
- **Step 3.6.4: Initialize Git (MANDATORY)**
1927
+ **Step 3.6.3: Initialize Git (MANDATORY)**
1933
1928
  - Git is REQUIRED for Mother Brain to function properly:
1934
1929
  - Improvement submissions require git diff
1935
1930
  - Version tracking requires git tags
@@ -1937,20 +1932,18 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
1937
1932
 
1938
1933
  - Check if git is already initialized:
1939
1934
  ```powershell
1940
- $gitExists = Test-Path (Join-Path "[project-path]" ".git")
1935
+ $gitExists = Test-Path ".git"
1941
1936
  ```
1942
1937
 
1943
1938
  - If git already exists:
1944
1939
  - Display: "βœ… Git repository detected"
1945
- - Skip initialization
1946
1940
 
1947
1941
  - If git does NOT exist:
1948
1942
  - Initialize automatically:
1949
1943
  ```powershell
1950
- Set-Location "[project-path]"
1951
1944
  git init
1952
1945
  git add .
1953
- git commit -m "Initial project setup from Mother Brain"
1946
+ git commit -m "Initialize Mother Brain"
1954
1947
  ```
1955
1948
  - Display: "βœ… Git repository initialized"
1956
1949
 
@@ -1958,35 +1951,22 @@ This pattern ensures NO workflow ever traps the userβ€”there's always an escape
1958
1951
  - "Continue (git is ready)"
1959
1952
  - "I want to connect to a remote repository"
1960
1953
 
1961
- - If user wants to connect existing repo:
1954
+ - If user wants to connect remote:
1962
1955
  - Ask for repo URL with `ask_user` freeform
1963
1956
  - `git remote add origin [url]`
1964
1957
 
1965
- **Step 3.6.5: Switch Context to Project Folder**
1966
- - Change working directory to project folder:
1967
- ```powershell
1968
- Set-Location "[project-path]"
1969
- ```
1970
-
1971
- - **Add project folder to current VS Code workspace** (keeps terminal session active):
1972
- ```powershell
1973
- code --add "[project-path]"
1974
- ```
1975
-
1958
+ **Step 3.6.4: Display Confirmation**
1976
1959
  - Display:
1977
1960
  ```
1978
- βœ… Project folder created!
1961
+ βœ… Mother Brain initialized!
1979
1962
 
1980
- πŸ“ Location: [project-path]
1981
- πŸ“¦ Skills: Copied (mother-brain, child-brain, skill-creator)
1982
- πŸ”— Git: [Initialized / Not set up]
1963
+ πŸ“ Location: [current directory]
1964
+ πŸ“‚ Created: .mother-brain/, .github/skills/
1965
+ πŸ”— Git: [Initialized / Already existed]
1983
1966
 
1984
- Project folder added to your workspace. Your file tree now shows the project.
1985
- Terminal session preserved - continue working here.
1967
+ Ready to create your vision document.
1986
1968
  ```
1987
1969
 
1988
- - Store project path in memory for potential eject/return
1989
- - **CRITICAL**: Do NOT open a new VS Code window. Use `code --add` to add to current workspace, preserving the terminal session.
1990
1970
  - **Proceed to Step 4** (Vision Document Creation)
1991
1971
 
1992
1972
  ### 4. **Vision Document Creation**