[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M730X0RVAPEWJBHTD3Q1B9AN":3,"skill-same:01M730X0RVAPEWJBHTD3Q1B9AN":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M730X0RVAPEWJBHTD3Q1B9AN","ui-demo",null,"Record polished UI demo videos using Playwright. Use when the user asks to create a demo, walkthrough, screen recording, or tutorial video of a web application. Produces WebM videos with visible cursor, natural pacing, and professional feel.","SriramGandhiS\u002FSkills","SriramGandhiS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F211849986?v=4","01M72WQCW12BYX71C6WN584TTA","Sriram S","01M72WQCWTJ2RD0ET1X31AF1RC",1,"MIT","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fskills\u002Feverything-claude-code\u002Fskills\u002Fui-demo\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: ui-demo\ndescription: Record polished UI demo videos using Playwright. Use when the user asks to create a demo, walkthrough, screen recording, or tutorial video of a web application. Produces WebM videos with visible cursor, natural pacing, and professional feel.\norigin: ECC\n---\n\n# UI Demo Video Recorder\n\nRecord polished demo videos of web applications using Playwright's video recording with an injected cursor overlay, natural pacing, and storytelling flow.\n\n## When to Use\n\n- User asks for a \"demo video\", \"screen recording\", \"walkthrough\", or \"tutorial\"\n- User wants to showcase a feature or workflow visually\n- User needs a video for documentation, onboarding, or stakeholder presentation\n\n## Three-Phase Process\n\nEvery demo goes through three phases: **Discover -> Rehearse -> Record**. Never skip straight to recording.\n\n---\n\n## Phase 1: Discover\n\nBefore writing any script, explore the target pages to understand what is actually there.\n\n### Why\n\nYou cannot script what you have not seen. Fields may be `\u003Cinput>` not `\u003Ctextarea>`, dropdowns may be custom components not `\u003Cselect>`, and comment boxes may support `@mentions` or `#tags`. Assumptions break recordings silently.\n\n### How\n\nNavigate to each page in the flow and dump its interactive elements:\n\n```javascript\n\u002F\u002F Run this for each page in the flow BEFORE writing the demo script\nconst fields = await page.evaluate(() => {\n  const els = [];\n  document.querySelectorAll('input, select, textarea, button, [contenteditable]').forEach(el => {\n    if (el.offsetParent !== null) {\n      els.push({\n        tag: el.tagName,\n        type: el.type || '',\n        name: el.name || '',\n        placeholder: el.placeholder || '',\n        text: el.textContent?.trim().substring(0, 40) || '',\n        contentEditable: el.contentEditable === 'true',\n        role: el.getAttribute('role') || '',\n      });\n    }\n  });\n  return els;\n});\nconsole.log(JSON.stringify(fields, null, 2));\n```\n\n### What to look for\n\n- **Form fields**: Are they `\u003Cselect>`, `\u003Cinput>`, custom dropdowns, or comboboxes?\n- **Select options**: Dump option values AND text. Placeholders often have `value=\"0\"` or `value=\"\"` which looks non-empty. Use `Array.from(el.options).map(o => ({ value: o.value, text: o.text }))`. Skip options where text includes \"Select\" or value is `\"0\"`.\n- **Rich text**: Does the comment box support `@mentions`, `#tags`, markdown, or emoji? Check placeholder text.\n- **Required fields**: Which fields block form submission? Check `required`, `*` in labels, and try submitting empty to see validation errors.\n- **Dynamic content**: Do fields appear after other fields are filled?\n- **Button labels**: Exact text such as `\"Submit\"`, `\"Submit Request\"`, or `\"Send\"`.\n- **Table column headers**: For table-driven modals, map each `input[type=\"number\"]` to its column header instead of assuming all numeric inputs mean the same thing.\n\n### Output\n\nA field map for each page, used to write correct selectors in the script. Example:\n\n```text\n\u002Fpurchase-requests\u002Fnew:\n  - Budget Code: \u003Cselect> (first select on page, 4 options)\n  - Desired Delivery: \u003Cinput type=\"date\">\n  - Context: \u003Ctextarea> (not input)\n  - BOM table: inline-editable cells with span.cursor-pointer -> input pattern\n  - Submit: \u003Cbutton> text=\"Submit\"\n\n\u002Fpurchase-requests\u002FN (detail):\n  - Comment: \u003Cinput placeholder=\"Type a message...\"> supports @user and #PR tags\n  - Send: \u003Cbutton> text=\"Send\" (disabled until input has content)\n```\n\n---\n\n## Phase 2: Rehearse\n\nRun through all steps without recording. Verify every selector resolves.\n\n### Why\n\nSilent selector failures are the main reason demo recordings break. Rehearsal catches them before you waste a recording.\n\n### How\n\nUse `ensureVisible`, a wrapper that logs and fails loudly:\n\n```javascript\nasync function ensureVisible(page, locator, label) {\n  const el = typeof locator === 'string' ? page.locator(locator).first() : locator;\n  const visible = await el.isVisible().catch(() => false);\n  if (!visible) {\n    const msg = `REHEARSAL FAIL: \"${label}\" not found - selector: ${typeof locator === 'string' ? locator : '(locator object)'}`;\n    console.error(msg);\n    const found = await page.evaluate(() => {\n      return Array.from(document.querySelectorAll('button, input, select, textarea, a'))\n        .filter(el => el.offsetParent !== null)\n        .map(el => `${el.tagName}[${el.type || ''}] \"${el.textContent?.trim().substring(0, 30)}\"`)\n        .join('\\n  ');\n    });\n    console.error('  Visible elements:\\n  ' + found);\n    return false;\n  }\n  console.log(`REHEARSAL OK: \"${label}\"`);\n  return true;\n}\n```\n\n### Rehearsal script structure\n\n```javascript\nconst steps = [\n  { label: 'Login email field', selector: '#email' },\n  { label: 'Login submit', selector: 'button[type=\"submit\"]' },\n  { label: 'New Request button', selector: 'button:has-text(\"New Request\")' },\n  { label: 'Budget Code select', selector: 'select' },\n  { label: 'Delivery date', selector: 'input[type=\"date\"]:visible' },\n  { label: 'Description field', selector: 'textarea:visible' },\n  { label: 'Add Item button', selector: 'button:has-text(\"Add Item\")' },\n  { label: 'Submit button', selector: 'button:has-text(\"Submit\")' },\n];\n\nlet allOk = true;\nfor (const step of steps) {\n  if (!await ensureVisible(page, step.selector, step.label)) {\n    allOk = false;\n  }\n}\nif (!allOk) {\n  console.error('REHEARSAL FAILED - fix selectors before recording');\n  process.exit(1);\n}\nconsole.log('REHEARSAL PASSED - all selectors verified');\n```\n\n### When rehearsal fails\n\n1. Read the visible-element dump.\n2. Find the correct selector.\n3. Update the script.\n4. Re-run rehearsal.\n5. Only proceed when every selector passes.\n\n---\n\n## Phase 3: Record\n\nOnly after discovery and rehearsal pass should you create the recording.\n\n### Recording Principles\n\n#### 1. Storytelling Flow\n\nPlan the video as a story. Follow user-specified order, or use this default:\n\n- **Entry**: Login or navigate to the starting point\n- **Context**: Pan the surroundings so viewers orient themselves\n- **Action**: Perform the main workflow steps\n- **Variation**: Show a secondary feature such as settings, theme, or localization\n- **Result**: Show the outcome, confirmation, or new state\n\n#### 2. Pacing\n\n- After login: `4s`\n- After navigation: `3s`\n- After clicking a button: `2s`\n- Between major steps: `1.5-2s`\n- After the final action: `3s`\n- Typing delay: `25-40ms` per character\n\n#### 3. Cursor Overlay\n\nInject an SVG arrow cursor that follows mouse movements:\n\n```javascript\nasync function injectCursor(page) {\n  await page.evaluate(() => {\n    if (document.getElementById('demo-cursor')) return;\n    const cursor = document.createElement('div');\n    cursor.id = 'demo-cursor';\n    cursor.innerHTML = `\u003Csvg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\">\n      \u003Cpath d=\"M5 3L19 12L12 13L9 20L5 3Z\" fill=\"white\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"\u002F>\n    \u003C\u002Fsvg>`;\n    cursor.style.cssText = `\n      position: fixed; z-index: 999999; pointer-events: none;\n      width: 24px; height: 24px;\n      transition: left 0.1s, top 0.1s;\n      filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));\n    `;\n    cursor.style.left = '0px';\n    cursor.style.top = '0px';\n    document.body.appendChild(cursor);\n    document.addEventListener('mousemove', (e) => {\n      cursor.style.left = e.clientX + 'px';\n      cursor.style.top = e.clientY + 'px';\n    });\n  });\n}\n```\n\nCall `injectCursor(page)` after every page navigation because the overlay is destroyed on navigate.\n\n#### 4. Mouse Movement\n\nNever teleport the cursor. Move to the target before clicking:\n\n```javascript\nasync function moveAndClick(page, locator, label, opts = {}) {\n  const { postClickDelay = 800, ...clickOpts } = opts;\n  const el = typeof locator === 'string' ? page.locator(locator).first() : locator;\n  const visible = await el.isVisible().catch(() => false);\n  if (!visible) {\n    console.error(`WARNING: moveAndClick skipped - \"${label}\" not visible`);\n    return false;\n  }\n  try {\n    await el.scrollIntoViewIfNeeded();\n    await page.waitForTimeout(300);\n    const box = await el.boundingBox();\n    if (box) {\n      await page.mouse.move(box.x + box.width \u002F 2, box.y + box.height \u002F 2, { steps: 10 });\n      await page.waitForTimeout(400);\n    }\n    await el.click(clickOpts);\n  } catch (e) {\n    console.error(`WARNING: moveAndClick failed on \"${label}\": ${e.message}`);\n    return false;\n  }\n  await page.waitForTimeout(postClickDelay);\n  return true;\n}\n```\n\nEvery call should include a descriptive `label` for debugging.\n\n#### 5. Typing\n\nType visibly, not instant-fill:\n\n```javascript\nasync function typeSlowly(page, locator, text, label, charDelay = 35) {\n  const el = typeof locator === 'string' ? page.locator(locator).first() : locator;\n  const visible = await el.isVisible().catch(() => false);\n  if (!visible) {\n    console.error(`WARNING: typeSlowly skipped - \"${label}\" not visible`);\n    return false;\n  }\n  await moveAndClick(page, el, label);\n  await el.fill('');\n  await el.pressSequentially(text, { delay: charDelay });\n  await page.waitForTimeout(500);\n  return true;\n}\n```\n\n#### 6. Scrolling\n\nUse smooth scroll instead of jumps:\n\n```javascript\nawait page.evaluate(() => window.scrollTo({ top: 400, behavior: 'smooth' }));\nawait page.waitForTimeout(1500);\n```\n\n#### 7. Dashboard Panning\n\nWhen showing a dashboard or overview page, move the cursor across key elements:\n\n```javascript\nasync function panElements(page, selector, maxCount = 6) {\n  const elements = await page.locator(selector).all();\n  for (let i = 0; i \u003C Math.min(elements.length, maxCount); i++) {\n    try {\n      const box = await elements[i].boundingBox();\n      if (box && box.y \u003C 700) {\n        await page.mouse.move(box.x + box.width \u002F 2, box.y + box.height \u002F 2, { steps: 8 });\n        await page.waitForTimeout(600);\n      }\n    } catch (e) {\n      console.warn(`WARNING: panElements skipped element ${i} (selector: \"${selector}\"): ${e.message}`);\n    }\n  }\n}\n```\n\n#### 8. Subtitles\n\nInject a subtitle bar at the bottom of the viewport:\n\n```javascript\nasync function injectSubtitleBar(page) {\n  await page.evaluate(() => {\n    if (document.getElementById('demo-subtitle')) return;\n    const bar = document.createElement('div');\n    bar.id = 'demo-subtitle';\n    bar.style.cssText = `\n      position: fixed; bottom: 0; left: 0; right: 0; z-index: 999998;\n      text-align: center; padding: 12px 24px;\n      background: rgba(0, 0, 0, 0.75);\n      color: white; font-family: -apple-system, \"Segoe UI\", sans-serif;\n      font-size: 16px; font-weight: 500; letter-spacing: 0.3px;\n      transition: opacity 0.3s;\n      pointer-events: none;\n    `;\n    bar.textContent = '';\n    bar.style.opacity = '0';\n    document.body.appendChild(bar);\n  });\n}\n\nasync function showSubtitle(page, text) {\n  await page.evaluate((t) => {\n    const bar = document.getElementById('demo-subtitle');\n    if (!bar) return;\n    if (t) {\n      bar.textContent = t;\n      bar.style.opacity = '1';\n    } else {\n      bar.style.opacity = '0';\n    }\n  }, text);\n  if (text) await page.waitForTimeout(800);\n}\n```\n\nCall `injectSubtitleBar(page)` alongside `injectCursor(page)` after every navigation.\n\nUsage pattern:\n\n```javascript\nawait showSubtitle(page, 'Step 1 - Logging in');\nawait showSubtitle(page, 'Step 2 - Dashboard overview');\nawait showSubtitle(page, '');\n```\n\nGuidelines:\n\n- Keep subtitle text short, ideally under 60 characters.\n- Use `Step N - Action` format for consistency.\n- Clear the subtitle during long pauses where the UI can speak for itself.\n\n## Script Template\n\n```javascript\n'use strict';\nconst { chromium } = require('playwright');\nconst path = require('path');\nconst fs = require('fs');\n\nconst BASE_URL = process.env.QA_BASE_URL || 'http:\u002F\u002Flocalhost:3000';\nconst VIDEO_DIR = path.join(__dirname, 'screenshots');\nconst OUTPUT_NAME = 'demo-FEATURE.webm';\nconst REHEARSAL = process.argv.includes('--rehearse');\n\n\u002F\u002F Paste injectCursor, injectSubtitleBar, showSubtitle, moveAndClick,\n\u002F\u002F typeSlowly, ensureVisible, and panElements here.\n\n(async () => {\n  const browser = await chromium.launch({ headless: true });\n\n  if (REHEARSAL) {\n    const context = await browser.newContext({ viewport: { width: 1280, height: 720 } });\n    const page = await context.newPage();\n    \u002F\u002F Navigate through the flow and run ensureVisible for each selector.\n    await browser.close();\n    return;\n  }\n\n  const context = await browser.newContext({\n    recordVideo: { dir: VIDEO_DIR, size: { width: 1280, height: 720 } },\n    viewport: { width: 1280, height: 720 }\n  });\n  const page = await context.newPage();\n\n  try {\n    await injectCursor(page);\n    await injectSubtitleBar(page);\n\n    await showSubtitle(page, 'Step 1 - Logging in');\n    \u002F\u002F login actions\n\n    await page.goto(`${BASE_URL}\u002Fdashboard`);\n    await injectCursor(page);\n    await injectSubtitleBar(page);\n    await showSubtitle(page, 'Step 2 - Dashboard overview');\n    \u002F\u002F pan dashboard\n\n    await showSubtitle(page, 'Step 3 - Main workflow');\n    \u002F\u002F action sequence\n\n    await showSubtitle(page, 'Step 4 - Result');\n    \u002F\u002F final reveal\n    await showSubtitle(page, '');\n  } catch (err) {\n    console.error('DEMO ERROR:', err.message);\n  } finally {\n    await context.close();\n    const video = page.video();\n    if (video) {\n      const src = await video.path();\n      const dest = path.join(VIDEO_DIR, OUTPUT_NAME);\n      try {\n        fs.copyFileSync(src, dest);\n        console.log('Video saved:', dest);\n      } catch (e) {\n        console.error('ERROR: Failed to copy video:', e.message);\n        console.error('  Source:', src);\n        console.error('  Destination:', dest);\n      }\n    }\n    await browser.close();\n  }\n})();\n```\n\nUsage:\n\n```bash\n# Phase 2: Rehearse\nnode demo-script.cjs --rehearse\n\n# Phase 3: Record\nnode demo-script.cjs\n```\n\n## Checklist Before Recording\n\n- [ ] Discovery phase completed\n- [ ] Rehearsal passes with all selectors OK\n- [ ] Headless mode enabled\n- [ ] Resolution set to `1280x720`\n- [ ] Cursor and subtitle overlays re-injected after every navigation\n- [ ] `showSubtitle(page, 'Step N - ...')` used at major transitions\n- [ ] `moveAndClick` used for all clicks with descriptive labels\n- [ ] `typeSlowly` used for visible input\n- [ ] No silent catches; helpers log warnings\n- [ ] Smooth scrolling used for content reveal\n- [ ] Key pauses are visible to a human viewer\n- [ ] Flow matches the requested story order\n- [ ] Script reflects the actual UI discovered in phase 1\n\n## Common Pitfalls\n\n1. Cursor disappears after navigation - re-inject it.\n2. Video is too fast - add pauses.\n3. Cursor is a dot instead of an arrow - use the SVG overlay.\n4. Cursor teleports - move before clicking.\n5. Select dropdowns look wrong - show the move, then pick the option.\n6. Modals feel abrupt - add a read pause before confirming.\n7. Video file path is random - copy it to a stable output name.\n8. Selector failures are swallowed - never use silent catch blocks.\n9. Field types were assumed - discover them first.\n10. Features were assumed - inspect the actual UI before scripting.\n11. Placeholder select values look real - watch for `\"0\"` and `\"Select...\"`.\n12. Popups create separate videos - capture popup pages explicitly and merge later if needed.\n","# UI Demo Video Recorder\n\nRecord polished demo videos of web applications using Playwright's video recording with an injected cursor overlay, natural pacing, and storytelling flow.\n\n## When to Use\n\n- User asks for a \"demo video\", \"screen recording\", \"walkthrough\", or \"tutorial\"\n- User wants to showcase a feature or workflow visually\n- User needs a video for documentation, onboarding, or stakeholder presentation\n\n## Three-Phase Process\n\nEvery demo goes through three phases: **Discover -> Rehearse -> Record**. Never skip straight to recording.\n\n---\n\n## Phase 1: Discover\n\nBefore writing any script, explore the target pages to understand what is actually there.\n\n### Why\n\nYou cannot script what you have not seen. Fields may be `\u003Cinput>` not `\u003Ctextarea>`, dropdowns may be custom components not `\u003Cselect>`, and comment boxes may support `@mentions` or `#tags`. Assumptions break recordings silently.\n\n### How\n\nNavigate to each page in the flow and dump its interactive elements:\n\n```javascript\n\u002F\u002F Run this for each page in the flow BEFORE writing the demo script\nconst fields = await page.evaluate(() => {\n  const els = [];\n  document.querySelectorAll('input, select, textarea, button, [contenteditable]').forEach(el => {\n    if (el.offsetParent !== null) {\n      els.push({\n        tag: el.tagName,\n        type: el.type || '',\n        name: el.name || '',\n        placeholder: el.placeholder || '',\n        text: el.textContent?.trim().substring(0, 40) || '',\n        contentEditable: el.contentEditable === 'true',\n        role: el.getAttribute('role') || '',\n      });\n    }\n  });\n  return els;\n});\nconsole.log(JSON.stringify(fields, null, 2));\n```\n\n### What to look for\n\n- **Form fields**: Are they `\u003Cselect>`, `\u003Cinput>`, custom dropdowns, or comboboxes?\n- **Select options**: Dump option values AND text. Placeholders often have `value=\"0\"` or `value=\"\"` which looks non-empty. Use `Array.from(el.options).map(o => ({ value: o.value, text: o.text }))`. Skip options where text includes \"Select\" or value is `\"0\"`.\n- **Rich text**: Does the comment box support `@mentions`, `#tags`, markdown, or emoji? Check placeholder text.\n- **Required fields**: Which fields block form submission? Check `required`, `*` in labels, and try submitting empty to see validation errors.\n- **Dynamic content**: Do fields appear after other fields are filled?\n- **Button labels**: Exact text such as `\"Submit\"`, `\"Submit Request\"`, or `\"Send\"`.\n- **Table column headers**: For table-driven modals, map each `input[type=\"number\"]` to its column header instead of assuming all numeric inputs mean the same thing.\n\n### Output\n\nA field map for each page, used to write correct selectors in the script. Example:\n\n```text\n\u002Fpurchase-requests\u002Fnew:\n  - Budget Code: \u003Cselect> (first select on page, 4 options)\n  - Desired Delivery: \u003Cinput type=\"date\">\n  - Context: \u003Ctextarea> (not input)\n  - BOM table: inline-editable cells with span.cursor-pointer -> input pattern\n  - Submit: \u003Cbutton> text=\"Submit\"\n\n\u002Fpurchase-requests\u002FN (detail):\n  - Comment: \u003Cinput placeholder=\"Type a message...\"> supports @user and #PR tags\n  - Send: \u003Cbutton> text=\"Send\" (disabled until input has content)\n```\n\n---\n\n## Phase 2: Rehearse\n\nRun through all steps without recording. Verify every selector resolves.\n\n### Why\n\nSilent selector failures are the main reason demo recordings break. Rehearsal catches them before you waste a recording.\n\n### How\n\nUse `ensureVisible`, a wrapper that logs and fails loudly:\n\n```javascript\nasync function ensureVisible(page, locator, label) {\n  const el = typeof locator === 'string' ? page.locator(locator).first() : locator;\n  const visible = await el.isVisible().catch(() => false);\n  if (!visible) {\n    const msg = `REHEARSAL FAIL: \"${label}\" not found - selector: ${typeof locator === 'string' ? locator : '(locator object)'}`;\n    console.error(msg);\n    const found = await page.evaluate(() => {\n      return Array.from(document.querySelectorAll('button, input, select, textarea, a'))\n        .filter(el => el.offsetParent !== null)\n        .map(el => `${el.tagName}[${el.type || ''}] \"${el.textContent?.trim().substring(0, 30)}\"`)\n        .join('\\n  ');\n    });\n    console.error('  Visible elements:\\n  ' + found);\n    return false;\n  }\n  console.log(`REHEARSAL OK: \"${label}\"`);\n  return true;\n}\n```\n\n### Rehearsal script structure\n\n```javascript\nconst steps = [\n  { label: 'Login email field', selector: '#email' },\n  { label: 'Login submit', selector: 'button[type=\"submit\"]' },\n  { label: 'New Request button', selector: 'button:has-text(\"New Request\")' },\n  { label: 'Budget Code select', selector: 'select' },\n  { label: 'Delivery date', selector: 'input[type=\"date\"]:visible' },\n  { label: 'Description field', selector: 'textarea:visible' },\n  { label: 'Add Item button', selector: 'button:has-text(\"Add Item\")' },\n  { label: 'Submit button', selector: 'button:has-text(\"Submit\")' },\n];\n\nlet allOk = true;\nfor (const step of steps) {\n  if (!await ensureVisible(page, step.selector, step.label)) {\n    allOk = false;\n  }\n}\nif (!allOk) {\n  console.error('REHEARSAL FAILED - fix selectors before recording');\n  process.exit(1);\n}\nconsole.log('REHEARSAL PASSED - all selectors verified');\n```\n\n### When rehearsal fails\n\n1. Read the visible-element dump.\n2. Find the correct selector.\n3. Update the script.\n4. Re-run rehearsal.\n5. Only proceed when every selector passes.\n\n---\n\n## Phase 3: Record\n\nOnly after discovery and rehearsal pass should you create the recording.\n\n### Recording Principles\n\n#### 1. Storytelling Flow\n\nPlan the video as a story. Follow user-specified order, or use this default:\n\n- **Entry**: Login or navigate to the starting point\n- **Context**: Pan the surroundings so viewers orient themselves\n- **Action**: Perform the main workflow steps\n- **Variation**: Show a secondary feature such as settings, theme, or localization\n- **Result**: Show the outcome, confirmation, or new state\n\n#### 2. Pacing\n\n- After login: `4s`\n- After navigation: `3s`\n- After clicking a button: `2s`\n- Between major steps: `1.5-2s`\n- After the final action: `3s`\n- Typing delay: `25-40ms` per character\n\n#### 3. Cursor Overlay\n\nInject an SVG arrow cursor that follows mouse movements:\n\n```javascript\nasync function injectCursor(page) {\n  await page.evaluate(() => {\n    if (document.getElementById('demo-cursor')) return;\n    const cursor = document.createElement('div');\n    cursor.id = 'demo-cursor';\n    cursor.innerHTML = `\u003Csvg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\u002F\u002Fwww.w3.org\u002F2000\u002Fsvg\">\n      \u003Cpath d=\"M5 3L19 12L12 13L9 20L5 3Z\" fill=\"white\" stroke=\"black\" stroke-width=\"1.5\" stroke-linejoin=\"round\"\u002F>\n    \u003C\u002Fsvg>`;\n    cursor.style.cssText = `\n      position: fixed; z-index: 999999; pointer-events: none;\n      width: 24px; height: 24px;\n      transition: left 0.1s, top 0.1s;\n      filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.3));\n    `;\n    cursor.style.left = '0px';\n    cursor.style.top = '0px';\n    document.body.appendChild(cursor);\n    document.addEventListener('mousemove', (e) => {\n      cursor.style.left = e.clientX + 'px';\n      cursor.style.top = e.clientY + 'px';\n    });\n  });\n}\n```\n\nCall `injectCursor(page)` after every page navigation because the overlay is destroyed on navigate.\n\n#### 4. Mouse Movement\n\nNever teleport the cursor. Move to the target before clicking:\n\n```javascript\nasync function moveAndClick(page, locator, label, opts = {}) {\n  const { postClickDelay = 800, ...clickOpts } = opts;\n  const el = typeof locator === 'string' ? page.locator(locator).first() : locator;\n  const visible = await el.isVisible().catch(() => false);\n  if (!visible) {\n    console.error(`WARNING: moveAndClick skipped - \"${label}\" not visible`);\n    return false;\n  }\n  try {\n    await el.scrollIntoViewIfNeeded();\n    await page.waitForTimeout(300);\n    const box = await el.boundingBox();\n    if (box) {\n      await page.mouse.move(box.x + box.width \u002F 2, box.y + box.height \u002F 2, { steps: 10 });\n      await page.waitForTimeout(400);\n    }\n    await el.click(clickOpts);\n  } catch (e) {\n    console.error(`WARNING: moveAndClick failed on \"${label}\": ${e.message}`);\n    return false;\n  }\n  await page.waitForTimeout(postClickDelay);\n  return true;\n}\n```\n\nEvery call should include a descriptive `label` for debugging.\n\n#### 5. Typing\n\nType visibly, not instant-fill:\n\n```javascript\nasync function typeSlowly(page, locator, text, label, charDelay = 35) {\n  const el = typeof locator === 'string' ? page.locator(locator).first() : locator;\n  const visible = await el.isVisible().catch(() => false);\n  if (!visible) {\n    console.error(`WARNING: typeSlowly skipped - \"${label}\" not visible`);\n    return false;\n  }\n  await moveAndClick(page, el, label);\n  await el.fill('');\n  await el.pressSequentially(text, { delay: charDelay });\n  await page.waitForTimeout(500);\n  return true;\n}\n```\n\n#### 6. Scrolling\n\nUse smooth scroll instead of jumps:\n\n```javascript\nawait page.evaluate(() => window.scrollTo({ top: 400, behavior: 'smooth' }));\nawait page.waitForTimeout(1500);\n```\n\n#### 7. Dashboard Panning\n\nWhen showing a dashboard or overview page, move the cursor across key elements:\n\n```javascript\nasync function panElements(page, selector, maxCount = 6) {\n  const elements = await page.locator(selector).all();\n  for (let i = 0; i \u003C Math.min(elements.length, maxCount); i++) {\n    try {\n      const box = await elements[i].boundingBox();\n      if (box && box.y \u003C 700) {\n        await page.mouse.move(box.x + box.width \u002F 2, box.y + box.height \u002F 2, { steps: 8 });\n        await page.waitForTimeout(600);\n      }\n    } catch (e) {\n      console.warn(`WARNING: panElements skipped element ${i} (selector: \"${selector}\"): ${e.message}`);\n    }\n  }\n}\n```\n\n#### 8. Subtitles\n\nInject a subtitle bar at the bottom of the viewport:\n\n```javascript\nasync function injectSubtitleBar(page) {\n  await page.evaluate(() => {\n    if (document.getElementById('demo-subtitle')) return;\n    const bar = document.createElement('div');\n    bar.id = 'demo-subtitle';\n    bar.style.cssText = `\n      position: fixed; bottom: 0; left: 0; right: 0; z-index: 999998;\n      text-align: center; padding: 12px 24px;\n      background: rgba(0, 0, 0, 0.75);\n      color: white; font-family: -apple-system, \"Segoe UI\", sans-serif;\n      font-size: 16px; font-weight: 500; letter-spacing: 0.3px;\n      transition: opacity 0.3s;\n      pointer-events: none;\n    `;\n    bar.textContent = '';\n    bar.style.opacity = '0';\n    document.body.appendChild(bar);\n  });\n}\n\nasync function showSubtitle(page, text) {\n  await page.evaluate((t) => {\n    const bar = document.getElementById('demo-subtitle');\n    if (!bar) return;\n    if (t) {\n      bar.textContent = t;\n      bar.style.opacity = '1';\n    } else {\n      bar.style.opacity = '0';\n    }\n  }, text);\n  if (text) await page.waitForTimeout(800);\n}\n```\n\nCall `injectSubtitleBar(page)` alongside `injectCursor(page)` after every navigation.\n\nUsage pattern:\n\n```javascript\nawait showSubtitle(page, 'Step 1 - Logging in');\nawait showSubtitle(page, 'Step 2 - Dashboard overview');\nawait showSubtitle(page, '');\n```\n\nGuidelines:\n\n- Keep subtitle text short, ideally under 60 characters.\n- Use `Step N - Action` format for consistency.\n- Clear the subtitle during long pauses where the UI can speak for itself.\n\n## Script Template\n\n```javascript\n'use strict';\nconst { chromium } = require('playwright');\nconst path = require('path');\nconst fs = require('fs');\n\nconst BASE_URL = process.env.QA_BASE_URL || 'http:\u002F\u002Flocalhost:3000';\nconst VIDEO_DIR = path.join(__dirname, 'screenshots');\nconst OUTPUT_NAME = 'demo-FEATURE.webm';\nconst REHEARSAL = process.argv.includes('--rehearse');\n\n\u002F\u002F Paste injectCursor, injectSubtitleBar, showSubtitle, moveAndClick,\n\u002F\u002F typeSlowly, ensureVisible, and panElements here.\n\n(async () => {\n  const browser = await chromium.launch({ headless: true });\n\n  if (REHEARSAL) {\n    const context = await browser.newContext({ viewport: { width: 1280, height: 720 } });\n    const page = await context.newPage();\n    \u002F\u002F Navigate through the flow and run ensureVisible for each selector.\n    await browser.close();\n    return;\n  }\n\n  const context = await browser.newContext({\n    recordVideo: { dir: VIDEO_DIR, size: { width: 1280, height: 720 } },\n    viewport: { width: 1280, height: 720 }\n  });\n  const page = await context.newPage();\n\n  try {\n    await injectCursor(page);\n    await injectSubtitleBar(page);\n\n    await showSubtitle(page, 'Step 1 - Logging in');\n    \u002F\u002F login actions\n\n    await page.goto(`${BASE_URL}\u002Fdashboard`);\n    await injectCursor(page);\n    await injectSubtitleBar(page);\n    await showSubtitle(page, 'Step 2 - Dashboard overview');\n    \u002F\u002F pan dashboard\n\n    await showSubtitle(page, 'Step 3 - Main workflow');\n    \u002F\u002F action sequence\n\n    await showSubtitle(page, 'Step 4 - Result');\n    \u002F\u002F final reveal\n    await showSubtitle(page, '');\n  } catch (err) {\n    console.error('DEMO ERROR:', err.message);\n  } finally {\n    await context.close();\n    const video = page.video();\n    if (video) {\n      const src = await video.path();\n      const dest = path.join(VIDEO_DIR, OUTPUT_NAME);\n      try {\n        fs.copyFileSync(src, dest);\n        console.log('Video saved:', dest);\n      } catch (e) {\n        console.error('ERROR: Failed to copy video:', e.message);\n        console.error('  Source:', src);\n        console.error('  Destination:', dest);\n      }\n    }\n    await browser.close();\n  }\n})();\n```\n\nUsage:\n\n```bash\n# Phase 2: Rehearse\nnode demo-script.cjs --rehearse\n\n# Phase 3: Record\nnode demo-script.cjs\n```\n\n## Checklist Before Recording\n\n- [ ] Discovery phase completed\n- [ ] Rehearsal passes with all selectors OK\n- [ ] Headless mode enabled\n- [ ] Resolution set to `1280x720`\n- [ ] Cursor and subtitle overlays re-injected after every navigation\n- [ ] `showSubtitle(page, 'Step N - ...')` used at major transitions\n- [ ] `moveAndClick` used for all clicks with descriptive labels\n- [ ] `typeSlowly` used for visible input\n- [ ] No silent catches; helpers log warnings\n- [ ] Smooth scrolling used for content reveal\n- [ ] Key pauses are visible to a human viewer\n- [ ] Flow matches the requested story order\n- [ ] Script reflects the actual UI discovered in phase 1\n\n## Common Pitfalls\n\n1. Cursor disappears after navigation - re-inject it.\n2. Video is too fast - add pauses.\n3. Cursor is a dot instead of an arrow - use the SVG overlay.\n4. Cursor teleports - move before clicking.\n5. Select dropdowns look wrong - show the move, then pick the option.\n6. Modals feel abrupt - add a read pause before confirming.\n7. Video file path is random - copy it to a stable output name.\n8. Selector failures are swallowed - never use silent catch blocks.\n9. Field types were assumed - discover them first.\n10. Features were assumed - inspect the actual UI before scripting.\n11. Placeholder select values look real - watch for `\"0\"` and `\"Select...\"`.\n12. Popups create separate videos - capture popup pages explicitly and merge later if needed.\n",{"name":5,"origin":24,"description":7},"ECC","master","d6ca01da0f24a3b0e26e4a8b7b66cbd25d429f5d","skills\u002Feverything-claude-code\u002Fskills\u002Fui-demo",0,"https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills","https:\u002F\u002Fgithub.com\u002FSriramGandhiS","https:\u002F\u002Fsriram.website\u002F","Curious guy who keeps tinkering until something works","2026-05-20 16:21:34",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add SriramGandhiS\u002FSkills --skill ui-demo",{"tool":40,"command":41},"bunx","bunx skills add SriramGandhiS\u002FSkills --skill ui-demo",{"tool":43,"command":44},"pnpm","pnpm dlx skills add SriramGandhiS\u002FSkills --skill ui-demo","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fskills\u002Feverything-claude-code\u002Fskills\u002Fui-demo\u002FSKILL.md",true,[],[49,56,61,67,74,81],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M732609EPJWV13PVTX3GT4TM","webgpu-threejs-tsl","Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fwebgpu-threejs-tsl\u002Fskills\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[],{"skillNo":57,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":58,"categories":59,"keywords":60,"publishedAt":19},"01M7325XM47AGWB6K6C4VXKE6B","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fwebgpu-threejs-tsl\u002FSKILL.md",[],[],{"skillNo":62,"name":63,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7325WP6DES69JKC840VMFEP","verification-loop","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fverification-loop\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":71,"categories":72,"keywords":73,"publishedAt":19},"01M7325TFQF1DZTQ6J3WGQQ1VR","tdd-workflow","Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Ftdd-workflow\u002FSKILL.md",[],[],{"skillNo":75,"name":76,"nameZh":6,"description":77,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":78,"categories":79,"keywords":80,"publishedAt":19},"01M7325RGV9AY9PK92D2V8KKPW","strategic-compact","Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fstrategic-compact\u002FSKILL.md",[],[],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":19},"01M7325MZC28SE86E7NMCNEFS4","security-review","Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment\u002Fsensitive features. Provides comprehensive security checklist and patterns.","https:\u002F\u002Fgithub.com\u002FSriramGandhiS\u002FSkills\u002Fblob\u002Fmaster\u002Fweb-assets\u002Fdocs\u002Fzh-TW\u002Fskills\u002Fsecurity-review\u002FSKILL.md",[],[]]