SuperAPI AI Directory

laohan-luping

Agents & models

View repository

Updated 10-15 22:12

About this skill

Screen recording automation: voiceover script → recording script → MP4

Boundaries (2026-09-20 governance P2-20): This tool does not enter the episode production contract. Screen recording within an episode only responds to the ⑨-frozenLOCAL_CAPTURErequest (Prompt 08 / local-capture-mvp); when there is no request, it isNOT_NEEDED; do not use this tool to initiate screen recording in an episode context. Independent research, demos, or free screen recording explicitly requested by Jeffrey are not subject to this restriction.

Input a voiceover script (or screen recording instructions), and automatically generate a bash screen recording script. The script orchestrates CLI operations (tmux + Claude Code) and browser operations (Playwright headed), ffmpeg records the physical screen, and outputs 1080p MP4.

Core philosophy

The voiceover script is the script blueprint. Each voiceover segment corresponds to one screen operation (CLI command/browser navigation/static wait). Extract the operation sequence and durations from the voiceover script and fill them into the recording template.

Record what you see. ffmpeg records the physical screen, tmux displays the terminal in the foreground, and Playwright headed displays the browser. The two kinds of "actors" take the stage alternately according to the voiceover script.

Screen recording is material, not production. All temporary files during the recording process are automatically cleaned up, keeping only the final MP4.

Workflow

1. Input the voiceover script

Receive what the user provides:

  • voiceover script file path (script.md)
  • or screen recording instruction file path (录屏指示.md)
  • or directly describe what to record

If the user provides a voiceover script but no screen recording instructions → automatically infer the operation corresponding to each segment based on the voiceover script content. If the user provides screen recording instructions → directly use the operation sequence in the instructions.

  • Completion condition: Obtain the complete operation sequence and the duration of each step

2. Parse the voiceover script → operation sequence

Extract from the voiceover script/screen recording instructions. Operations fall into three types:

CLI operations(tmux + Claude Code):

Voiceover segment Screen operation Script action
"Say 'fetch today's AI picks'" Execute command send_cmd "抓今天的AI精选"
"Say 'help me write a voiceover script'" Execute command send_cmd "帮我写口播稿"
"Show the output/ folder" View command send_cmd "ls output/"

Browser operations(Playwright headed):

Voiceover segment Screen operation Script action
"Open the GitHub project page" Navigate to URL browser_goto "https://github.com/..."
"Take a look at the README" Page scroll browser_scroll 500
"Click the installation docs" Click link browser_click "a[href='docs']"
"Show the project screenshots" Static display browser_wait 3000

Static operations(pure waiting):

Voiceover segment Screen operation Script action
Opening/transition/ending Static frame sleep N

Extraction rules:

  • Content in quotation marks («» or "") → directly used as the argument to send_cmd

  • Mentions URL / GitHub / website / docs → browser actions

  • Mentions terminal / command / CLI → CLI actions

  • Pure narration paragraphs → estimate sleep seconds based on spoken duration (normal speech is about 3 characters/second)

  • If a CLI command needs to wait for Claude to finish → add wait_for_claude

  • If a browser page needs reading time → add browser_wait

  • Completion criteria: Generate a structured action list, each item containing type (cli/browser/static), content, wait method, and label

3. Environment detection

which ffmpeg && which tmux && which node
ffmpeg -f avfoundation -list_devices true -i "" 2>&1 | grep "Capture screen"
node -e "require('playwright')" 2>/dev/null && echo "playwright OK" || echo "playwright missing"
  • Missing tools → prompt to install
  • Multiple screens → ask the user to confirm the index
  • Missing Playwright → npm install playwright
  • Completion criteria: Confirm the screen index + Playwright available (if a browser segment is needed)

4. Generate recording script

Generate based on the scripts/record_template.sh template. The template includes:

  • ffmpeg screen recording start/stop
  • tmux session management (CLI segment)
  • Playwright browser control (browser segment)
  • send_cmd()、wait_for_claude()、browser_*() function
  • 1080p transcoding + temporary file cleanup

Fill in content:

  • CLI segment: command sequence block (send_cmd + wait_for_claude)
  • Browser segment: navigation JSON file (browser_actions.json)
  • Switch timing: the order of narration script paragraphs determines the CLI/browser alternation

If there is only a CLI segment → pure CLI mode (do not start the browser). If there is only a browser segment → pure browser mode (do not start tmux). If both → mixed mode.

Write the generated script to the user-specified directory (or the current directory), file name format:record_<教程名>.sh

5. Delivery + guidance

Output:

  1. Generated record_xxx.sh script (including browser_actions.json if there is a browser segment)
  2. Run command:bash record_xxx.sh
  3. Reminders:
    • Fullscreen terminal (Cmd+Enter)
    • Turn on Do Not Disturb
    • After pressing Enter, do not touch the keyboard or mouse
    • Press Enter to continue at the Gate confirmation dialog

Do not automatically execute the script — screen recording requires the user to start it manually in the terminal.

Operating rules

  • Narration-script-driven — every action can be traced back to a paragraph in the narration script
  • Do not automatically execute the screen recording script — it involves taking over the screen, so the user must run it manually
  • Screen index must be confirmed — configurations differ across machines and cannot be hardcoded
  • Natural CLI/browser alternation — add a brief sleep (1-2s) when switching to simulate a natural switch
  • Browser scrolling simulates a real person — scroll in segments of 200-400px with 500-800ms intervals
  • Use sleep for static paragraphs — for segments with no actions such as the opening/transition/ending, estimate seconds by narration character count ÷ 3
  • Clean up all temporary files — Claude working directory + raw files + browser JSON, keeping only the final MP4

Not applicable scenarios

  • Recording desktop apps (neither terminal nor browser) → use OBS
  • Voice narration → requires additional audio input configuration
  • Live streaming → this is a recording solution, not a live streaming solution
  • Browser operations requiring login state → use opencli Browser Bridge

Browser operation JSON format

{
  "viewport": { "width": 1920, "height": 1080 },
  "steps": [
    { "action": "goto", "url": "https://github.com/xxx", "label": "打开项目页" },
    { "action": "wait", "ms": 3000 },
    { "action": "scroll", "pixels": 600, "smooth": true },
    { "action": "wait", "ms": 2000 },
    { "action": "click", "selector": "a[href='/xxx/docs']", "label": "点击文档" },
    { "action": "wait", "ms": 3000 }
  ]
}

Supported actions:goto、wait、scroll、click。

Troubleshooting quick reference

Issue Cause Solution
Recorded wrong screen Incorrect multi-monitor index ffmpeg -list_devices Confirm
claude exits immediately in tmux Occasional network/initialization issue Rerun
Screen is frozen claude is waiting for input Press Enter manually
Video too large CRF value too low Change -crf 23
Command not fully sent Timeout Increase max_wait
Browser window size is incorrect viewport mismatch Set viewport in JSON
Playwright failed to start Not installed npm install playwright