create-merlin-brain 3.18.3 → 3.18.4
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/install.cjs +28 -6
- package/package.json +1 -1
package/bin/install.cjs
CHANGED
|
@@ -24,9 +24,22 @@ if (isInjectMode) {
|
|
|
24
24
|
const path = require('path');
|
|
25
25
|
|
|
26
26
|
const MERLIN_HEADER = `<!-- MERLIN SIGHTS INTEGRATION - DO NOT REMOVE -->
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
|
|
28
|
+
# MERLIN — MANDATORY: Read ~/.claude/CLAUDE.md for full instructions
|
|
29
|
+
|
|
30
|
+
**BEFORE responding:** Call \`merlin_get_selected_repo\`, then \`merlin_get_project_status\`, then \`merlin_get_rules\` and \`merlin_get_brief\` in parallel. Do NOT skip.
|
|
31
|
+
|
|
32
|
+
**ROUTING — You are an orchestrator, not a coder. Route work to specialists:**
|
|
33
|
+
- Bug/crash/error → \`Skill("merlin:workflow", args='run bug-fix "<task>"')\`
|
|
34
|
+
- Build feature → \`Skill("merlin:workflow", args='run feature-dev "<task>"')\`
|
|
35
|
+
- Refactor → \`Skill("merlin:workflow", args='run refactor "<task>"')\`
|
|
36
|
+
- Small task → \`merlin_smart_route(task="...")\` then \`merlin_route()\`
|
|
37
|
+
- Before editing code → call \`merlin_get_context("task")\` first
|
|
38
|
+
- Multiple tasks → run agents in PARALLEL
|
|
39
|
+
|
|
40
|
+
**Every action prefixed with \`⟡🔮 MERLIN ›\`**
|
|
41
|
+
|
|
42
|
+
---
|
|
30
43
|
|
|
31
44
|
`;
|
|
32
45
|
|
|
@@ -35,10 +48,19 @@ if (isInjectMode) {
|
|
|
35
48
|
function injectHeader(filePath) {
|
|
36
49
|
if (!fs.existsSync(filePath)) return false;
|
|
37
50
|
|
|
38
|
-
|
|
51
|
+
let content = fs.readFileSync(filePath, 'utf8');
|
|
52
|
+
|
|
39
53
|
if (content.includes(MARKER)) {
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
// Replace old header with new one (strip everything before first ---)
|
|
55
|
+
const markerIdx = content.indexOf(MARKER);
|
|
56
|
+
const hrIdx = content.indexOf('\n---\n', markerIdx);
|
|
57
|
+
if (hrIdx !== -1) {
|
|
58
|
+
// Remove old header (everything from start through the --- after marker)
|
|
59
|
+
content = content.substring(hrIdx + 5).trimStart();
|
|
60
|
+
} else {
|
|
61
|
+
// Fallback: remove just the comment lines at the top
|
|
62
|
+
content = content.replace(/^<!--[^>]*MERLIN[^>]*-->\n?/gm, '').trimStart();
|
|
63
|
+
}
|
|
42
64
|
}
|
|
43
65
|
|
|
44
66
|
fs.writeFileSync(filePath, MERLIN_HEADER + content);
|
package/package.json
CHANGED