second-brain
Build and maintain a Karpathy-style LLM-maintained personal wiki (a "Second Brain") as plain markdown the user owns. Use when the user wants to set up a second brain, capture/ingest a source into their notes, ask their knowledge base a question, file decisions, or keep a personal wiki organized. Tri
Install
mkdir -p .claude/skills/second-brain-bradliebs && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/15274" && unzip -o skill.zip -d .claude/skills/second-brain-bradliebs && rm skill.zipInstalls to .claude/skills/second-brain-bradliebs
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Build and maintain a Karpathy-style LLM-maintained personal wiki (a "Second Brain") as plain markdown the user owns. Use when the user wants to set up a second brain, capture/ingest a source into their notes, ask their knowledge base a question, file decisions, or keep a personal wiki organized. Triggers on ingest/query/lint requests against the vault.About this skill
Second Brain
This skill teaches you to build and maintain a Second Brain: an LLM-maintained personal wiki in plain markdown, following the pattern Andrej Karpathy described. You own the wiki and keep it organized. The user provides sources and asks questions. Knowledge compounds — every ingest touches a few pages, every good question becomes a new page.
Core principle
Three layers, clear ownership:
- raw/ — immutable inputs the user provides. You append, you never delete or rewrite. This is the audit trail.
- the wiki (
10-Notes/,20-Projects/,30-Areas/,40-Resources/) — owned and maintained by you. You summarize, link, file, and bookkeep. - the schema (
AGENTS.md,_meta/conventions.md) — co-evolved with the user. Propose changes; don't impose them.
House rules, always:
- One idea per page.
- Cite sources in frontmatter (
sources:) and inline where it matters. - Flag uncertainty explicitly — never paper over a gap with a plausible guess.
- Never delete from
raw/. - Summarize before filing — raw text goes to
raw/, distilled knowledge to the wiki. - Every new page links to at least one existing page (no orphans).
Precondition: the vault must be writable
The vault is usually a folder outside the harness project directory. The file tools can only write outside the project when the folder is on the allow-list.
Before any file operation, confirm the vault path is reachable:
-
Attempt a tiny round-trip:
file_writea temp file in the vault,file_readit back, then delete it. -
If the write is denied, stop and tell the user to add the vault path to
allowedExternalPathsin.harness/settings.jsonand restart the harness:{ "allowedExternalPaths": ["<absolute path to the vault>"] } -
If the vault is inside the project directory, no allow-list entry is needed.
Do not proceed with bootstrap or ingest until the round-trip succeeds.
Operation: bootstrap (first-time setup)
When the user has no vault yet, build the structure:
<vault>/
AGENTS.md # the schema — read first, every session
README.md # human-facing overview
index.md # top-level map of the wiki
log.md # dated, greppable activity log
raw/ # immutable sources
00-Inbox/ # unfiled captures awaiting processing
50-Archive/ # retired-but-kept material
10-Notes/
entities/ # people, orgs, tools, products
concepts/ # ideas, definitions, principles
20-Projects/ # active, goal-bound work
30-Areas/ # ongoing responsibilities (no end date)
40-Resources/ # reference material by topic
_meta/
conventions.md # style guide
MOCs/ # Maps of Content (curated index pages)
templates/ # page templates per type
Then write AGENTS.md and _meta/conventions.md (see below). Draft each, take
the user's edits, then save. Never silently overwrite an existing vault — if
files already exist, ask before changing them.
AGENTS.md must define
- The three layers and who owns each.
- Folder conventions and naming (kebab-case filenames, one subject per page).
- Page types and required YAML frontmatter:
title,type,created,updated,tags,sources,status. - The three operations below.
- Log format (dated, one line per action, greppable).
- The house rules above.
_meta/conventions.md must define
- Naming and
[[wiki-link]]rules (every new page links somewhere). - Allowed values for
typeandstatus. - Tone: terse, factual, source-cited; uncertainty marked.
- When to make an MOC vs. a normal note.
Operation: ingest <source>
Turn a raw input into filed knowledge.
- Save the verbatim source to
raw/(orraw/00-Inbox/if it needs triage). Give it a dated, descriptive filename. Never edit it after saving. - Read it. Extract entities and concepts.
- For each entity/concept: create a new page in
10-Notes/entities|concepts/or update an existing one. Distill — don't copy. Addsources:pointing at the raw file. - Add
[[wiki-links]]connecting new pages to existing ones. - Update
index.mdif a new top-level subject appeared. - Append a dated entry to
log.md: what was ingested, which pages changed. - Report: the raw file, the pages created/updated, the index change, the log entry. Then stop for review before filing anything further.
Operation: query <question>
Answer from the vault, and capture the answer if it's worth keeping.
- Start from
index.md, then drill into relevant notes (file_read, search). - Synthesize an answer. Attribute each claim to a page or source. Mark anything the vault doesn't cover as a gap — do not invent.
- If the answer is durable and reusable, propose filing it as a new page
(often a
conceptnote or an MOC) and link it in. Ask before creating. - If a source contradicts something already filed, surface the conflict explicitly rather than silently overwriting.
Operation: lint
Audit the vault's health. Read-only unless the user approves fixes.
Check for and report:
- Contradictions — pages that disagree.
- Orphans — pages with no inbound or outbound links.
- Stale — pages whose
updatedis old relative to theirtype. - Missing — pages lacking required frontmatter fields.
- Inbox backlog — unfiled items sitting in
raw/00-Inbox/.
Report findings grouped by category, with the fix you'd propose for each. Apply
fixes only after the user approves. Append a dated lint summary to log.md.
Optional: scheduled consolidation
If the user wants nightly upkeep, set up an automation that runs lint, files
anything in 00-Inbox/, appends a dated summary to log.md, and leaves a short
note of anything needing the user's decision. Show the exact steps before
enabling it.
Honesty notes
- This harness is local-first. There is no built-in Microsoft 365, Teams, or email connector — the Second Brain works on local files only. Don't claim integrations that don't exist.
- The separate "personal wiki" blueprint (
buildPersonalWiki) is a read-only HTML renderer of semantic-memory entries — a viewer, not this maintained markdown vault. Don't conflate them.