# huima-pty/papergit2video architecture

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

- Interactive diagram: https://gitdiagram.com/huima-pty/papergit2video
- Repository: https://github.com/huima-pty/papergit2video

## Overview

papergit2video is a local agent skill that turns papers or code repositories into narrated explainer videos or interactive pages. The main workflow is source reading, audience-specific script drafting, narration and visual rendering, then export; the README also documents style, language, subtitle, and performance options. The sampled source verifies caption checking and the Kokoro TTS server path. Other rendering and interactive-page details are represented from README descriptions, not inspected implementation, so those links cite the README.

Main entry points: [`skills/papergit2video/SKILL.md`](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md) (Script drafting), [`skills/papergit2video/scripts/render.sh`](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh) (Diagrams and charts), [`skills/papergit2video`](https://github.com/huima-pty/papergit2video/tree/main/skills/papergit2video) (Interactive explainer), [`skills/papergit2video/bin/espeak-ng`](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/bin/espeak-ng) (TTS launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Source and script"]
  node_skill["Skill workflow<br/>[SKILL.md]"]
  node_source_reading["Source reading<br/>[SKILL.md]"]
  node_script["Script drafting<br/>[SKILL.md]"]
  node_caption_check["Caption checks<br/>[caption_check.py]"]
end

subgraph group_media["Narration and visuals"]
  node_narration["Narration lines<br/>[SKILL.md]"]
  node_visuals["Diagrams and charts<br/>[render.sh]"]
  node_frame_render["Frame rendering<br/>[render.sh]"]
  node_video_export["Video export<br/>[render.sh]"]
  node_interactive_page["Interactive explainer"]
end

subgraph group_runtime["Local runtime"]
  node_tts_client["TTS launcher"]
  node_tts_server["Persistent TTS server<br/>[tts_server.py]"]
  node_kokoro["Kokoro synthesis<br/>[kokoro_tts.py]"]
end

node_agent(("AI agent"))
node_research["Paper or code"]
node_output["MP4 or HTML"]

node_agent -->|"invokes"| node_skill
node_research -->|"provides source"| node_source_reading
node_skill -->|"reads"| node_source_reading
node_source_reading -->|"informs"| node_script
node_script -->|"checks captions"| node_caption_check
node_script -->|"supplies lines"| node_narration
node_narration -->|"requests speech"| node_tts_client
node_tts_client -->|"forwards requests"| node_tts_server
node_tts_server -->|"writes WAV"| node_kokoro
node_script -->|"defines scenes"| node_visuals
node_visuals -->|"draws frames"| node_frame_render
node_frame_render -->|"encodes video"| node_video_export
node_video_export -->|"exports MP4"| node_output
node_skill -->|"offers alternative"| node_interactive_page
node_interactive_page -->|"produces page"| node_output

click node_skill "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md"
click node_source_reading "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md"
click node_script "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md"
click node_caption_check "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/caption_check.py"
click node_narration "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md"
click node_tts_client "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/bin/espeak-ng"
click node_tts_server "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/tts_server.py"
click node_kokoro "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/kokoro_tts.py"
click node_visuals "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh"
click node_frame_render "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh"
click node_video_export "https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh"
click node_interactive_page "https://github.com/huima-pty/papergit2video/tree/main/skills/papergit2video"

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_source_reading,node_script,node_caption_check toneBlue
class node_narration,node_visuals,node_frame_render,node_video_export,node_interactive_page toneAmber
class node_tts_client,node_tts_server,node_kokoro toneMint
class node_agent,node_research,node_output toneIndigo
```

## Components

### Source and script

- [Skill workflow](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md): `skills/papergit2video/SKILL.md`
- [Source reading](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md): `skills/papergit2video/SKILL.md`
- [Script drafting](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md): `skills/papergit2video/SKILL.md`
- [Caption checks](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/caption_check.py): `skills/papergit2video/scripts/caption_check.py`

### Narration and visuals

- [Narration lines](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/SKILL.md): `skills/papergit2video/SKILL.md`
- [Diagrams and charts](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh): `skills/papergit2video/scripts/render.sh`
- [Frame rendering](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh): `skills/papergit2video/scripts/render.sh`
- [Video export](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/render.sh): `skills/papergit2video/scripts/render.sh`
- [Interactive explainer](https://github.com/huima-pty/papergit2video/tree/main/skills/papergit2video): `skills/papergit2video`

### Local runtime

- [TTS launcher](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/bin/espeak-ng): `skills/papergit2video/bin/espeak-ng`
- [Persistent TTS server](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/tts_server.py): `skills/papergit2video/scripts/tts_server.py`
- [Kokoro synthesis](https://github.com/huima-pty/papergit2video/blob/main/skills/papergit2video/scripts/kokoro_tts.py): `skills/papergit2video/scripts/kokoro_tts.py`

### Other components

- **AI agent**
- **Paper or code**
- **MP4 or HTML**

## Connections

- AI agent → Skill workflow: invokes (evidence: `README.md`)
- Paper or code → Source reading: provides source (evidence: `README.md`)
- Skill workflow → Source reading: reads (evidence: `README.md`)
- Source reading → Script drafting: informs (evidence: `README.md`)
- Script drafting → Caption checks: checks captions (evidence: `README.md`)
- Script drafting → Narration lines: supplies lines (evidence: `README.md`)
- Narration lines → TTS launcher: requests speech (evidence: `README.md`)
- TTS launcher → Persistent TTS server: forwards requests (evidence: `skills/papergit2video/scripts/tts_server.py`)
- Persistent TTS server → Kokoro synthesis: writes WAV (evidence: `skills/papergit2video/scripts/tts_server.py`)
- Script drafting → Diagrams and charts: defines scenes (evidence: `README.md`)
- Diagrams and charts → Frame rendering: draws frames (evidence: `README.md`)
- Frame rendering → Video export: encodes video (evidence: `README.md`)
- Video export → MP4 or HTML: exports MP4 (evidence: `README.md`)
- Skill workflow → Interactive explainer: offers alternative (evidence: `README.md`)
- Interactive explainer → MP4 or HTML: produces page (evidence: `README.md`)
