From matts-second-brain
Set up matts-second-brain end-to-end on this Claude instance: detect or install Trilium, prompt for an ETAPI token, register the MCP server, seed the brain taxonomy, optionally scan existing transcripts for inferable standards. Use when the user says things like 'set up second brain', 'install matts-second-brain', 'wire up Trilium memory', 'connect Claude to my notes'.
How this skill is triggered — by the user, by Claude, or both
Slash command
/matts-second-brain:install [--multi-user] [--scan-transcripts] [--trilium-url URL][--multi-user] [--scan-transcripts] [--trilium-url URL]This skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Walks through the full setup. Idempotent — safe to re-run.
Walks through the full setup. Idempotent — safe to re-run.
Check what's already in place. Report each as [ok] / [needs setup]:
# Trilium reachable?
curl -sf -o /dev/null "${TRILIUM_URL:-http://127.0.0.1:8787}/api/health-check" \
&& echo "[ok] Trilium reachable" \
|| echo "[needs setup] Trilium not reachable"
# trilium-mcp jar built?
test -f /home/matt/mcp/trilium-mcp/target/trilium-mcp-1.0.0.jar \
&& echo "[ok] trilium-mcp jar present" \
|| echo "[needs setup] trilium-mcp jar missing"
# Token present?
test -s /etc/claude-brain/trilium-token \
&& echo "[ok] ETAPI token configured" \
|| echo "[needs setup] ETAPI token not set"
# MCP registered in user's Claude config?
grep -q '"trilium"' ~/.claude.json 2>/dev/null \
&& echo "[ok] trilium MCP registered" \
|| echo "[needs setup] trilium MCP not registered"
For each [needs setup], walk the user through it interactively. Don't run destructive things without confirmation.
Offer to bring up a docker container:
docs/trilium-docker-compose.ymldocker compose up -d/home/matt/mcp/trilium-mcpmvn -q package inside itread -rs)/etc/claude-brain/trilium-token with mode 0640, owner root:claude~/.claude.json (or merge with existing mcpServers)/usr/local/bin/trilium-mcp as the command — wrapper handles env injectionUse trilium MCP tools to create the root note + structure if not already there:
Claude Memory/
├── 00 — How to use this brain # discipline rules (see skills/_discipline)
├── Standards/
├── Decisions/
├── Lessons Learned/
├── Apps/
├── Reviews/
└── Drafts/
Tag every note with #claude-brain. If the root already exists, skip — never overwrite the user's existing notes.
If --multi-user flag passed:
claude group if missing--users a,b,c/etc/claude-brain/ with group ownership/etc/profile.d/claude-brain.sh so future login shells auto-register the MCP/usr/local/bin/trilium-mcp if not presentIf --scan-transcripts flag passed:
~/.claude/projects/*/ for .jsonl session transcriptsbrain_scan_transcripts MCP tool to infer:
Standards/Lessons Learned/Apps/<name>/End by:
brain_recall("git workflow") — should return citations from the seeded standardsbrain_rememberGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub wrxck/matts-second-brain