Skip to content

ythx-101/live-panel-skill

live-panel

Verified

Build a terminal-style, always-running animated architecture diagram (a "live panel") from a JSON config and render it to an mp4. Use when the user wants a system, agent or org architecture diagram that looks like a monitoring dashboard in a terminal window - fixed layout, glowing packets on the wires, scrolling log, counters, bars that flip state - as a screen-recording-style video or a live web page, instead of a static picture or a step-by-step reveal. 中文:当用户要做"活的"架构图、agent 树或系统监控面板风格的动画(mp4 视频或循环网页)时使用——终端里一直在跑的监控面板外观,固定布局、线上流动的数据包、滚动日志、翻转的计数器和状态条;不是静态图,也不是分步演示。

FileKindSize
SKILL.mdskill md11.2 KB
assets/fonts/Excalifont-OFL.txtmarkdown5.1 KB
assets/fonts/Excalifont-Regular-Latin.woff2binary24.4 KB
assets/fonts/SmileySans-OFL.txtmarkdown4.3 KB
assets/fonts/SmileySans-Oblique.woff2binary1.1 MB
assets/fonts/Xiaolai-OFL.txtmarkdown4.3 KB
assets/template.htmlother35.9 KB
assets/views/LUCIDE-LICENSE.txtmarkdown3.1 KB
assets/views/ROUGH-LICENSE.txtmarkdown1.0 KB
assets/views/excalidraw.jsscript50.0 KB
assets/views/funnel.jsscript15.5 KB
assets/views/loop.jsscript74.3 KB
assets/views/ring.jsscript15.2 KB
assets/views/sketchboard.jsscript18.7 KB
examples/agent-architecture/agent-architecture.mp4binary1.4 MB
examples/agent-architecture/config.jsonconfig37.1 KB
examples/agent-architecture/preview.webpbinary1.2 MB
examples/airbnb/airbnb.mp4binary1.9 MB
examples/airbnb/config.jsonconfig20.3 KB
examples/airbnb/preview.webpbinary1.4 MB
examples/codex-agents/codex-agents.mp4binary1.8 MB
examples/codex-agents/config.jsonconfig19.1 KB
examples/codex-agents/preview.webpbinary1.6 MB
examples/excalidraw-aqua/README.mdmarkdown760 B
examples/excalidraw-aqua/build_config.pyscript6.6 KB
examples/excalidraw-aqua/config-3x4.jsonconfig8.3 KB
examples/excalidraw-aqua/config-4x5.jsonconfig8.3 KB
examples/excalidraw-aqua/preview.webpbinary2.3 MB
examples/excalidraw-gardener/README.mdmarkdown671 B
examples/excalidraw-gardener/build_config.pyscript6.4 KB
examples/excalidraw-gardener/config-3x4.jsonconfig7.6 KB
examples/excalidraw-gardener/config-4x5.jsonconfig7.6 KB
examples/excalidraw-gardener/preview.webpbinary1.2 MB
examples/excalidraw-import/agent-loop.excalidrawother6.7 KB
examples/excalidraw-import/agent-loop.mp4binary1.6 MB
examples/excalidraw-import/config.jsonconfig3.9 KB
examples/funnel-karpathy/config.jsonconfig1.2 KB
examples/funnel/config.jsonconfig1.2 KB
examples/funnel/funnel.mp4binary1.1 MB
examples/funnel/preview.webpbinary475.3 KB
examples/hybrid-agent/README.mdmarkdown729 B
examples/hybrid-agent/config.jsonconfig6.2 KB
examples/loop-poteto/config.jsonconfig6.6 KB
examples/loop-poteto/loop-poteto.mp4binary2.1 MB
examples/loop-poteto/preview-dark.webpbinary638.3 KB
examples/loop-poteto/preview-light.webpbinary627.2 KB
examples/minimal/config.jsonconfig1.9 KB
examples/minimal/preview.webpbinary146.3 KB
examples/ring/config.jsonconfig940 B
examples/ring/preview.webpbinary150.9 KB
examples/ring/ring.mp4binary593.1 KB
references/config-schema.mdmarkdown4.9 KB
references/motion-grammar.mdmarkdown6.4 KB
references/verify-view.mdmarkdown3.3 KB
references/view-rules.mdmarkdown4.3 KB
references/views.mdmarkdown24.7 KB
scripts/check_frames.pyexecutablescript4.6 KB
scripts/excalidraw_import.pyscript14.7 KB
scripts/fetch_fonts.shexecutablescript528 B
scripts/livepanel.pyexecutablescript10.2 KB
scripts/render.pyexecutablescript3.8 KB
scripts/scaffold.pyexecutablescript25.0 KB
scripts/verify_view.pyscript28.5 KB

scripts/render.py

View on GitHub
#!/usr/bin/env python3
"""Render a live-panel config to an H.264 mp4: step window.seek(t) frame by frame, screenshot, pipe into ffmpeg.

  python3 scripts/render.py --config examples/codex-agents/config.json --out out.mp4
Chrome and ffmpeg are looked up on PATH (Chrome also under /Applications on macOS) unless --chrome / --ffmpeg are given.
Runs on Linux and macOS; on Windows use WSL (the Chrome DevTools pipe needs POSIX fd passing).
"""
import argparse, os, subprocess, sys, tempfile
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import livepanel as lp


def main():
    ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
    ap.add_argument("--config", required=True, help="path to the JSON config")
    ap.add_argument("--out", required=True, help="output .mp4")
    ap.add_argument("--width", type=int, help="video width (default: config canvas.width)")
    ap.add_argument("--height", type=int, help="video height (default: config canvas.height)")
    ap.add_argument("--duration", type=float, help="seconds (default: config canvas.duration)")
    ap.add_argument("--fps", type=int, help="frames per second (default: config canvas.fps or 30)")
    ap.add_argument("--chrome", help="Chrome/Chromium executable (default: search PATH, and /Applications on macOS)")
    ap.add_argument("--ffmpeg", help="ffmpeg executable (default: search PATH)")
    ap.add_argument("--template", help="alternative template.html")
    ap.add_argument("--crf", type=int, default=16)
    ap.add_argument("--audio", choices=["silent", "none"], default="silent", help="add a silent AAC track (some chat apps treat silent-less mp4 as a GIF)")
    ap.add_argument("--html-out", help="also keep the generated self-contained page here (opens live in any browser)")
    ap.add_argument("--keep-frames", help="also write PNG frames into this directory")
    ap.add_argument("--no-sandbox", action="store_true", help="pass --no-sandbox to Chrome (auto when running as root)")
    a = ap.parse_args()

    chrome = lp.find_chrome(a.chrome)
    ffmpeg = lp.find_exe(a.ffmpeg, ["ffmpeg"], "ffmpeg")
    tmpdir = tempfile.mkdtemp(prefix="livepanel-page-")
    page = a.html_out or os.path.join(tmpdir, "page.html")
    cfg = lp.build_page(a.config, page, a.template)
    cw, ch, cdur, cfps = lp.canvas(cfg)
    w = a.width or cw; h = a.height or ch
    fps = a.fps or cfps; dur = a.duration or cdur
    n = int(round(fps * dur))
    w -= w % 2; h -= h % 2   # yuv420p needs even sizes
    cmd = [ffmpeg, "-y", "-loglevel", "error", "-f", "image2pipe", "-framerate", str(fps), "-c:v", "png", "-i", "-"]
    if a.audio == "silent":
        cmd += ["-f", "lavfi", "-i", "anullsrc=r=44100:cl=stereo", "-shortest", "-c:a", "aac", "-b:a", "32k"]
    cmd += ["-c:v", "libx264", "-preset", "medium", "-crf", str(a.crf), "-pix_fmt", "yuv420p", "-r", str(fps), "-movflags", "+faststart", a.out]
    os.makedirs(os.path.dirname(os.path.abspath(a.out)), exist_ok=True)
    if a.keep_frames:
        os.makedirs(a.keep_frames, exist_ok=True)
    ff = subprocess.Popen(cmd, stdin=subprocess.PIPE)
    with lp.Chrome(chrome, w, h, True if a.no_sandbox else None) as br:
        br.open("file://" + os.path.abspath(page) + "?manual")
        for i in range(n):
            br.seek(i / fps)
            png = br.shot()
            if a.keep_frames:
                Path(a.keep_frames, f"f_{i:04d}.png").write_bytes(png)
            ff.stdin.write(png)
            if i % fps == 0:
                print(f"\r{i}/{n} frames", end="", file=sys.stderr, flush=True)
        err = br.eval("window.__error||''")
        if err:
            print("\npage errors:", err, file=sys.stderr)
    ff.stdin.close(); rc = ff.wait()
    print(f"\nwrote {a.out} ({n} frames, {w}x{h}@{fps})", file=sys.stderr)
    sys.exit(rc)


if __name__ == "__main__":
    main()
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall