Community程式設計與開發github.com

proof-video

捕捉並標註 PR 截圖與影片,加入測量箭頭、輪廓、對齊輔助線、間距括號、說明文字、縮放與速度提示。

proof-video 是什麼?

這個技能旨在為 pull request 建立高品質的視覺證據,包含靜態截圖與動態影片。它透過 Playwright 自動化流程,讓開發者能直接在 PR 工作流程中捕捉 Control UI 的螢幕畫面與影片,並自動疊加說明文字、縮放效果與速度變化等標註。支援的平台為 macOS 上的 Playwright 與 Chromium,並仰賴系統的 ffmpeg 進行最終渲染。技能的核心是 `proof-video.ts` 測試輔助函式庫,提供 `caption()`、`zoom()`、`speed()` 等 API 來控制錄製過程中的標註與播放速度。渲染階段則透過 `render-proof-video.mts` 指令碼將原始影片與 `cues.json` 側車檔案合併,輸出帶有沈浸式標註的 H.264 MP4。值得注意的是,字幕必須燒錄在影片中,因為 GitHub 的播放器不支援字幕軌。技能也支援手寫 `cues.json` 來處理原生螢幕錄製,但需注意縮放與速度提示不能重疊,且必須使用固定幀率的來源影片。

相容平台~Claude Code✓Codex CLI~Cursor
npx skills add https://github.com/clawdbot/clawdbot/tree/main/.agents/skills/proof-video

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

Proof video

對於 PR 截圖,請從共用的 視覺證明工作流程 開始,然後使用標註。透過現有的平台工作流程進行截圖;靜態圖片無需錄製器、影片或 ffmpeg 設定。這些標註是 PR 的產出物,而非儲存/發布用的截圖。

對於附有說明文字的 Control UI 與原生影片,請使用下方的錄製章節。說明文字會燒錄在 MP4 中;它們是視覺敘述,而非合成音訊。保留原始影片作為證據,附加處理後的 MP4,且絕不提交媒體或 .artifacts/ 輸出。在發布至 PR 現有授權之前,請檢查整個捕捉內容是否包含無關或私人資訊。

對於新增或變更的錯誤狀態、空白狀態與載入狀態,請遵循狀態捕捉閘門。捕捉每個已變更的狀態,包括適用時的真實頻道連結表單。當靜態截圖能證明狀態時使用靜態截圖;當動作是主張重點時才錄製轉場效果。僅刪除省略號的複製操作不會授權加入載入動畫。

指出主張重點

關於目標選取、原生/網頁幾何與檢查,請閱讀標註。兩種路徑都使用相同的 SVG 幾何渲染器。標註會在縮放前合成,而敘述則維持固定於視埠中。在滾動或版面變更後,請重新測量並取代標記;一個提示描述的是靜態捕捉,而非即時元素追蹤器。在移動期間清除那些會變得不準確的標記。

獨立錄製

從儲存庫根目錄開始,將此腳本儲存為 .artifacts/proof-video/record.mts(先建立父目錄),然後執行 node --import tsx .artifacts/proof-video/record.mts。它會啟動一個隔離的模擬 Control UI,錄製五個說明文字、一個真實的工具列縮放、快轉啟動過程,以及一個以 4 倍速進行的八秒暫停。每次呼叫都會分配一個全新的證據目錄。

import { chromium } from "playwright";
import { createControlUiE2eArtifactDir } from "../../ui/src/test-helpers/control-ui-e2e-artifacts.ts";
import {
  installMockGateway,
  resolvePlaywrightChromiumExecutablePath,
  startControlUiE2eServer,
} from "../../ui/src/test-helpers/control-ui-e2e.ts";
import { startProofRecording } from "../../ui/src/test-helpers/proof-video.ts";

const dir = createControlUiE2eArtifactDir("captioned-toolbar", ".artifacts/proof-video");
const server = await startControlUiE2eServer(undefined, { source: true });
const browser = await chromium.launch({
  executablePath: resolvePlaywrightChromiumExecutablePath(chromium.executablePath()),
  args: ["--force-device-scale-factor=2"],
});
try {
  const recording = await startProofRecording(browser, {
    dir,
    contextOptions: { colorScheme: "dark", locale: "en-US", reducedMotion: "reduce" },
  });
  const { page } = recording;
  const sessions = ["Main", "Weekly planning", "Reading list"].map((label, index) => ({
    key: index === 0 ? "agent:main:main" : `agent:main:proof-${index}`,
    label,
    displayName: label,
    kind: "direct",
    status: "done",
    hasActiveRun: false,
    updatedAt: Date.parse("2026-09-01T12:00:00Z") - index * 60000,
    contextTokens: 200000,
    totalTokens: 0,
    model: "gpt-5.6-luna",
    modelProvider: "openai",
  }));
  const gateway = await installMockGateway(page, {
    sessionKey: "agent:main:main",
    sessionArchiveFiltering: true,
    methodResponses: {
      "sessions.list": {
        sessions,
        count: sessions.length,
        totalCount: sessions.length,
        hasMore: false,
        offset: 0,
        limitApplied: 50,
        nextOffset: null,
        path: "",
        ts: sessions[0].updatedAt,
        defaults: { contextTokens: 200000, model: "gpt-5.6-luna", modelProvider: "openai" },
      },
    },
  });
  recording.caption("Open the mocked Control UI.");
  recording.speed(8);
  await page.goto(`${server.baseUrl}chat`);
  await gateway.waitForRequest("sessions.list");
  await page.getByRole("link", { name: "Weekly planning", exact: true }).waitFor();
  const toolbar = page.locator(".sidebar-session-toolbar");
  await toolbar.getByText("Sessions", { exact: true }).waitFor();
  recording.speed(1);
  await page.waitForTimeout(1500);
  recording.caption("Find your conversations in the session list.");
  await page.waitForTimeout(3000);
  await recording.zoom(toolbar);
  recording.caption("Zoom in on the session filter controls.");
  await toolbar.getByRole("button", { name: "Filter & sort" }).click();
  await page.locator(".sidebar-session-sort-menu").waitFor({ state: "visible" });
  await page.waitForTimeout(4000);
  recording.zoomOut();
  recording.caption("Fast-forward an eight-second pause.");
  recording.speed(4);
  await page.waitForTimeout(8000);
  recording.speed(1);
  recording.caption("Return to the full session list.");
  await page.getByRole("radio", { name: "All", exact: true }).click();
  await page.waitForFunction(() =>
    document
      .querySelector(".sidebar-session-sort")
      ?.classList.contains("sidebar-session-sort--filtered"),
  );
  await page.waitForTimeout(3000);
  console.log(JSON.stringify(await recording.finish(), null, 2));
} finally {
  await browser.close();
  await server.close();
}

使用 caption(text) 來取代目前的說明文字,clearCaption() 來結束它,zoom(locatorOrRect, { factor: 2, padding: 24, ease: 0.5 }) 來開始或取代縮放,以及 zoomOut() 來結束縮放。矩形使用視埠 CSS 像素。填補會展開並限制目標矩形;其中心點決定縮放焦點。speed(factor) 會變更播放速度直到下次呼叫;speed(1) 恢復正常播放。finish() 會在最終影片結束時關閉開啟中的提示,關閉錄製上下文,將說明文字柵格化,寫入 cues.json,並回傳 { dir, videoPath, cuesPath }。呼叫者負責關閉瀏覽器與伺服器。

此輔助程式是位於 ui/src/test-helpers/proof-video.ts 的測試工具;正式環境程式碼不得匯入它。contextOptions 傳遞一般的 Playwright 上下文選項,而輔助程式則擁有視埠、錄製尺寸與裝置縮放比例的控制權。保持敘述為一至兩行簡短文字;過大的文字會失敗,而非靜默裁剪。說明文字 PNG 是透明、視埠寬度、120 像素高的長條,包含一個置中的深色圓角卡片與 30 像素系統文字。

渲染

使用錄製所輸出的確切目錄:

node --import tsx scripts/render-proof-video.mts --cues .artifacts/proof-video/<capture>/cues.json

渲染器會輸出檔案路徑與持續時間。可選的 --input <video> 可覆寫原始輸入,--out <file.mp4> 則可選擇輸出檔案。拒絕使用現有的輸出檔案,以保護原始證據與先前的渲染結果。它使用系統信任的 ffmpeg 與 ffprobe,絕不使用 Playwright 內建的編碼器。使用 brew install ffmpeg 或 apt install ffmpeg 安裝完整的系統版本。

速度區段會使用 trim/setpts/concat 分割原始時間軸,然後將其正規化為輸入幀率。說明文字視窗與縮放轉換會重新對應至輸出時間。縮放使用 zoompan 搭配 d=1 與匹配的輸入 FPS;一個 100 幀、4 秒、25 FPS 的合成捕捉會精確保留 100 幀與 4 秒,並呈現視覺上與數值上不同的縮放停留。動態裁切寬度/高度表達式不會產生動畫:ffmpeg 僅在初始化時評估它們。輸出為視埠大小的 H.264 MP4,yuv420p,CRF 23,包含 faststart 且無音訊。

提示側車 v1 與原生捕捉

在未經修改的原生 .mov 或 .webm 旁儲存手寫的 cues.json。使用 scale 來表示每個視埠 CSS 像素對應的實際原始像素,而非顯示中繼資料。輸入尺寸必須等於視埠 × 縮放比例,且幀率必須固定。以下所有時間單位為 RAW 影片中的秒數。說明圖片路徑相對於側車目錄。縮放提示不能與其他縮放提示重疊;速度提示不能與其他速度提示重疊。允許相鄰的提示。

{
  "version": 1,
  "video": "capture.mov",
  "viewport": { "width": 1280, "height": 800 },
  "scale": 2,
  "captionHeight": 120,
  "cues": [
    {
      "kind": "caption",
      "start": 1,
      "end": 4,
      "text": "Inspect the session controls.",
      "image": "captions/0.png"
    },
    {
      "kind": "zoom",
      "start": 1,
      "end": 4,
      "rect": { "x": 20, "y": 150, "width": 280, "height": 80 },
      "factor": 2,
      "ease": 0.5
    },
    { "kind": "speed", "start": 5, "end": 9, "factor": 4 }
  ]
}
node --import tsx scripts/render-proof-video.mts --cues <dir>/cues.json --rasterize

--rasterize 會使用全新的 Playwright Chromium 頁面來建立缺少的說明文字與標註 PNG。匯出的 rasterizeProofOverlays(browser, cues, dir) 也支援程式化的原生捕捉工作流程。這兩個路徑都不需要 libass 或 drawtext:Chromium 負責柵格化文字與幾何圖形。ffmpeg 在縮放之前疊加標註,並在縮放之後疊加說明文字。

已驗證的捕捉模式與限制

在搭載 Playwright 1.62.1 與 Chromium 151.0.7922.34 的 macOS 上,上下文 deviceScaleFactor: 2 會產生一個 2560×1600 的 WebM,其中僅包含 1280×800 的頁面內容加上灰色填補。使用 --force-device-scale-factor=2 啟動,並將上下文模擬保留為 1,則會錄製真正的 2 倍內容:一個 100 CSS 像素的標記在原始座標 (2360, 1400) 處測量為 200×200。輔助程式預設使用 deviceScaleFactor: 2 作為錄製尺寸與側車縮放比例;範本中的啟動旗標是必要的。此參數不會啟用上下文模擬。對於已驗證的 1 倍捕捉,請在不使用旗標的情況下啟動,並傳遞 deviceScaleFactor: 1。渲染器會對 1 倍來源使用 Lanczos 預先放大,但無法恢復遺失的細節:對這些錄製進行 2 倍縮放時會顯得較柔和。

提示時鐘從上下文建立時使用 performance.now() 開始。Playwright 的影片時鐘可能有大約 100 毫秒的差異,且啟動/載入可能增加偏差;請在最終錄製中檢查動作/說明文字的對齊情況。避免在錄製期間使用裁剪、定位器或全頁截圖:Chromium 可能會損壞螢幕畫面錄製表面。說明文字柵格化僅在錄製關閉後、在新的上下文中進行。請參閱 Control UI E2E 技能的截圖指南。

GitHub 的播放器會忽略字幕軌道,因此說明文字必須燒錄在影片中。渲染器需要系統 ffmpeg 建置中包含 crop、scale、overlay、setpts、trim、concat、fps 與 zoompan。它不會使用 subtitles= 或 drawtext=。可變幀率的原生捕捉需要先轉換為單獨的固定幀率工作副本;請保留原始檔案。幀率量化可能會將速度區段邊界偏移約一個輸出幀。在附加 MP4 之前,請檢查輸出持續時間,並提取說明文字、縮放停留與加速區段的幀。

Individual skills in this repo

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

1password

Set up and use 1Password CLI for sign-in, desktop integration, and reading or injecting secrets.

acp-router

Route plain-language requests for Claude Code, Cursor, Copilot, OpenClaw ACP, OpenCode, Gemini CLI, Grok Build, Qwen, Kiro, Kimi, iFlow, Factory Droid, Kilocode, or explicit ACP harness work into either OpenClaw ACP runtime sessions or direct acpx-driven sessions ("telephone game" flow). For coding-agent thread requests, read this skill first, then use only `sessions_spawn` for thread creation. Codex chat binding defaults to the native Codex app-server plugin unless ACP is explicit or background spawn needs ACP.

add-model-provider

Add and live-prove a model provider with non-interactive config one-liners, without exposing credentials.

agent-transcript

Requested GitHub PR/issue agent transcripts: redact, trim, preview, and insert safely.

apple-notes

Create, view, edit, delete, search, move, or export Apple Notes via the memo CLI on macOS.

apple-reminders

List, add, edit, complete, or delete Apple Reminders and reminder lists via remindctl.

auto-qa

Run OpenClaw-wide autonomous QA and live/stress campaigns across independent subsystem lanes, with verified fixes and a resumable evidence report.

autoreview

Structured code review through the shared OpenClaw agent-skills installation.

bear-notes

Create, search, and manage Bear notes via grizzly CLI.

blacksmith-testbox

Run Blacksmith Testbox for CI-parity checks, secrets, hosted services, migrations, or builds local cannot reproduce.

block-kit

Use proactively for structured or interactive Slack replies, and when asked to author or validate native Slack Block Kit JSON.

blogwatcher

Monitor blogs and RSS/Atom feeds for updates using the blogwatcher CLI.

blucli

BluOS CLI (blu) for discovery, playback, grouping, and volume.

bluebubbles

Send and manage iMessages via BlueBubbles, including attachments, tapbacks, edits, replies, and groups.

browser-automation

Use when controlling web pages with the OpenClaw browser tool, especially multi-step flows, login checks, tab management, or recovery from stale refs/timeouts.

camsnap

Capture frames or clips from RTSP/ONVIF cameras and local webcams, including USB pan/tilt/zoom control.

canvas

Present HTML on connected OpenClaw node canvases, navigate/eval/snapshot, and debug canvas host URLs.

channel-message-flows

Use when running QA Lab channel message flow evidence.

clawdtributor

Clawtributor PRs here, last week or another window: discover conversation refs, recheck GitHub, rank by impact.

clawhub

Search ClawHub for plugins by default, or skills and agent Templates when requested; add Templates; install, verify, update, uninstall, publish, or sync skills.

相關技能