/matts-second-brain:_disciplinefrom matts-second-brain
The behavioural rules Claude follows when matts-second-brain is installed. Loaded automatically — defines how to consult and write back to the brain. Always invoked at session start. Skip only if the user has explicitly disabled second-brain.
Ships in matts-second-brain. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill is auto-loaded when the plugin is enabled. It defines the rules for how I consult and update the persistent knowledge brain backed by Trilium, and how I combine it with srag (semantic code search across all indexed repos) and the underlying trilium-mcp (low-level note CRUD) when both are present.
| Layer | What it knows | When I reach for it |
|---|---|---|
| second-brain (Trilium, structured prose) | Standards, decisions, lessons learned, per-app gotchas, review patterns | Before acting on anything non-trivial: "what's our standard / have we hit this before?" |
| srag (semantic code search across all repos) | Every implementation pattern I've ever written, across every indexed project | Before writing new code: "how have I solved this before? what's the convention?" |
| trilium-mcp (raw Trilium ETAPI) | Direct note CRUD, search, attribute manipulation | When second-brain's high-level tools aren't enough — bulk operations, raw search, attribute fixes |
Combined query pattern for any non-trivial task:
brain_search_semantic(query) — broad semantic cast over brain notes (chunked + embedded via srag). Use for vague "what did we figure out about…" questions.brain_recall(query) — keyword/tag search; pinpoint a known note, or chase a brain_search_semantic hit by id/title.search_code(query) (srag direct) — are there existing implementations to reuse?If brain_search_semantic returns nothing, run brain_sync_srag first — the export may be stale or missing.
If srag's code search returns nothing for the query, that's a signal the project may not be indexed yet. Suggest srag index <path> to the user.
After writing several notes in a session, call brain_sync_srag so semantic search picks up the new content.
package.json, git remote, etc.).brain_recall(query="standards + apps/<this-app> + recent lessons", limit=10).Always cite the source:
Per Trilium Standards / Git Workflow (last updated 2026-04-25): all PRs target
develop, nevermain. So I'll branch offdevelopfor this fix.
This makes stale citations obvious to the user — they can correct or update the note.
Memory can go stale. If a note references function foo in file.ts, check foo still exists before recommending action that depends on it. Use Grep or Read to verify, then either:
Use brain_remember(category, title, body) for new knowledge. Categories:
Never silently overwrite. Updates use brain_update with an explicit "supersedes" link to the prior note + the reason.
Decisions and Lessons Learned MUST contain:
If you can't fill all three, it's an opinion, not a decision. Don't write it.
If brain_recall returns something that conflicts with what the current code or current request says:
"The brain says X (Trilium note: , 2026-04-25) but the current request is Y. Should I update the note, follow the older standard, or you tell me?"
Surface contradictions; never silently pick one.
These trigger a brain_remember:
| Event | Category | Why |
|---|---|---|
| User corrects me with a non-obvious reason | Standards/ | Codify so I don't make the same mistake |
| A bug fix with a non-obvious root cause | Lessons Learned/ | Postmortem |
| A design choice between two viable alternatives | Decisions/ | Future me needs the rationale |
| A new gotcha specific to one app | Apps/<name>/ | Surfaces on next session in that app |
| An independent reviewer's finding I had to fix | Reviews/ | Pattern recognition for the next change |
If unsure, ask the user before writing — better to skip than to fill the brain with noise.
Once a week (or when prompted):
This is opt-in (a separate /matts-second-brain:hygiene skill, not auto-run).
What SKILL.md sets; muted values are Claude Code's defaults
6 skills in this plugin
/hygienePeriodic brain hygiene: dedupe near-duplicate notes, flag stale file citations and contradictions, archive long-unused notes, and reindex. Use when the user says 'brain hygiene', 'consolidate the brain', 'clean up duplicate notes', 'find stale notes', or after a long burst of writing. Opt-in and dry-run by default./installSet 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'./maintenanceOther plugins' skills for the same job
matts-second-brain@wrxck-claude-plugins is listed by wrxck/claude-plugins — review the source before installing
npx claudepluginhub wrxck/claude-plugins --plugin matts-second-brain