musubix 1.1.7 → 1.1.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "musubix",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Neuro-Symbolic AI Coding System - MUSUBI × YATA Integration",
5
5
  "type": "module",
6
6
  "workspaces": [
@@ -19,9 +19,11 @@
19
19
  "docs/",
20
20
  "steering/",
21
21
  "templates/",
22
- ".github/"
22
+ ".github/",
23
+ "scripts/"
23
24
  ],
24
25
  "scripts": {
26
+ "postinstall": "node scripts/postinstall.js",
25
27
  "build": "npm run build --workspaces --if-present",
26
28
  "test": "vitest run",
27
29
  "test:unit": "vitest run --dir packages/*/src/__tests__",
@@ -0,0 +1,94 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * MUSUBIX Postinstall Script
4
+ *
5
+ * Copies .github/ and AGENTS.md to the project root after npm install.
6
+ * This enables GitHub Copilot and other AI agents to use MUSUBIX prompts and skills.
7
+ */
8
+
9
+ import { existsSync, cpSync, copyFileSync, mkdirSync } from 'fs';
10
+ import { dirname, join, resolve } from 'path';
11
+ import { fileURLToPath } from 'url';
12
+
13
+ const __filename = fileURLToPath(import.meta.url);
14
+ const __dirname = dirname(__filename);
15
+
16
+ // Source: where musubix is installed (node_modules/musubix)
17
+ const packageRoot = resolve(__dirname, '..');
18
+
19
+ // Target: project root (where npm install was run)
20
+ // When installed as dependency: process.env.INIT_CWD points to project root
21
+ // When running in musubix repo itself: skip
22
+ const projectRoot = process.env.INIT_CWD || process.cwd();
23
+
24
+ // Skip if we're in the musubix package itself
25
+ if (projectRoot === packageRoot || projectRoot.includes('node_modules/musubix')) {
26
+ console.log('musubix: Skipping postinstall (running in package directory)');
27
+ process.exit(0);
28
+ }
29
+
30
+ const sourceGithub = join(packageRoot, '.github');
31
+ const sourceAgents = join(packageRoot, 'AGENTS.md');
32
+ const targetGithub = join(projectRoot, '.github');
33
+ const targetAgents = join(projectRoot, 'AGENTS.md');
34
+
35
+ let copied = false;
36
+
37
+ // Copy .github directory
38
+ if (existsSync(sourceGithub)) {
39
+ // Only copy musubix-specific files, don't overwrite existing .github
40
+ const musubixPrompts = join(sourceGithub, 'prompts');
41
+ const musubixSkills = join(sourceGithub, 'skills');
42
+ const musubixAgents = join(sourceGithub, 'AGENTS.md');
43
+
44
+ // Create .github if not exists
45
+ if (!existsSync(targetGithub)) {
46
+ mkdirSync(targetGithub, { recursive: true });
47
+ }
48
+
49
+ // Copy prompts
50
+ if (existsSync(musubixPrompts)) {
51
+ const targetPrompts = join(targetGithub, 'prompts');
52
+ if (!existsSync(targetPrompts)) {
53
+ mkdirSync(targetPrompts, { recursive: true });
54
+ }
55
+ cpSync(musubixPrompts, targetPrompts, { recursive: true, force: false });
56
+ console.log('musubix: Copied .github/prompts/');
57
+ copied = true;
58
+ }
59
+
60
+ // Copy skills
61
+ if (existsSync(musubixSkills)) {
62
+ const targetSkills = join(targetGithub, 'skills');
63
+ if (!existsSync(targetSkills)) {
64
+ mkdirSync(targetSkills, { recursive: true });
65
+ }
66
+ cpSync(musubixSkills, targetSkills, { recursive: true, force: false });
67
+ console.log('musubix: Copied .github/skills/');
68
+ copied = true;
69
+ }
70
+
71
+ // Copy .github/AGENTS.md
72
+ if (existsSync(musubixAgents)) {
73
+ const targetGithubAgents = join(targetGithub, 'AGENTS.md');
74
+ if (!existsSync(targetGithubAgents)) {
75
+ copyFileSync(musubixAgents, targetGithubAgents);
76
+ console.log('musubix: Copied .github/AGENTS.md');
77
+ copied = true;
78
+ }
79
+ }
80
+ }
81
+
82
+ // Copy AGENTS.md to project root
83
+ if (existsSync(sourceAgents) && !existsSync(targetAgents)) {
84
+ copyFileSync(sourceAgents, targetAgents);
85
+ console.log('musubix: Copied AGENTS.md');
86
+ copied = true;
87
+ }
88
+
89
+ if (copied) {
90
+ console.log('musubix: AI agent configuration files installed successfully!');
91
+ console.log('musubix: GitHub Copilot can now use MUSUBIX SDD prompts and skills.');
92
+ } else {
93
+ console.log('musubix: Configuration files already exist, skipping.');
94
+ }