create-merlin-brain 5.3.5 → 5.3.7

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 CHANGED
@@ -1750,12 +1750,15 @@ ${colors.cyan}Universal Task Optimization (NEW in 5.3.0):${colors.reset}
1750
1750
  • ${colors.bright}/merlin:polish${colors.reset} - Animation polish via animation-expert
1751
1751
  • ${colors.bright}/merlin:redesign${colors.reset} - Full redesign via ui-builder
1752
1752
 
1753
- ${colors.cyan}Tier-2 cleanup (NEW in 5.3.5):${colors.reset}
1754
- 4 new agents wired (android-expert, apple-swift-expert, desktop-app-expert, marketing-automation)
1755
- Counter-reset bug diagnosed in duo-codex-call.sh (fix pending v5.3.6)
1756
- MCP routing reads live agent list from disk (no drift)
1757
- • Concurrent codex calls protected by flock
1758
- Malformed config files now backed up before overwrite
1753
+ ${colors.cyan}Attribution hardening (NEW in 5.3.6):${colors.reset}
1754
+ All shipped agents now carry provenance frontmatter (source + license + import date)
1755
+ check-provenance.js now requires every agent to declare provenance
1756
+ Unknown-origin agents documented in NOTICE.md (attribution pending see issue tracker)
1757
+
1758
+ ${colors.cyan}Discovery-first (NEW in 5.3.7):${colors.reset}
1759
+ • Brain now proactively searches 1000+ community agents before routing
1760
+ • ${colors.bright}/merlin:install <slug>${colors.reset} - One-keystroke install of any catalog agent
1761
+ • smart_route + discover_agents wired into the orchestrator protocol
1759
1762
 
1760
1763
  ${colors.cyan}Merlin works with or without Sights:${colors.reset}
1761
1764
  • ${colors.green}With Sights${colors.reset}: Instant context, cross-session memory
package/files/CLAUDE.md CHANGED
@@ -53,11 +53,23 @@ Do NOT spawn Explore agents or run Glob/Grep for codebase questions. Use Sights
53
53
 
54
54
  Never just dump an agent result and go silent. Always follow through.
55
55
 
56
+ ## Discovery-First Routing (1000+ community agents)
57
+
58
+ Before routing any non-trivial task to a built-in specialist, proactively check the community catalog:
59
+
60
+ 1. Call `merlin_smart_route(task="<full user text>")` to score both built-in and catalog agents.
61
+ 2. If a catalog match (Grade A+ or A) scores higher than built-in options, surface it to the user.
62
+ 3. Example: "⟡🔮 MERLIN › Found a community agent: **Payment Integration** (Grade A). Install with `/merlin:install payment-integration`, or use built-in implementation-dev?"
63
+ 4. Wait for user choice — never auto-install without confirmation.
64
+ 5. Use `/merlin:install <slug>` to install, or the user can describe what they want and Merlin will auto-route.
65
+
66
+ Skip discovery for: trivial edits (single file, comment, rename), debug runs, doc updates, or when user explicitly names an agent.
67
+
56
68
  ## Execution
57
69
 
58
70
  Run independent agents in PARALLEL. Never sequential when parallel is possible.
59
71
  NEVER run `claude --agent` via Bash. Always use `Skill("merlin:route")` or `merlin_route()`.
60
- For ANY routing, call `merlin_smart_route(task="...")` FIRST to check 500+ community agents.
72
+ For ANY routing, call `merlin_smart_route(task="...")` FIRST to check community agents + built-ins.
61
73
 
62
74
  ## Learning
63
75
 
@@ -3,6 +3,15 @@ name: android-expert
3
3
  description: Full-lifecycle Android agent — implements, refactors, architects, tests, and hardens Kotlin, Jetpack Compose, Material Design 3, and Android apps.
4
4
  model: sonnet
5
5
  color: green
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -3,6 +3,15 @@ name: animation-expert
3
3
  description: Full-lifecycle animation agent — builds, refactors, architects, tests, and hardens animations with Motion, GSAP, CSS, and 60fps performance.
4
4
  model: sonnet
5
5
  color: violet
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -3,6 +3,15 @@ name: apple-swift-expert
3
3
  description: Full-lifecycle Apple platform agent — implements, refactors, architects, tests, and hardens Swift 6, SwiftUI, AppKit, iOS and macOS code.
4
4
  model: sonnet
5
5
  color: blue
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -3,6 +3,15 @@ name: desktop-app-expert
3
3
  description: Full-lifecycle desktop app agent — implements, refactors, architects, tests, and hardens Electron and Tauri apps with IPC security and cross-platform distribution.
4
4
  model: sonnet
5
5
  color: cyan
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -3,6 +3,15 @@ name: marketing-automation
3
3
  description: Full-lifecycle marketing engineering agent — builds, refactors, architects, tests, and hardens email campaigns, drip sequences, A/B tests, and analytics.
4
4
  model: sonnet
5
5
  color: red
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -3,6 +3,14 @@ name: orchestrator
3
3
  description: Master router for a vibe coder building serious, production-leaning systems. Always choose and coordinate the right specialist agent instead of doing work yourself.
4
4
  model: opus
5
5
  color: red
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-01-22"
10
+ license: unknown
11
+ license_verification: unconfirmed
12
+ adapted: "Vendored as-is from local cache on 2026-01-22. No modifications beyond Merlin integration."
13
+ note: "Imported on 2026-01-22 from an unidentified source (different style than the Feb 4 batch). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
14
  ---
7
15
 
8
16
  You are the orchestrator for a very strong product thinker and vibe coder who uses Claude Code as their main dev environment.
@@ -3,6 +3,15 @@ name: ui-builder
3
3
  description: Full-lifecycle UI engineering agent — builds, refactors, architects, tests, and hardens React components with Tailwind, shadcn/ui, and Radix.
4
4
  model: sonnet
5
5
  color: orange
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -3,6 +3,15 @@ name: ui-designer
3
3
  description: Full-lifecycle design agent — creates, refactors, architects, audits, and hardens design systems, accessibility, tokens, and component specs.
4
4
  model: sonnet
5
5
  color: pink
6
+ provenance:
7
+ upstream: unknown-origin/vendored-agents-feb2026
8
+ source: unknown
9
+ imported_date: "2026-02-04"
10
+ style_signature: "Full-lifecycle X agent — builds, refactors, architects, tests, and hardens"
11
+ license: unknown
12
+ license_verification: unconfirmed
13
+ adapted: "Vendored as-is from local cache on 2026-02-04. No modifications beyond Merlin integration."
14
+ note: "Imported in batch on 2026-02-04 from an unidentified source. Style is consistent with a single author/tool but no public catalog match was found (checked wshobson/agents, VoltAgent/awesome-claude-code-subagents). Curated, integrated, and shipped via create-merlin-brain. If you recognize this as your work, please open an issue at https://github.com/sandman66666/merlin and we'll update attribution."
6
15
  ---
7
16
 
8
17
  <role>
@@ -0,0 +1,49 @@
1
+ ---
2
+ name: merlin:install
3
+ description: Install a community agent/skill from the Merlin catalog by slug. Wraps `npx skills add` and similar install commands per the agent's metadata.
4
+ argument-hint: "<slug> — agent slug from merlin_discover_agents (e.g., 'payment-integration')"
5
+ allowed-tools:
6
+ - Bash
7
+ - Read
8
+ - mcp__merlin__merlin_get_agent_detail
9
+ ---
10
+
11
+ <objective>
12
+ Install a community agent or skill from the Merlin catalog into the user's local Claude environment.
13
+ </objective>
14
+
15
+ ## Steps
16
+
17
+ 1. Read the agent detail via `merlin_get_agent_detail(slug="$ARGUMENTS")` to get the install command and source.
18
+
19
+ 2. Show the user what's about to be installed:
20
+ - Name, grade, description
21
+ - Install command from agent metadata
22
+ - Source repo URL
23
+ Then ask explicit confirmation: "Install <name>? (Y/N)"
24
+
25
+ 3. On YES, run the install command:
26
+ - If it starts with `npx skills add`: `bash -c "<install_command>"`
27
+ - If it starts with `npm install`: `bash -c "<install_command>"` (in cwd or globally based on agent type)
28
+ - If unknown: surface the command and tell user to run it manually
29
+
30
+ 4. After install, verify the agent is now reachable:
31
+ - For Claude agents: check `~/.claude/agents/<slug>.md` exists
32
+ - For skills: check `~/.claude/skills/<slug>/SKILL.md` exists
33
+ - Otherwise: trust the install command's exit code
34
+
35
+ 5. Surface a usage hint: "Installed <name>. Use via `merlin_route(agent=\"<name>\", task=\"...\")` or just describe what you want — Merlin will route to it."
36
+
37
+ ## Safety
38
+
39
+ - NEVER run install commands without explicit user Y confirmation.
40
+ - NEVER pipe install commands through eval or shell injection unsafe channels.
41
+ - If the install command from the catalog looks suspicious (contains `curl | sh`, sudo, etc.), refuse and surface the command for manual review.
42
+ - Honor the user's deny list (`~/.claude/settings.json` permissions.deny).
43
+
44
+ ## Errors
45
+
46
+ - Slug not found → "Slug `<x>` not found. Try `merlin_discover_agents(query=\"...\")` to search."
47
+ - No install command in metadata → "This agent doesn't have an automated install. Visit <source_url> for instructions."
48
+ - Install command failed → show stderr, suggest manual run.
49
+
@@ -32,4 +32,6 @@ wait
32
32
 
33
33
  **Badge:** Always prefix every action with `⟡🔮↔🔮 MERLIN·DUO ›` when duo is on, `⟡🔮 MERLIN ›` when off.
34
34
 
35
- TASK OPTIMIZATION: Before EVERY routing decision (workflows, agents, specialists), run ~/.claude/scripts/task-optimize.sh --task "<user text>". It returns {intent, skills[], agent, score, matched_phrases}. If score>=25, ALWAYS announce "⟡🔮 MERLIN › Intent: <X>. Loading <skills> + routing to <agent>." then route with skills prepended to context. Registry: ~/.claude/merlin/skills/TASK-OPTIMIZER.json. Slash commands /merlin:optimize, /merlin:design-audit, /merlin:polish, /merlin:redesign wrap common flows.
35
+ TASK OPTIMIZATION: Before EVERY routing decision (workflows, agents, specialists), run ~/.claude/scripts/task-optimize.sh --task "<user text>". It returns {intent, skills[], agent, score, matched_phrases}. If score>=25, ALWAYS announce "⟡🔮 MERLIN › Intent: <X>. Loading <skills> + routing to <agent>." then route with skills prepended to context. Registry: ~/.claude/merlin/skills/TASK-OPTIMIZER.json. Slash commands /merlin:optimize, /merlin:design-audit, /merlin:polish, /merlin:redesign wrap common flows.
36
+
37
+ DISCOVERY-FIRST: Before routing any non-trivial task to a built-in specialist, call `merlin_smart_route(task="...")` and `merlin_discover_agents(query="...")` to check the community catalog (1000+ indexed agents/skills). If a catalog match scores a higher grade (A+/A++) than the best built-in for the task, surface it: "⟡🔮 MERLIN › I found a community agent that fits better: <name> (Grade: <X>). Install with /merlin:install <slug> or stick with built-in <built-in>?" — then wait for user choice. NEVER install without confirmation. Skip discovery only for: trivial single-file edits, debug runs, doc updates, or when the user explicitly names an agent.
@@ -55,6 +55,41 @@ Slash commands: `/merlin:optimize`, `/merlin:design-audit`, `/merlin:polish`, `/
55
55
 
56
56
  The optimizer is the AUTHORITY. Don't override its recommendations unless the user explicitly asks for a different agent.
57
57
 
58
+ ## Discovery-First Routing (1000+ community agents)
59
+
60
+ The Merlin Sights server indexes 1000+ community agents/skills from GitHub, npm, skills.sh, and other sources. Before routing any non-trivial task to a built-in, ALWAYS check if a better community agent exists.
61
+
62
+ ### Protocol
63
+
64
+ For tasks that are NOT trivial (i.e., > 5 minutes of work, or touching a new domain):
65
+
66
+ 1. Call `merlin_smart_route(task="<full user text>")` — returns the best match from BOTH installed local agents AND the community catalog.
67
+ 2. If the response includes a catalog match (source: catalog, grade A+/A++):
68
+ - Surface it to the user: `⟡🔮 MERLIN › Catalog match: <name> (Grade <X>). Install with /merlin:install <slug>, or use built-in <fallback>?`
69
+ - Wait for user choice. Never install without confirmation.
70
+ 3. If only built-in matches, proceed with normal routing.
71
+
72
+ For tasks that ARE trivial (single-file edit, rename, comment fix, debug print):
73
+ - Skip discovery. Use the optimizer + built-in directly.
74
+
75
+ ### When to use discover_agents vs smart_route
76
+
77
+ - `merlin_smart_route(task)` — best for "what agent should I use" decisions (returns ranked recommendation)
78
+ - `merlin_discover_agents(query)` — best for "what's available for X technology" exploration (returns 5-10 matches with install commands)
79
+
80
+ ### Examples
81
+
82
+ Bad:
83
+ > User: "build me a Stripe payments integration"
84
+ > Merlin: routes to implementation-dev without checking catalog
85
+
86
+ Good:
87
+ > User: "build me a Stripe payments integration"
88
+ > Merlin: `merlin_smart_route("build Stripe payments...")` → finds "Payment Integration" (Grade A) catalog agent
89
+ > Merlin: "⟡🔮 MERLIN › Found a community agent: **Payment Integration** (Grade A) by ChatAndBuild. Install with `/merlin:install payment-integration`, or use built-in implementation-dev?"
90
+
91
+ This is what makes the "1000+ skills on the server" actually useful.
92
+
58
93
  ## Agent Routing
59
94
 
60
95
  Call `merlin_smart_route(task="...")` FIRST (searches 500+ community agents). Then:
@@ -33,8 +33,13 @@ pair=$(grep -o '"pair"[[:space:]]*:[[:space:]]*"[^"]*"' "$STATE_FILE" 2>/dev/nul
33
33
  [[ "$enabled" != "true" ]] && { if [[ "$PAIR_MODE" == "true" ]]; then echo "none"; else echo "disabled"; fi; exit 0; }
34
34
  [[ -z "$since" || "$since" == "null" ]] && { if [[ "$PAIR_MODE" == "true" ]]; then echo "none"; else echo "disabled"; fi; exit 0; }
35
35
 
36
- # Check 24h expiry using portable date commands (macOS has date -j, Linux has date -d)
37
- since_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$since" "+%s" 2>/dev/null || date -d "$since" "+%s" 2>/dev/null || echo "")
36
+ # Check 24h expiry using portable date commands (macOS has date -j, Linux has date -d).
37
+ # Normalize +00:00 / +0000 offsets to Z so the strict macOS parser accepts them.
38
+ since_normalized=$(echo "$since" | sed 's/\+00:00$/Z/; s/\+0000$/Z/; s/\.[0-9][0-9][0-9]Z$/Z/; s/\.[0-9][0-9][0-9]\+00:00$/Z/')
39
+ since_epoch=$(date -j -f "%Y-%m-%dT%H:%M:%SZ" "$since_normalized" "+%s" 2>/dev/null \
40
+ || date -d "$since" "+%s" 2>/dev/null \
41
+ || date -d "$since_normalized" "+%s" 2>/dev/null \
42
+ || echo "")
38
43
  if [[ -z "$since_epoch" ]]; then
39
44
  # Unparseable timestamp — treat as expired
40
45
  if [[ "$PAIR_MODE" == "true" ]]; then
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-merlin-brain",
3
- "version": "5.3.5",
3
+ "version": "5.3.7",
4
4
  "description": "Merlin - The Ultimate AI Brain for Claude Code, Codex, and other AI CLIs. One install: workflows, agents, loop, and Sights MCP server.",
5
5
  "type": "module",
6
6
  "main": "./dist/server/index.js",