lanshu-animated-architecture-diagram
About lanshu-animated-architecture-diagram
A skill for turning articles, processes, or reference images into black-background, hand-drawn technical architecture diagrams. It produces an editable `.excalidraw` source, a PNG preview, and an animated GIF, with scripted rendering and validation.
Key features
- 01Extract architecture and data flows
- 02Author a diagram specification JSON
- 03Render three output formats
- 04Validate animation and file structure
Use cases
- 01Turn a long article into an architecture diagram
- 02Recreate a technical flow from a reference image
- 03Deliver editable source and animated preview
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ cclank/ lanshu-animated-architecture-diagram --skill lanshu-animated-architecture-diagramAfter installing, type/lanshu-animated-architecture-diagramin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
README.mdLICENSErequirements.txt.gitignoreagents/openai.yamlassets/default-spec.jsonreferences/spec-format.mdscripts/render_animated_diagram.pytests/test_render_output_checks.pytest_text_fitting.pyDetails
From the project READMELanshu Animated Architecture Diagram
Create a polished black-background hand-drawn technical diagram with:
- Editable
.excalidrawsource - Static
.pngpreview - Animated
.gifwith moving glow points and pulsing module highlights
Use the bundled renderer for deterministic output. Avoid external icon libraries unless the user explicitly provides audited assets.
Workflow
-
Extract the diagram content.
- For an article or long post, identify the core architecture, actors, stages, data flow, decisions, and final outputs.
- For a reference image, preserve the visual grammar: title structure, panels, arrows, density, and signature placement.
-
Create a spec JSON.
- Start from
assets/default-spec.json. - Keep labels short. Read
references/spec-format.mdwhen field details or copy length guidance are needed. - Use the user’s language for explanatory labels unless the reference style clearly calls for English titles.
- Start from
-
Render the outputs.
python /path/to/skill/scripts/render_animated_diagram.py \
--spec /path/to/spec.json \
--outdir /path/to/output-dir \
--basename descriptive-name \
--verify \
--check
-
Validate before delivery.
- Confirm GIF dimensions, FPS, frame count, and duration with
ffprobe. - Use
--verifyoutput or--checkto prove the GIF is not static. - Confirm
.excalidrawJSON has unique IDs, text usesfontFamily: 5, andfilesis empty.--checkvalidates these output contracts automatically. - Open the PNG preview visually and fix overlap, cramped text, or weak hierarchy.
- Confirm GIF dimensions, FPS, frame count, and duration with
-
Deliver the three files.
- Show the GIF preview when the interface supports local images.
- Link the PNG and
.excalidrawsource.
Style Rules
- Use a dark canvas with a thin outer rounded frame.
- Use one highlighted title phrase in a green capsule.
- Put the author signature in the top-right brand slot unless the user asks otherwise.
- Prefer clean white main arrows. Use colored motion only in the GIF overlay.
- Keep static diagrams restrained. Let animation add motion, not clutter.
- Use short text. If a phrase cannot fit, rewrite it instead of shrinking until unreadable.
- Use built-in simple icons:
folder,file,scan,shield,db,hash,package.
Spec Authoring Hints
Map common content to the fixed layout:
inputs: source systems, triggers, documents, tools, or user actionscore.cards: the three main stages of the processdecision: the quality gate or readiness checkleft_panel: memory/context/source materialcenter_panel: internal layers, safeguards, archive stores, or pipeline internalsright_panel: packaged outputs, reusable assets, generated reports, or agent-facing artifacts
If the subject has more than three stages, group adjacent steps into three core cards and move details into the lower panels.
Verification Commands
Use these checks after rendering:
ffprobe -v error -select_streams v:0 -count_frames \
-show_entries stream=width,height,r_frame_rate,avg_frame_rate,nb_read_frames \
-show_entries format=duration \
-of default=noprint_wrappers=1 output.gif
python /path/to/skill/scripts/render_animated_diagram.py \
--spec spec.json \
--outdir outputs \
--basename diagram \
--verify \
--check
The --verify report should show nonzero changed pixels between sampled GIF frames.
The --check report should return "ok": true; it exits nonzero on contract failures.