skills/setup-secondbrain/SKILL.md
Scaffold and wire a persistent SecondBrain (Obsidian vault + LLM wiki) for cross-session knowledge management. Creates PARA structure, wiki domains/entities/concepts, cross-project references, and RAG integration. Runs once per user, then the wiki compounds over time. Triggers on: "setup secondbrain", "create knowledge base", "setup wiki", "persistent memory", "second brain", "/setup-secondbrain".
npx skillsauth add ShaheerKhawaja/ProductionOS setup-secondbrainInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scaffold a SecondBrain vault that persists knowledge across all Claude Code sessions and projects. Uses the PARA method (Projects, Areas, Resources, Archive) combined with an LLM-powered wiki layer.
The wiki is the product. Chat is just the interface.
git available (for vault version control)Ask the user these questions (one at a time, adapt based on answers):
~/SecondBrainDerive user identity from git config (NEVER hardcode):
USERNAME=$(git config --global user.name 2>/dev/null || echo "User")
EMAIL=$(git config --global user.email 2>/dev/null || echo "")
$VAULT_PATH/
.raw/ # Immutable source documents (hidden in Obsidian)
.obsidian/ # Obsidian config
snippets/
wiki/ # LLM-generated knowledge base
index.md # Master catalog
log.md # Chronological operation log
hot.md # Hot cache (~500 words, recent context)
overview.md # Executive summary
sources/ # One summary per raw source
entities/ # Products, people, orgs, repos
_index.md
concepts/ # Patterns, frameworks, mental models
_index.md
domains/ # Top-level topic areas
_index.md
comparisons/ # Side-by-side analyses
questions/ # Filed answers
meta/ # Dashboards, lint reports
00-Inbox/ # PARA: temporary capture
01-Projects/ # PARA: active initiatives (one folder per project)
02-Areas/ # PARA: ongoing responsibilities
03-Resources/ # PARA: reference materials
04-Archive/ # PARA: completed/inactive
05-Templates/ # Note templates
Daily/ # Daily notes
Sessions/ # Claude Code session logs
Handoffs/ # Session handoff documents
_attachments/ # Images, PDFs
Use this template (substitute user values):
# $VAULT_NAME: LLM Wiki + PARA Second Brain
Mode: D (Personal) + C (Business)
Purpose: Persistent knowledge base for $USERNAME
Owner: $USERNAME
Created: $TODAY
## Structure
[paste folder map]
## Conventions
- All notes use YAML frontmatter: type, status, created, updated, tags (minimum)
- Wikilinks use [[Note Name]] format: filenames are unique, no paths needed
- .raw/ contains source documents: never modify them
- wiki/index.md is the master catalog: update on every ingest
- wiki/log.md is append-only: never edit past entries
- New log entries go at the TOP of the file
## Operations
- Ingest: drop source in .raw/, say "ingest [filename]"
- Query: ask any question -- Claude reads index first, then drills in
- Lint: say "lint the wiki" to run a health check
- Save: "/save" to file current conversation as a wiki note
For each domain the user listed, create wiki/domains/<slug>.md:
---
type: domain
title: "$DOMAIN_NAME"
created: $TODAY
updated: $TODAY
tags: [domain, $TAG1, $TAG2]
status: active
---
# $DOMAIN_NAME
[User's description]
## Products
- [[Product 1]] -- description
- [[Product 2]] -- description
## Key Architecture
[Populated from user's answers or left as TODO]
For each project/product, create wiki/entities/<slug>.md:
---
type: entity
title: "$ENTITY_NAME"
created: $TODAY
updated: $TODAY
tags: [entity, product, $TAG1]
status: active
entity_type: product
---
# $ENTITY_NAME
## Overview
| Field | Value |
|-------|-------|
| Repo | $REPO_PATH |
| Stack | $STACK |
| Domain | [[$DOMAIN]] |
| Status | $STATUS |
02-Areas/<area>.md for each ongoing responsibility03-Resources/<resource>.md for reference materials01-Projects/<project>/ folder for each active projectCreate 05-Templates/ with: entity.md, concept.md, domain.md, source.md, question.md, comparison.md, daily-note.md, session-log.md, handoff.md, research-note.md, project.md
For EACH project that has a CLAUDE.md, append:
## Wiki Knowledge Base
Path: $VAULT_PATH
When you need context not already in this project:
1. Read wiki/hot.md first (recent context, ~500 words)
2. If not enough, read wiki/index.md (full catalog)
3. If you need domain specifics, read wiki/domains/<relevant-domain>.md
4. Only then read individual wiki pages
Do NOT read the wiki for:
- General coding questions or language syntax
- Things already in this project's files or conversation
- Tasks unrelated to the current project
Register the vault path in ProductionOS config:
# In ~/.productionos/config/settings.json
{
"secondbrain_path": "$VAULT_PATH",
"secondbrain_auto_session_log": true,
"secondbrain_hot_cache_update": "session_end"
}
Update stop-session-handoff.sh to:
$VAULT_PATH/Sessions/wiki/hot.md ONLY if session produced meaningful work (>3 commits or >5 file edits)$VAULT_PATH/Handoffs/cd $VAULT_PATH
git init
echo ".obsidian/workspace.json" >> .gitignore
echo ".obsidian/cache/" >> .gitignore
echo ".trash/" >> .gitignore
git add -A
git commit -m "chore: scaffold SecondBrain vault"
Run these checks:
Report results as pass/fail table.
After initial scaffold, the wiki grows through:
.raw/, say "ingest [filename]"wiki/questions/git config, not hardcoded values.gitignore excludes workspace state and cachetools
Implementation planning workflow that turns approved ideas into dependency-aware execution plans.
development
Local RAG and Graph RAG over the SecondBrain wiki vault. Progressive context loading (hot cache -> index -> domain -> entity). Graph traversal via wikilink resolution. Use when agents need cross-project context, when answering questions that span multiple domains, or when building context for planning tasks. Triggers on: "wiki context", "cross-project context", "what do we know about", "check the wiki", "graph context", "/wiki-rag".
devops
UX improvement pipeline — creates user stories from UI guidelines, maps user journeys, identifies friction, dispatches fix agents. The user-experience equivalent of /production-upgrade.
development
Test-driven development workflow that writes failing tests first, implements minimally, and refactors safely.