# timurugulava/lucid architecture

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

- Interactive diagram: https://gitdiagram.com/timurugulava/lucid
- Repository: https://github.com/timurugulava/lucid

## Overview

Lucid is a Claude Code skill that turns source material into a cited, visual explanation as a standalone page or narrated video. Its documented workflow runs from style setup and source capture through an anchored claim map, approval, writing and visual direction, then rendering, quality checks, fact-check, and delivery. The graph combines that documented workflow with the sampled scripts’ concrete generation and validation responsibilities. Most orchestration lives in SKILL.md and references; those unsampled instructions are represented only where the README describes them.

Main entry points: [`references/writing-rules.md`](https://github.com/timurugulava/lucid/blob/main/references/writing-rules.md) (Explanation script), [`SKILL.md`](https://github.com/timurugulava/lucid/blob/main/SKILL.md) (Skill orchestration), [`scripts/render_video.py`](https://github.com/timurugulava/lucid/blob/main/scripts/render_video.py) (Video renderer), [`scripts/scenes_from_script.py`](https://github.com/timurugulava/lucid/blob/main/scripts/scenes_from_script.py) (Scene generator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Explanation workflow"]
  node_skill["Skill orchestration<br/>[SKILL.md]"]
  node_onboarding["Style onboarding<br/>[onboarding.md]"]
  node_source["Source capture<br/>[SKILL.md]"]
  node_claimmap["Anchored claim map<br/>[writing-rules.md]"]
  node_approval["Map approval<br/>[SKILL.md]"]
  node_result["Page or video"]
  node_delivery["File and report<br/>[SKILL.md]"]
end

subgraph group_authoring["Authoring guidance"]
  node_writing["Explanation script<br/>[writing-rules.md]"]
  node_visualforms["Visual forms<br/>[visual-forms.md]"]
  node_presets["Style presets"]
  node_pageguide["Page build guidance<br/>[html-build.md]"]
  node_videoguide["Video build guidance<br/>[video-build.md]"]
  node_factguide["Fact-check instructions<br/>[fact-check.md]"]
end

subgraph group_media["Media generation"]
  node_scenegen["Scene generator"]
  node_skeleton["Scene templates"]
  node_tts["Gemini voice synthesis<br/>[tts.py]"]
  node_renderer["Video renderer<br/>[render_video.py]"]
end

subgraph group_quality["Quality assurance"]
  node_textcheck["Text checker<br/>[check_text.py]"]
  node_scenecheck["Scene validator<br/>[check_scenes.py]"]
  node_pagecheck["Page validator<br/>[check_page.py]"]
  node_factcheck["Independent fact-check<br/>[fact-check.md]"]
end

node_user(("User"))
node_gemini{{"Gemini TTS"}}
node_ffmpeg{{"FFmpeg"}}

node_user -->|"requests explanation"| node_skill
node_skill -->|"sets style"| node_onboarding
node_user -->|"provides material"| node_source
node_skill -->|"captures source"| node_source
node_source -->|"grounds claims"| node_claimmap
node_skill -->|"presents map"| node_approval
node_approval -->|"authorizes drafting"| node_writing
node_writing -->|"checks script"| node_textcheck
node_writing -->|"uses forms"| node_visualforms
node_onboarding -->|"selects style"| node_presets
node_writing -->|"provides script"| node_scenegen
node_scenegen -->|"fills templates"| node_skeleton
node_scenegen -->|"follows scene workflow"| node_videoguide
node_writing -->|"guides page assembly"| node_pageguide
node_writing -->|"supplies claims"| node_factguide
node_videoguide -->|"requests narration"| node_tts
node_tts -->|"requests speech"| node_gemini
node_tts -->|"provides audio"| node_renderer
node_scenegen -->|"provides scenes"| node_renderer
node_renderer -->|"runs validation"| node_scenecheck
node_renderer -->|"encodes video"| node_ffmpeg
node_renderer -->|"produces video"| node_result
node_pageguide -->|"produces page"| node_result
node_result -->|"checks page"| node_pagecheck
node_factguide -->|"instructs reviewer"| node_factcheck
node_factcheck -->|"returns corrections"| node_writing
node_scenecheck -->|"blocks defective render"| node_renderer
node_pagecheck -->|"reports quality"| node_skill
node_skill -->|"delivers output"| node_delivery
node_delivery -->|"shares result"| node_user

click node_skill "https://github.com/timurugulava/lucid/blob/main/SKILL.md"
click node_onboarding "https://github.com/timurugulava/lucid/blob/main/references/onboarding.md"
click node_source "https://github.com/timurugulava/lucid/blob/main/SKILL.md"
click node_claimmap "https://github.com/timurugulava/lucid/blob/main/references/writing-rules.md"
click node_approval "https://github.com/timurugulava/lucid/blob/main/SKILL.md"
click node_writing "https://github.com/timurugulava/lucid/blob/main/references/writing-rules.md"
click node_visualforms "https://github.com/timurugulava/lucid/blob/main/references/visual-forms.md"
click node_presets "https://github.com/timurugulava/lucid/tree/main/references/presets"
click node_pageguide "https://github.com/timurugulava/lucid/blob/main/references/html-build.md"
click node_videoguide "https://github.com/timurugulava/lucid/blob/main/references/video-build.md"
click node_factguide "https://github.com/timurugulava/lucid/blob/main/references/fact-check.md"
click node_textcheck "https://github.com/timurugulava/lucid/blob/main/scripts/check_text.py"
click node_scenegen "https://github.com/timurugulava/lucid/blob/main/scripts/scenes_from_script.py"
click node_skeleton "https://github.com/timurugulava/lucid/blob/main/assets/scene-skeleton.html"
click node_tts "https://github.com/timurugulava/lucid/blob/main/scripts/tts.py"
click node_renderer "https://github.com/timurugulava/lucid/blob/main/scripts/render_video.py"
click node_scenecheck "https://github.com/timurugulava/lucid/blob/main/scripts/check_scenes.py"
click node_pagecheck "https://github.com/timurugulava/lucid/blob/main/scripts/check_page.py"
click node_factcheck "https://github.com/timurugulava/lucid/blob/main/references/fact-check.md"
click node_delivery "https://github.com/timurugulava/lucid/blob/main/SKILL.md"

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_skill,node_onboarding,node_source,node_claimmap,node_approval,node_result,node_delivery,node_user toneBlue
class node_writing,node_visualforms,node_presets,node_pageguide,node_videoguide,node_factguide toneAmber
class node_scenegen,node_skeleton,node_tts,node_renderer toneMint
class node_textcheck,node_scenecheck,node_pagecheck,node_factcheck toneRose
class node_gemini,node_ffmpeg toneIndigo
```

## Components

### Explanation workflow

- [Skill orchestration](https://github.com/timurugulava/lucid/blob/main/SKILL.md): `SKILL.md`
- [Style onboarding](https://github.com/timurugulava/lucid/blob/main/references/onboarding.md): `references/onboarding.md`
- [Source capture](https://github.com/timurugulava/lucid/blob/main/SKILL.md): `SKILL.md`
- [Anchored claim map](https://github.com/timurugulava/lucid/blob/main/references/writing-rules.md): `references/writing-rules.md`
- [Map approval](https://github.com/timurugulava/lucid/blob/main/SKILL.md): `SKILL.md`
- **Page or video**
- [File and report](https://github.com/timurugulava/lucid/blob/main/SKILL.md): `SKILL.md`

### Authoring guidance

- [Explanation script](https://github.com/timurugulava/lucid/blob/main/references/writing-rules.md): `references/writing-rules.md`
- [Visual forms](https://github.com/timurugulava/lucid/blob/main/references/visual-forms.md): `references/visual-forms.md`
- [Style presets](https://github.com/timurugulava/lucid/tree/main/references/presets): `references/presets`
- [Page build guidance](https://github.com/timurugulava/lucid/blob/main/references/html-build.md): `references/html-build.md`
- [Video build guidance](https://github.com/timurugulava/lucid/blob/main/references/video-build.md): `references/video-build.md`
- [Fact-check instructions](https://github.com/timurugulava/lucid/blob/main/references/fact-check.md): `references/fact-check.md`

### Media generation

- [Scene generator](https://github.com/timurugulava/lucid/blob/main/scripts/scenes_from_script.py): `scripts/scenes_from_script.py`
- [Scene templates](https://github.com/timurugulava/lucid/blob/main/assets/scene-skeleton.html): `assets/scene-skeleton.html`
- [Gemini voice synthesis](https://github.com/timurugulava/lucid/blob/main/scripts/tts.py): `scripts/tts.py`
- [Video renderer](https://github.com/timurugulava/lucid/blob/main/scripts/render_video.py): `scripts/render_video.py`

### Quality assurance

- [Text checker](https://github.com/timurugulava/lucid/blob/main/scripts/check_text.py): `scripts/check_text.py`
- [Scene validator](https://github.com/timurugulava/lucid/blob/main/scripts/check_scenes.py): `scripts/check_scenes.py`
- [Page validator](https://github.com/timurugulava/lucid/blob/main/scripts/check_page.py): `scripts/check_page.py`
- [Independent fact-check](https://github.com/timurugulava/lucid/blob/main/references/fact-check.md): `references/fact-check.md`

### Other components

- **User**
- **Gemini TTS**
- **FFmpeg**

## Connections

- User → Skill orchestration: requests explanation (evidence: `README.md`)
- Skill orchestration → Style onboarding: sets style (evidence: `README.md`)
- User → Source capture: provides material (evidence: `README.md`)
- Skill orchestration → Source capture: captures source (evidence: `README.md`)
- Source capture → Anchored claim map: grounds claims (evidence: `README.md`)
- Skill orchestration → Map approval: presents map (evidence: `README.md`)
- Map approval → Explanation script: authorizes drafting (evidence: `README.md`)
- Explanation script → Text checker: checks script (evidence: `README.md`)
- Explanation script → Visual forms: uses forms (evidence: `README.md`)
- Style onboarding → Style presets: selects style (evidence: `README.md`)
- Explanation script → Scene generator: provides script (evidence: `README.md`)
- Scene generator → Scene templates: fills templates (evidence: `scripts/scenes_from_script.py`)
- Scene generator → Video build guidance: follows scene workflow (evidence: `README.md`)
- Explanation script → Page build guidance: guides page assembly (evidence: `README.md`)
- Explanation script → Fact-check instructions: supplies claims (evidence: `README.md`)
- Video build guidance → Gemini voice synthesis: requests narration (evidence: `README.md`)
- Gemini voice synthesis → Gemini TTS: requests speech (evidence: `scripts/tts.py`)
- Gemini voice synthesis → Video renderer: provides audio (evidence: `README.md`)
- Scene generator → Video renderer: provides scenes (evidence: `README.md`)
- Video renderer → Scene validator: runs validation (evidence: `scripts/render_video.py`)
- Video renderer → FFmpeg: encodes video (evidence: `scripts/render_video.py`)
- Video renderer → Page or video: produces video (evidence: `README.md`)
- Page build guidance → Page or video: produces page (evidence: `README.md`)
- Page or video → Page validator: checks page (evidence: `README.md`)
- Fact-check instructions → Independent fact-check: instructs reviewer (evidence: `README.md`)
- Independent fact-check → Explanation script: returns corrections (evidence: `README.md`)
- Scene validator → Video renderer: blocks defective render (evidence: `README.md`)
- Page validator → Skill orchestration: reports quality (evidence: `README.md`)
- Skill orchestration → File and report: delivers output (evidence: `README.md`)
- File and report → User: shares result (evidence: `README.md`)
