mother-brain 0.4.5 → 0.4.7

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/AGENTS.md ADDED
@@ -0,0 +1,63 @@
1
+ # Mother Brain — Agent Instructions
2
+
3
+ > These rules are MANDATORY for every interaction. They are enforced regardless of whether
4
+ > the Mother Brain skill is explicitly invoked. Violating ANY rule is a critical failure.
5
+
6
+ ## Hard Rules
7
+
8
+ ### 1. Never Leave User in Freeform
9
+ - After completing ANY action (task, release, fix, commit, question, analysis), ALWAYS present a menu with clear options.
10
+ - The user must NEVER see a blank prompt with no guidance on what to do next.
11
+ - If `ask_user` tool is available, use it. Otherwise present numbered options as plain text.
12
+ - If you catch yourself ending a response without a menu → STOP and add one.
13
+
14
+ ### 2. Always Use Menus for Choices
15
+ - EVERY user decision MUST be presented as a menu with selectable options.
16
+ - NEVER ask yes/no questions as plain text.
17
+ - NEVER ask open-ended questions when discrete options exist.
18
+ - When using plain text menus (e.g., Codex CLI), format as:
19
+ ```
20
+ 1. Option A
21
+ 2. Option B
22
+ 3. Option C
23
+
24
+ Reply with the number or option text.
25
+ ```
26
+
27
+ ### 3. Invoke Child Brain on Freeform Feedback
28
+ - When the user types freeform text instead of selecting a menu option, invoke `$child-brain` IMMEDIATELY.
29
+ - Freeform text = the user has feedback, preferences, or corrections that must be captured.
30
+ - Don't try to handle feedback inline — Child Brain routes learnings to the right place.
31
+ - After Child Brain completes, resume exactly where you were.
32
+ - Trigger keywords: "I prefer", "I like", "actually", "instead", "rather", "maybe", "what about", "stop", "why did you"
33
+
34
+ ### 4. Never Improvise Workflows
35
+ - If Mother Brain skill (`$mother-brain`) is active, follow its Steps section exactly.
36
+ - Do NOT invent menus, skip steps, or make up workflows.
37
+ - If you're unsure what to do next, return to Step 2 (Detect Project State).
38
+
39
+ ### 5. Resume After Skill Invocation
40
+ - After invoking any skill (`$child-brain`, `$skill-creator`, etc.), you MUST return to what you were doing before.
41
+ - NEVER invoke a skill and then stop.
42
+ - Track what step/menu/task you were on, and resume there after the skill completes.
43
+
44
+ ### 6. Show Learning Confirmations
45
+ - When preferences or learnings are recorded, display visible confirmation:
46
+ - `📘 Project Brain will remember this`
47
+ - `🧠 Mother Brain will remember this`
48
+ - `🧙 Elder Brain will remember this`
49
+ - The user should SEE their input being captured — silent learning erodes trust.
50
+
51
+ ### 7. Emoji as Enhancement Only
52
+ - Always include text labels alongside emoji (e.g., "🧠 Mother Brain" not just "🧠").
53
+ - Some runtimes may not render emoji correctly.
54
+
55
+ ## Skills Available
56
+
57
+ This project uses the Mother Brain framework. The following skills are available:
58
+
59
+ - **$mother-brain** — Full project management workflow (vision → roadmap → tasks → execution)
60
+ - **$child-brain** — Feedback analysis and learning orchestrator
61
+ - **$skill-creator** — Create new specialized skills
62
+
63
+ For guided project management, invoke `$mother-brain`.
package/dist/cli.js CHANGED
@@ -76,6 +76,16 @@ async function init(options = {}) {
76
76
  }, { spaces: 2 });
77
77
  }
78
78
  console.log(chalk.cyan("\n\u2705 Mother Brain initialized!\n"));
79
+ const agentsFile = path.join(cwd, "AGENTS.md");
80
+ const sourceAgentsFile = path.join(packageRoot, "AGENTS.md");
81
+ if (await fs.pathExists(sourceAgentsFile)) {
82
+ const agentsExists = await fs.pathExists(agentsFile);
83
+ if (!agentsExists || options.force) {
84
+ await fs.copy(sourceAgentsFile, agentsFile, { overwrite: true });
85
+ console.log(chalk.green("Created AGENTS.md (always-active rules for Codex/Copilot)"));
86
+ }
87
+ }
88
+ console.log("");
79
89
  console.log("Next steps:");
80
90
  console.log(chalk.dim(" 1. Commit the new files to your repo"));
81
91
  console.log(chalk.dim(" 2. Open your AI CLI:"));
@@ -202,6 +212,11 @@ async function update() {
202
212
  console.log(chalk2.green(` \u2713 Updated ${skill}`));
203
213
  }
204
214
  }
215
+ const extractedAgentsFile = path2.join(tempDir, "package", "AGENTS.md");
216
+ const agentsFile = path2.join(cwd, "AGENTS.md");
217
+ if (await fs2.pathExists(extractedAgentsFile)) {
218
+ await fs2.copy(extractedAgentsFile, agentsFile, { overwrite: true });
219
+ }
205
220
  await fs2.remove(tempDir);
206
221
  await fs2.writeJSON(versionFile, {
207
222
  installed: latestVersion,
@@ -747,7 +762,7 @@ async function uninstall(options) {
747
762
  // src/cli.ts
748
763
  import { exec as exec3 } from "child_process";
749
764
  var program = new Command();
750
- var VERSION = "0.4.5";
765
+ var VERSION = "0.4.7";
751
766
  program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI and Codex CLI").version(VERSION);
752
767
  program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
753
768
  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.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -29,7 +29,8 @@
29
29
  },
30
30
  "files": [
31
31
  "dist",
32
- "skills"
32
+ "skills",
33
+ "AGENTS.md"
33
34
  ],
34
35
  "engines": {
35
36
  "node": ">=18"
@@ -249,6 +249,7 @@ Mother Brain transforms high-level visions into executable reality by:
249
249
  2. GitHub Release with release notes (use `gh release create` with description)
250
250
  3. Update README version badge (if applicable)
251
251
  Never publish to npm without also creating a proper GitHub Release with notes.
252
+ - **NEVER END ON FREEFORM**: After completing ANY action (release, fix, learning, commit, task), ALWAYS present a menu with `ask_user` (or numbered plain text in Codex). The user must NEVER see a blank prompt with no guidance. End every action with "What's next?" and concrete options. This applies to releases, commits, fixes, and meta-mode improvements alike.
252
253
  - **SESSION STATE IS SOURCE OF TRUTH**: Always read session-state.json AND roadmap.md to determine actual progress. NEVER rely on conversation context alone for task numbering. When determining next task, load roadmap.md and check which tasks have `[ ]` vs `[x]`. Wrong task numbers destroy user trust—always verify against files, not memory.
253
254
  - **ROADMAP CHECKBOX UPDATE (MANDATORY)**: After EVERY task is marked complete, IMMEDIATELY update roadmap.md to check off that task's checkbox (`[ ]` → `[x]`). This is NOT optional and NOT deferred. Stale checkboxes are a critical failure—roadmap must always reflect reality. Use `edit` tool to update the specific task line in roadmap.md right after user confirms task completion.
254
255
  - **END-TO-END WALKTHROUGH FOR NEW INTEGRATIONS**: After implementing a new integration or feature (especially cross-tool like CLI→Codex, API→frontend), proactively walk the user through how to use it end-to-end BEFORE marking the task complete. Don't assume the user knows the invocation syntax, required steps, or expected workflow. Show concrete commands and expected output.
@@ -1632,9 +1633,16 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1632
1633
 
1633
1634
  - Load `.mother-brain/docs/vision.md` (for alignment check)
1634
1635
  - Load `.mother-brain/docs/roadmap.md` (for context on existing tasks)
1636
+ - Load `.mother-brain/docs/value-framework.md` (for prioritization criteria)
1635
1637
  - Load `.mother-brain/project-brain.md` (for project preferences, if exists)
1636
1638
 
1637
- - Analyze the idea across four dimensions:
1639
+ - **Score the idea using the Value Framework** (if it exists):
1640
+ - Rate each dimension from the framework (1-5)
1641
+ - Multiply by weight
1642
+ - Calculate total priority score
1643
+ - Compare against existing task scores to determine placement
1644
+
1645
+ - **If no Value Framework exists** (legacy projects), use basic analysis:
1638
1646
  1. **Vision Alignment**: How well does this idea serve the project's stated WHY and success criteria?
1639
1647
  2. **User Impact**: How much does this benefit the target users defined in the vision?
1640
1648
  3. **Effort Estimate**: Relative complexity — is this a single task or a multi-task effort?
@@ -1647,7 +1655,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1647
1655
 
1648
1656
  **Step 2F.3: Present Analysis to User**
1649
1657
 
1650
- - Display:
1658
+ - Display (with Value Framework scores if available):
1651
1659
  ```
1652
1660
  💡 Idea Analysis
1653
1661
 
@@ -1658,11 +1666,13 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1658
1666
  - User Impact: [High/Medium/Low] — [brief reason]
1659
1667
  - Effort: [Small (1 task) / Medium (2-3 tasks) / Large (new phase)]
1660
1668
  - Dependencies: [None / Depends on Task X / Blocks Task Y]
1669
+ [If Value Framework exists:]
1670
+ - Value Framework Score: [N] — ranked [position] out of [total] current tasks
1661
1671
 
1662
1672
  🎯 Recommended Priority: [🔴 Critical / 🟡 Important / 🟢 Backlog]
1663
1673
 
1664
1674
  Reasoning: [2-3 sentences explaining why this priority level was chosen,
1665
- referencing vision alignment and current roadmap state]
1675
+ referencing Value Framework dimensions and current roadmap state]
1666
1676
  ```
1667
1677
 
1668
1678
  - Use `ask_user` with choices:
@@ -1680,6 +1690,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1680
1690
  - Bump priority one level up (🟢→🟡 or 🟡→🔴)
1681
1691
  - If already 🔴: Acknowledge and proceed
1682
1692
  - Display: `📘 Project Brain will remember this — you prioritize [idea type] higher than expected`
1693
+ - **Update Value Framework**: If user consistently overrides for certain types, adjust relevant dimension weights
1683
1694
  - Invoke Child Brain with preference context (user values this type of feature highly)
1684
1695
  - Proceed to Step 2F.5
1685
1696
 
@@ -1687,6 +1698,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
1687
1698
  - Bump priority one level down (🔴→🟡 or 🟡→🟢)
1688
1699
  - If already 🟢: Keep at backlog
1689
1700
  - Display: `📘 Project Brain will remember this — you prefer to defer [idea type]`
1701
+ - **Update Value Framework**: Log the override in the Evolution Log section
1690
1702
  - Proceed to Step 2F.5
1691
1703
 
1692
1704
  - **If "Let me refine the idea"**:
@@ -2397,6 +2409,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2397
2409
 
2398
2410
  **⚠️ MANDATORY CHECKPOINT - DO NOT SKIP**
2399
2411
  After user confirms vision, you MUST complete ALL of the following steps IN ORDER before creating the roadmap:
2412
+ - [ ] Step 4A: Value Framework Discovery (capture prioritization criteria)
2400
2413
  - [ ] Step 5: Technology & Pattern Analysis (research best practices)
2401
2414
  - [ ] Step 5A: Design System Discovery (if project has visual requirements)
2402
2415
  - [ ] Step 6: Skill Identification & Creation (create essential skills)
@@ -2405,8 +2418,115 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2405
2418
  **NEVER skip directly to roadmap creation.** The research and skill creation steps ensure quality.
2406
2419
  If you find yourself about to create a roadmap without having done research and created skills, STOP and go back.
2407
2420
 
2408
- - **After user confirms vision**: Proceed immediately to Step 5 (Technology & Pattern Analysis)
2409
- - Do NOT stop or return to menu - the full setup flow (Steps 5-6A) must complete before roadmap
2421
+ - **After user confirms vision**: Proceed immediately to Step 4A (Value Framework Discovery)
2422
+ - Do NOT stop or return to menu - the full setup flow (Steps 4A-6A) must complete before roadmap
2423
+
2424
+ ### 4A. **Value Framework Discovery** (Prioritization Criteria)
2425
+ - **Purpose**: Capture the user's values, priorities, and constraints to create a living prioritization framework. This framework will be used to order tasks in the roadmap, justify priority decisions, and evaluate new tasks throughout the project lifecycle.
2426
+
2427
+ **Step 4A.1: Extract Implicit Priorities from Vision**
2428
+ - Review the vision document for signals:
2429
+ - "I need this ASAP" → urgency is high
2430
+ - "I want it done right" → quality over speed
2431
+ - "Users are waiting" → user impact is critical
2432
+ - "I'm learning as I go" → reduce risk, ship incrementally
2433
+ - "This is a side project" → effort/time is constrained
2434
+
2435
+ **Step 4A.2: Ask Prioritization Questions**
2436
+ - Present these as a focused discovery (not overwhelming):
2437
+
2438
+ ```
2439
+ 🎯 Value Framework — Understanding Your Priorities
2440
+
2441
+ To build the best roadmap, I need to understand what matters most to you.
2442
+ ```
2443
+
2444
+ Ask (1-2 at a time, not all at once):
2445
+
2446
+ 1. **"What matters more to you right now?"**
2447
+ - Getting to a working version fast (speed to MVP)
2448
+ - Getting it right the first time (quality/polish)
2449
+ - Learning and exploring (discovery/experimentation)
2450
+
2451
+ 2. **"When you think about this project succeeding, what's the #1 thing that needs to happen?"**
2452
+ - (Freeform — captures their core value driver)
2453
+
2454
+ 3. **"How do you feel about technical debt?"**
2455
+ - "Ship it, fix later" (velocity-first)
2456
+ - "Do it properly from the start" (quality-first)
2457
+ - "Depends on the feature" (balanced)
2458
+
2459
+ 4. **"What would make you abandon or deprioritize a task?"**
2460
+ - It doesn't serve the core vision
2461
+ - It takes too long relative to its value
2462
+ - Users don't actually need it
2463
+ - It blocks something more important
2464
+
2465
+ **Step 4A.3: Build the Value Framework**
2466
+ - Create `.mother-brain/docs/value-framework.md`:
2467
+
2468
+ ```markdown
2469
+ # [Project Name] - Value Framework
2470
+
2471
+ > Living prioritization criteria derived from vision discovery.
2472
+ > Used to order tasks, evaluate new ideas, and justify roadmap decisions.
2473
+ > Updated as the project evolves and user priorities shift.
2474
+
2475
+ ## Core Value Driver
2476
+ [The #1 thing from Step 4A.2 question 2 — e.g., "Users can track their backlog within 2 weeks"]
2477
+
2478
+ ## Priority Dimensions (Weighted)
2479
+
2480
+ | Dimension | Weight | Description |
2481
+ |-----------|--------|-------------|
2482
+ | Vision Alignment | [1-5] | How directly does this serve the core vision? |
2483
+ | MVP Proximity | [1-5] | Does this get us closer to a shippable release? |
2484
+ | User Impact | [1-5] | How much does this improve the user experience? |
2485
+ | Effort | [1-5] | How much work is required? (inverse: lower effort = higher priority) |
2486
+ | Urgency | [1-5] | Is this time-sensitive or blocking other work? |
2487
+ | Long-term Value | [1-5] | Does this pay off strategically over time? |
2488
+ | Risk Reduction | [1-5] | Does this reduce technical or project risk? |
2489
+
2490
+ *Weights are 1 (low importance) to 5 (critical). Derived from user's stated values.*
2491
+
2492
+ ## User's Stated Values
2493
+ - Speed vs Quality preference: [from question 3]
2494
+ - Abandon/deprioritize triggers: [from question 4]
2495
+ - Core success metric: [from question 2]
2496
+
2497
+ ## Scoring Guide
2498
+
2499
+ **Priority Score** = Sum of (Dimension Score × Weight) for each dimension
2500
+
2501
+ When comparing tasks:
2502
+ 1. Score each task across all dimensions (1-5 per dimension)
2503
+ 2. Multiply by weight
2504
+ 3. Higher total = higher priority
2505
+ 4. Ties broken by: Vision Alignment > MVP Proximity > User Impact
2506
+
2507
+ ## Decision Rules
2508
+ - Tasks scoring < [threshold] on Vision Alignment should be questioned: "Does this belong in this project?"
2509
+ - Tasks scoring 5 on Urgency override normal ordering (blockers first)
2510
+ - Tasks scoring 5 on MVP Proximity during Phase 1 get priority boost
2511
+ - After MVP: User Impact and Long-term Value become more important than MVP Proximity
2512
+
2513
+ ## Framework Evolution Log
2514
+
2515
+ | Date | Change | Reason |
2516
+ |------|--------|--------|
2517
+ | [Created] | Initial framework | Vision discovery |
2518
+ ```
2519
+
2520
+ **Step 4A.4: Confirm with User**
2521
+ - Show the framework summary (NOT the full file — just the key weights and values)
2522
+ - Use `ask_user`:
2523
+ - "This captures my priorities well"
2524
+ - "Adjust the weights" (then ask which dimensions to change)
2525
+ - "Add a dimension I care about" (then ask what)
2526
+
2527
+ **Step 4A.5: Proceed to Step 5**
2528
+ - Framework is saved and will be used in Step 7 (Roadmap Generation)
2529
+ - Display: `📋 Value Framework created — this will guide task prioritization`
2410
2530
 
2411
2531
  ### 5. **Technology & Pattern Analysis**
2412
2532
  - **Dynamic Research-Driven Discovery**:
@@ -2829,7 +2949,12 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2829
2949
  - Do NOT ask user to approve delivery strategy - Mother Brain is the expert
2830
2950
 
2831
2951
  ### 7. **Roadmap Generation**
2832
- - **MVP-First Phasing Using Research Findings**:
2952
+ - **MVP-First Phasing Using Research Findings + Value Framework**:
2953
+
2954
+ **Step 7.0: Load Value Framework**
2955
+ - Read `.mother-brain/docs/value-framework.md`
2956
+ - Use the priority dimensions and weights to order tasks
2957
+ - Every task in the roadmap must be scored (even roughly) against the framework
2833
2958
 
2834
2959
  **Step 7.1: Define Phase 1 = MVP (Core Problem Solution)**
2835
2960
  - Phase 1 scope = shortest path to solve core problem from vision
@@ -2863,10 +2988,12 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2863
2988
  **Success Gate**: [MVP criteria from vision document]
2864
2989
  **Strategy**: Solve core problem, defer everything else
2865
2990
 
2866
- **Deliverables**:
2867
- - [ ] **Task 001**: [Essential for solving core problem]
2868
- - [ ] **Task 002**: [Essential for solving core problem]
2869
- - [ ] **Task 003**: [Essential for solving core problem]
2991
+ **Deliverables** (ordered by Value Framework score):
2992
+ - [ ] **Task 001**: [Essential for solving core problem] — *Score: [N] (top dimensions)*
2993
+ - [ ] **Task 002**: [Essential for solving core problem] — *Score: [N] (top dimensions)*
2994
+ - [ ] **Task 003**: [Essential for solving core problem] — *Score: [N] (top dimensions)*
2995
+
2996
+ **Why this order**: [1-2 sentence explanation of why tasks are sequenced this way based on the Value Framework. E.g., "Task 001 first because it scores highest on Vision Alignment and unblocks Tasks 002-003."]
2870
2997
 
2871
2998
  **Skills Available**: [List relevant skills]
2872
2999
 
@@ -2883,9 +3010,11 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2883
3010
  **Trigger**: Phase 1 complete + [feedback mechanism from research]
2884
3011
  **Focus**: Learn from users and iterate
2885
3012
 
2886
- **Planned Enhancements** (subject to validation with real users):
2887
- - [ ] **Task [N]**: [Enhancement based on assumptions - validate first]
2888
- - [ ] **Task [N+1]**: [Feature that wasn't essential for MVP]
3013
+ **Planned Enhancements** (ordered by Value Framework, subject to validation):
3014
+ - [ ] **Task [N]**: [Enhancement] *Score: [N] (top dimensions)*
3015
+ - [ ] **Task [N+1]**: [Feature that wasn't essential for MVP] — *Score: [N] (top dimensions)*
3016
+
3017
+ **Why this order**: [1-2 sentence explanation based on Value Framework]
2889
3018
 
2890
3019
  **Learning Plan**:
2891
3020
  - [Feedback mechanism from Step 6A research]
@@ -3901,6 +4030,10 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3901
4030
  - Offer to adjust roadmap
3902
4031
  - Add new tasks if needed
3903
4032
  - Reprioritize based on feedback
4033
+ - **Re-evaluate Value Framework**: After completing a phase, priorities often shift. Ask:
4034
+ - "Now that Phase [N] is done, have your priorities changed?"
4035
+ - If yes → update `.mother-brain/docs/value-framework.md` weights and re-score remaining tasks
4036
+ - Log change in the Framework Evolution Log
3904
4037
 
3905
4038
  - Display:
3906
4039
  ```
@@ -3912,15 +4045,16 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
3912
4045
  - Proceed to Step 11 (Next Action Menu)
3913
4046
 
3914
4047
  ### 11. **Next Action Menu**
3915
- - After task completion, use `ask_user` with choices:
3916
4048
  - After task completion, use `ask_user` with choices:
3917
4049
  - "Start next task automatically"
3918
4050
  - "💡 I have a new idea"
3919
4051
  - "Review roadmap and choose task"
3920
4052
  - "Take a break (save progress)"
3921
4053
  - "Update/refine the roadmap"
4054
+ - "Adjust my priorities (Value Framework)"
3922
4055
  - Freeform available for custom actions
3923
4056
  - **If "I have a new idea"**: Jump to **Step 2F: Idea Capture & Prioritization**
4057
+ - **If "Adjust my priorities"**: Re-run Step 4A.2 questions, update `.mother-brain/docs/value-framework.md`, re-score existing roadmap tasks if weights changed significantly, show what moved
3924
4058
 
3925
4059
  - Save session state to `docs/session-state.json`:
3926
4060
  ```json