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/check_frames.py

View on GitHub
#!/usr/bin/env python3
"""Sample frames of a live-panel config, check text overflow / overlap by DOM measurement, export a few PNGs,
and (with --repeat) prove replays are identical.

  python3 scripts/check_frames.py --config examples/airbnb/config.json --out-dir /tmp/check
Exit status 1 when any problem is found. With --video, the PNGs are cut from that mp4 instead of the live page.
"""
import argparse, base64, os, subprocess, sys, tempfile
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import livepanel as lp


TOL_PIXELS = 50   # allowed number of visibly different pixels (sub-pixel anti-aliasing noise); a real state difference changes thousands


def pixel_diff(br, a, b, delta=24):
    """Compare two PNGs inside the browser: count of pixels differing by more than `delta` in any channel, and the max delta.
    (Anti-aliasing at a sub-pixel edge can differ by a few levels between repaints; a real state difference is far larger.)"""
    ja = base64.b64encode(a).decode(); jb = base64.b64encode(b).decode()
    js = '''(async()=>{const L=s=>new Promise(r=>{const i=new Image();i.onload=()=>r(i);i.src='data:image/png;base64,'+s});
      const A=await L(%r),B=await L(%r),c=document.createElement('canvas');c.width=A.width;c.height=A.height;const x=c.getContext('2d');
      x.drawImage(A,0,0);const da=x.getImageData(0,0,c.width,c.height).data;x.clearRect(0,0,c.width,c.height);x.drawImage(B,0,0);const db=x.getImageData(0,0,c.width,c.height).data;
      let n=0,m=0;for(let i=0;i<da.length;i+=4){const d=Math.max(Math.abs(da[i]-db[i]),Math.abs(da[i+1]-db[i+1]),Math.abs(da[i+2]-db[i+2]));if(d>m)m=d;if(d>%d)n++}return [n,m]})()''' % (ja, jb, delta)
    return br.eval(js)


def main():
    ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
    ap.add_argument("--config", required=True)
    ap.add_argument("--out-dir", required=True, help="where the PNGs go")
    ap.add_argument("--samples", type=int, default=120, help="how many time points to measure (DOM only, cheap)")
    ap.add_argument("--png", type=int, default=4, help="how many PNGs to export")
    ap.add_argument("--video", help="cut the PNGs from this mp4 instead of the page")
    ap.add_argument("--repeat", action="store_true", help="screenshot each exported time twice (with a seek elsewhere in between) and compare the pixels")
    ap.add_argument("--chrome"); ap.add_argument("--ffmpeg"); ap.add_argument("--template")
    ap.add_argument("--no-sandbox", action="store_true")
    a = ap.parse_args()
    chrome = lp.find_chrome(a.chrome)
    os.makedirs(a.out_dir, exist_ok=True)
    page = os.path.join(tempfile.mkdtemp(prefix="livepanel-page-"), "page.html")
    cfg = lp.build_page(a.config, page, a.template)
    w, h, dur, _ = lp.canvas(cfg)
    times = [dur * i / a.samples + 0.013 * i for i in range(a.samples)]
    shots = [dur * (i + 0.5) / a.png for i in range(a.png)]
    problems = {}
    with lp.Chrome(chrome, w, h, True if a.no_sandbox else None) as br:
        br.open("file://" + os.path.abspath(page) + "?manual")
        for t in times + shots:
            br.seek(t)
            for p in br.eval("window.__check()"):
                problems.setdefault(p, []).append(round(t, 2))
        err = br.eval("window.__error||''")
        if err:
            problems["page error: " + err] = [0]
        same = True
        for i, t in enumerate(shots):
            name = Path(a.out_dir) / f"frame_{i + 1}_t{t:05.2f}.png"
            br.seek(t); png = br.shot()
            if not a.video:
                name.write_bytes(png)
            if a.repeat:
                br.seek((t + dur / 2) % dur); br.shot()
                br.seek(t); again = br.shot()
                n, mx = pixel_diff(br, png, again)
                ok = n <= TOL_PIXELS
                same &= ok
                print(f"replay t={t:.2f}s: {n} pixels differ visibly (max channel delta {mx}) -> {'identical' if ok else 'DIFFERENT'}")
    if a.video:
        ffmpeg = lp.find_exe(a.ffmpeg, ["ffmpeg"], "ffmpeg")
        for i, t in enumerate(shots):
            subprocess.run([ffmpeg, "-y", "-loglevel", "error", "-ss", f"{t:.3f}", "-i", a.video, "-frames:v", "1",
                            str(Path(a.out_dir) / f"frame_{i + 1}_t{t:05.2f}.png")], check=True)
    for p, ts in problems.items():
        print(f"PROBLEM: {p}  (first at t={ts[0]}s, {len(ts)} of {a.samples + a.png} samples)")
    print(f"checked {a.samples + a.png} time points, {len(problems)} distinct problems; PNGs in {a.out_dir}")
    if a.repeat and not same:
        sys.exit(1)
    sys.exit(1 if problems else 0)


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