# cclank/lanshu-animated-architecture-diagram architecture

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

- Interactive diagram: https://gitdiagram.com/cclank/lanshu-animated-architecture-diagram
- Repository: https://github.com/cclank/lanshu-animated-architecture-diagram

## Overview

Lanshu is a Codex skill and local Python tool for turning a JSON diagram spec into editable Excalidraw, PNG, and animated GIF files. The documented workflow is to invoke the skill or run the renderer with a spec, then optionally verify the outputs. The renderer also provides text fitting, drawing, animation, and output checks. The source excerpt is partial, so internal calls beyond those explicitly shown are not mapped.

Main entry points: [`scripts/render_animated_diagram.py`](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py) (CLI Renderer), [`assets/default-spec.json`](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/assets/default-spec.json) (Default Spec), [`references/spec-format.md`](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/references/spec-format.md) (Spec Format), [`SKILL.md`](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/SKILL.md) (Codex Skill)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Spec and Skill"]
  node_skill["Codex Skill<br/>[SKILL.md]"]
  node_template["Default Spec<br/>[default-spec.json]"]
  node_format["Spec Format<br/>[spec-format.md]"]
end

subgraph group_rendering["Rendering"]
  node_renderer["CLI Renderer"]
  node_text["Text Fitting"]
  node_excal["Excalidraw Builder"]
  node_animation["GIF Animation"]
  node_verification["Output Checks"]
end

subgraph group_outputs["Generated Outputs"]
  node_excal_output["Editable Excalidraw"]
  node_png_output["Static PNG"]
  node_gif_output["Animated GIF"]
end

node_user(("Diagram Author"))

node_user -->|"invokes"| node_skill
node_user -->|"runs"| node_renderer
node_renderer -->|"loads default"| node_template
node_renderer -->|"fits text"| node_text
node_renderer -->|"builds elements"| node_excal
node_renderer -->|"creates frames"| node_animation
node_renderer -->|"writes"| node_excal_output
node_renderer -->|"saves"| node_png_output
node_renderer -->|"saves"| node_gif_output
node_renderer -->|"checks outputs"| node_verification
node_format -->|"describes fields"| node_template

click node_skill "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/SKILL.md"
click node_template "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/assets/default-spec.json"
click node_format "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/references/spec-format.md"
click node_renderer "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py"
click node_text "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py"
click node_excal "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py"
click node_animation "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py"
click node_verification "https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.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_skill,node_template,node_format toneBlue
class node_renderer,node_text,node_excal,node_animation,node_verification toneAmber
class node_excal_output,node_png_output,node_gif_output toneMint
class node_user toneIndigo
```

## Components

### Spec and Skill

- [Codex Skill](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/SKILL.md): `SKILL.md`
- [Default Spec](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/assets/default-spec.json): `assets/default-spec.json`
- [Spec Format](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/references/spec-format.md): `references/spec-format.md`

### Rendering

- [CLI Renderer](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py): `scripts/render_animated_diagram.py`
- [Text Fitting](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py): `scripts/render_animated_diagram.py`
- [Excalidraw Builder](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py): `scripts/render_animated_diagram.py`
- [GIF Animation](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py): `scripts/render_animated_diagram.py`
- [Output Checks](https://github.com/cclank/lanshu-animated-architecture-diagram/blob/main/scripts/render_animated_diagram.py): `scripts/render_animated_diagram.py`

### Generated Outputs

- **Editable Excalidraw**
- **Static PNG**
- **Animated GIF**

### Other components

- **Diagram Author**

## Connections

- Diagram Author → Codex Skill: invokes (evidence: `README.md`)
- Diagram Author → CLI Renderer: runs (evidence: `README.md`)
- CLI Renderer → Default Spec: loads default (evidence: `README.md`)
- CLI Renderer → Text Fitting: fits text (evidence: `scripts/render_animated_diagram.py`)
- CLI Renderer → Excalidraw Builder: builds elements (evidence: `scripts/render_animated_diagram.py`)
- CLI Renderer → GIF Animation: creates frames (evidence: `scripts/render_animated_diagram.py`)
- CLI Renderer → Editable Excalidraw: writes (evidence: `scripts/render_animated_diagram.py`)
- CLI Renderer → Static PNG: saves (evidence: `scripts/render_animated_diagram.py`)
- CLI Renderer → Animated GIF: saves (evidence: `scripts/render_animated_diagram.py`)
- CLI Renderer → Output Checks: checks outputs (evidence: `README.md`)
- Spec Format → Default Spec: describes fields (evidence: `README.md`)
