AGENT SKILL

demo-recording

Recording repeatable iOS feature demo videos / marketing GIFs from the simulator without hand-driving it. Drives the app with paced XCUITests (Thread.sleep + lenient guards) gated out of normal runs via an env flag forwarded through xcodebuild's TEST_RUNNER_ prefix, records with simctl recordVideo (finalized on SIGINT), and converts to GIF with ffmpeg palettegen/paletteuse — including a CoreText caption-bar fallback when the ffmpeg build lacks drawtext/libfreetype. Trigger on "record the app / make a GIF or video of the features", or any need for repeatable demo footage in CI.

License 许可
MIT
最近更新
2026-11-07
Stars
★ 1
Forks
1

01 前言 Front Matter

name
demo-recording
description
Recording repeatable iOS feature demo videos / marketing GIFs from the simulator without hand-driving it. Drives the app with paced XCUITests (Thread.sleep + lenient guards) gated out of normal runs via an env flag forwarded through xcodebuild's TEST_RUNNER_ prefix, records with simctl recordVideo (finalized on SIGINT), and converts to GIF with ffmpeg palettegen/paletteuse — including a CoreText caption-bar fallback when the ffmpeg build lacks drawtext/libfreetype. Trigger on "record the app / make a GIF or video of the features", or any need for repeatable demo footage in CI.

03 SKILL.md 正文

Simulator Demo Videos/GIFs via Paced XCUITests

Why this skill exists

simctl can screenshot but not tap; hand-recording is unrepeatable; and demo flows shouldn't pollute the regular test suite. A paced, env-gated XCUITest class plus simctl recordVideo produces deterministic footage you can regenerate on demand or in CI.

When to use

  • "Record the app / make a GIF / video of the features" on any iOS project
  • Repeatable demo footage in CI without a human driver

Pipeline

  1. Write a DemoRecordingUITests class — real flows with Thread.sleep pacing and lenient guards (waitForExistence + if-checks, minimal asserts, continueAfterFailure = true). Gate it out of normal runs:

    try XCTSkipUnless(ProcessInfo.processInfo.environment["DEMO_RECORDING"] == "1")
    

    xcodebuild forwards env vars to the test runner via the TEST_RUNNER_ prefix: TEST_RUNNER_DEMO_RECORDING=1 xcodebuild test-without-building ….

  2. build-for-testing once, then record per clip:

    xcodebuild build-for-testing -scheme App -destination "id=$UDID"
    xcrun simctl io "$UDID" recordVideo --codec h264 --force out.mov &
    recpid=$!
    TEST_RUNNER_DEMO_RECORDING=1 xcodebuild test-without-building \
      -destination "id=$UDID" -only-testing:"UITests/Demo/testOneFlow"
    kill -INT "$recpid"; wait "$recpid"   # recordVideo finalizes on SIGINT
    
  3. GIF conversion (trim launch dead-time with -ss):

    ffmpeg -ss 6 -i clip.mov -vf "fps=8,scale=380:-1:flags=lanczos,\
    split[s0][s1];[s0]palettegen=max_colors=128[p];[s1][p]paletteuse=dither=bayer" out.gif
    
  4. Caption bars when ffmpeg lacks drawtext (homebrew builds often skip libfreetype): render text → PNG with a tiny CoreGraphics/CoreText Swift script, then composite with the always-available overlay filter:

    ffmpeg -ss 6 -i clip.mov -i caption.png \
      -filter_complex "[0:v]fps=8,scale=380:-1[v];[v][1:v]overlay=0:H-44,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" out.gif
    
  5. Seed deterministic app data first: xcrun simctl get_app_container <udid> <bundle> data → copy fixture folders into Documents/. Control @AppStorage per-launch through the NSArgumentDomain: app.launchArguments = ["-hasSeenOnboarding", "YES"].

Related skills

This is the manual/CI counterpart to the simulator screenshot loop in the app-preview skill — use app-preview for single inline screenshots, demo-recording for narrated multi-step video.

04 同仓库更多 Skills

abhijitbansal
abhijitbansal/claude-skills

second-wind

Orchestrate long unattended Claude Code runs across multiple repos with the wind CLI. Use when the user wants to run Claude Code overnight, resume sessions after the 5-hour usage limit, run Claude in many repos at once via tmux, or says "set up second wind", "wind up", "overnight run", "resume after limit", "usage limit orchestrator".

★ 1
abhijitbansal
abhijitbansal/claude-skills

structured-output-adaptive-thinking-token-bloat

A Claude API call using output_config.format (json_schema structured outputs) with thinking:{type:"adaptive"} burns most of its output budget on thinking (observed ~21k of ~24k tokens) without improving JSON quality, making the run up to ~5x more expensive than the same call with thinking omitted — use when calling the Messages API with a json_schema output format for extraction, ranking, classification, or summarization tasks, or when a schema-constrained call's usage.output_tokens is far larger than the returned JSON.

★ 1
abhijitbansal
abhijitbansal/claude-skills

review

Apply a code-review lens to a diff, branch, or file — find correctness bugs, security issues, and quality problems, ranked by severity, with a concrete fix for each. Use when the user says "review this", "review my diff", "check this PR", "look this over before I commit", or "is this safe". Skip when the user wants the code written, not reviewed.

★ 1
abhijitbansal
abhijitbansal/claude-skills

refresh

Rebuild the prompt-craft command registry and usage profile, and print a summary of installed commands and your personalized recommendations. Use when you install or update plugins and want the advisor to pick them up immediately, or say "refresh prompt-craft", "rebuild the command registry".

★ 1
abhijitbansal
abhijitbansal/claude-skills

refactor

Apply a refactoring lens — restructure code without changing behavior, guarded by tests that pass before and after. Use when the user says "refactor", "clean this up", "extract this", "simplify this", "reduce duplication", or "make this readable" on existing working code. Skip when the change is meant to alter behavior (that's a feature or a fix).

★ 1
abhijitbansal
abhijitbansal/claude-skills

plan

Decompose a non-trivial task into an explicit, tracked plan with goals and per-step acceptance criteria before writing code. Use when the user says "plan this", "break this down", "what's the plan", or asks for a multi-step feature/refactor that touches more than one file. Pairs with plan mode. Skip for single-edit changes that need no decomposition.

★ 1