---
name: "Obsidian Second Brain"
client: "Oliver Internal"
status: active
server: local (iCloud)
tech: [Obsidian, Python, Markdown, Dataview, Templater, Claude API]
local_path: /Users/ai_leed/Library/Mobile Documents/iCloud~md~obsidian/Documents/VadymSamoilenko
scripts_path: /Users/ai_leed/.claude/
deploy: "Open Obsidian → vault VadymSamoilenko"
url: https://github.com/SamoilenkoVadym/obsidian
tags:
  - project
  - type/project
  - domain/devops
created: 2026-04-14
---

## Overview
Obsidian-based second brain for all Oliver Agency projects and personal knowledge. AI-first knowledge management: Claude Code reads/writes notes via hooks at every session start/stop. Project notes are the **source of truth** — tech stack, server, deploy command, URL, changelog, session history. The wiki is auto-populated from sessions and technical work. When starting on any project, Claude reads the project note before asking the user anything.

## Setup
- **Vault:** `~/Library/Mobile Documents/iCloud~md~obsidian/Documents/VadymSamoilenko`
- **Projects root:** `/Users/ai_leed/Documents/Projects/Oliver/`
- **Git sync:** `github.com/SamoilenkoVadym/obsidian` (private)
- **Hook scripts:** `~/.claude/obsidian-*.py`
- **Memory compiler:** `~/.claude/memory-compiler/` (github.com/coleam00/claude-memory-compiler)
- **Claude Code skills:** `~/.agents/skills/` via `kepano/obsidian-skills`

## Architecture

```
Claude Code session start
    → obsidian-session-start.py
        → reads 01 Projects/<project>/*.md
        → injects: client, server, tech, overview, recent timeline, last 5 sessions
        → memory-compiler/hooks/session-start.py
        → injects: wiki/_master-index.md + relevant topic articles

Work happens...

Claude Code session stop
    → obsidian-session-log.py (Stop hook)
        → Haiku: Asked/Done summary + Change Log row
        → Haiku: wiki article if significant tech work done
        → dedup: skip session entry if today already has 5+
        → writes: Sessions, Change Log, Timeline to project note
        → writes: 99 Daily/<date>.md entry
    → memory-compiler/hooks/session-end.py
        → flush.py: knowledge → daily log
        → compile.py: daily logs → wiki articles (auto after 21:00)

Claude Code PostCompact
    → obsidian-postcompact.py
        → Haiku writes structured session entry to project note

Manual enrichment (any time):
    cd /path/to/project
    PROJECTS_ROOT=... python3 ~/.claude/obsidian-enrich.py
```

## Automation Hooks

| Hook | Script | Does |
|------|--------|------|
| SessionStart | `obsidian-session-start.py` v3 | Injects client, server, tech, overview, recent timeline, last 5 sessions. Auto-creates stub notes. Injects pending commands from `02 Areas/Pending Commands.md` |
| SessionStart | `memory-compiler/hooks/session-start.py` | Injects wiki master-index + relevant topic articles |
| Stop | `obsidian-session-log.py` | Haiku: session summary + changelog row + wiki article generation. Dedup: max 5 sessions/day per project. Updates project note + daily note |
| PostCompact | `obsidian-postcompact.py` | Haiku writes structured session entry to project note on context compaction |
| PreCompact | `memory-compiler/hooks/pre-compact.py` | Saves context to knowledge base before compaction |
| SessionEnd | `memory-compiler/hooks/session-end.py` | Triggers flush.py → daily log → compile.py → wiki |
| PreCompact | `memory-compiler/scripts/wiki-count-sync.py` | Updates article counts in _master-index.md |

## Key Scripts

| Script | Purpose |
|--------|---------|
| `obsidian-session-start.py` | SessionStart hook — injects project context |
| `obsidian-session-log.py` | Stop hook — logs session, generates wiki articles |
| `obsidian-enrich.py` | **Manual enrichment** — reads project files, generates full note via Haiku |
| `obsidian-postcompact.py` | PostCompact hook |
| `memory-compiler/scripts/flush.py` | Extracts knowledge from transcripts → daily log |
| `memory-compiler/scripts/compile.py` | Compiles daily logs → wiki articles |
| `memory-compiler/scripts/query.py` | Query the wiki: `uv run python query.py "question" [--file-back]` |

## Vault Structure (PARA)

```
VadymSamoilenko/
├── 01 Projects/          ← project notes (source of truth)
│   ├── <project-name>/   ← 1:1 with /Documents/Projects/Oliver/
│   │   └── *.md          ← overview, tech, server, deploy, sessions, changelog
│   ├── Dashboard.md      ← Dataview dashboard (5 views)
│   └── Projects.base     ← Bases database view
├── 02 Areas/
│   └── Pending Commands.md ← injected at every session start
├── 03 Resources/
├── 04 Archive/
├── 05 Aimpress LTD/
├── 99 Daily/             ← auto-written by Stop hook
└── wiki/                 ← LLM's domain — auto-written
    ├── _master-index.md  ← master index, injected at session start
    ├── concepts/         ← 62+ articles
    ├── tech-patterns/    ← how-to: Docker, FastAPI, Azure AD, etc.
    ├── architecture/     ← architectural decisions + patterns
    ├── connections/      ← cross-cutting insights
    ├── homelab/          ← 38 articles
    ├── agent-sdk/        ← 30 articles
    └── ...               ← 15+ topic folders
```

## Project Note Standard

Every project note must have:
- **Frontmatter:** name, client, status, tech, server, deploy, url, port, db, service
- **## Overview** — what it is, who uses it, key capabilities
- **## Tech Stack** — frontend, backend, db, infrastructure, AI/ML
- **## Architecture** — components, data flow, diagram
- **## Dev Commands** — exact commands to run locally
- **## Deployment** — server, deploy command, URL, port, service name
- **## Environment Variables** — key env vars
- **## Sessions** — auto-written by Stop hook (max 5/day)
- **## Change Log** — auto-written by Stop hook (every session)
- **## Timeline** — auto-written from git commits

To enrich any incomplete note:
```bash
cd /path/to/project
PROJECTS_ROOT=/Users/ai_leed/Documents/Projects/Oliver python3 ~/.claude/obsidian-enrich.py
```

## Installed Skills

Total: **24 skills** — 5 always-active (Obsidian) + 19 contextual (task-matched).
Full config: `~/.claude/CLAUDE.md`. Wiki: [[wiki/claude-code/oliver-skills-config|oliver-skills-config]].

### Always Active — kepano/obsidian-skills (5)

From **Steph Yin (kepano)**, creator of Obsidian: `github.com/kepano/obsidian-skills`

| Skill | Auto-trigger | Does |
|-------|-------------|------|
| `obsidian:defuddle` | Any web URL | Extracts clean markdown from web — use INSTEAD of WebFetch |
| `obsidian:obsidian-markdown` | Creating/editing .md in vault | Wikilinks, callouts, embeds, frontmatter syntax |
| `obsidian:obsidian-cli` | "interact with vault", "search notes" | CLI read/write — requires Obsidian open |
| `obsidian:obsidian-bases` | ".base files", "database view" | Create Bases views (.base files) |
| `obsidian:json-canvas` | "canvas", "diagram" | Create .canvas diagram files |

### Contextual Skills — Invoke When Task Matches (19)

**Backend / Python**
| Skill | When to Use |
|-------|------------|
| `python-pro` | Any `.py` file, script, or module |
| `fastapi-expert` | FastAPI routes, Pydantic models, async endpoints |
| `security-reviewer` | Auth flows, Azure AD/MSAL, JWT, OAuth, OWASP |

**Frontend / TypeScript**
| Skill | When to Use |
|-------|------------|
| `react-expert` | React components, hooks, context, `.tsx` files, Vite |
| `typescript-pro` | Complex types, generics, type guards, utility types |
| `ckm-ui-styling` | shadcn/ui, Tailwind, Radix UI, design tokens |
| `ui-ux-pro-max` | UI/UX decisions, layout, color, typography, new screens |

**Design**
| Skill | When to Use |
|-------|------------|
| `ckm-banner-design` | Banner tools, ad creatives, social assets, print layouts |

**DevOps / Infrastructure**
| Skill | When to Use |
|-------|------------|
| `devops-engineer` | Dockerfile, docker-compose, systemd, GCP, nginx, CI/CD |
| `postgres-pro` | SQL, schema design, indexes, migrations, query optimisation |

**Testing**
| Skill | When to Use |
|-------|------------|
| `test-master` | Writing tests, mocking strategy, test architecture |
| `playwright-expert` | E2E test scripts, browser automation, page objects |
| `codebase-audit-suite:ln-630-test-auditor` | Full test suite audit (7 sub-auditors): "audit tests", "review test quality" |
| `agile-workflow:ln-523-auto-test-planner` | Risk-Based Test plan after feature is done; 11-section output |

**AI / LLM**
| Skill | When to Use |
|-------|------------|
| `rag-architect` | RAG pipelines, Qdrant, embeddings, chunking, retrieval |
| `prompt-engineer` | Prompt design, Claude/Gemini/OpenAI API, system prompts |

**Documentation**
| Skill | When to Use |
|-------|------------|
| `documentation-pipeline:ln-100-documents-pipeline` | Full doc system bootstrap — "generate full docs", "document this project" |

**Code Quality**
| Skill | When to Use |
|-------|------------|
| `code-reviewer` | Code review, bug detection, security, refactoring |
| `debugging-wizard` | Stack traces, error diagnosis, log analysis, root cause |

**Selection rationale (2026-04-29):** Frequency analysis of 40+ Oliver Agency projects:
Docker 21 · Python 19 · React 15 · FastAPI 15 · PostgreSQL 14 · TypeScript 13 · Redis 8 · Azure AD 8

Install more: `/plugin marketplace add kepano/obsidian-skills`

## Plugins
calendar, obsidian-git, obsidian-kanban, templater-obsidian, obsidian-tasks-plugin, dataview, nldates-obsidian, obsidian-outliner, mermaid-tools, obsidian-html-plugin, omnisearch

## CLAUDE.md Rules (global)

Claude Code is configured (in `~/.claude/CLAUDE.md`) to:
1. Use 5 obsidian skills automatically (defuddle, markdown, cli, bases, canvas)
2. Invoke 19 contextual skills before starting matching work — no prompting needed
3. Search Obsidian vault before asking user for project info
4. Read `01 Projects/<project>/*.md` for server, URL, tech, deploy command
5. Read `wiki/_master-index.md` → topic index → articles
6. Run `obsidian-enrich.py` when starting on a stub project
7. Ask user only if info is genuinely missing

## Wiki Source of Truth

Wiki articles come from:
1. **flush.py** → sessions transcripts → `concepts/`, `tech-patterns/`, etc.
2. **obsidian-session-log.py** → significant tech work detected → article written to wiki
3. **Manual compile:** `cd ~/.claude/memory-compiler && uv run python scripts/compile.py`
4. **Query + file-back:** `uv run python scripts/query.py "question" --file-back`

## Sessions

### 2026-04-29 — Second Brain System Overhaul
**Asked:** Make Obsidian second brain the source of truth; wiki auto-populated; Claude searches Obsidian first; complete project notes.
**Done:**
- `obsidian-session-start.py` v3: now injects client, server, tech, overview, recent timeline, last 5 sessions (by count not lines); `extract_frontmatter` parses tech list; `extract_last_sessions` replaces `extract_sessions_section`
- `obsidian-session-log.py`: added session deduplication (max 5/day per project), added wiki article generation (second Haiku call — writes to wiki/tech-patterns or wiki/concepts if significant work detected)
- `obsidian-enrich.py`: NEW script — reads CLAUDE.md, README, package.json, docker-compose.yml, git log, generates complete project note via Haiku; preserves Sessions/Changelog/Timeline
- `~/.claude/CLAUDE.md`: added "Second Brain" section — Claude now instructed to search Obsidian before asking user
- Mass enrichment: ran `obsidian-enrich.py` on all 28 stub project notes
- Confirmed kepano/obsidian-skills installed (5 skills from Obsidian creator)

### 2026-04-27 — Wiki Knowledge Base Expansion
**Requested:** Расширить wiki чтобы максимально помогать в разработке; автоматически обновлять index файлы
**Done:**
- 3 новые architecture статьи: new-project-checklist, troubleshooting-playbooks, adr-log
- 3 новые client-knowledge статьи: barclays, ferrero, 3m
- 5 новых connections статей: fastapi-azuread-docker-trinity, ai-always-needs-cost-tracker, optical-dev-apache-vite-basepath, gcp-no-websockets, box-api-hotfolder-pattern
- Обновлён CLAUDE.md: добавлен Q&A Auto-Save Protocol
- `wiki-count-sync.py` расширен до полного `wiki-index-sync`

### 2026-04-14 — Full Setup + Improvements
**Requested:** Analyse vault and implement improvements, enrichment, automation
**Done:**
- Full vault analysis, hook setup, kepano skills install
- Fixed PostCompact parser bug, date format inconsistency
- Git sync setup: `SamoilenkoVadym/obsidian`
- Dashboard.md + Projects.base created
- SessionStart v2: auto-create stubs + stub detection
- CLAUDE.md: tag taxonomy, status lifecycle, archival workflow

---

## Change Log
| Date | Requested | Changed | Files |
|------|-----------|---------|-------|
| 2026-04-29 | Second brain system overhaul | session-start v3, session-log dedup+wiki, obsidian-enrich.py, CLAUDE.md, mass enrichment 28 projects | obsidian-session-start.py, obsidian-session-log.py, obsidian-enrich.py, CLAUDE.md |
| 2026-04-27 | Wiki expansion + auto-indexing | 11 new wiki articles, wiki-index-sync, CLAUDE.md | wiki/*, memory-compiler/scripts |
| 2026-04-14 | Full vault setup | Hooks, skills, templates, git sync, dashboards | 20+ files |

## Related
- [[Projects Index]]
- [[Dashboard]]
- [[wiki/obsidian-rag/karpathy-llm-wiki-approach|Karpathy LLM Wiki Approach]]
- [[wiki/obsidian-rag/claude-code-obsidian-setup|Claude Code + Obsidian Setup]]
