mother-brain 0.3.0 → 0.4.0

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
@@ -20,6 +20,7 @@ var __dirname = path.dirname(__filename);
20
20
  async function init(options = {}) {
21
21
  const cwd = process.cwd();
22
22
  const skillsDir = path.join(cwd, ".github", "skills");
23
+ const agentsSkillsDir = path.join(cwd, ".agents", "skills");
23
24
  const motherBrainDir = path.join(cwd, ".mother-brain");
24
25
  console.log("");
25
26
  console.log(chalk.cyan("\u2533\u2533\u2513\u250F\u2513\u250F\u2533\u2513\u2513\u250F\u250F\u2513\u2533\u2513 \u2533\u2513\u2533\u2513\u250F\u2513\u2533\u2533\u2513"));
@@ -76,12 +77,44 @@ async function init(options = {}) {
76
77
  console.log(chalk.cyan("\n\u2705 Mother Brain initialized!\n"));
77
78
  console.log("Next steps:");
78
79
  console.log(chalk.dim(" 1. Commit the new files to your repo"));
79
- console.log(chalk.dim(" 2. Open GitHub Copilot CLI"));
80
- console.log(chalk.dim(" 3. Type: /mother-brain\n"));
80
+ console.log(chalk.dim(" 2. Open your AI CLI:"));
81
+ console.log(chalk.dim(' GitHub Copilot CLI: ghcs "/mother-brain"'));
82
+ console.log(chalk.dim(" Codex CLI: $mother-brain"));
83
+ console.log(chalk.dim(" 3. Follow the wizard to define your vision\n"));
81
84
  if (copiedCount > 0) {
82
85
  console.log(chalk.green(`Added ${copiedCount} skill(s) to .github/skills/`));
83
86
  }
84
87
  console.log(chalk.green("Created .mother-brain/ for project state\n"));
88
+ await fs.ensureDir(path.join(cwd, ".agents", "skills"));
89
+ let symlinkCount = 0;
90
+ for (const skill of coreSkills) {
91
+ const target = path.join(skillsDir, skill);
92
+ const link = path.join(agentsSkillsDir, skill);
93
+ if (await fs.pathExists(target)) {
94
+ try {
95
+ if (await fs.pathExists(link)) {
96
+ const stat = await fs.lstat(link);
97
+ if (stat.isSymbolicLink()) {
98
+ await fs.remove(link);
99
+ } else if (!options.force) {
100
+ console.log(chalk.yellow(` \u26A0 .agents/skills/${skill} exists (not a symlink, skipping)`));
101
+ continue;
102
+ } else {
103
+ await fs.remove(link);
104
+ }
105
+ }
106
+ await fs.symlink(target, link, "junction");
107
+ symlinkCount++;
108
+ } catch (err) {
109
+ console.log(chalk.yellow(` \u26A0 Symlink failed for ${skill}, copying instead`));
110
+ await fs.copy(target, link, { overwrite: true });
111
+ symlinkCount++;
112
+ }
113
+ }
114
+ }
115
+ if (symlinkCount > 0) {
116
+ console.log(chalk.green(`Linked ${symlinkCount} skill(s) to .agents/skills/ (Codex CLI compatible)`));
117
+ }
85
118
  }
86
119
 
87
120
  // src/commands/update.ts
@@ -97,6 +130,7 @@ var __dirname2 = path2.dirname(__filename2);
97
130
  async function update() {
98
131
  const cwd = process.cwd();
99
132
  const skillsDir = path2.join(cwd, ".github", "skills");
133
+ const agentsSkillsDir = path2.join(cwd, ".agents", "skills");
100
134
  const motherBrainDir = path2.join(cwd, ".mother-brain");
101
135
  const versionFile = path2.join(motherBrainDir, "version.json");
102
136
  console.log(chalk2.cyan("\n\u{1F9E0} Updating Mother Brain...\n"));
@@ -155,6 +189,28 @@ async function update() {
155
189
  \u2705 Updated to v${latestVersion}!
156
190
  `));
157
191
  console.log(chalk2.dim("Don't forget to commit the updated files.\n"));
192
+ if (await fs2.pathExists(agentsSkillsDir)) {
193
+ for (const skill of coreSkills) {
194
+ const target = path2.join(skillsDir, skill);
195
+ const link = path2.join(agentsSkillsDir, skill);
196
+ if (await fs2.pathExists(target)) {
197
+ try {
198
+ if (await fs2.pathExists(link)) {
199
+ const stat = await fs2.lstat(link);
200
+ if (stat.isSymbolicLink()) {
201
+ continue;
202
+ }
203
+ await fs2.copy(target, link, { overwrite: true });
204
+ } else {
205
+ await fs2.symlink(target, link, "junction");
206
+ }
207
+ } catch {
208
+ await fs2.copy(target, link, { overwrite: true });
209
+ }
210
+ }
211
+ }
212
+ console.log(chalk2.green("Refreshed .agents/skills/ (Codex CLI compatible)"));
213
+ }
158
214
  } catch (error) {
159
215
  console.log(chalk2.red("Failed to download update."));
160
216
  console.log(chalk2.dim("Try running: npx mother-brain@latest init --force\n"));
@@ -653,8 +709,8 @@ async function uninstall(options) {
653
709
  // src/cli.ts
654
710
  import { exec as exec3 } from "child_process";
655
711
  var program = new Command();
656
- var VERSION = "0.3.0";
657
- program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI").version(VERSION);
712
+ var VERSION = "0.4.0";
713
+ program.name("mother-brain").description("AI-powered project management framework for GitHub Copilot CLI and Codex CLI").version(VERSION);
658
714
  program.command("init").description("Initialize Mother Brain in the current project").option("-f, --force", "Overwrite existing skills").action(init);
659
715
  program.command("update").description("Update Mother Brain skills to the latest version").action(update);
660
716
  program.command("status").description("Show installed version and available updates").action(status);
@@ -680,8 +736,9 @@ program.command("quickstart").description("Show quick start guide").action(() =>
680
736
  console.log(chalk6.white.bold("\u{1F680} Quick Start Guide\n"));
681
737
  console.log(chalk6.yellow("Step 1:") + " Initialize Mother Brain in your project");
682
738
  console.log(chalk6.dim(" npx -y mother-brain init\n"));
683
- console.log(chalk6.yellow("Step 2:") + " Start using it with GitHub Copilot CLI");
684
- console.log(chalk6.dim(' ghcs "/mother-brain"\n'));
739
+ console.log(chalk6.yellow("Step 2:") + " Start using it with your AI CLI");
740
+ console.log(chalk6.dim(' GitHub Copilot CLI: ghcs "/mother-brain"'));
741
+ console.log(chalk6.dim(" Codex CLI: $mother-brain\n"));
685
742
  console.log(chalk6.yellow("Step 3:") + " Follow the wizard to define your vision");
686
743
  console.log(chalk6.dim(" Mother Brain will guide you through:\n"));
687
744
  console.log(chalk6.dim(" - Vision Discovery (what are you building?)"));
@@ -698,7 +755,7 @@ program.action(() => {
698
755
  \u2503\u2503\u2503\u2503\u2503 \u2503 \u2523\u252B\u2523 \u2523\u252B \u2523\u252B\u2523\u252B\u2523\u252B\u2503\u2503\u2503
699
756
  \u251B \u2517\u2517\u251B \u253B \u251B\u2517\u2517\u251B\u251B\u2517 \u253B\u251B\u251B\u2517\u251B\u2517\u253B\u251B\u2517
700
757
  `));
701
- console.log(chalk6.white("AI-powered project management for GitHub Copilot CLI"));
758
+ console.log(chalk6.white("AI-powered project management for GitHub Copilot CLI & Codex CLI"));
702
759
  console.log(chalk6.dim(`v${VERSION}
703
760
  `));
704
761
  console.log(chalk6.white.bold("Getting Started:"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mother-brain",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "AI-powered project management framework for GitHub Copilot CLI",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -2271,8 +2271,24 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2271
2271
  New-Item -ItemType Directory -Path ".mother-brain/docs/tasks" -Force
2272
2272
  New-Item -ItemType Directory -Path ".mother-brain/docs/research" -Force
2273
2273
  New-Item -ItemType Directory -Path ".github/skills" -Force
2274
+ New-Item -ItemType Directory -Path ".agents/skills" -Force
2274
2275
  ```
2275
2276
 
2277
+ - Create `.agents/skills/` symlinks for Codex CLI compatibility:
2278
+ ```powershell
2279
+ # Symlink each core skill so Codex CLI can discover them
2280
+ # Uses 'junction' on Windows (works without admin/dev mode)
2281
+ $coreSkills = @("mother-brain", "child-brain", "skill-creator")
2282
+ foreach ($skill in $coreSkills) {
2283
+ $target = ".github\skills\$skill"
2284
+ $link = ".agents\skills\$skill"
2285
+ if ((Test-Path $target) -and !(Test-Path $link)) {
2286
+ New-Item -ItemType Junction -Path $link -Target (Resolve-Path $target) -Force
2287
+ }
2288
+ }
2289
+ ```
2290
+ - **Why symlinks**: Skills live in `.github/skills/` (GitHub Copilot CLI) and are symlinked to `.agents/skills/` (Codex CLI). One source of truth, both CLIs can discover them.
2291
+
2276
2292
  - Create initial version tracking:
2277
2293
  ```powershell
2278
2294
  $version = "[current-mother-brain-version]"
@@ -2316,7 +2332,7 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2316
2332
  ✅ Mother Brain initialized!
2317
2333
 
2318
2334
  📁 Location: [current directory]
2319
- 📂 Created: .mother-brain/, .github/skills/
2335
+ 📂 Created: .mother-brain/, .github/skills/, .agents/skills/ (symlinked)
2320
2336
  🔗 Git: [Initialized / Already existed]
2321
2337
 
2322
2338
  Ready to create your vision document.
@@ -2706,6 +2722,10 @@ This pattern ensures NO workflow ever traps the user—there's always an escape
2706
2722
  ```
2707
2723
  - Let skill-creator run its wizard with all three knowledge sources
2708
2724
  - **Store created skills in `.github/skills/`** (CLI-discoverable location)
2725
+ - **Symlink to `.agents/skills/`** for Codex CLI compatibility:
2726
+ ```powershell
2727
+ New-Item -ItemType Junction -Path ".agents\skills\[skill-name]" -Target (Resolve-Path ".github\skills\[skill-name]") -Force
2728
+ ```
2709
2729
  - **Track in session-state.json**: Add skill name to `skillsCreated` array
2710
2730
  - **VALIDATE SKILL** (CRITICAL - prevents task execution failures):
2711
2731
  1. Check `.github/skills/[skill-name]/SKILL.md` exists
@@ -4034,6 +4054,11 @@ project-root/
4034
4054
  │ ├── skill-creator/ # Core framework (never delete)
4035
4055
  │ ├── [project-skill-1]/ # Project-specific (tracked in session-state.json)
4036
4056
  │ └── [project-skill-2]/ # Project-specific (tracked in session-state.json)
4057
+ ├── .agents/
4058
+ │ └── skills/ # Symlinks to .github/skills/ (Codex CLI compatibility)
4059
+ │ ├── mother-brain/ → ../.github/skills/mother-brain/
4060
+ │ ├── child-brain/ → ../.github/skills/child-brain/
4061
+ │ └── skill-creator/ → ../.github/skills/skill-creator/
4037
4062
  ├── src/ # Source code (standard structure)
4038
4063
  ├── tests/ # Tests (standard structure)
4039
4064
  ├── README.md # Project overview
@@ -4041,7 +4066,7 @@ project-root/
4041
4066
  ```
4042
4067
 
4043
4068
  **Key Principles:**
4044
- - **CLI Compatibility**: All skills in `.github/skills/` so Copilot CLI can find them
4069
+ - **Dual CLI Compatibility**: Skills live in `.github/skills/` (GitHub Copilot CLI) and are symlinked to `.agents/skills/` (Codex CLI). One source of truth, both CLIs discover them.
4045
4070
  - **Skill Tracking**: `session-state.json` tracks which skills are project-specific via `skillsCreated` array
4046
4071
  - **Easy Ejection**: Delete skills listed in `skillsCreated`, keep core framework skills
4047
4072
  - **Isolated Docs**: Project documentation in `.mother-brain/docs/` (separate from project code)