Maintenance

ai-tooling

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.

RepoGitHub URLLocal PathLive URL
`second-brain`github.com/triursa/second-brain`D:\Kaleb\second-brain`brain.kaleb.one
GitHub username: triursa

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.

DomainPathStateWhat Goes Here
`worldbuilding``domains/worldbuilding/`ACTIVELore, sessions, decisions for Halden City, Avar, Lyscairn, Darkreach
`novel``domains/novel/`ACTIVEDrafts, progress, writing notes
`household``domains/household/`ACTIVEMindy, Teddy, family logistics
`cooking``domains/cooking/`ACTIVERecipes, meal plans, grocery lists โ€” native, not external repo
`health``domains/health/`ACTIVEGoals, gout/fatty liver tracking, health notes
`entertainment``domains/entertainment/`ACTIVEMovie/show backlog and watched log
`books``domains/books/`ACTIVEReading list only โ€” see Books Rules below
`tools``domains/tools/`PAUSEDCharcreate, Image Wrangler, Path Wiki Aggregator
`music``domains/music/`COMING SOONHandled by GitHub Actions + Spotify API โ€” do not touch

Routing Table

Content TypeRoute 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


```

These surface on the dashboard's Open Loops widget.

Worldbuilding Content Rules

When writing lore, character notes, or faction details under `domains/worldbuilding/`:

contradicting locked lore

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/`.

- Always include the calorie and health rating block (Gout/Fatty Liver) in recipes.

- 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

LayerTechnologyLocation
UI frameworkReact 18 + React Router (HashRouter)`src/App.jsx`
StylingPlain CSS with CSS custom properties`src/index.css`
Markdown rendering`react-markdown` + `remark-gfm``src/App.jsx` โ€” `MarkdownViewer`
Build toolVite`vite.config.js` โ€” outputs to `dist/`
Manifest generationNode.js script`generate-manifest.js`
DeploymentCloudflare PagesTriggers 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

FilePurposeTouch?
`src/App.jsx`All React components: Sidebar, Dashboard, CommandPalette, MarkdownViewerYes โ€” UI changes
`src/index.css`All styling via CSS custom propertiesYes โ€” style changes
`src/main.jsx`React entry pointRarely
`generate-manifest.js`Build script โ€” manifest + copies `.md` to `public/`Only for new domain colors
`vite.config.js`Vite configRarely
`public/manifest.json`Auto-generatedNever
`index.html`Vite HTML shellNever

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.

VariableValueUsage
`--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


Writing Style


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

SettingValue
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

1. Add color to `DEFAULT_DOMAIN_COLORS` in `generate-manifest.js`

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:


Last updated: 2026-04-02