# kidow/brain architecture

> Architecture diagram of the GitHub repository kidow/brain, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kidow/brain
- Repository: https://github.com/kidow/brain

## Overview

#### Purpose and Entry Points
This is a Git-backed personal knowledge base and GitHub Pages site. Its primary control loop is external AI skills—`place-me → teach-me → review-me`—which assess, write knowledge, and update mastery. Browser entry points are rendered notes, cheat sheets, drills, vocabulary pages, and search. Core roots: `README.md`, `levels.md`, `_config.yml`.

#### Learning-State Backbone
`levels.md` is the shared per-topic state keyed to note filenames; it stores Blank/Glimpsed/Grounded/Fluent plus prose context. External `kidow/skills` agents read it to calibrate teaching or choose weak topics, then write it after assessment/review. Notes are durable Git content; review-session state is intentionally ephemeral and excluded from the tree. Paths: `levels.md`, `notes/영어/영어_문장_구조.md`, `notes/화학/화학.md`.

#### Knowledge Content and Publishing
Markdown notes are the canonical long-form learning artifacts, organized by domain/language. Jekyll converts them into the published static site, using shared layouts and ordered metadata. Static HTML cheat sheets are separately authored/served reference material rather than derived note output. Paths: `notes/`, `_layouts/note.html`, `_data/notes_order.yml`, `sheets/영어/영어_문장_구조_심화_치트시트.html`.

#### Static-Site Presentation and Discovery
Jekyll configuration and layouts provide site-level rendering; custom head markup and client-side scripts add search, vocabulary interactions, and link copying. Search has a dedicated page/layout and JavaScript runtime; no server-side application or database is represented. Paths: `_config.yml`, `_layouts/search.html`, `search.md`, `assets/js/search.js`.

#### Interactive Drill Subsystem
Each drill is a static HTML application paired with a JSON content dataset. It implements vocabulary SM-2 review or character handwriting/stroke-order practice in the browser; learner progress stays in browser `localStorage`, creating a hard boundary from repository learning state and cross-device sync. Paths: `drills/일본어_히라가나.html`, `drills/일본어_히라가나.json`, `drills/중국어_한자_쓰기.html`.

#### Cross-Language Vocabulary and Audio
Vocabulary is category-centric: matching HTML and JSON files present concepts across eight languages. Client code drives vocabulary behavior, while `audio/manifest.json` maps available pronunciation assets; MP3s are organized language/category/word. Audio generation is a separate local pipeline that batches source scripts and produces assets/manifest updates. Paths: `vocab/색깔.html`, `vocab/색깔.json`, `assets/js/vocab.js`, `audio/manifest.json`, `scripts/build_vocab_audio.py`.

#### Generation, Runtime, and External Boundaries
The repository is predominantly static: Jekyll/GitHub Pages serves the site at the configured custom domain, and browsers run vanilla JavaScript and retain drill progress locally. Python scripts generate handwriting stroke data and vocabulary audio from repository inputs. AI learning orchestration is supplied externally through `npx skills@latest` and `kidow/skills`, not implemented here. Paths: `scripts/build_hanzi_strokes.py`, `scripts/build_stroke_data.py`, `scripts/split_audio_script.py`, `CNAME`.

Main entry points: [`CNAME`](https://github.com/kidow/brain/blob/main/CNAME) (GitHub Pages), [`drills/일본어_히라가나.html`](https://github.com/kidow/brain/blob/main/drills/%EC%9D%BC%EB%B3%B8%EC%96%B4_%ED%9E%88%EB%9D%BC%EA%B0%80%EB%82%98.html) (Vocabulary and handwriting drills), [`vocab/색깔.html`](https://github.com/kidow/brain/blob/main/vocab/%EC%83%89%EA%B9%94.html) (Vocabulary categories), [`levels.md`](https://github.com/kidow/brain/blob/main/levels.md) (Topic mastery state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Learning control loop"]
  node_skills{{"External AI skills<br/>kidow/skills agents"}}
  node_levels["Topic mastery state<br/>Markdown state registry<br/>[levels.md]"]
end

subgraph group_content["Knowledge content"]
  node_notes["Learning notes<br/>Canonical Markdown"]
  node_english_note["English sentence structure<br/>Example note<br/>[영어_문장_구조.md]"]
  node_chemistry_note["Chemistry note<br/>Example note<br/>[화학.md]"]
  node_cheat_sheet["English cheat sheet<br/>Static HTML reference"]
end

subgraph group_site["Static site"]
  node_note_layout["Note layout<br/>Jekyll layout<br/>[note.html]"]
  node_note_order["Note ordering<br/>Jekyll data<br/>[notes_order.yml]"]
  node_jekyll_config["Site configuration<br/>Jekyll config<br/>[_config.yml]"]
  node_jekyll{{"Jekyll build<br/>Static-site generator"}}
  node_github_pages{{"GitHub Pages<br/>Static hosting"}}
end

subgraph group_interactive["Browser interactions"]
  node_search_page["Search page<br/>Jekyll page and layout<br/>[search.md]"]
  node_search_runtime["Search runtime<br/>Browser JavaScript<br/>[search.js]"]
  node_drills["Vocabulary and handwriting drills<br/>Static browser apps<br/>[일본어_히라가나.html]"]
  node_drill_data["Drill datasets<br/>JSON content<br/>[일본어_히라가나.json]"]
  node_hanzi_drill["Hanzi handwriting drill<br/>Static browser app<br/>[중국어_한자_쓰기.html]"]
  node_local_storage[("Browser progress<br/>localStorage")]
  node_vocab["Vocabulary categories<br/>HTML and JSON content<br/>[색깔.html]"]
  node_vocab_data["Vocabulary dataset<br/>JSON content<br/>[색깔.json]"]
  node_vocab_runtime["Vocabulary runtime<br/>Browser JavaScript<br/>[vocab.js]"]
end

subgraph group_generation["Local generation"]
  node_audio_manifest["Pronunciation manifest<br/>Audio asset index<br/>[manifest.json]"]
  node_audio_builder{{"Vocabulary audio builder<br/>Python pipeline"}}
  node_stroke_builders{{"Stroke-data builders<br/>Python pipelines"}}
end

node_skills -->|"reads and updates"| node_levels
node_skills -->|"assesses and writes"| node_notes
node_levels -.->|"keyed by note filename"| node_notes
node_english_note -->|"belongs to"| node_notes
node_chemistry_note -->|"belongs to"| node_notes
node_notes -->|"renders"| node_jekyll
node_note_layout -->|"templates notes"| node_jekyll
node_note_order -->|"orders content"| node_jekyll
node_jekyll_config -->|"configures"| node_jekyll
node_jekyll -->|"publishes"| node_github_pages
node_cheat_sheet -->|"served as static reference"| node_github_pages
node_search_page -->|"renders"| node_jekyll
node_search_runtime -->|"powers search"| node_search_page
node_drill_data -->|"supplies review content"| node_drills
node_drills -->|"stores progress"| node_local_storage
node_hanzi_drill -->|"stores practice progress"| node_local_storage
node_vocab_data -->|"supplies category content"| node_vocab
node_vocab_runtime -->|"adds interactions"| node_vocab
node_audio_manifest -->|"resolves pronunciation assets"| node_vocab_runtime
node_audio_builder -->|"updates"| node_audio_manifest
node_stroke_builders -->|"generates stroke data for"| node_hanzi_drill
node_drills -->|"served statically"| node_github_pages
node_vocab -->|"served statically"| node_github_pages

click node_levels "https://github.com/kidow/brain/blob/main/levels.md"
click node_english_note "https://github.com/kidow/brain/blob/main/notes/%EC%98%81%EC%96%B4/%EC%98%81%EC%96%B4_%EB%AC%B8%EC%9E%A5_%EA%B5%AC%EC%A1%B0.md"
click node_chemistry_note "https://github.com/kidow/brain/blob/main/notes/%ED%99%94%ED%95%99/%ED%99%94%ED%95%99.md"
click node_note_layout "https://github.com/kidow/brain/blob/main/_layouts/note.html"
click node_note_order "https://github.com/kidow/brain/blob/main/_data/notes_order.yml"
click node_jekyll_config "https://github.com/kidow/brain/blob/main/_config.yml"
click node_github_pages "https://github.com/kidow/brain/blob/main/CNAME"
click node_cheat_sheet "https://github.com/kidow/brain/blob/main/sheets/%EC%98%81%EC%96%B4/%EC%98%81%EC%96%B4_%EB%AC%B8%EC%9E%A5_%EA%B5%AC%EC%A1%B0_%EC%8B%AC%ED%99%94_%EC%B9%98%ED%8A%B8%EC%8B%9C%ED%8A%B8.html"
click node_search_page "https://github.com/kidow/brain/blob/main/search.md"
click node_search_runtime "https://github.com/kidow/brain/blob/main/assets/js/search.js"
click node_drills "https://github.com/kidow/brain/blob/main/drills/%EC%9D%BC%EB%B3%B8%EC%96%B4_%ED%9E%88%EB%9D%BC%EA%B0%80%EB%82%98.html"
click node_drill_data "https://github.com/kidow/brain/blob/main/drills/%EC%9D%BC%EB%B3%B8%EC%96%B4_%ED%9E%88%EB%9D%BC%EA%B0%80%EB%82%98.json"
click node_hanzi_drill "https://github.com/kidow/brain/blob/main/drills/%EC%A4%91%EA%B5%AD%EC%96%B4_%ED%95%9C%EC%9E%90_%EC%93%B0%EA%B8%B0.html"
click node_vocab "https://github.com/kidow/brain/blob/main/vocab/%EC%83%89%EA%B9%94.html"
click node_vocab_data "https://github.com/kidow/brain/blob/main/vocab/%EC%83%89%EA%B9%94.json"
click node_vocab_runtime "https://github.com/kidow/brain/blob/main/assets/js/vocab.js"
click node_audio_manifest "https://github.com/kidow/brain/blob/main/audio/manifest.json"
click node_audio_builder "https://github.com/kidow/brain/blob/main/scripts/build_vocab_audio.py"
click node_stroke_builders "https://github.com/kidow/brain/blob/main/scripts/build_hanzi_strokes.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_skills,node_levels toneBlue
class node_notes,node_english_note,node_chemistry_note,node_cheat_sheet toneAmber
class node_note_layout,node_note_order,node_jekyll_config,node_jekyll,node_github_pages toneMint
class node_search_page,node_search_runtime,node_drills,node_drill_data,node_hanzi_drill,node_local_storage,node_vocab,node_vocab_data,node_vocab_runtime toneRose
class node_audio_manifest,node_audio_builder,node_stroke_builders toneIndigo
```

## Components

### Learning control loop

- **External AI skills**: kidow/skills agents · place-me, teach-me, and review-me orchestration lives outside this repository.
- [Topic mastery state](https://github.com/kidow/brain/blob/main/levels.md): Markdown state registry · Per-note Blank/Glimpsed/Grounded/Fluent state and teaching context. · `levels.md`

### Knowledge content

- **Learning notes**: Canonical Markdown · Durable long-form knowledge organized by domain and language.
- [English sentence structure](https://github.com/kidow/brain/blob/main/notes/%EC%98%81%EC%96%B4/%EC%98%81%EC%96%B4_%EB%AC%B8%EC%9E%A5_%EA%B5%AC%EC%A1%B0.md): Example note · `notes/영어/영어_문장_구조.md`
- [Chemistry note](https://github.com/kidow/brain/blob/main/notes/%ED%99%94%ED%95%99/%ED%99%94%ED%95%99.md): Example note · `notes/화학/화학.md`
- [English cheat sheet](https://github.com/kidow/brain/blob/main/sheets/%EC%98%81%EC%96%B4/%EC%98%81%EC%96%B4_%EB%AC%B8%EC%9E%A5_%EA%B5%AC%EC%A1%B0_%EC%8B%AC%ED%99%94_%EC%B9%98%ED%8A%B8%EC%8B%9C%ED%8A%B8.html): Static HTML reference · Separately authored reference material, not generated from notes. · `sheets/영어/영어_문장_구조_심화_치트시트.html`

### Static site

- [Note layout](https://github.com/kidow/brain/blob/main/_layouts/note.html): Jekyll layout · `_layouts/note.html`
- [Note ordering](https://github.com/kidow/brain/blob/main/_data/notes_order.yml): Jekyll data · `_data/notes_order.yml`
- [Site configuration](https://github.com/kidow/brain/blob/main/_config.yml): Jekyll config · `_config.yml`
- **Jekyll build**: Static-site generator · Converts repository content and layouts into the published site.
- [GitHub Pages](https://github.com/kidow/brain/blob/main/CNAME): Static hosting · Serves the generated site at the custom domain. · `CNAME`

### Browser interactions

- [Search page](https://github.com/kidow/brain/blob/main/search.md): Jekyll page and layout · `search.md`
- [Search runtime](https://github.com/kidow/brain/blob/main/assets/js/search.js): Browser JavaScript · `assets/js/search.js`
- [Vocabulary and handwriting drills](https://github.com/kidow/brain/blob/main/drills/%EC%9D%BC%EB%B3%B8%EC%96%B4_%ED%9E%88%EB%9D%BC%EA%B0%80%EB%82%98.html): Static browser apps · SM-2 vocabulary review and character stroke-order practice. · `drills/일본어_히라가나.html`
- [Drill datasets](https://github.com/kidow/brain/blob/main/drills/%EC%9D%BC%EB%B3%B8%EC%96%B4_%ED%9E%88%EB%9D%BC%EA%B0%80%EB%82%98.json): JSON content · `drills/일본어_히라가나.json`
- [Hanzi handwriting drill](https://github.com/kidow/brain/blob/main/drills/%EC%A4%91%EA%B5%AD%EC%96%B4_%ED%95%9C%EC%9E%90_%EC%93%B0%EA%B8%B0.html): Static browser app · `drills/중국어_한자_쓰기.html`
- **Browser progress**: localStorage · Ephemeral per-browser drill progress is isolated from Git learning state.
- [Vocabulary categories](https://github.com/kidow/brain/blob/main/vocab/%EC%83%89%EA%B9%94.html): HTML and JSON content · Category-centric concepts presented across eight languages. · `vocab/색깔.html`
- [Vocabulary dataset](https://github.com/kidow/brain/blob/main/vocab/%EC%83%89%EA%B9%94.json): JSON content · `vocab/색깔.json`
- [Vocabulary runtime](https://github.com/kidow/brain/blob/main/assets/js/vocab.js): Browser JavaScript · `assets/js/vocab.js`

### Local generation

- [Pronunciation manifest](https://github.com/kidow/brain/blob/main/audio/manifest.json): Audio asset index · Maps available language/category/word MP3 assets. · `audio/manifest.json`
- [Vocabulary audio builder](https://github.com/kidow/brain/blob/main/scripts/build_vocab_audio.py): Python pipeline · Batches source scripts into pronunciation assets and manifest updates. · `scripts/build_vocab_audio.py`
- [Stroke-data builders](https://github.com/kidow/brain/blob/main/scripts/build_hanzi_strokes.py): Python pipelines · Generate handwriting stroke data from repository inputs. · `scripts/build_hanzi_strokes.py`

## Connections

- External AI skills → Topic mastery state: reads and updates
- External AI skills → Learning notes: assesses and writes
- Topic mastery state → Learning notes: keyed by note filename
- English sentence structure → Learning notes: belongs to
- Chemistry note → Learning notes: belongs to
- Learning notes → Jekyll build: renders
- Note layout → Jekyll build: templates notes
- Note ordering → Jekyll build: orders content
- Site configuration → Jekyll build: configures
- Jekyll build → GitHub Pages: publishes
- English cheat sheet → GitHub Pages: served as static reference
- Search page → Jekyll build: renders
- Search runtime → Search page: powers search
- Drill datasets → Vocabulary and handwriting drills: supplies review content
- Vocabulary and handwriting drills → Browser progress: stores progress
- Hanzi handwriting drill → Browser progress: stores practice progress
- Vocabulary dataset → Vocabulary categories: supplies category content
- Vocabulary runtime → Vocabulary categories: adds interactions
- Pronunciation manifest → Vocabulary runtime: resolves pronunciation assets
- Vocabulary audio builder → Pronunciation manifest: updates
- Stroke-data builders → Hanzi handwriting drill: generates stroke data for
- Vocabulary and handwriting drills → GitHub Pages: served statically
- Vocabulary categories → GitHub Pages: served statically
