mother-brain 0.7.3 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -798,7 +798,7 @@ async function uninstall(options) {
798
798
  // src/cli.ts
799
799
  import { exec as exec3 } from "child_process";
800
800
  var program = new Command();
801
- var VERSION = "0.7.3";
801
+ var VERSION = "0.7.5";
802
802
  program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI and Codex CLI").version(VERSION);
803
803
  program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
804
804
  program.command("update").description("Update Mother Brain skills to the latest version").action(update);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mother-brain",
3
- "version": "0.7.3",
3
+ "version": "0.7.5",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -137,6 +137,7 @@ allowed-tools: powershell view grep glob web_search ask_user create edit skill
137
137
  - Template files to load on demand:
138
138
  - **Boot/Startup**: Read `references/boot-screen.md` before printing startup status
139
139
  - **Outcome Demo**: Read `references/outcome-demo.md` before outcome validation/sign-off
140
+ - **Outcome Discovery**: Read `references/outcome-discovery.md` before adding a new outcome/phase or pivoting to a new outcome
140
141
  - **Menus**: Read `references/branded-menu.md` before displaying any menu
141
142
  - **Formatting**: Read `references/formatting-rules.md` before formatting lists/output
142
143
  - **Issue reporting**: Read `references/issue-reporting.md` when handling freeform issue detection
@@ -240,7 +241,7 @@ Mother Brain transforms high-level visions into executable reality by:
240
241
  - **Adaptive planning**: Roadmaps are living documents, not contracts
241
242
  - **Outcome-Driven Roadmap (CORE PRINCIPLE)**: Roadmaps are organized by **Outcomes** (user abilities), not tasks. Each outcome is an "Ability to [do something]" that fulfills a user need. Tasks exist only as internal implementation details. Users validate **acceptance criteria** for outcomes, never technical tasks. This keeps validation meaningful ("Can I now do X?") rather than abstract ("Does this code look right?").
242
243
  - **User Needs as Foundation**: During Vision Discovery, capture explicit user needs as "Ability to..." statements. These become the outcomes in the roadmap. Every outcome traces back to which user need it fulfills.
243
- - **Acceptance Criteria Validation**: User signs off on acceptance criteria for each outcome, not on individual tasks. For each criterion, ask: "Can you do this now? Yes/No". If "No" → invoke Child Brain to analyze and fix.
244
+ - **Acceptance Criteria Validation**: User signs off on acceptance criteria for each outcome, not on individual tasks. Default to **batch sign-off**: show the full criteria list once, run the outcome demo, then ask whether everything works. If something fails or needs adjustment → invoke Child Brain. Only drill into per-criterion Yes/No when the user can't identify what is failing.
244
245
  - **Best practice structure**: Organize projects using standard dev conventions
245
246
  - **Skill automation**: Create skills for repetitive tasks proactively
246
247
  - **User validation**: Always confirm outcomes meet expectations via acceptance criteria before marking complete
@@ -381,17 +382,17 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
381
382
  - Proceed immediately to Step 2 (Detect Project State)
382
383
 
383
384
  ### 2. **Detect Project State & Show Progress**
384
-
385
- - Runs version check, meta-mode detection, fast startup optimization, auto-update with improvement capture, and artifact scanning.
386
- - **Read `references/state-detection.md`** for the full detection procedure (version check, meta-mode, fast startup, auto-update Steps A–D, artifact list)
387
- - After detection completes, display the appropriate menu below based on project state:
385
+
386
+ - Runs version check, meta-mode detection, fast startup optimization, auto-update with improvement capture, and artifact scanning.
387
+ - **Read `references/state-detection.md`** for the full detection procedure (version check, meta-mode, fast startup, auto-update Steps A–D, artifact list)
388
+ - After detection completes, display the appropriate menu below based on project state:
388
389
 
389
- **If project exists:**
390
- - Load session state from `docs/session-state.json`
391
-
392
- - **Git Check (ensure git is available)**:
393
- - Check if `.git` folder exists in project root
394
- - If NOT exists:
390
+ **If project exists:**
391
+ - Load session state from `.mother-brain/session-state.json`
392
+
393
+ - **Git Check (ensure git is available)**:
394
+ - Check if `.git` folder exists in project root
395
+ - If NOT exists:
395
396
  ```
396
397
  ⚠️ Git repository not found - initializing...
397
398
  ```
@@ -423,11 +424,11 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
423
424
  - **If "I have a new idea"**: Jump to **Step 2F: Idea Capture & Prioritization**
424
425
  - **If "Improve Mother Brain"**: Jump to **Step 2A: Improve Mother Brain Menu**
425
426
 
426
- **If existing project WITHOUT Mother Brain artifacts (ONBOARDING):**
427
- - Detect: Files exist in directory, but NO `.mother-brain/` folder and NO `docs/vision.md`
428
- - Display:
429
- ```
430
- 🧠 I see an existing project here!
427
+ **If existing project WITHOUT Mother Brain artifacts (ONBOARDING):**
428
+ - Detect: Files exist in directory, but NO `.mother-brain/` folder (Mother Brain not installed here)
429
+ - Display:
430
+ ```
431
+ 🧠 I see an existing project here!
431
432
 
432
433
  I can help you manage this project using the Mother Brain framework.
433
434
  I'll scan your codebase, understand what you've built, and help you
@@ -438,12 +439,19 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
438
439
  - "Yes, onboard Mother Brain into this project"
439
440
  - "No, start fresh (ignore existing files)"
440
441
 
441
- - **If user selects onboarding**: Jump to **Step 2.2: Existing Project Onboarding**
442
+ - **If user selects onboarding**: Jump to **Step 2.2: Existing Project Onboarding**
442
443
 
443
- **If new project (empty directory or user chose fresh start):**
444
- - Display welcome:
445
- ```
446
- 🧠 Welcome to Mother Brain!
444
+ **If Mother Brain is installed but this folder is scaffolding-only (NEW PROJECT):**
445
+ - Detect:
446
+ - `.mother-brain/session-state.json` exists AND its project is unset (e.g., `project: null`)
447
+ - `.mother-brain/docs/vision.md` does NOT exist
448
+ - Repo root contains only Mother Brain scaffolding (e.g., `.mother-brain/`, `.github/`, `.agents/`, `AGENTS.md`, optional `.git/`)
449
+ - Treat this as a **new project** (show the new-project welcome flow below). Do NOT show onboarding.
450
+
451
+ **If new project (empty directory or user chose fresh start):**
452
+ - Display welcome:
453
+ ```
454
+ 🧠 Welcome to Mother Brain!
447
455
 
448
456
  I'm your AI project companion. Tell me what you want to build,
449
457
  and I'll help you make it real—step by step.
@@ -541,13 +549,13 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
541
549
  Encountered friction or have ideas for improvement?
542
550
  ```
543
551
 
544
- - Use `ask_user` with choices:
545
- - "Something broke or didn't work"
546
- - "A feature is missing"
547
- - "The workflow is confusing"
548
- - "I have a suggestion for improvement"
549
- - "📤 Send my local improvements (auto-detect changes)"
550
- - "⬅️ Back to project"
552
+ - Use `ask_user` with choices:
553
+ - "Something broke or didn't work"
554
+ - "A feature is missing"
555
+ - "The workflow is confusing"
556
+ - "I have a suggestion for improvement"
557
+ - "📤 Send community improvements (auto-detect local changes)"
558
+ - "⬅️ Back to project"
551
559
 
552
560
  **Step 2A.0.1: Friction Auto-Detection (for "Something broke")**
553
561
 
@@ -604,17 +612,25 @@ Key rules: Use `allow_freeform: true` on all `ask_user` calls. Check freeform re
604
612
  - Work on implementing if appropriate
605
613
  - Offer to send improvement when done
606
614
 
607
- - **If "Send my local improvements"**: Continue to Step 2A.1 (Auto-Detect)
615
+ - **If "Send community improvements"**: Continue to Step 2A.1 (Auto-Detect)
608
616
 
609
617
  - **If "Back to project"**: Return to main menu (Step 2)
610
618
 
611
619
  ### 2A.1 **Send Improvement** (Automatic Multi-Issue Contribution)
612
- - When user selects "📤 Send my local improvements":
620
+ - When user selects "📤 Send community improvements":
613
621
  - **Read `references/improvement-pipeline.md`** for the full pipeline (Steps 2A.1.1–2A.1.5)
614
622
  - 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
615
623
  - Target repository: `super-state/mother-brain`
616
624
  - After submission → return to main menu (Step 2)
617
625
 
626
+ ### 2H. **Outcome Discovery & Planning** (Mini Requirements Session)
627
+ - A mini "vision-like" discovery workflow for new outcomes/phases or pivots. Clarifies the outcome, does lightweight research, consults Project Brain constraints, detects skill gaps (via Elder Brain gate + skill-creator), and writes the outcome into the roadmap with a do-now vs later choice.
628
+ - **Read `references/outcome-discovery.md`** for the full procedure.
629
+ - This flow must be available from:
630
+ - Layer 2 (Roadmap): "🔎 Discover a new outcome"
631
+ - Layer 3 (Outcome execution): "🔎 Pivot to a different outcome"
632
+ - Also run it when starting an outcome that hasn't been clarified yet (placeholder outcome or unclear scope). In that case, treat the discovery as "clarify/refine this outcome" and update the existing roadmap entry.
633
+
618
634
  ### 2A.2 **Review Community Improvements** (Maintainer Workflow)
619
635
  - Maintainer workflow for reviewing community improvement issues. Lists open issues, shows AI-generated analysis, and provides accept/reject/request-changes actions.
620
636
  - **Read `references/review-improvements.md`** for the full review procedure (Steps 2A.2.1–2A.2.5, issue listing, diff review, auto-commenting, label management)
@@ -1504,6 +1520,7 @@ Progress: [X/Y] criteria verified
1504
1520
  - "Continue working" (→ resume/start next task in this outcome)
1505
1521
  - "I have feedback on this outcome"
1506
1522
  - "Something's broken"
1523
+ - "🔎 Pivot to a different outcome"
1507
1524
  - "Do something else (→ Roadmap)" (→ Layer 2)
1508
1525
  - "Mark outcome complete"
1509
1526
  - Freeform available → route to Freeform Classification (Step 12)
@@ -1523,6 +1540,12 @@ Progress: [X/Y] criteria verified
1523
1540
  - Invoke Child Brain immediately (friction detected)
1524
1541
  - After Child Brain completes, return to Step 10E
1525
1542
 
1543
+ - **If "🔎 Pivot to a different outcome"**:
1544
+ - Run **Step 2H (Outcome Discovery & Planning)**
1545
+ - After discovery:
1546
+ - If user chose "Do this next": set it as active and return to Step 10E
1547
+ - If user chose "Add to roadmap for later": return to Step 10E (current outcome unchanged)
1548
+
1526
1549
  - **If "Do something else"**:
1527
1550
  - Navigate UP one layer to **Step 11 (Roadmap Menu / Layer 2)**
1528
1551
  - Save current outcome progress before navigating
@@ -1622,19 +1645,21 @@ Progress: [X/Y] criteria verified
1622
1645
 
1623
1646
  **Step 11.2: Present Layer 2 Menu**
1624
1647
 
1625
- - Use `ask_user` with choices:
1626
- - "Continue next outcome" (→ Layer 3 Outcome Execution Menu)
1627
- - "Review specific outcome"
1628
- - "💡 I have a new idea"
1629
- - "Adjust priorities (Value Framework)"
1630
- - "Take a break (save progress)"
1648
+ - Use `ask_user` with choices:
1649
+ - "Continue next outcome" (→ Layer 3 Outcome Execution Menu)
1650
+ - "Review specific outcome"
1651
+ - "🔎 Discover a new outcome"
1652
+ - "💡 I have a new idea"
1653
+ - "Adjust priorities (Value Framework)"
1654
+ - "Take a break (save progress)"
1631
1655
  - Freeform available for custom actions → route to Freeform Classification (Step 12)
1632
1656
 
1633
1657
  **Step 11.3: Handle Selections**
1634
1658
 
1635
- - **If "Continue next outcome"**:
1636
- - Load next uncompleted outcome from roadmap
1637
- - Jump to **Layer 3 Outcome Execution Menu (Step 10E)**
1659
+ - **If "Continue next outcome"**:
1660
+ - Load next uncompleted outcome from roadmap
1661
+ - If this outcome is still a placeholder or needs clarification, run **Step 2H (Outcome Discovery & Planning)** to refine it before starting execution.
1662
+ - Jump to **Layer 3 — Outcome Execution Menu (Step 10E)**
1638
1663
 
1639
1664
  - **If "Review specific outcome"**:
1640
1665
  - List all outcomes with status (✅/🔄/⬜)
@@ -1651,10 +1676,14 @@ Progress: [X/Y] criteria verified
1651
1676
  - Re-score existing roadmap tasks if weights changed significantly
1652
1677
  - Show what moved, then return to Step 11.2
1653
1678
 
1654
- - **If "Take a break"**:
1655
- - Save session state to `session-state.json`
1656
- - Display progress summary
1657
- - End session gracefully
1679
+ - **If "Take a break"**:
1680
+ - Save session state to `session-state.json`
1681
+ - Display progress summary
1682
+ - Then present a choice:
1683
+ - "Back to Main Menu (Layer 1)" (return to Step 2)
1684
+ - "Back to Roadmap Menu (Layer 2)" (return to Step 11.2)
1685
+ - "Exit session" (end cleanly after showing a short resume hint)
1686
+ - **Exit discipline**: If user selects "Exit session", display a short "Session ended" message and a single resume hint (`/mother-brain`), then STOP. Do not present additional menus after exit.
1658
1687
 
1659
1688
  - Save session state to `docs/session-state.json`:
1660
1689
  ```json
@@ -1720,8 +1749,10 @@ Analyze the freeform text and classify as one of:
1720
1749
 
1721
1750
  2. **Feature/Idea** — User has a new feature or idea
1722
1751
  - Trigger words: "what if", "could we", "add", "new feature", "idea", "I want"
1723
- - Route to Step 2F (Idea Capture & Prioritization)
1724
- - After capture, return to the LAYER the user was on (not Layer 1)
1752
+ - Use `ask_user` to choose:
1753
+ - "💡 Quick idea capture" ( Step 2F)
1754
+ - "🔎 Outcome discovery (plan it onto the roadmap)" (→ Step 2H)
1755
+ - After capture/discovery, return to the LAYER the user was on (not Layer 1)
1725
1756
 
1726
1757
  3. **Clarification/Question** — User is asking about the project/roadmap/outcome
1727
1758
  - Trigger words: "why", "what does", "how", "explain", "tell me about", "?"
@@ -1933,3 +1964,6 @@ See `references/resources.md` for:
1933
1964
  - Vision document templates
1934
1965
  - Roadmap examples
1935
1966
  - Task management methodologies
1967
+ - **If "🔎 Discover a new outcome"**:
1968
+ - Run **Step 2H (Outcome Discovery & Planning)**
1969
+ - After discovery, return to Step 11.2
@@ -54,7 +54,10 @@
54
54
 
55
55
  - If user selects a delivery option:
56
56
  - Check if relevant skill exists (e.g., "deployment-manager", "cicd-setup")
57
- - If skill doesn't exist: Invoke skill-creator to create delivery skill
57
+ - If skill doesn't exist:
58
+ - Consult Project Brain (`.mother-brain/project-brain.md`) for project-specific delivery constraints/preferences
59
+ - Consult Elder Brain RETRIEVE for the relevant technologies/platforms BEFORE invoking skill-creator
60
+ - Invoke skill-creator to create the delivery skill with Project Brain + Elder Brain context
58
61
  - Execute delivery using appropriate skill
59
62
  - Validate deployment/release succeeded
60
63
 
@@ -90,6 +93,7 @@
90
93
  - Create task documents (like Step 8)
91
94
  - Identify patterns that need new skills
92
95
  - If new patterns detected: Create skills using skill-creator
96
+ - Before creating any new skill, consult Elder Brain RETRIEVE for relevant technologies/domains and pass findings into skill-creator
93
97
  - Update roadmap with detailed tasks
94
98
  - Return to Step 11 (Roadmap Menu)
95
99
 
@@ -97,7 +101,7 @@
97
101
  - Use `ask_user` (freeform): "What direction do you want to take the project?"
98
102
  - Re-run vision discovery (Step 3) with context of what exists
99
103
  - Generate new roadmap phases while preserving completed work
100
- - Create any needed new skills using skill-creator
104
+ - Create any needed new skills using skill-creator (consult Elder Brain RETRIEVE first, and bake gotchas into the skill context)
101
105
  - Return to Step 11 (Roadmap Menu)
102
106
 
103
107
  **If "Add new features":**
@@ -106,7 +110,9 @@
106
110
  - If patterns detected that need skills:
107
111
  - Display: "I detect patterns that could benefit from new skills:"
108
112
  - List detected patterns
109
- - Invoke skill-creator for each pattern
113
+ - For each skill:
114
+ - Consult Elder Brain RETRIEVE for relevant technologies/domains
115
+ - Invoke skill-creator with Elder Brain findings baked in
110
116
  - Add features as new tasks to appropriate phase
111
117
  - Update roadmap
112
118
  - Return to Step 11 (Roadmap Menu)
@@ -46,7 +46,9 @@ When user selects to onboard Mother Brain into an existing project, follow these
46
46
  ## Step 2.2.4: Skill Identification
47
47
  - Analyze patterns in existing code
48
48
  - Identify repetitive work that warrants skills
49
- - Invoke skill-creator for detected patterns
49
+ - Consult Project Brain (`.mother-brain/project-brain.md`) for project-specific constraints/preferences (if it exists)
50
+ - Consult Elder Brain RETRIEVE for relevant technologies/domains BEFORE invoking skill-creator
51
+ - Invoke skill-creator for detected patterns with Project Brain + Elder Brain context baked in
50
52
 
51
53
  ## Step 2.2.5: Confirmation
52
54
  - Display:
@@ -24,9 +24,17 @@ How to verify (quick path):
24
24
  - Step 2: [Click/Action]
25
25
  - Expected: [What should happen]
26
26
 
27
- Then validate each acceptance criterion (Yes/No).
27
+ Acceptance Criteria:
28
+ - I can ...
29
+ - I can ...
30
+
31
+ Then validate acceptance criteria using batch sign-off (preferred): show the full list once, then ask if everything works. Use per-criterion Yes/No only as fallback when the user can't identify what's failing.
32
+
33
+ Use choices like:
34
+ - "✅ Everything works (all criteria pass)"
35
+ - "⚠️ Something isn't working (tell me what's failing)"
36
+ - "🛠 Works but needs adjustment (tell me what to change)"
28
37
 
29
38
  Rules:
30
39
  - If login/authorization/setup requires user action, guide them step-by-step.
31
40
  - If auto-launch fails, provide one fallback method and then clear manual steps with full paths/URLs.
32
-
@@ -0,0 +1,142 @@
1
+ # Outcome Discovery — Mini Requirements Session (Per Outcome / Phase)
2
+
3
+ Use this procedure when:
4
+ - The user wants to add a new outcome to the roadmap
5
+ - The user wants to pivot mid-outcome to a different outcome
6
+ - The user is about to start an existing roadmap outcome that is still a placeholder or unclear (refine it before execution)
7
+
8
+ Purpose:
9
+ - Treat each new outcome like a mini vision session: clarify intent, do lightweight research, consult project constraints, detect skill gaps, and only then plan it onto the roadmap.
10
+ - End with a clear decision: do it now vs schedule it for later (and confirm priority).
11
+
12
+ ---
13
+
14
+ ## Step OD.1: Capture the Outcome (Freeform)
15
+
16
+ Display:
17
+ ```
18
+ 🔎 Outcome Discovery
19
+
20
+ Tell me the outcome you want.
21
+ Write it as: "Ability to [do something]" if you can.
22
+ ```
23
+
24
+ Use `ask_user` with `allow_freeform: true`.
25
+
26
+ ---
27
+
28
+ ## Step OD.2: Project Brain Gate (Before Planning)
29
+
30
+ Before drafting acceptance criteria and demo/proof, consult Project Brain:
31
+ - Read `.mother-brain/project-brain.md` (if it exists)
32
+ - Apply relevant preferences/constraints:
33
+ - Style & tone expectations
34
+ - Validation checks to preserve
35
+ - Known integration constraints
36
+ - Any "do/don't" rules discovered from prior work
37
+
38
+ ---
39
+
40
+ ## Step OD.3: Adaptive Clarification Loop (Repeat Until Clear)
41
+
42
+ After EACH user response:
43
+ 1. Extract domain signals and constraints:
44
+ - Who is the user?
45
+ - What is the exact ability (scope boundaries)?
46
+ - What data is involved (PII/orders/payments/health)?
47
+ - What does "done" look like (proof)?
48
+ 2. If a new/unclear domain is detected, do quick research with `web_search`:
49
+ - "[domain] best practices"
50
+ - "[domain] common pitfalls"
51
+ - "[domain] UX expectations"
52
+ 3. Identify likely skill needs (do we need a new skill or to invoke an existing one?)
53
+ 4. Ask the single most important next question (avoid long questionnaires).
54
+
55
+ Use `ask_user` with 2-3 choices whenever discrete options exist, otherwise allow freeform.
56
+
57
+ Stop the loop only when:
58
+ - The outcome statement is unambiguous
59
+ - Acceptance criteria can be written as testable user checks
60
+ - A demo/proof path is clear
61
+
62
+ ---
63
+
64
+ ## Step OD.4: Draft the Outcome Package (Batch Correction)
65
+
66
+ Create a draft:
67
+ - Outcome name: `📋 Ability to ...`
68
+ - "So that" benefit line (why this matters)
69
+ - Acceptance criteria (3-7 items, testable by the user)
70
+ - Demo / Proof (what will open, where, and the quick verification path)
71
+ - Internal tasks (high-level list; implementation details only)
72
+
73
+ Then ask for correction (batch, not per-line):
74
+
75
+ Use `ask_user`:
76
+ - "✅ Looks right — proceed"
77
+ - "✏️ Needs adjustment (tell me what to change)"
78
+ - "🔄 Actually different outcome (restart discovery)"
79
+
80
+ If adjustment/restart is chosen, continue OD.3.
81
+
82
+ ---
83
+
84
+ ## Step OD.5: Skill Check (Autonomous, With Elder Brain Gate)
85
+
86
+ - Scan existing project skills (`.github/skills/`) for relevant capabilities.
87
+ - If a capability gap is detected:
88
+ - FIRST: Consult Elder Brain RETRIEVE for relevant gotchas/patterns:
89
+ - Invoke Elder Brain RETRIEVE for the domains/technologies the skill will touch
90
+ - If Elder Brain returns relevant info, bake it into the skill context
91
+ - Then invoke `skill-creator` to create/update the necessary skill(s) using:
92
+ - Project Brain preferences (project-specific constraints)
93
+ - Lightweight domain research (if needed)
94
+ - Elder Brain gotchas/patterns (cross-project defensive knowledge)
95
+ - Do not ask for permission to create the skill; do it as part of discovery.
96
+
97
+ ---
98
+
99
+ ## Step OD.6: Priority + Scheduling Decision (User Choice)
100
+
101
+ Load:
102
+ - `.mother-brain/docs/value-framework.md` (if it exists)
103
+ - `.mother-brain/docs/vision.md` and `.mother-brain/docs/roadmap.md`
104
+
105
+ Determine recommended priority:
106
+ - If Value Framework exists: score outcome and compare to nearby outcomes
107
+ - Otherwise: assess vision alignment, user impact, effort, dependencies
108
+
109
+ Use `ask_user`:
110
+ - "🚀 Do this next (make it the active/next outcome)"
111
+ - "🗓 Add to roadmap for later (keep current plan)"
112
+ - "📌 Adjust priority (tell me higher/lower)"
113
+
114
+ If "Adjust priority":
115
+ - Ask for brief rationale (freeform), apply the override, and (if repeated) flag for Value Framework weight adjustment.
116
+
117
+ ---
118
+
119
+ ## Step OD.7: Write It Into the Roadmap
120
+
121
+ - Insert (or refine) the outcome in `.mother-brain/docs/roadmap.md` with:
122
+ - Acceptance criteria checklist
123
+ - Demo / Proof section
124
+ - Priority score / note
125
+ - Internal tasks list
126
+ - If it belongs in a new phase, create the phase section and explain why (briefly).
127
+
128
+ Update `.mother-brain/session-state.json`:
129
+ - If "Do this next": set the new outcome as active
130
+ - Otherwise: keep current outcome, just record that a new outcome was added
131
+
132
+ Return control to the menu the user came from:
133
+ - If called from Roadmap (Layer 2): return to Step 11
134
+ - If called from Outcome work (Layer 3 pivot): return to Step 10E (or Step 11 if the user navigated up)
135
+
136
+ ---
137
+
138
+ Key rules:
139
+ - Discovery happens BEFORE planning/execution for a new outcome.
140
+ - Always provide the do-now vs later choice after discovery.
141
+ - Keep questions tight: one meaningful question per loop.
142
+
@@ -4,17 +4,27 @@
4
4
 
5
5
  **Step 2A.2.1: List Open Improvement Issues**
6
6
 
7
- - Fetch issues with "improvement" or "community-contribution" labels:
8
- ```
9
- github-mcp-server: list_issues
10
- state: open
11
- labels: ["improvement"]
12
- ```
7
+ - **Do NOT assume repo-specific labels exist.** Many repos only have default labels
8
+ (`enhancement`, `documentation`, etc.). Improvement submissions created by Mother Brain
9
+ also commonly use a title prefix like `[Improvement]`.
10
+
11
+ - Fetch open improvement issues using this fallback order:
12
+ - **Primary (title prefix)**: search for issues whose title includes `[Improvement]`
13
+ - Example (gh CLI):
14
+ - `gh issue list --repo super-state/mother-brain --state open --search "is:issue is:open [Improvement]" --limit 20`
15
+ - **Secondary (default labels)**: search for likely labels
16
+ - `label:enhancement` and/or `label:documentation`
17
+ - Example (gh CLI):
18
+ - `gh issue list --repo super-state/mother-brain --state open --label enhancement --limit 20`
19
+ - `gh issue list --repo super-state/mother-brain --state open --label documentation --limit 20`
20
+ - **Last-resort (recent open issues)**: list recent open issues and manually select
21
+ - Example (gh CLI):
22
+ - `gh issue list --repo super-state/mother-brain --state open --limit 20`
13
23
 
14
24
  - **If no issues**: Display "📭 No community improvements pending review." → Return to menu
15
25
 
16
26
  - **If issues exist**: Display summarized list:
17
- ```
27
+ ```
18
28
  📥 Community Improvements to Review ([count] pending)
19
29
 
20
30
  ┌─────────────────────────────────────────────────────────────┐
@@ -25,10 +35,18 @@
25
35
  │ 📁 [files affected count] files • [lines changed] lines │
26
36
  └─────────────────────────────────────────────────────────────┘
27
37
 
28
- [Repeat for each issue, max 5 shown]
38
+ [Repeat for each issue, up to 10 shown]
39
+
40
+ If more than 10 issues exist:
41
+ - Show a second menu choice to view the next page (issues 11–20)
42
+ - Also offer a "Deduplicate by title" view (recommended when many issues share the same `[Improvement] YYYY-MM-DD - ...` titles)
29
43
  ```
30
44
 
31
- - Use `ask_user` with issue numbers as choices + "Back to menu"
45
+ - Use `ask_user` with:
46
+ - Issue numbers as choices (for the visible page)
47
+ - "Next page"
48
+ - "Deduplicate by title (recommended)"
49
+ - "Back to menu"
32
50
 
33
51
  **Step 2A.2.2: Review Selected Issue**
34
52
 
@@ -66,6 +84,14 @@
66
84
  - "❌ Reject - close with explanation"
67
85
  - "💬 Request changes - ask for modifications"
68
86
  - "⏭️ Skip - review later"
87
+
88
+ **Deduplicate by title (helper view)**
89
+ - When "Deduplicate by title" is selected:
90
+ - Group open issues by normalized title (strip issue number, keep full title text)
91
+ - For each group, show ONLY the newest issue number as the representative
92
+ - Present the representative issue numbers as choices, plus:
93
+ - "Show all issues (paged)"
94
+ - "Back to menu"
69
95
 
70
96
  **Step 2A.2.3: Accept Improvement**
71
97
 
@@ -125,7 +125,7 @@
125
125
  - Outcome 2: [name]
126
126
  - Outcome 3: [name]
127
127
 
128
- **Validation Method**: User confirms each criterion with "Yes, I can do this"
128
+ **Validation Method**: Batch sign-off (preferred). Show the full acceptance-criteria list once, run the outcome demo, then ask whether everything works. Use per-criterion Yes/No only as fallback when the user can't identify what's failing.
129
129
 
130
130
  **Next Step After MVP**: [From Step 6A research]
131
131
 
@@ -11,22 +11,41 @@
11
11
  npm view mother-brain version --json 2>$null
12
12
  ```
13
13
  - Compare against:
14
- - If in framework repo: `cli/package.json` version field
15
- - If in project: `.mother-brain/version.json` version field
14
+ - If in framework repo: `cli/package.json` version field (source repo version)
15
+ - If in project: `.mother-brain/version.json` installed field (installed/tracked version)
16
16
  - **If newer version exists**:
17
- ```
18
- ⚠️ Mother Brain Update Available
19
-
20
- Installed: v[current]
21
- Latest: v[npm version]
17
+ - **If in a project folder** (has `.mother-brain/version.json`):
18
+ ```
19
+ ⚠️ Mother Brain Update Available
20
+
21
+ Installed: v[current]
22
+ Latest: v[npm version]
23
+
24
+ Update recommended before continuing.
25
+ ```
26
+ - Use `ask_user` with choices:
27
+ - "Update now (recommended)"
28
+ - "Skip this time"
29
+ - **If "Update now"**: Run `npx -y mother-brain update`, then continue
30
+ - **If "Skip"**: Continue but note version mismatch
22
31
 
23
- Update recommended before continuing.
24
- ```
25
- - Use `ask_user` with choices:
26
- - "Update now (recommended)"
27
- - "Skip this time"
28
- - **If "Update now"**: Run auto-update (see update commands below), then continue
29
- - **If "Skip"**: Continue but note version mismatch
32
+ - **If in the Mother Brain framework repo** (source code checkout):
33
+ ```
34
+ ⚠️ Mother Brain Release Ahead of This Checkout
35
+
36
+ Repo version (cli/package.json): v[current]
37
+ Latest release (npm): v[npm version]
38
+
39
+ This usually means your local checkout hasn’t been pulled to the latest tag yet.
40
+ ```
41
+ - Use `ask_user` with choices:
42
+ - "Fetch tags + pull latest framework changes (recommended)"
43
+ - "Skip this time"
44
+ - **If "Fetch tags + pull"**:
45
+ - Run `git fetch --tags origin`
46
+ - Run `git pull --ff-only origin main`
47
+ - Then continue detection
48
+ - **If "Skip"**: Continue but note mismatch
30
49
  - **If current or check fails**: Continue silently
31
50
 
32
51
  **🧬 META-MODE DETECTION (AFTER VERSION CHECK)**:
@@ -37,6 +56,8 @@
37
56
  4. If ALL of these exist → we are in the Mother Brain framework repo
38
57
 
39
58
  - **If in Mother Brain framework repo**:
59
+ - Refresh tags before reporting "last release" (quiet):
60
+ - Run `git fetch --tags origin`
40
61
  - Check `.mother-brain/meta-mode.json` for existing meta session state
41
62
  - Display:
42
63
  ```
@@ -77,11 +98,34 @@
77
98
  - **If NOT in framework repo**: Continue with normal detection below
78
99
 
79
100
  **⚡ FAST STARTUP OPTIMIZATION (MANDATORY)**:
80
- - **Single file check first**: Check ONLY `.mother-brain/session-state.json` - if it exists, project exists
101
+ - **Single file check first**: Check ONLY `.mother-brain/session-state.json`
102
+ - If it exists: Mother Brain is installed in this folder (NOT necessarily an "existing project")
103
+ - If it does not exist: treat as "no Mother Brain artifacts" (possible onboarding or brand-new folder)
81
104
  - **Parallel tool calls**: When multiple checks are needed, run them in ONE response (not sequentially)
82
105
  - **Lazy loading**: Only load vision.md, roadmap.md, README.md when actually needed (not at startup)
83
106
  - **Minimal detection**: For new project detection, a single glob for `.mother-brain/` is sufficient
84
107
  - Goal: User sees menu within 1-2 tool calls, not 6+
108
+
109
+ **🧩 SCAFFOLDING-ONLY DETECTION (CRITICAL - fixes false "existing project" onboarding)**
110
+ - A freshly created folder can look like an "existing project" after `mother-brain init` because init creates:
111
+ - `.mother-brain/session-state.json` (with `project: null`)
112
+ - `.mother-brain/version.json`
113
+ - `.github/skills/*`
114
+ - `.agents/skills/*`
115
+ - `AGENTS.md`
116
+ - `.git/` (if git init is performed)
117
+ - **Rule**: If the folder contains ONLY Mother Brain scaffolding, treat it as a **new project** (show the new-project welcome flow), NOT onboarding.
118
+ - Detect scaffolding-only as:
119
+ 1. `.mother-brain/session-state.json` exists AND its JSON has `project: null` (or no project name)
120
+ 2. `.mother-brain/docs/vision.md` does NOT exist
121
+ 3. The repo root contains no "real project files" beyond:
122
+ - `.mother-brain/`
123
+ - `.github/`
124
+ - `.agents/`
125
+ - `.git/`
126
+ - `AGENTS.md`
127
+ - If all true → show **New Project** welcome menu (Step 2 new project)
128
+ - If false → proceed with normal project/onboarding detection
85
129
 
86
130
  **📦 AUTO-UPDATE CHECK (on startup, if project exists)**:
87
131
  - If `.mother-brain/version.json` exists:
@@ -109,4 +153,4 @@
109
153
  - `.mother-brain/docs/roadmap.md` - Current roadmap (load only when needed)
110
154
  - `.mother-brain/docs/tasks/` - Task documentation folder
111
155
  - `.github/skills/` - Project-specific skills
112
-
156
+
@@ -76,7 +76,9 @@
76
76
  ```
77
77
  📋 Outcome Complete: [Ability to do X]
78
78
 
79
- Please verify each criterion — can you do this now?
79
+ Acceptance Criteria:
80
+ - I can ...
81
+ - I can ...
80
82
  ```
81
83
 
82
84
  - **MANDATORY: Outcome Demo First (Interactive Experience)**:
@@ -84,30 +86,34 @@
84
86
  2. Launch the experience for the user (app/page/flow) so they can interact with the outcome
85
87
  - Do NOT ask the user to run startup commands
86
88
  - If launching fails, use one fallback, then provide clear manual steps
87
- 3. Only after the demo is in front of the user, proceed to acceptance-criteria Yes/No sign-off
89
+ 3. Only after the demo is in front of the user, proceed to acceptance-criteria sign-off (batch-first)
88
90
 
89
- - For EACH acceptance criterion, use `ask_user` with choices:
90
- - "Yes, I can do this ✅"
91
- - "No, something's wrong ❌"
92
-
93
- - **If "Yes"**: Mark criterion complete, proceed to next
94
- - **If "No"**:
95
- - Invoke Child Brain immediately (friction detected)
96
- - Child Brain analyzes what went wrong
97
- - Fix applied, re-validate this criterion
91
+ - **Batch acceptance sign-off (preferred)**:
92
+ - Display the FULL acceptance-criteria list at once
93
+ - Then use `ask_user` with choices:
94
+ - "✅ Everything works (all criteria pass)"
95
+ - "⚠️ Something isn't working (tell me what's failing)"
96
+ - "🛠 Works but needs adjustment (tell me what to change)"
97
+ - If the user reports failures/adjustments:
98
+ - Ask them to paste the failing criteria text or numbers (freeform)
99
+ - Invoke Child Brain immediately (friction detected), fix, then re-run demo + batch sign-off
100
+ - Only drill into per-criterion Yes/No when:
101
+ - The user says "some fail" but can't identify which, or
102
+ - The outcome has many criteria and pinpointing is unclear
98
103
 
99
104
  - **Example validation flow**:
100
105
  ```
101
106
  📋 Ability to see my emails inside the portal
102
107
 
103
- Criterion 1: I can see my inbox with sender, subject, and preview
104
- [Yes, I can do this] [No, something's wrong]
105
-
106
- Criterion 2: I can click an email to read the full content
107
- → [Yes, I can do this] [No, something's wrong]
108
+ Acceptance Criteria:
109
+ 1. I can see my inbox with sender, subject, and preview
110
+ 2. I can click an email to read the full content
111
+ 3. New emails appear without refreshing the page
108
112
 
109
- Criterion 3: New emails appear without refreshing the page
110
- [Yes, I can do this] [No, something's wrong]
113
+ Now that the demo is in front of you, which is true?
114
+ 1. Everything works (all criteria pass)
115
+ 2. ⚠️ Something isn't working (tell me what's failing)
116
+ 3. 🛠 Works but needs adjustment (tell me what to change)
111
117
  ```
112
118
 
113
119
  - **All criteria pass**: Mark outcome complete (✅)
@@ -117,6 +123,15 @@
117
123
  - Update task document with final status
118
124
  - Update roadmap checklist
119
125
 
126
+ - **Post-outcome wrap-up + commit discipline (order matters)**:
127
+ 1. Run Steps 10B and 10C (mandatory learning + documentation checkpoint)
128
+ 2. If the outcome was accepted, run the outcome-level retrospective:
129
+ - Invoke Child Brain (post-delivery retrospective)
130
+ - Apply any approved Mother Brain / Project Brain / skill updates
131
+ 3. If the repo is a git repo and there are uncommitted changes:
132
+ - Create a commit AFTER the retrospective updates are applied
133
+ - Then return the user to the Layer 2 Roadmap Menu
134
+
120
135
  **⚠️ CRITICAL: After marking task complete, proceed through Steps 10B, 10C, and optionally 10D before returning to the Outcome Execution Menu (Layer 3).**
121
136
 
122
137
  **⛔ BLOCKING GATE - Steps 10B and 10C are MANDATORY:**