# haiderfarooq3/paper-reel architecture

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

- Interactive diagram: https://gitdiagram.com/haiderfarooq3/paper-reel
- Repository: https://github.com/haiderfarooq3/paper-reel

## Overview

paper-reel is a local Claude Code skill and command-line toolkit for creating cut-paper explainer reels. The main workflow starts with a topic and approved script, creates a piece, generates and aligns speech, renders voice-timed scenes, checks frames and text, and exports an MP4. The graph preserves the documented scene, style, transition, audio, preview, and review capabilities. Some subsystems are documented but unsampled; their links are included only where the README or excerpts support them.

Main entry points: [`bin/reel`](https://github.com/haiderfarooq3/paper-reel/blob/main/bin/reel) (Reel CLI), [`tools/build.mjs`](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/build.mjs) (Piece assembly), [`tools/voice.mjs`](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/voice.mjs) (Voice timeline), [`templates/starter/src/scenes.js`](https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/scenes.js) (Timed scenes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Authoring"]
  node_skill["Reel skill<br/>[SKILL.md]"]
  node_cli["Reel CLI"]
  node_starter["Starter piece"]
  node_script["Voice script<br/>[script.json]"]
end

subgraph group_voice["Voice timing"]
  node_kokoro["Kokoro speech<br/>[kokoro_lines.py]"]
  node_voice["Voice timeline<br/>[voice.mjs]"]
  node_align["Word alignment<br/>[align.mjs]"]
end

subgraph group_visuals["Scene rendering"]
  node_scenes["Timed scenes<br/>[scenes.js]"]
  node_bridges["Scene bridges<br/>[bridges.js]"]
  node_style["Paper style kit<br/>[kit.js]"]
  node_core["Drawing primitives<br/>[core.js]"]
  node_morph["Frame renderer<br/>[morph.js]"]
  node_board["Storyboard board<br/>[board.js]"]
end

subgraph group_audio["Score and audio"]
  node_score["Music and cues<br/>[score.js]"]
  node_scorekit["Audio synthesis<br/>[score-head.js]"]
  node_scoretail["Score output<br/>[score-tail.js]"]
end

subgraph group_delivery["Review and export"]
  node_build["Piece assembly<br/>[build.mjs]"]
  node_still["Still preview<br/>[still.mjs]"]
  node_storyboard["Storyboard preview<br/>[storyboard.mjs]"]
  node_textcheck["Text review<br/>[textcheck.mjs]"]
  node_export["MP4 export<br/>[export.mjs]"]
  node_gpu["GPU support<br/>[gpu.mjs]"]
end

node_creator(("Creator"))
node_claude(("Claude Code"))
node_ffmpeg["ffmpeg"]
node_whisper["whisper.cpp"]

node_creator -->|"requests reel"| node_claude
node_claude -->|"uses guidance"| node_skill
node_creator -->|"runs commands"| node_cli
node_cli -->|"copies starter"| node_starter
node_creator -->|"edits script"| node_script
node_script -.->|"provides lines"| node_kokoro
node_kokoro -.->|"generates takes"| node_voice
node_voice -.->|"times words"| node_whisper
node_voice -->|"refines timing"| node_align
node_voice -.->|"supplies word times"| node_scenes
node_scenes -->|"draws with"| node_style
node_style -->|"built on"| node_core
node_bridges -.->|"defines transitions"| node_morph
node_scenes -.->|"renders scenes"| node_morph
node_score -->|"uses synthesis"| node_scorekit
node_scorekit -->|"closes builder"| node_scoretail
node_cli -->|"assembles piece"| node_build
node_build -->|"includes scenes"| node_scenes
node_build -->|"includes bridges"| node_bridges
node_build -->|"includes kit"| node_core
node_build -->|"includes renderer"| node_morph
node_build -->|"includes board"| node_board
node_build -->|"includes audio kit"| node_scorekit
node_cli -->|"requests still"| node_still
node_cli -.->|"requests preview"| node_storyboard
node_cli -->|"checks text"| node_textcheck
node_cli -->|"exports piece"| node_export
node_export -->|"checks GPU"| node_gpu
node_export -->|"muxes media"| node_ffmpeg

click node_skill "https://github.com/haiderfarooq3/paper-reel/blob/main/SKILL.md"
click node_cli "https://github.com/haiderfarooq3/paper-reel/blob/main/bin/reel"
click node_starter "https://github.com/haiderfarooq3/paper-reel/tree/main/templates/starter"
click node_script "https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/voice/script.json"
click node_kokoro "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/kokoro_lines.py"
click node_voice "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/voice.mjs"
click node_align "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/align.mjs"
click node_scenes "https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/scenes.js"
click node_bridges "https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/bridges.js"
click node_style "https://github.com/haiderfarooq3/paper-reel/blob/main/styles/paper-reel/kit.js"
click node_core "https://github.com/haiderfarooq3/paper-reel/blob/main/kit/core.js"
click node_morph "https://github.com/haiderfarooq3/paper-reel/blob/main/kit/morph.js"
click node_board "https://github.com/haiderfarooq3/paper-reel/blob/main/kit/board.js"
click node_score "https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/score.js"
click node_scorekit "https://github.com/haiderfarooq3/paper-reel/blob/main/kit/score-head.js"
click node_scoretail "https://github.com/haiderfarooq3/paper-reel/blob/main/kit/score-tail.js"
click node_build "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/build.mjs"
click node_still "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/still.mjs"
click node_storyboard "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/storyboard.mjs"
click node_textcheck "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/textcheck.mjs"
click node_export "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/export.mjs"
click node_gpu "https://github.com/haiderfarooq3/paper-reel/blob/main/tools/gpu.mjs"

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_cli,node_starter,node_script toneBlue
class node_kokoro,node_voice,node_align toneAmber
class node_scenes,node_bridges,node_style,node_core,node_morph,node_board toneMint
class node_score,node_scorekit,node_scoretail toneRose
class node_build,node_still,node_storyboard,node_textcheck,node_export,node_gpu,node_creator,node_claude,node_ffmpeg,node_whisper toneIndigo
```

## Components

### Authoring

- [Reel skill](https://github.com/haiderfarooq3/paper-reel/blob/main/SKILL.md): `SKILL.md`
- [Reel CLI](https://github.com/haiderfarooq3/paper-reel/blob/main/bin/reel): `bin/reel`
- [Starter piece](https://github.com/haiderfarooq3/paper-reel/tree/main/templates/starter): `templates/starter`
- [Voice script](https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/voice/script.json): `templates/starter/voice/script.json`

### Voice timing

- [Kokoro speech](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/kokoro_lines.py): `tools/kokoro_lines.py`
- [Voice timeline](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/voice.mjs): `tools/voice.mjs`
- [Word alignment](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/align.mjs): `tools/align.mjs`

### Scene rendering

- [Timed scenes](https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/scenes.js): `templates/starter/src/scenes.js`
- [Scene bridges](https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/bridges.js): `templates/starter/src/bridges.js`
- [Paper style kit](https://github.com/haiderfarooq3/paper-reel/blob/main/styles/paper-reel/kit.js): `styles/paper-reel/kit.js`
- [Drawing primitives](https://github.com/haiderfarooq3/paper-reel/blob/main/kit/core.js): `kit/core.js`
- [Frame renderer](https://github.com/haiderfarooq3/paper-reel/blob/main/kit/morph.js): `kit/morph.js`
- [Storyboard board](https://github.com/haiderfarooq3/paper-reel/blob/main/kit/board.js): `kit/board.js`

### Score and audio

- [Music and cues](https://github.com/haiderfarooq3/paper-reel/blob/main/templates/starter/src/score.js): `templates/starter/src/score.js`
- [Audio synthesis](https://github.com/haiderfarooq3/paper-reel/blob/main/kit/score-head.js): `kit/score-head.js`
- [Score output](https://github.com/haiderfarooq3/paper-reel/blob/main/kit/score-tail.js): `kit/score-tail.js`

### Review and export

- [Piece assembly](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/build.mjs): `tools/build.mjs`
- [Still preview](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/still.mjs): `tools/still.mjs`
- [Storyboard preview](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/storyboard.mjs): `tools/storyboard.mjs`
- [Text review](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/textcheck.mjs): `tools/textcheck.mjs`
- [MP4 export](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/export.mjs): `tools/export.mjs`
- [GPU support](https://github.com/haiderfarooq3/paper-reel/blob/main/tools/gpu.mjs): `tools/gpu.mjs`

### Other components

- **Creator**
- **Claude Code**
- **ffmpeg**
- **whisper.cpp**

## Connections

- Creator → Claude Code: requests reel (evidence: `README.md`)
- Claude Code → Reel skill: uses guidance (evidence: `README.md`)
- Creator → Reel CLI: runs commands (evidence: `README.md`)
- Reel CLI → Starter piece: copies starter (evidence: `README.md`)
- Creator → Voice script: edits script (evidence: `README.md`)
- Voice script → Kokoro speech: provides lines (evidence: `README.md`)
- Kokoro speech → Voice timeline: generates takes (evidence: `README.md`)
- Voice timeline → whisper.cpp: times words (evidence: `README.md`)
- Voice timeline → Word alignment: refines timing (evidence: `tools/voice.mjs`)
- Voice timeline → Timed scenes: supplies word times (evidence: `README.md`)
- Timed scenes → Paper style kit: draws with (evidence: `README.md`)
- Paper style kit → Drawing primitives: built on (evidence: `styles/paper-reel/kit.js`)
- Scene bridges → Frame renderer: defines transitions
- Timed scenes → Frame renderer: renders scenes
- Music and cues → Audio synthesis: uses synthesis (evidence: `templates/starter/src/score.js`)
- Audio synthesis → Score output: closes builder (evidence: `kit/score-head.js`)
- Reel CLI → Piece assembly: assembles piece (evidence: `README.md`)
- Piece assembly → Timed scenes: includes scenes (evidence: `tools/build.mjs`)
- Piece assembly → Scene bridges: includes bridges (evidence: `tools/build.mjs`)
- Piece assembly → Drawing primitives: includes kit (evidence: `tools/build.mjs`)
- Piece assembly → Frame renderer: includes renderer (evidence: `tools/build.mjs`)
- Piece assembly → Storyboard board: includes board (evidence: `tools/build.mjs`)
- Piece assembly → Audio synthesis: includes audio kit (evidence: `tools/build.mjs`)
- Reel CLI → Still preview: requests still (evidence: `README.md`)
- Reel CLI → Storyboard preview: requests preview
- Reel CLI → Text review: checks text (evidence: `README.md`)
- Reel CLI → MP4 export: exports piece (evidence: `README.md`)
- MP4 export → GPU support: checks GPU (evidence: `tools/export.mjs`)
- MP4 export → ffmpeg: muxes media (evidence: `tools/export.mjs`)
