一键导入
heal-spec
Automatically fix a broken demo-machine spec by analyzing failure artifacts (screenshots, DOM, error logs). Use when a demo fails after a UI change.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Automatically fix a broken demo-machine spec by analyzing failure artifacts (screenshots, DOM, error logs). Use when a demo fails after a UI change.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Generate a polished product demo video from a YAML spec using demo-machine. Use when the user wants to create, run, or update a demo video for their app.
Generate a complete demo-machine YAML spec by crawling a live web app. Give it a URL and description, get a ready-to-run spec.
Generate compelling AI narration for every step in a demo-machine spec. Use when a spec has no narration or needs better narration text.
AI quality review of a completed demo run. Analyzes event log, timing, and narration to flag issues and suggest improvements.
Convert an existing Playwright or Cypress E2E test file into a demo-machine YAML spec. Reuses test coverage as demo scripts.
Translate all narration text in a demo-machine spec to another language, producing a localized copy.
| name | heal-spec |
| description | Automatically fix a broken demo-machine spec by analyzing failure artifacts (screenshots, DOM, error logs). Use when a demo fails after a UI change. |
| argument-hint | <spec-file> [--output-dir ./output] |
| allowed-tools | Read, Write, Edit, Glob, Grep, Bash(node *), Bash(pnpm *), Bash(npx *) |
When a demo spec fails (selector not found, assertion failed, navigation error), analyze the failure context and automatically fix the spec. This turns UI changes from demo-breaking events into auto-resolved patches.
$ARGUMENTS should include a path to the failing .demo.yaml spec file.--output-dir to specify where failure artifacts are (default: ./output).*.demo.yaml files and recent failure artifacts.Demo-machine produces these artifacts on failure (check the output directory):
| File | Contents |
|---|---|
failure.json | Error details: step index, chapter, selector, error message |
failure.png | Screenshot at the moment of failure |
failure.html | Full page HTML at the moment of failure |
events.json | All successful action events before the failure |
trace.zip | Playwright trace (open with npx playwright show-trace) |
failure.json for the error type, failed step, and selectorfailure.html to understand the current page DOMfailure.png to see the visual state at failure| Failure Type | Signal | Likely Fix |
|---|---|---|
| Selector changed | TimeoutError on locator.waitFor | Update CSS selector or switch to target (role/text/testId) |
| Text changed | assert step fails text match | Update expected text in assertion |
| Element moved | Selector exists but action fails | Element may need scroll, wait, or updated selector path |
| New modal/overlay | Click intercepted or element obscured | Add a dismiss step before the failing action |
| Page structure changed | Multiple selectors broken | Larger refactor — update chapter steps |
| Timing issue | Intermittent failures | Add wait step or increase timeoutMs |
| URL changed | Navigation error | Update navigate URL and runner.url |
Prefer resilient selectors: When fixing a broken CSS selector, upgrade to a target block:
# Before (fragile)
- action: click
selector: ".btn-primary.submit-form"
# After (resilient)
- action: click
target:
by: role
role: button
name: "Submit"
Selector priority (most to least stable):
by: testId — data-testid attributes (most stable)by: role + name — ARIA roles (accessible, stable)by: label — Form labels (stable for form elements)by: text — Visible text (stable if text doesn't change often)selector (CSS) — Last resort, most fragileAfter applying changes:
node dist/cli.js validate <spec.yaml>
Then attempt a re-run:
node dist/cli.js run <spec.yaml> --output ./output --no-headless --verbose
failure.json, failure.html, failure.png, events.json)failure.html) — find what the selector should be nownode dist/cli.js validate <spec.yaml>node dist/cli.js run <spec.yaml> --output ./output --no-headlessError: TimeoutError: locator.waitFor: Timeout 5000ms exceeded. Waiting for locator('.submit-btn')
Analysis of failure.html: Button text changed from "Submit" to "Save Changes", class changed from submit-btn to btn-save.
Fix applied:
# Before
- action: click
selector: ".submit-btn"
narration: "Click Submit to save."
# After
- action: click
target:
by: role
role: button
name: "Save Changes"
narration: "Click Save Changes to persist our updates."
Arguments: $ARGUMENTS