demo2skill
Synthesize a SKILL.md from a recorded demonstration of a task. This is the “Record & Replay” parity piece: the user shows the workflow once (in a recorded shell, or via Chrome’s Recorder), and this skill turns the recording into a skill draft — rather than /skillify, which reads the conversation.
Subscription-safe: all synthesis runs in this Claude session (or a headless claude -p child with ANTHROPIC_API_KEY scrubbed). Never call a paid API.
Modes (one command to remember: /demo2skill)
/demo2skill record [slug]— start a recording. The recorder wrapsscriptand needs a live terminal, which cannot run inside a tool call. So this mode prints the paste-ready command for the user to run in their own prompt:!~/.claude/scripts/demo-record.sh <slug>(the leading!runs it in the user’s session). Tell them: run it, do the task, typeexit, then come back and run/demo2skillto synthesize. Default slugdemo./demo2skill(no args) — synthesize from the newest recording (auto-detect)./demo2skill --cli <transcript.log>— synthesize from a specific transcript./demo2skill --browser <export.json>— synthesize from a Chrome DevTools Recorder export.
Inputs
--cli <transcript.log>(default) — a transcript from~/.claude/scripts/demo-record.sh.--browser <export.json>— a Chrome DevTools Recorder export (Puppeteer/JSON flow).- No path → auto-detect the newest file in
./.omc/artifacts/demos/then~/.claude/demos/.
Workflow — CLI layer (--cli)
- Clean the transcript:
~/.claude/skills/demo2skill/scripts/clean-transcript.sh <transcript.log>(strips ANSI/control noise +scriptbanners). - Extract from the cleaned text: the ordered command sequence, the working directory/branch context, and any obvious decision points (a command that was retried, edited, or followed a failure).
- Quality gate (from skillify): proceed only if all true — “couldn’t be Googled in 5 min”, “specific to this user/project/workflow”, “took real operational effort”. If it fails, say so and stop — don’t make a slop skill.
- Ask ≤2 clarifying questions via AskUserQuestion: (a) what are the inputs/variables that change between runs? (b) what is the success criterion? Keep it to two.
- Synthesize a
SKILL.mdinto~/.claude/skills/<new-slug>/SKILL.mdusing the frontmatter shape below. Body = Goal, Inputs, ordered Steps (the extracted commands, generalized with the variables from step 4), Verification, Pitfalls.
Workflow — browser layer (--browser)
Honest constraint: the
chrome-devtoolsMCP drives the browser; it cannot passively log a human’s clicks. The capture bridge is Chrome’s built-in Recorder panel (DevTools → Recorder → record → export as JSON). This skill ingests that export.
- Parse the Recorder JSON: each
steps[]entry has atype(navigate|click|change|keyDown|waitForElement|setViewport) andselectors/url/value. Readtitle+steps. - Translate into a human-readable procedure (one line per meaningful step; collapse
setViewport/keyDownnoise). - Quality gate + ≤2 clarifying questions as above.
- Synthesize
SKILL.mdwith: the readable procedure, plus an optional Playback section expressing the steps aschrome-devtoolsMCP calls (navigate_page → click → wait_for) or a Playwright snippet, so the skill can re-run the flow later.
Output frontmatter (required)
---
name: <kebab-slug>
description: >
<what it does> Triggers: "<phrase>", "<phrase>". Do NOT use for <anti-trigger>.
metadata:
user-invocable: true
slash-command: /<slug>
---
description MUST be < 1024 chars and lead with verbs + triggers (per the user’s skill-authoring convention).
Pre-ship checklist (from skill-authoring)
- Description leads with what it does + concrete trigger phrases + an anti-trigger.
- Steps are generalized (variables, not the literal one-off values from the demo).
- A Verification section exists and is runnable.
- No secrets/tokens copied verbatim from the transcript — redact to
${ENV_VAR}. - Slug directory is
~/.claude/skills/<slug>/withSKILL.md(exact case).
Related
/skillify— conversation-based extraction (no recording).~/.claude/scripts/demo-record.sh— produces the CLI transcript this consumes.