CommunityProductivity & Collaborationgithub.com

geniusdapeng-collab/WorkLoom-video-edit

Client-side real-shot screen recording skill (with audio) — spin up a WorkLoom desktop client, drive real user operations via CDP, and produce high-fidelity demo videos with ffmpeg screen capture + neural voice/programmatic sound effects, suitable for review, presentation, and promotion. For 3D/animated content, use virtual clock offline frame-by-frame rendering for smoothness.

What is WorkLoom-video-edit?

This skill transforms a developer's environment into a professional demo video production line for the WorkLoom client. It goes beyond simple screen recording by orchestrating a real Electron client instance, using Chrome DevTools Protocol (CDP) to simulate genuine mouse and keyboard interactions, and combining ffmpeg screen capture with neural text-to-speech (via edge-tts) for voiceovers or programmatic sound effects. The critical innovation is a dual-path approach: for standard 2D UI demonstrations, it uses real-time x11grab screen recording. For 3D scenes, CSS animations, or ceremonial sequences that require silky smooth playback, it switches to an offline frame-by-frame rendering mode driven by a virtual clock, ensuring perfectly smooth output regardless of CPU rendering speed. This skill is essential for generating polished, client-facing demo videos that accurately reflect the real product experience, complete with interaction trails and synchronized audio, while avoiding common pitfalls like GPU-less WebGL fallbacks or audio truncation.

Works with~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/geniusdapeng-collab/WorkLoom-video-edit/tree/HEAD/skills/official/client-demo-recorder

Installed? Explore more Productivity & Collaboration skills: steipete/gemini, steipete/gh-issues, steipete/skill-creator · View all 6 →

Ask in your favorite AI

Open a new chat with this agent skill pre-loaded.

Documentation

Client Real-Shot Screen Recording (With Audio)

Positioning: Delivery-grade demo video production line. Not "just a screenshot," but a real client running state + real mouse & keyboard operations + audible sound triple combo.

Trigger & Execute

When the user expresses intent like "record a video / real-shot demo / screen recording for me / make a demo video / with audio" and the target is a WorkLoom repository (containing apps/desktop/electron/main.cjs), execute according to this skill.

Act 0 · Select Recording Route (Critical Decision)

Content TypeRouteReason
2D page operation demo (click button/fill form/navigate)Route A: Real-time Screen Recording (x11grab, Act 3)Operation flow is the star, real-time suffices
3D scene / CSS animation / ceremonialRoute B: Offline Frame-by-Frame Rendering (this act)Sandbox has no GPU, uses CPU software rendering; real-time recording would be choppy—choppiness is an environment issue, but we must fix it, not let the client guess

Route B · Virtual Clock Offline Frame-by-Frame Rendering (Smooth 3D/Animation Guarantee)

Principle: Animation is driven by a virtual clock—virtual time advances by 1/30s only after each frame is rendered, completely decoupled from wall clock/render speed. Produces mathematically perfectly smooth frame sequences at any frame rate (30/60fps).

Page-side Contract (the captured page must implement, one-time modification):

const CAPTURE = location.search.includes("capture");
// ① Renderer enables preserveDrawingBuffer (screenshot fidelity)
// ② Expose step interface: advance dt virtual seconds → drive mixer/position/camera → render one frame
window.__ceremonyStep = (dt) => { /* mixer.update(dt); event table triggered by virtual time; render(); return virtualT; */ };
window.__ceremonyReady = () => actorsReady;   // Asset load completion flag
// ③ Timeline changed from setTimeout to "virtual time event table": { t, fn } triggered by virtualT
// ④ Side effects without rAF loop (e.g., spotlight fade-in) set to final state directly in CAPTURE branch

Capture-side Script (CDP-driven):

await send("Page.navigate", { url: "<page>?capture=1" });
// Poll __ceremonyReady() === true
for (let i = 0; i < FPS * SECONDS; i++) {
  await send("Runtime.evaluate", { expression: `window.__ceremonyStep(${(1/FPS).toFixed(6)})` });
  const shot = await send("Page.captureScreenshot", { format: "jpeg", quality: 85 });
  fs.writeFileSync(`f${String(i).padStart(4,"0")}.jpg`, Buffer.from(shot.data, "base64"));
}

Assembly: ffmpeg -framerate 30 -i f%04d.jpg -i music.wav -c:v libopenh264 -b:v 4000k -c:a aac -t <seconds> -movflags +faststart out.mp4

Discipline:

  • All 3D/animated videos must use Route B—"should be smooth" is empty talk; offline rendering is the proof;
  • Speed reference: about 0.5-0.8s per frame under SwiftShader (375 frames ≈ 4.5 minutes), be patient;
  • DOM overlay elements (banners/popups) are captured in the same frame as canvas (Page.captureScreenshot includes DOM);
  • Route B also applies to product 3D views (Floor3D/Stage3D need the same capture contract—just add the ?capture branch in the page to reuse).

Full Four-Act Process (Route A · Real-Time Screen Recording)

Act 1 · Stack Up (Real Client, Not Browser)

# 1. Virtual display (necessary for headless environments)
nohup Xvfb :86 -screen 0 1600x1000x24 &

# 2. Backend + Frontend Preview (independent ports, avoid existing 8787/4173 instances)
SERVER_PORT=<PORT1> pnpm -C apps/server start &
WEB_PORT=<PORT2> SERVER_PORT=<PORT1> vite preview --port <PORT2> &

# 3. Electron Client (CDP mode, programmatically drivable)
DISPLAY=:86 \
WORKLOOM_SERVER_URL=http://localhost:<PORT1> \
WORKLOOM_MANAGE_SERVER=0 \
WORKLOOM_WEB_URL=http://localhost:<PORT2> \
./node_modules/.bin/electron --no-sandbox --in-process-gpu \
  --remote-debugging-port=9333 \
  --user-data-dir=/tmp/elec-rec \
  apps/desktop/electron/main.cjs &

Discipline:

  • Must use real Electron client (the product's actual form), never fake with browser tab screenshots;
  • WebGL verification: Run canvas.getContext('webgl2') via CDP—headless Chromium without WebGL triggers product degraded rendering (2D fallback), resulting in an "old version" video—a common failure point;
  • All processes are killed on sandbox sleep; check ports before starting: fuser -k 9333/tcp <PORT1>/tcp <PORT2>/tcp.

Act 2 · Drive (CDP Simulates Real User)

Use CDP (http://127.0.0.1:9333/json → WebSocket) to orchestrate scripts:

OperationCDP Method
Navigate/Refresh statePage.navigate + Runtime.evaluate (localStorage state control, e.g., clearing ceremonial markers like theater-ceremony-*)
Drag rotate viewInput.dispatchMouseEvent (mousePressed → segmented mouseMoved → mouseReleased, each step 40-50ms)
Scroll wheel zoomInput.dispatchMouseEvent type=mouseWheel (deltaY ±240, interval 150ms)
Right-click panSame as drag rotate, button=right
Hover triggerMove mouseMoved to position and pause (hover 0.5s triggers tooltip, stare 1.5s triggers nod)
Screenshot verificationPage.captureScreenshot (evidence at end of each act)

Camera pacing (audience-friendly): Let the entry camera settle ≥8s before operating; leave 2-3s "breathing room" between actions; target total duration 60-100s.

Act 3 · Screen Recording

ffmpeg -y -f x11grab -video_size 1600x1000 -framerate 24 -i :86 \
  -c:v libopenh264 -b:v 2500k -pix_fmt yuv420p out.mp4
  • Codec discipline: This sandbox ffmpeg has no libx264; use libopenh264 (best compatibility) or libsvtav1;
  • After recording, verify duration with ffprobe; spot-check frames with select=eq(n,...) tile collage;
  • Cut black leader: ffmpeg -ss <N> -i in.mp4 -c:v libopenh264 -movflags +faststart out.mp4.

Act 4 · Dubbing (Two Routes)

Route A · Real-Time Capture (Preferred, Real Sound)

  • Prerequisites: System has PulseAudio + Chinese TTS voice pack (speech-dispatcher + espeak-ng) and Chromium speechSynthesis.getVoices().length > 0;
  • ffmpeg -f pulse -i auto_null.monitor recorded synchronously with video.

Route B · Post-Production Dubbing (Tested Route, Recommended) Linux headless environment Chromium typically cannot get TTS voices (getVoices()=0), so use post-production:

  1. Neural voice sentence-by-sentence generation (edge-tts):
    import edge_tts
    await edge_tts.Communicate(text, voice, rate="-5%", pitch="+0Hz").save(f"line{i}.mp3")
    
    • Verified usable Chinese voices: zh-CN-XiaoxiaoNeural / XiaoyiNeural / YunjianNeural / YunxiNeural / YunxiaNeural / YunyangNeural (first run --list-voices—voices not in the list will definitely fail);
    • Rate limit strategy: 1.5s sleep between sentences + 5 retries with backoff on failure;
    • Role voice mapping uses the product's VoiceEngine 7+1 presets (voice equals personality—keep a role consistent throughout the video).
  2. Programmatic sound effects (ffmpeg sine synthesis for fanfare/wind chimes);
  3. Timeline mixing + synthesis:
    # Align each line with adelay to video timeline → amix audio mix → composite with video
    ffmpeg -i video.mp4 -i dub.aac -filter_complex "[1:a]apad[a]" \
      -map 0:v -map "[a]" -c:v copy -c:a aac -b:a 160k \
      -t <video duration> -movflags +faststart final.mp4
    
    • Major pitfall: -shortest will trim the video to the audio length—must use apad to pad silence + explicit -t duration;
    • Spot-check waveform: Use astats to check Peak/RMS (prevent silent tracks or clipping).

Acceptance Checklist

  • Video shows Electron client (not browser), WebGL 3D scene normal (not 2D fallback)
  • Has real interaction traces (drag/zoom/pan/click), not static display
  • Duration 60-100s, no black leader, faststart for streaming playback
  • Audio version: voice intelligible, voice matches character, peaks not clipped, video not truncated by -shortest
  • Spot-check at least 3 frames (beginning/middle/end)

Common Failure Points (Potholes Encountered)

PitfallSolution
Headless Chromium no WebGL → captures 2D fallback videoUse real Electron (SwiftShader ready)
Electron binary missing (postinstall download failed)Copy from node_modules/.pnpm/electron@*/dist in another repo on same machine
Single instance lock conflict / port in useUse separate --user-data-dir + fuser -k to clear ports
getVoices()=0 (Linux headless)Use Route B post-production dubbing, don't fight it
edge-tts voice name not in list → NoAudioReceivedFirst --list-voices; differentiate roles by voice + pitch tweak
Video truncated by -shortestUse apad + explicit -t duration
All processes killed on sandbox sleepRestack; check all four layers: Xvfb/server/preview/electron

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

geniusdapeng-collab/WorkLoom-video-edit

配乐交付规范官方套件:原节目默认来源、显式独立分轨授权、单次实际混音、曲目许可与字节证据,完整平台/电平/选段工艺参数和用户返修归因。成功源镜不经声音品质复检,不按余量/可闻度/卡点分数自动重试或降级;绑定 G-BGM0..G-BGM5,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

曲库与许可合规官方套件(随 bundles/ai-video 分发):无版权曲库怎么接、许可白名单与商用红线、TASL 署名怎么出、AI 生成音乐的许可陷阱(MusicGen 权重 CC-BY-NC)、自算作曲为什么是默认路径。安装后被 BGM 配乐师调用;绑定围栏 G-BGM0..G-BGM5,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

配乐定调官方套件(随 bundles/ai-video 分发):题材×场景×情绪→调式/调性/BPM/和弦/配器/结构的选型法,含 32 个题材配方(16 既有 + T-15 新增 16)、速度决策(配方 BPM vs 剪辑点反推)、禁忌清单与"允许不配"。安装后被 BGM 配乐师调用;绑定围栏 G-BGM0..G-BGM5,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

人声分离纪律官方套件(随 bundles/ai-video 分发):什么时候真需要分轨、两档引擎链(demucs/audio-separator → ffmpeg 中心声道近似)、质量等级与诚实标注、单声道与失败处理、与 UVR/Spleeter 的关系。安装后被 BGM 配乐师调用;绑定围栏 G-BGM0..G-BGM5,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

SRT/ASS、字体解析、实际烧录与文字扩展轨的完整执行纪律;默认一次处理、原片原声保持,核对时间轴和真实产物,不抽帧评审可现度或循环选优;遵守 G-SUB 围栏的原片、字体、权限和执行回执约束。

geniusdapeng-collab/WorkLoom-video-edit

摄影知识库调用技能(随 bundles/ai-video 分发):19 篇九章式摄影知识(光学/景别/运镜/光线/色彩/材质/天气/风格/情绪),每篇第六章是「意图→提示词」核心调用区。用于写镜头提示词前定光圈/焦距/景别/光位/色调/材质,把参数意图翻译成画面语言。绑定制片与摄影指导岗位及围栏 G-KB0–G-KB4;卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

调色交付规范官方套件:Rec.709 本地加工、平台派生、滤镜和来源证据、真实产物哈希、版本回滚与用户反馈归因。成功渲染素材默认接受,保留完整参数与工艺参考,未测画面品质如实为空,实际缺件、授权或加工失败保持阻断;绑定 G-COL0..G-COL4,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

调色执行纪律官方套件(随 bundles/ai-video 分发):规格读取、明确校正与风格配方、单次请求加工、多镜参考匹配、来源和输出字节留痕,保留目标值与 profile 工艺知识。成功源镜默认接受,独立诊断不接入品质否决或自动重做;绑定 G-COL0..G-COL4,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

题材、场景、情绪与平台到单次调色配方的选型方法;保留题材表、参数建议、操作流程与失败诊断,成功渲染素材默认进入后期,不以画面评分复核或重做。

geniusdapeng-collab/WorkLoom-video-edit

多镜色彩一致性官方套件:指定参考镜、逐镜派生曝光和色度校正、完整批次结果、原片只读与当前字节证据。保留参考选择与诊断残差的工艺知识,成功源镜默认接受,成片不以残差、肤色或主观跳变自动拒绝重做;绑定 G-COL0..G-COL4,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

评论三级分流 SOP 官方套件(随 bundles/ai-video 分发,F8.1 官方套件级):评论采集→意图分类→三级分流(夸赞 auto/咨询 review/负面 review+告警/敏感 block)、投诉维权关键词必审+告警、外发回执落账。安装后被评论区运营调用;绑定围栏 G10,卸载即撤销(F8.2/L8.3)。

geniusdapeng-collab/WorkLoom-video-edit

封面设计官方套件:按明确标题、主视觉镜号/时刻、平台与账号字体色板一次本地合成,保留字号、安全区、人物布局和标题工艺知识。成功源镜默认接受,不调用模型选帧或整图质量评审,不做 PSNR/墨迹投票自动重做;实际来源、字体、请求和产物失败明确,绑定 G-MAT1/G-SUB3。

geniusdapeng-collab/WorkLoom-video-edit

封面设计知识库(cover-kb)调用技能。为封面设计师岗位提供「平台规范 / 账号定位 / 题材映射 / 钩子公式 / 构图工艺」的结构化检索与注入纪律(14 篇九章式,确定性检索,无向量库)。绑定围栏 G-SUB2/G-SUB3/G-MAT1;卸载即撤销封面 know-how 注入能力。

geniusdapeng-collab/WorkLoom-video-edit

母版、旁挂字幕、软轨、封面、变体、工程与清单的完整交付纪律;含产物表、变体设计、执行参数、来源哈希与逐层失败 SOP。按声明配方实际执行,保留来源与真实错误,不以差异评分、声音质量或默认增强模型再次拒收素材;绑定 G-DLV0..G-DLV9,供后期交付与封面岗位调用。

geniusdapeng-collab/WorkLoom-video-edit

返修闭环官方套件:反馈归因、层影响分析、基础工程版本/SHA 前置条件、独占版本认领、本地增量重合成与复用证据。保留完整反馈表、并发冲突和存储失败 SOP;成功镜头默认接受,组件或旧品质失败不重新生成,点名新生成保持 G8/G-DLV5,绑定 G-DLV4..G-DLV7。

geniusdapeng-collab/WorkLoom-video-edit

导演评审官方套件(随 bundles/ai-video 分发,F8.1 官方套件级):6 问评审 + 5 维评分 + 硬阻断打回、事实红线一票否决、跨集连贯性校验,含硬阻断优先级/平均分不得掩盖短板/事实红线以 confirmed 字段为准等决策原则、四种评审形态打法、五步 SOP 与失败模式表。安装后被连贯审查官调用;绑定围栏 G6,卸载即撤销(F8.2/L8.3)。

geniusdapeng-collab/WorkLoom-video-edit

字体许可合规官方套件(字幕师专业套件):OFL-1.1/Apache-2.0/厂商免费商用三类白名单判定、OFL 四条义务(可商用/禁单售/改后改名/保留声明)、不做子集化的理由、客户自备商用字体的登记口径、证据留痕与围栏 G-SUB5 对应关系。安装后被字幕师调用;绑定围栏 G-SUB1/G-SUB5,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

字体选型官方套件(字幕师专业套件):场景×语言硬过滤、五维加权打分(作品类型/BGM节奏/粗细/艺术气息/气质关键词)、账号视觉锤锁定、中英混排搭配、上位提示词气质命中、否决项与"允许报告无合适字体"。安装后被字幕师调用;绑定围栏 G-SUB0/G-SUB1/G-SUB3/G-SUB5,卸载即撤销。

geniusdapeng-collab/WorkLoom-video-edit

情报五站方法论官方套件(随 bundles/ai-video 分发,F8.1 官方套件级):采集/评价/竞品/核验/装订五站流水,含决策原则(无源不入库/置信度三级/域名去重/冲突不仲裁)、实物 8 路与服务 6 路两套打法、五步 SOP(每步带回执与失败路径)、关键指标护栏与失败模式表。安装后被情报科五站与调研员调用;绑定围栏 G1,卸载即撤销(F8.2/L8.3)。

geniusdapeng-collab/WorkLoom-video-edit

原声 program、显式签章分轨与配乐的来源、策略、时间轴和一次混流方法;默认保留原声,不自动分离或测声音品质,真实非法分轨与混流失败明确停止。

Related Skills