automation
БесплатноБез исполняемых скриптовНе проверенAutomation and verification guide for running Native SDK apps. Use when the user asks to test a running app, inspect runtime state, list windows, wait for…
от vercel-labs★ 7 869 звёзд на GitHubОб этом скилле
Automate Native SDK apps
Every Native SDK app embeds an automation server — native-rendered apps and WebView-shell apps alike. It works through file-based IPC in .zig-cache/native-sdk-automation/ and is intended for smoke tests, CI checks with a GUI session, and quick runtime inspection: accessibility snapshots, widget driving through the real input paths, deterministic reference-renderer screenshots, readiness/state assertions, and bridge round-trips.
Automation is not browser DOM automation. It reports runtime/window/widget state, drives retained-canvas widgets, and can ask the runtime to reload or dispatch bridge requests. For DOM testing of the optional WebView path, use the frontend framework's tests or a browser automation tool against the dev server.
What automation can verify
- An automation-enabled app started and published
ready=true. - The runtime loaded the expected app name, source kind, and window metadata.
- The main window exists and is focused/open.
- The JavaScript-to-Zig bridge can round-trip a request through
native automate bridge. - Builtin window/WebView commands work when exercised by a smoke test.
- Reload requests are accepted by the runtime.
- Real pixels of retained-canvas (
gpu_surface) views:native automate screenshot <view-label>renders the view's current canvas frame through the deterministic CPU reference renderer and writes a PNG artifact. Two captures of an unchanged scene are byte-identical, so screenshots can back golden-image or "did the UI change" checks.
What automation cannot verify
- Screenshots of WebView content.
screenshotcoversgpu_surfacecanvas views only; there is no DOM/WebView pixel capture. - Arbitrary DOM queries and clicks.
- Browser network assertions.
Prerequisites
Build/run an app with automation enabled. Generated examples usually expose -Dautomation=true:
zig build run -Dplatform=macos -Dautomation=true
Repository examples may have specialized steps:
zig build run-webview -Dplatform=macos -Dautomation=true
zig build test-webview-smoke -Dplatform=macos
The runner must pass an automation server into RuntimeOptions:
const server = native_sdk.automation.Server.init(io, ".zig-cache/native-sdk-automation", "My App");
var runtime = native_sdk.Runtime.init(.{
.platform = my_platform,
.automation = server,
});
Apps built without -Dautomation=true usually ignore automation files.
Commands
native automate wait
native automate assert 'gpu_nonblank=true' 'role=button name="Reset"'
native automate assert --absent 'error event='
native automate list
native automate snapshot
native automate reload
native automate screenshot inbox-canvas
native automate screenshot inbox-canvas 2
native automate widget-action canvas 2 press
native automate widget-click canvas 3
native automate widget-hold canvas 3
native automate widget-context-press canvas 3
native automate widget-drag canvas 4 0.25 0.82
native automate widget-wheel canvas 5 18
native automate widget-key canvas tab
native automate widget-key canvas cmd+c
native automate widget-pinch canvas 1.5
native automate widget-pinch canvas 0.5 120 80
native automate profile on
native automate profile off
native automate bridge '{"id":"smoke","command":"native.ping","payload":{"source":"automation"}}'
If using the repository-built CLI:
zig-out/bin/native automate wait
zig-out/bin/native automate snapshot
Snapshot assertions (automate assert)
Prefer native automate assert over snapshot | grep chains: it polls, so no sleeps, and its failure output carries the evidence (each missing pattern plus the snapshot tail).
native automate assert 'gpu_nonblank=true' 'role=button name="Reset"' 'count: 0'
native automate assert --timeout-ms 10000 '4 open'
native automate assert --absent 'error event=' 'dispatch_errors=[1-9]'
Semantics:
- Every argument is a regex that must match somewhere in
snapshot.txt. The command polls (100ms interval) until all match, then exits 0. --timeout-ms <n>bounds the polling (default 30000). On timeout it printsmissing: <pattern>for each unmatched pattern, the last 20 snapshot lines, and exits non-zero — CI-friendly, no wrapper script needed.--absentinverts the whole invocation: every pattern must NOT match (poll until gone). Mix presence and absence by running two invocations.- Supported regex subset: literals,
., postfix*+?, line anchors^/$, classes[a-z]/[^0-9], and\d \w \s(with uppercase negations). No groups or alternation — pass multiple patterns instead. - Quote patterns in single quotes so the shell leaves
",$, and\dalone.
Standard workflow
- Start the app with automation enabled.
- Run
native automate waitto block untilsnapshot.txtcontainsready=true. - Run
native automate assert '<pattern>' ...for state checks, ornative automate snapshotto eyeball app/window/source metadata. - Run `n
Установить automation в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл automation?
Automation and verification guide for running Native SDK apps. Use when the user asks to test a running app, inspect runtime state, list windows, wait for readiness, drive widgets, take deterministic screenshots, send bridge commands, debug why automation is not connected, create smoke tests, or verify a Native SDK example in a GUI-capable session.
Как установить скилл automation?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл automation запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an…
от Anthropicdiscernment-nudge
After you give a substantive answer or draft that the user may act on — advice or recommendations, drafted artifacts such as goals, plans, pitches, proposals…
от Anthropicdata-consolidate
Joins the plant's scheduled exports and connector data into one working dataset — ERP items (NetSuite or Infor M3), sales orders, production work orders…
от Anthropicinspection-to-capa
Runs the quality chain end to end: writes the nonconformance against the requirement it violates, searches history at the moment of writing to say whether…
от Anthropic