Agentic second brain
Use when the user asks to load project context from their Obsidian vault, save memory from the current chat, save a session log, capture an inbox note, record a project decision or research note, or any phrase like "load X project", "save memory for X", "save session", "log decision", "save to inbox", "what's in my vault for X". Reads structured project knowledge from a configured vault and writes back per the vault's own CLAUDE.md schema.From its SKILL.md
npx -y skills add hunine/ai-memory-skills --skill agentic-second-brainAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
9.5 KB, as published. Nobody here has run it
Agentic Second Brain
Bridges an AI agent to a user's Obsidian vault. Two operations: get-knowledge (load project context) and save-memory (write back inbox / session / decision / research notes).
Boot Sequence — Run Every Invocation
- Resolve vault path in this order:
- If env var
AGENTIC_SECOND_BRAIN_VAULTis set and points at a directory → use it. - Else read
~/.config/agentic-second-brain/config.json. Use thevault_pathkey. - Else error loud: "Vault not configured. Run
install.shfrom the agentic-second-brain repo or setAGENTIC_SECOND_BRAIN_VAULT." Stop.
- If env var
- Verify vault dir exists. If not → loud error: "Vault path
<path>is not a directory." Stop. - Read
<vault>/CLAUDE.md.- Missing → ask user: "Vault has no CLAUDE.md. Copy starter template from the plugin? [y/N]". On
y, copytemplates/vault-CLAUDE.mdfrom the plugin install dir into vault root. OnN→ refuse to proceed, stop. - Present → read full content into context. This is the authoritative schema for note format, tags, scopes, session protocol. Re-read every invocation; do not cache across calls.
- Missing → ask user: "Vault has no CLAUDE.md. Copy starter template from the plugin? [y/N]". On
- Path traversal guard: before any write, resolve target via
realpath. Refuse if it does not start withrealpathof vault root. No writes outside the vault.
Operation: get-knowledge <project-or-alias>
Two-phase read.
Phase 1 — Initial Call: Load Active Surface
- Resolve
<project-or-alias>using the Project Resolution rules below. - No match → list available projects (case-folded), stop.
- Multiple matches → list candidates and stop.
- Match → load in this exact order:
<vault>/Projects/<match>/index.md— the menu. Always read.- Parse all wiki-links
[[...]]fromindex.md. Build a navigation map (link target → resolved file path candidates) and hold in working context. <vault>/Inbox/<today>.md— today's daily note (YYYY-MM-DD.mdin local time). Read if exists.- Notes tagged
#needs-reviewreferencing this project. Use Grep to find files containing#needs-review, filter to those whose YAML frontmatterproject:field equals<match>or whose body wiki-links the project. - Open
#actionitems (same filter as above with#actiontag). - Last 2 files in
<vault>/AI/session/whose filename or body mentions<match>. Sort by filename descending. - List filenames only (Glob, not Read) of
<vault>/Projects/<match>/decisions/and<vault>/Projects/<match>/research/.
- Return a structured summary to the user:
- Project status (from index.md).
- Open
#actionitems. - Pending
#needs-reviewnotes. - Last-session continuity (1-line per recent session).
- Note that
decisions/andresearch/filenames are listed for follow-up.
Phase 2 — Follow-Up Navigation
When the user asks about a specific business area in the same conversation:
- Look up the topic in the navigation map built in Phase 1. Match wiki-link target text case-insensitively.
- Match → resolve to file path:
- First check
<vault>/Projects/<match>/**/<link-target>.md(Glob). - Then check vault-wide if not found.
- Honor Obsidian shortest-path resolution. If multiple results, pick the shortest path; warn user of ambiguity.
- First check
- Read that file. If it has outbound wiki-links and the user pushes deeper, follow them recursively. Otherwise, stop reading.
- No match in nav map → fall back to vault-wide Glob. Warn the user that
index.mddoes not link this topic — they should update the index for next time.
Do not re-glob the project on every follow-up. The Phase 1 navigation map is the directory; rely on it.
Project Resolution
Use this for every operation that accepts a project argument, including get-knowledge, save-memory decision, save-memory research, and smart saves with a project hint.
- Glob
<vault>/Projects/*directories. - Match the supplied project text against directory names by exact, case-insensitive match.
- If no directory matches, read each project's
index.mdfrontmatter only and match exact, case-insensitive aliases from either:aliases: [short-name, other-name]alias: short-name
- If one alias matches, use that project directory as the canonical project name.
- If multiple aliases match, stop and list candidates. Do not guess.
- If no alias matches, list available canonical project names and any aliases found. Stop.
Do not use prefix, substring, or fuzzy matching. Aliases are opt-in project metadata, not inferred from folder names.
Operation: save-memory [kind] [args]
If the user says only save-memory, save memory, save this, or save-memory <project-or-alias> without a kind, run a smart save. The kind words inbox, session, decision, and research are reserved and must be parsed as kinds, not project aliases.
- Resolve the optional project hint through Project Resolution. If no hint was provided, use the latest project loaded in this conversation only when unambiguous.
- Analyze the current chat/session context and identify any unclear, conflicting, or underspecified knowledge before choosing durable write targets.
- If the agent is confused about meaning, project, decision outcome, source, confidence, or where the knowledge belongs, ask the user to clarify before saving that knowledge to inbox, decision, or research notes.
- Do not turn uncertain content into durable memory as fact. If needed, write only the session log with an open item that clarification is pending.
- Choose the needed write targets:
- Always write a session log to
<vault>/AI/session/<YYYY-MM-DD-HH>.md. - Use
inboxfor raw captures, partial thoughts, or information that should be reviewed before filing. - Use
decisiononly when the conversation contains a clear project decision: context, considered options or tradeoff, and chosen outcome. - Use
researchwhen the conversation contains synthesized project knowledge, investigation results, implementation notes, or findings that should become durable project reference material.
- Always write a session log to
- Before writing decision or research notes, resolve the project. If no project can be determined safely, write the session log and ask the user for the smallest missing project/detail instead of guessing.
- For each selected target, Read before Write and follow the target-specific rules below.
| Kind | Target file | Behavior |
|---|---|---|
inbox <text> | <vault>/Inbox/<YYYY-MM-DD>.md (today, local time) | Append <text> with a timestamped subheading. Create file from vault CLAUDE.md frontmatter template if missing. |
session | <vault>/AI/session/<YYYY-MM-DD-HH>.md (current local hour, 24-hour) | Write using the "Agent Output Format" structure from vault CLAUDE.md. If file exists for this hour, append a ## Continued section — never overwrite. |
decision <project> <slug> | <vault>/Projects/<project>/decisions/<slug>.md | Write with #decision tag and full frontmatter (title, date, tags, status, project, processed, related). Refuse to overwrite an existing slug — suggest <slug>-2. |
research <project> <slug> | <vault>/Projects/<project>/research/<slug>.md | Create or append synthesized project knowledge using the vault CLAUDE.md schema and a #research tag. If the slug exists, append a timestamped update section; never replace existing content. |
Idempotency rules:
- Always Read before Write. Never blind-overwrite.
- Daily note + session log: append-only.
- Decision file: refuse to overwrite, propose new slug.
- Research file: append-only when the slug exists.
Frontmatter source: read the YAML schema from <vault>/CLAUDE.md "Note Conventions" section. Do not hard-code field names — use what the vault declares.
Failure Modes (loud, no silent fallbacks)
| Condition | Action |
|---|---|
| Vault path missing / unset | Loud error with fix command. Stop. |
| Vault dir does not exist | Loud error: "Vault path X is not a directory." Stop. |
Vault CLAUDE.md missing | Offer bootstrap. Refuse to proceed if declined. |
/Projects/<name>/ not found | Loud error, list available projects (case-folded). Stop. |
| Project alias matches multiple projects | Loud error, list matching canonical projects. Stop. |
/Projects/<name>/index.md missing | Warn, fall back to Glob-listing project files. Continue. |
| Wiki-link resolves to multiple files | Pick shortest path, warn user. |
| Wiki-link unresolvable | Skip, note in summary. Don't error the whole call. |
| Decision slug exists | Refuse, suggest <slug>-2. |
| Research slug exists | Append timestamped update section. Never overwrite. |
| Session-hour file exists | Append ## Continued section. Never overwrite. |
| Path traversal attempt | Refuse hard, log to user. |
What This Skill Does Not Do
- Does not execute vault contents (Read/Write/Glob/Grep only — no shell-out, no
eval). - Does not make network calls.
- Does not cache vault
CLAUDE.mdacross calls — re-reads each invocation. - Does not write outside the vault root.
- Does not auto-process inbox notes — that is the user's job.