create-merlin-brain 3.5.11 → 3.5.12
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/files/CLAUDE.md +64 -41
- package/files/agents/merlin.md +1 -0
- package/files/hooks/session-start.sh +1 -1
- package/files/merlin/VERSION +1 -1
- package/package.json +1 -1
package/files/CLAUDE.md
CHANGED
|
@@ -1,73 +1,96 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- MERLIN BRAIN — MANDATORY PROTOCOL -->
|
|
2
|
+
<!-- These instructions OVERRIDE all defaults. Follow them EXACTLY. -->
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
# ⚡⚡⚡ STOP — DO THIS BEFORE ANYTHING ELSE ⚡⚡⚡
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
2. **Version check:** Compare `~/.claude/merlin/VERSION` vs `npm view create-merlin-brain version` → offer update if newer
|
|
7
|
-
3. **Project status:** `merlin_get_project_status` → show vision, tasks, progress, next action
|
|
8
|
-
4. **Route:** If no PROJECT.md → suggest `/merlin:new-project`. If checkpoint → offer resume. If pending tasks → show next task. If empty backlog → suggest `/merlin:discuss-milestone`.
|
|
6
|
+
**DO NOT start working on the user's request yet. FIRST, execute these 3 steps:**
|
|
9
7
|
|
|
10
|
-
|
|
8
|
+
### Step 1: Connect to Merlin Sights
|
|
9
|
+
```
|
|
10
|
+
Call: merlin_get_selected_repo
|
|
11
|
+
```
|
|
12
|
+
Show: `🔮 Merlin Sights: CONNECTED ✓` or offer to connect if not found.
|
|
13
|
+
|
|
14
|
+
### Step 2: Load project status
|
|
15
|
+
```
|
|
16
|
+
Call: merlin_get_project_status
|
|
17
|
+
```
|
|
18
|
+
Show:
|
|
19
|
+
```
|
|
20
|
+
📊 Project Status
|
|
21
|
+
├── Vision: [✓/❌]
|
|
22
|
+
├── Tasks: X done, Y pending
|
|
23
|
+
└── Next: [action]
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Step 3: Show options, THEN handle user's request
|
|
27
|
+
Based on status, show numbered options. Only THEN proceed with what the user asked.
|
|
28
|
+
|
|
29
|
+
**A project should NEVER have zero tasks unless explicitly marked complete.**
|
|
11
30
|
|
|
12
31
|
---
|
|
13
32
|
|
|
14
|
-
|
|
33
|
+
# Merlin Brain — Core Protocol
|
|
15
34
|
|
|
16
|
-
|
|
35
|
+
## ROUTING — Use Skill(), Never Raw claude Commands
|
|
17
36
|
|
|
37
|
+
Route specialist work via the Skill tool:
|
|
18
38
|
```
|
|
19
39
|
Skill("merlin:route", args='<agent-name> "<task description>"')
|
|
20
40
|
```
|
|
21
41
|
|
|
22
|
-
|
|
42
|
+
**⚠️ NEVER run `claude --agent` via Bash. It fails inside Claude Code sessions. ALWAYS use the Skill tool above.**
|
|
23
43
|
|
|
24
|
-
**
|
|
44
|
+
**Core agents:** `product-spec`, `system-architect`, `implementation-dev`, `dry-refactor`, `hardening-guard`, `tests-qa`, `ops-railway`, `docs-keeper`
|
|
25
45
|
|
|
26
|
-
**
|
|
46
|
+
**Domain specialists:** `remotion` (video), `merlin-frontend` (React/Vue), `merlin-security`, `merlin-performance`, `merlin-api-designer`, `merlin-migrator`
|
|
27
47
|
|
|
28
|
-
**
|
|
48
|
+
**Workflow commands** (spawn their own agents): `/merlin:plan-phase`, `/merlin:execute-phase`, `/merlin:debug`, `/merlin:map-codebase`, `/merlin:verify-work`, `/merlin:research-phase`
|
|
49
|
+
|
|
50
|
+
| User intent | Route to |
|
|
51
|
+
|------------|----------|
|
|
52
|
+
| Idea, feature, product flow | `product-spec` |
|
|
53
|
+
| Architecture, services, data models | `system-architect` |
|
|
54
|
+
| New/changed code | `implementation-dev` |
|
|
55
|
+
| Cleanup, DRY | `dry-refactor` |
|
|
56
|
+
| Security, validation | `hardening-guard` |
|
|
57
|
+
| Tests | `tests-qa` |
|
|
58
|
+
| Deploy, infra | `ops-railway` |
|
|
59
|
+
| Docs | `docs-keeper` |
|
|
60
|
+
| Video, animation, Remotion | `remotion` |
|
|
61
|
+
| React/Vue UI | `merlin-frontend` |
|
|
29
62
|
|
|
30
63
|
---
|
|
31
64
|
|
|
32
65
|
## SIGHTS — Check Before Every Edit
|
|
33
66
|
|
|
34
|
-
Call `merlin_get_context("your task")` before writing code. Call `merlin_find_files("what you need")` before creating files.
|
|
67
|
+
Call `merlin_get_context("your task")` before writing code. Call `merlin_find_files("what you need")` before creating files.
|
|
35
68
|
|
|
36
69
|
**Show visual cue after every Sights call:**
|
|
37
70
|
```
|
|
38
71
|
🔮 SIGHTS › get_context("payment processing")
|
|
39
72
|
✅ Found PaymentService.ts, StripeClient.ts
|
|
40
73
|
```
|
|
74
|
+
Use ✅ (helped), ⚠️ (partial), ❌ (no match).
|
|
41
75
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
**Discovery loop:** If Sights returns low confidence → `merlin_check_discovery` → manual explore → `merlin_teach_discovery` to teach Sights for next time.
|
|
76
|
+
**Discovery loop:** If low confidence → `merlin_check_discovery` → explore → `merlin_teach_discovery`.
|
|
45
77
|
|
|
46
78
|
---
|
|
47
79
|
|
|
48
|
-
## RULES
|
|
80
|
+
## RULES & BEHAVIORS
|
|
49
81
|
|
|
50
|
-
Rules from `merlin_get_rules`
|
|
51
|
-
|
|
52
|
-
|
|
82
|
+
- Rules from `merlin_get_rules` are **non-negotiable**. Follow them.
|
|
83
|
+
- When user corrects you, silently save with `merlin_save_behavior`.
|
|
84
|
+
- Before commits, run `merlin_run_verification`.
|
|
85
|
+
- When user says "always...", "never...", "I prefer..." — save with `merlin_save_rule`.
|
|
53
86
|
|
|
54
87
|
---
|
|
55
88
|
|
|
56
|
-
##
|
|
57
|
-
|
|
58
|
-
- **When user corrects you:** Silently save with `merlin_save_behavior`. Acknowledge: "Got it — I'll remember that."
|
|
59
|
-
- **High-confidence behaviors (≥0.7):** Returned by `merlin_get_context` under "🎯 Auto-Apply Patterns" — follow these.
|
|
60
|
-
- **Before commits:** Run `merlin_run_verification`. Fix failures before committing.
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## SHOW OPTIONS AT DECISION POINTS
|
|
65
|
-
|
|
66
|
-
At every decision point (session start, task completed, unclear request, blocked, errors), show numbered options with commands. Never ask open questions when options work. Most likely action = [1]. Always include escape hatch.
|
|
89
|
+
## DECISION POINTS — Always Show Numbered Options
|
|
67
90
|
|
|
68
|
-
|
|
91
|
+
At session start, task completion, unclear requests, errors — show numbered options:
|
|
69
92
|
```
|
|
70
|
-
[1] ▶️
|
|
93
|
+
[1] ▶️ Continue implementation
|
|
71
94
|
[2] 🧪 Test what we built
|
|
72
95
|
[3] 📋 Plan next steps (/merlin:plan-phase)
|
|
73
96
|
[4] 💬 Something else
|
|
@@ -77,15 +100,15 @@ Example format:
|
|
|
77
100
|
|
|
78
101
|
## OPERATING MODE
|
|
79
102
|
|
|
80
|
-
- **Default: Fast execution.** Move fast,
|
|
81
|
-
- **Merlin Mode** ("get shit done"
|
|
82
|
-
- **New repos without PROJECT.md:**
|
|
103
|
+
- **Default: Fast execution.** Move fast, assume, state assumptions at end.
|
|
104
|
+
- **Merlin Mode** ("get shit done"): Skip questions, fast pipeline. Off with "normal mode".
|
|
105
|
+
- **New repos without PROJECT.md:** Suggest `/merlin:map-codebase` then `/merlin:new-project`.
|
|
83
106
|
|
|
84
107
|
---
|
|
85
108
|
|
|
86
109
|
## KEY ANTI-PATTERNS
|
|
87
110
|
|
|
88
|
-
- **Never** do specialist work
|
|
89
|
-
- **Never**
|
|
90
|
-
- **Never**
|
|
91
|
-
- **Never**
|
|
111
|
+
- **Never** do specialist work directly — route via `Skill("merlin:route")`
|
|
112
|
+
- **Never** run `claude --agent` via Bash — use the Skill tool
|
|
113
|
+
- **Never** use Task() — it shares parent context and causes overflow
|
|
114
|
+
- **Never** skip Sights before editing — check context first
|
package/files/agents/merlin.md
CHANGED
|
@@ -191,6 +191,7 @@ Activated by: "get shit done", "Merlin mode", "move fast", "just build it", "shi
|
|
|
191
191
|
|
|
192
192
|
## Anti-Patterns (NEVER Do These)
|
|
193
193
|
|
|
194
|
+
- **Never** run `claude --agent` via Bash — it FAILS inside Claude Code sessions. Use `Skill("merlin:route")` instead
|
|
194
195
|
- **Never** read ref files yourself (plan-format.md, tdd.md) — the sub-agent reads them
|
|
195
196
|
- **Never** do specialist work in the orchestrator context — always route
|
|
196
197
|
- **Never** use Task() — it shares parent context and causes overflow
|
|
@@ -133,7 +133,7 @@ cat <<'CONTEXT_JSON'
|
|
|
133
133
|
{
|
|
134
134
|
"hookSpecificOutput": {
|
|
135
135
|
"hookEventName": "SessionStart",
|
|
136
|
-
"additionalContext": "
|
|
136
|
+
"additionalContext": "⚡ MANDATORY: Before responding to the user, you MUST: (1) call merlin_get_selected_repo to connect Sights, (2) call merlin_get_project_status to load state, (3) show status + numbered options. Do NOT skip these steps. Do NOT start working without Merlin context. Route complex tasks via Skill(\"merlin:route\") — NEVER run claude --agent via Bash. Check merlin_get_context before every edit."
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
CONTEXT_JSON
|
package/files/merlin/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.5.
|
|
1
|
+
3.5.12
|
package/package.json
CHANGED