From 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.
How this skill is triggered — by the user, by Claude, or both
Slash command
/matts-second-brain:_disciplineThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this 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](https://github.com/wrxck/srag) (semantic code search across all indexed repos) and the underlying trilium-mcp (low-level note CRUD) when both are present.
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).
npx claudepluginhub wrxck/matts-second-brainGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.