homunculus-code 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/bin/init.js +28 -7
  2. package/package.json +1 -1
package/bin/init.js CHANGED
@@ -66,14 +66,35 @@ function main() {
66
66
  console.log(' \x1b[32m✓\x1b[0m Added evolution rules');
67
67
  }
68
68
 
69
- // 3. Copy CLAUDE.md template
70
- const claudeSrc = path.join(TEMPLATES_DIR, 'CLAUDE.md.template');
69
+ // 3. Add Homunculus section to CLAUDE.md
71
70
  const claudeDest = path.join(projectDir, 'CLAUDE.md');
72
- if (!fs.existsSync(claudeDest) && fs.existsSync(claudeSrc)) {
73
- const template = fs.readFileSync(claudeSrc, 'utf8');
74
- const projectName = path.basename(projectDir);
75
- fs.writeFileSync(claudeDest, template.replace(/\{\{PROJECT_NAME\}\}/g, projectName));
76
- console.log(' \x1b[32m✓\x1b[0m Created CLAUDE.md');
71
+ const homunculusSection = `
72
+ ## Homunculus Self-Evolving AI Assistant
73
+
74
+ This project uses Homunculus for goal-driven evolution.
75
+
76
+ - **Goal Tree**: \`architecture.yaml\` — defines goals, metrics, and health checks
77
+ - **Instincts**: \`homunculus/instincts/personal/\` — auto-extracted patterns
78
+ - **Skills**: \`homunculus/evolved/skills/\` — tested, versioned knowledge
79
+ - **Commands**: \`/hm-setup\` (define goals) | \`/hm-night\` (evolution cycle) | \`/hm-status\` (dashboard)
80
+ `;
81
+
82
+ if (fs.existsSync(claudeDest)) {
83
+ const existing = fs.readFileSync(claudeDest, 'utf8');
84
+ if (!existing.includes('Homunculus')) {
85
+ fs.appendFileSync(claudeDest, '\n' + homunculusSection);
86
+ console.log(' \x1b[32m✓\x1b[0m Added Homunculus section to existing CLAUDE.md');
87
+ } else {
88
+ console.log(' \x1b[33m-\x1b[0m CLAUDE.md already has Homunculus section');
89
+ }
90
+ } else {
91
+ const claudeSrc = path.join(TEMPLATES_DIR, 'CLAUDE.md.template');
92
+ if (fs.existsSync(claudeSrc)) {
93
+ const template = fs.readFileSync(claudeSrc, 'utf8');
94
+ const projectName = path.basename(projectDir);
95
+ fs.writeFileSync(claudeDest, template.replace(/\{\{PROJECT_NAME\}\}/g, projectName));
96
+ console.log(' \x1b[32m✓\x1b[0m Created CLAUDE.md');
97
+ }
77
98
  }
78
99
 
79
100
  // 4. Copy core scripts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homunculus-code",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "A self-evolving AI assistant that grows smarter every night",
5
5
  "bin": {
6
6
  "homunculus-code": "./bin/cli.js"