Maintenance
Second Brain Maintenance
Kaleb's second brain is a monolithic single-repo knowledge base rendered as a
Vite + React SPA at brain.kaleb.one via Cloudflare Pages.Notes are GitHub-flavored Markdown. Claude maintains these notes through conversations.
Obsidian is not used โ never suggest it.
> โ ๏ธ Canonical source of truth: `domains/ai-tooling/SYSTEM_PROMPT.md`
> Read that file at the start of any second-brain session. This skill is a fast
> reference; SYSTEM_PROMPT.md wins on any conflict.
Single Repo โ No External Repos
The second brain is monolithic. Previous external repos (`halden-city-wiki`,
`wood-home-cooking`) are retired and fully integrated. Do not reference or route
content to them.
| Repo | GitHub URL | Local Path | Live URL |
|---|---|---|---|
| `second-brain` | github.com/triursa/second-brain | `D:\Kaleb\second-brain` | brain.kaleb.one |
Domains
All substantive content lives under `domains/`. Route here first. Do not duplicate into
`notes/personal/` unless it is reference context with no natural domain home.
| Domain | Path | State | What Goes Here |
|---|---|---|---|
| `worldbuilding` | `domains/worldbuilding/` | ACTIVE | Lore, sessions, decisions for Halden City, Avar, Lyscairn, Darkreach |
| `novel` | `domains/novel/` | ACTIVE | Drafts, progress, writing notes |
| `household` | `domains/household/` | ACTIVE | Mindy, Teddy, family logistics |
| `cooking` | `domains/cooking/` | ACTIVE | Recipes, meal plans, grocery lists โ native, not external repo |
| `health` | `domains/health/` | ACTIVE | Goals, gout/fatty liver tracking, health notes |
| `entertainment` | `domains/entertainment/` | ACTIVE | Movie/show backlog and watched log |
| `books` | `domains/books/` | ACTIVE | Reading list only โ see Books Rules below |
| `tools` | `domains/tools/` | PAUSED | Charcreate, Image Wrangler, Path Wiki Aggregator |
| `music` | `domains/music/` | COMING SOON | Handled by GitHub Actions + Spotify API โ do not touch |
Routing Table
| Content Type | Route To |
|---|---|
| Worldbuilding โ Halden City (chars, factions, lore, plot) | `domains/worldbuilding/halden-city/` |
| Worldbuilding โ other settings (Avar, Lyscairn, Darkreach) | `domains/worldbuilding/[setting]/` |
| Worldbuilding session logs | `domains/worldbuilding/sessions/YYYY-MM-DD.md` |
| Novel drafts, progress, voice notes | `domains/novel/` |
| Household logistics, Mindy, Teddy, family | `domains/household/` |
| Recipes, meal plans, grocery lists | `domains/cooking/recipes/` ยท `domains/cooking/meal-plans/` ยท `domains/cooking/grocery-lists/` |
| Health goals, gout/fatty liver tracking | `domains/health/` |
| Entertainment backlog/watched | `domains/entertainment/BACKLOG.md` ยท `domains/entertainment/WATCHED.md` |
| Book tracking | `domains/books/MASTER_LIST.md` โ bullets only (see Books Rules) |
| Personal profile, identity | `notes/personal/profile.md` |
| Home & family logistics reference | `notes/personal/home-family.md` |
| Calendar system, color codes, MCP notes | `notes/personal/calendar-system.md` |
| Work / IBM / ITVM context | `notes/personal/work-ibm.md` |
| Finance, home buying, Kyle TX research | `notes/personal/finance-home.md` |
| Tech stack, MCP setup, tools decisions | `notes/personal/tech-tools.md` |
| Hobbies, gaming, Steam, Letterboxd | `notes/personal/hobbies.md` |
| Novel & writing goals/preferences | `notes/personal/writing.md` |
| Projects & artifacts built with Claude | `notes/personal/projects.md` |
| Food/health preferences (reference copy) | `notes/personal/food-health.md` |
| Unprocessed captures, raw saves | `inbox/` or `INBOX.md` |
| Dated session logs | `journal/YYYY-MM-DD.md` |
| Cross-repo/domain navigation | `maps/master-map.md` |
| Routing rules, system structure | `domains/ai-tooling/repo-index.md` |
| AI Instructions & Skills | `domains/ai-tooling/` |
Books Domain Rules (CRITICAL)
> โ ๏ธ A background worker automatically fetches book metadata from an API and generates
> full enriched `.md` files in `domains/books/` from bullet points in `MASTER_LIST.md`.
Do NOT generate individual book markdown files manually.When Kaleb mentions a book to track:
1. Add a bullet to the appropriate section in `domains/books/MASTER_LIST.md`
2. Format: `- [Title] by [Author]`
3. Tell Kaleb the worker will auto-generate the enriched file on next sync
Music Domain Rules
> โ ๏ธ `domains/music/` is managed entirely by GitHub Actions + Spotify API.
> Do not create, edit, or delete files there. Treat as read-only.
Frontmatter (REQUIRED on every .md file)
Every markdown file must include YAML frontmatter. The React dashboard and `Cmd+K`
global search rely on this metadata. Never omit it.
```yaml
title: "Human Readable Title"
domain: worldbuilding # worldbuilding / cooking / health / novel / household / tools / entertainment / books / system
status: active # active / paused / loop
tags:
- tag-name
```
- Use `status: loop` (or include `loop` in tags) for open questions and unresolved items.
- Use `status: active` for current, maintained notes.
- Use `status: paused` for deprioritized content.
Worldbuilding Content Rules
When writing lore, character notes, or faction details under `domains/worldbuilding/`:
- Use wikilink syntax for cross-references: `Avi`, `A.E.G.I.S.`
- These links are functional in the React SPA โ they resolve to other files
- Always check `domains/worldbuilding/DECISIONS.md` before a session to avoid
Halden City content lives at `domains/worldbuilding/halden-city/` with subfolders:
`characters/`, `factions/`, `locations/`, `lore/`, `plot/`, `images/`, `meta/`
Cooking Content Rules
All food/recipe content is native to `domains/cooking/`.
- Dashboard: The main entry point is `domains/cooking/index.md`.
- Recipes: `domains/cooking/recipes/`. Every file gets a graphical card on the `CookingGrid`.
- Meal Plans: `domains/cooking/meal-plans/YYYY-MM.md`. Use Markdown tables.
- Grocery Lists: `domains/cooking/grocery-lists/MASTER_LIST.md`. Use Markdown checkboxes.
- Rules:
- Avoid onions and tomatoes strictly.
- Do NOT use raw HTML for grocery lists; use the checklist format in `MASTER_LIST.md`.
Architecture Overview
The second brain is a Vite + React SPA. Understanding this is essential before
touching any source files.
Stack
| Layer | Technology | Location |
|---|---|---|
| UI framework | React 18 + React Router (HashRouter) | `src/App.jsx` |
| Styling | Plain CSS with CSS custom properties | `src/index.css` |
| Markdown rendering | `react-markdown` + `remark-gfm` | `src/App.jsx` โ `MarkdownViewer` |
| Build tool | Vite | `vite.config.js` โ outputs to `dist/` |
| Manifest generation | Node.js script | `generate-manifest.js` |
| Deployment | Cloudflare Pages | Triggers on every `git push` |
How the build works
1. `generate-manifest.js` runs as the Cloudflare Pages build step
2. It walks the repo, reads git dates + frontmatter, outputs `public/manifest.json`
3. It copies every `.md` file into `public/` so Vite can serve them at runtime
4. Vite builds `src/` โ `dist/` โ this is what Cloudflare Pages serves
5. At runtime, `App.jsx` fetches `manifest.json`, builds the sidebar, fetches `.md` on demand
Source files
| File | Purpose | Touch? |
|---|---|---|
| `src/App.jsx` | All React components: Sidebar, Dashboard, CommandPalette, MarkdownViewer | Yes โ UI changes |
| `src/index.css` | All styling via CSS custom properties | Yes โ style changes |
| `src/main.jsx` | React entry point | Rarely |
| `generate-manifest.js` | Build script โ manifest + copies `.md` to `public/` | Only for new domain colors |
| `vite.config.js` | Vite config | Rarely |
| `public/manifest.json` | Auto-generated | Never |
| `index.html` | Vite HTML shell | Never |
Domain metadata (colors)
```js
// generate-manifest.js โ DEFAULT_DOMAIN_COLORS
const DEFAULT_DOMAIN_COLORS = {
worldbuilding: '#534ab7',
novel: '#993c1d',
household: '#185fa5',
health: '#3b6d11',
tools: '#993556',
entertainment: '#7a3f99'
};
```
To add a new domain color: add an entry here and re-run the build.
CSS design system
All in `src/index.css`. Use CSS custom properties โ never hardcode colors.
| Variable | Value | Usage |
|---|---|---|
| `--bg` | `#09090b` | App background |
| `--surface` | `#18181b` | Cards, code blocks, table headers |
| `--accent` | `#14b8a6` | Teal โ links, active states |
| `--text` | `#fafafa` | Primary text |
| `--text-muted` | `#a1a1aa` | Body text, list items |
| `--font-ui` | `Inter` | UI and prose |
| `--font-mono` | `Geist Mono` | Code, paths |
File Structure
```
second-brain/
โโโ src/
โ โโโ App.jsx โ All React components
โ โโโ index.css โ All styles
โ โโโ main.jsx โ React entry point
โโโ public/
โ โโโ manifest.json โ Auto-generated (DO NOT EDIT)
โ โโโ [all .md files] โ Copied here by generate-manifest.js
โโโ dist/ โ Vite build output (Cloudflare serves this)
โโโ generate-manifest.js โ Build script
โโโ vite.config.js โ Vite config
โโโ package.json โ Dependencies
โโโ index.html โ Vite HTML shell
โโโ domains/
โ โโโ ai-tooling/ โ Repository logic, system prompt, chat conventions
โ โ โโโ skills/ โ maintenance.md, specialized instructions
โ โ โโโ index.md โ AI Hub Dashboard
โ โโโ worldbuilding/ โ halden-city/, sessions/, CONTEXT.md, DECISIONS.md
โ โโโ novel/ โ CONTEXT.md, PROGRESS.md, drafts/
โ โโโ household/ โ CONTEXT.md
โ โโโ cooking/ โ recipes/, meal-plans/, grocery-lists/, knowledge-base/
โ โโโ health/ โ GOALS.md
โ โโโ entertainment/ โ BACKLOG.md, WATCHED.md, CONTEXT.md
โ โโโ books/ โ MASTER_LIST.md (bullets only), auto-generated files
โ โโโ tools/ โ ROADMAP.md, DECISIONS.md (PAUSED)
โ โโโ music/ โ GitHub Actions managed (DO NOT TOUCH)
โโโ notes/
โ โโโ personal/ โ profile, home-family, calendar-system, work-ibm,
โ โ finance-home, tech-tools, hobbies, writing, projects,
โ โ food-health
โ โโโ halden-city/ โ Quick Halden City reference notes
โโโ maps/
โ โโโ master-map.md โ Navigation hub
โ โโโ halden-city-map.md โ Halden City specific map
โโโ meta/ โ System docs, conventions, this skill file
โโโ inbox/ โ Unprocessed captures
โโโ journal/ โ Dated entries
```
File Naming Conventions
- kebab-case for notes: `home-family.md`, `session-2026-04-01.md`
- ALLCAPS for core system files: `OPEN_LOOPS.md`, `PROJECTS.md`, `INBOX.md`, `MASTER_LIST.md`
- Date journal entries: `YYYY-MM-DD.md`
- Domain session logs: `domains/[domain]/sessions/YYYY-MM-DD.md`
Writing Style
- GitHub-flavored Markdown throughout
- Tables for structured data
- `##` / `###` headers for navigable sections
- Factual, reference-style prose โ docs, not essays
- Include `Last updated: YYYY-MM-DD` in frequently-updated notes
- Relative cross-links: `Calendar System`
- Worldbuilding cross-references: wikilink syntax `Entity Name`
Sync Process
After writing or modifying `.md` content files:
```
D:\Kaleb\second-brain\sync.bat (double-click)
D:\Kaleb\second-brain\sync.ps1 (PowerShell, colored output)
```
Runs `git pull โ git add โ git commit โ git push`.
Cloudflare Pages then runs `npm install && npm run build` and deploys to `dist/`.
Site live at brain.kaleb.one within ~60 seconds of push.
After editing `src/App.jsx` or `src/index.css`: just sync โ Cloudflare builds automatically. Claude writes files; Kaleb runs sync.Exception: When `windows-mcp` filesystem access is available, Claude can write directly
and trigger sync via PowerShell.
Cloudflare Pages Build Reference
| Setting | Value |
|---|---|
| Build command | `npm install && npm run build` |
| Build output directory | `dist/` |
| What `npm run build` does | `node generate-manifest.js && vite build` |
> โ ๏ธ The raw `vite` binary is not on Cloudflare's PATH โ always go through npm.
master-map.md Update Protocol
- New file in existing domain โ no update needed (manifest auto-discovers)
- New domain or new top-level concept โ
2. Add section to `maps/master-map.md`
3. Update `domains/ai-tooling/repo-index.md`
Common Tasks
Add a worldbuilding session log
1. Create `domains/worldbuilding/sessions/YYYY-MM-DD.md` with required frontmatter
2. Use session summary format from `SYSTEM_PROMPT.md`
3. Check `DECISIONS.md` first โ don't contradict locked lore
Add a recipe
1. Create `domains/cooking/recipes/[recipe-name].md`
2. Include frontmatter (`domain: cooking`, `status: active`)
3. Include calorie count, serving size, Gout โ rating, Fatty Liver โ rating
4. No nav update needed
Add a book to track
1. Edit `domains/books/MASTER_LIST.md`
2. Add `- [Title] by [Author]` to the correct section
3. Do not create individual book files โ the background worker handles that
Capture to inbox
1. Append to `INBOX.md` or create `inbox/[descriptive-name].md`
2. Use frontmatter: `status: loop`
3. Flag for triage: "Added to inbox โ process during next daily loop"
Update an existing note
1. Read the current file first
2. Append or merge โ don't overwrite unless restructuring
3. Update `Last updated` date
4. No nav update needed
Add a new domain
1. Create `domains/[new-domain]/CONTEXT.md` with frontmatter
2. Add color to `DEFAULT_DOMAIN_COLORS` in `generate-manifest.js`
3. Add section to `maps/master-map.md`
4. Sync โ manifest rebuild auto-adds all files to the nav
Edit the UI
1. Edit `src/App.jsx` or `src/index.css`
2. Do NOT run a local build
3. Sync โ Cloudflare runs `vite build` automatically
Pre-Flight Checklist
Before writing any second brain files:
- Read `domains/ai-tooling/SYSTEM_PROMPT.md` โ it is the canonical source of truth
- Is this domain-specific content? โ Route to `domains/[domain]/`, not `notes/personal/`
- Books? โ Bullet in `MASTER_LIST.md` only โ no individual file
- Music? โ Do NOT touch `domains/music/` โ it's managed by GitHub Actions
- Does every new file have YAML frontmatter with `title`, `domain`, `status`, `tags`?
- Worldbuilding content? โ Use wikilink syntax for cross-references
- Filename: kebab-case for notes, ALLCAPS for system files?
- Does `master-map.md` need updating? (Only for new domains or top-level concepts)
- Do NOT touch `public/manifest.json`, `index.html`, or `dist/`
- Have I told Kaleb to run `sync.bat`, or do I have filesystem access to do it?
Last updated: 2026-04-02