homunculus-code 0.3.0 → 0.3.2
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/bin/init.js +33 -10
- 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.
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
|
@@ -98,9 +119,11 @@ function main() {
|
|
|
98
119
|
if (!settings.hooks) settings.hooks = {};
|
|
99
120
|
if (!settings.hooks.PostToolUse) {
|
|
100
121
|
settings.hooks.PostToolUse = [{
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
122
|
+
matcher: "",
|
|
123
|
+
hooks: [{
|
|
124
|
+
type: "command",
|
|
125
|
+
command: "bash scripts/observe.sh post"
|
|
126
|
+
}]
|
|
104
127
|
}];
|
|
105
128
|
ensureDir(path.join(projectDir, '.claude'));
|
|
106
129
|
fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + '\n');
|