Agent Skillskrafton-ai/KIRA › playwright-use

playwright-use

GitHub

提供基于 Playwright 的浏览器自动化指导,涵盖本地 HTML 服务启动、页面就绪检查、常规交互及 Canvas/WebGL 等特殊页面的脚本驱动策略,解决超时和失效问题。

KiraClaw/defaults/skills/playwright-use/SKILL.md krafton-ai/KIRA

Trigger Scenarios

测试 localhost 应用 验证网页流程 处理浏览器操作超时或失败 打开下载的 HTML 文件

Install

npx skills add krafton-ai/KIRA --skill playwright-use -g -y
More Options

Non-standard path

npx skills add https://github.com/krafton-ai/KIRA/tree/main/KiraClaw/defaults/skills/playwright-use -g -y

Use without installing

npx skills use krafton-ai/KIRA@playwright-use

指定 Agent (Claude Code)

npx skills add krafton-ai/KIRA --skill playwright-use -a claude-code -g -y

安装 repo 全部 skill

npx skills add krafton-ai/KIRA --all -g -y

预览 repo 内 skill

npx skills add krafton-ai/KIRA --list

SKILL.md

Frontmatter
{
    "name": "playwright-use",
    "description": "Practical browser automation guidance for KiraClaw browser MCP tasks. Trigger on: opening a downloaded HTML file, testing a localhost app, validating a web flow in the browser, interacting with a browser game, or when Playwright\/browser actions keep timing out or failing."
}

Playwright Use

Use this skill when the task depends on a live page and browser behavior matters.

Core Rules

  1. For remote websites, use browser tools directly.
  2. For local HTML or downloaded web assets, do not use file://. Serve the directory over local HTTP and open http://127.0.0.1 or http://localhost instead.
  3. Before starting a new local server, check existing background process sessions and reuse one if it already serves the needed directory.
  4. Reuse the current app tab when possible. Do not intentionally create extra blank tabs.

Local HTML / Localhost Workflow

  1. Identify the HTML file and its containing directory.
  2. Check whether a suitable local server is already running.
  3. If not, start one with a simple command such as:
cd /path/to/dir && python3 -m http.server 8765 --bind 127.0.0.1
  1. Open the page through http://127.0.0.1:8765/....
  2. Once the page is no longer needed, stop the temporary server unless the user still needs it.

Page Readiness

  • After navigation, do a lightweight readiness check before acting.
  • Prefer title, document.readyState, visible buttons, or small DOM checks over immediate screenshots.
  • Use screenshots sparingly. They are for confirmation, evidence, or final reporting, not for every step.

Interaction Strategy

Start with normal browser interactions:

  • browser_navigate
  • browser_click
  • browser_fill
  • browser_wait_for
  • browser_snapshot

If normal interactions fail repeatedly because of overlays, viewport problems, canvas rendering, or unstable refs, switch quickly instead of repeating the same failed action.

Canvas / WebGL / Three.js / Game Pages

For canvas-heavy or animated pages:

  • do not rely on screenshots as the main control strategy
  • do not keep reusing stale snapshot refs after rerenders
  • prefer targeted browser_evaluate or browser_run_code against app state, exposed globals, or known UI handlers

When you switch to script-driven interaction, keep it focused:

  • inspect the current app state
  • call the smallest useful function or click handler
  • verify the resulting state change before moving on

Common Failure Patterns

  • file:// blocked: switch to localhost
  • click timeout or pointer interception: inspect overlays, viewport, and visible state
  • stale ref errors: capture a fresh snapshot or use direct state inspection
  • repeated screenshot timeout: stop using screenshots as your primary probe
  • browser page/context closed: reopen the target page and rebuild current state before continuing

Decision Heuristic

  • Standard website or form: browser actions first
  • Local HTML demo or app: localhost first, then browser actions
  • Canvas/game/non-DOM UI: browser actions if they work, otherwise targeted script interaction

Version History

  • 652dacb Current 2026-08-20 12:24

Same Skill Collection

KIRA-Slack/.claude/skills/confluence-deep-reader/SKILL.md
KIRA-Slack/.claude/skills/docx/SKILL.md
KIRA-Slack/.claude/skills/email-action-extractor/SKILL.md
KIRA-Slack/.claude/skills/it-role-expert/SKILL.md
KIRA-Slack/.claude/skills/pdf/SKILL.md
KIRA-Slack/.claude/skills/pptx/SKILL.md
KIRA-Slack/.claude/skills/scratch-pad/SKILL.md
KIRA-Slack/.claude/skills/slack-memory-cleanup/SKILL.md
KIRA-Slack/.claude/skills/slack-memory-retrieval/SKILL.md
KIRA-Slack/.claude/skills/slack-memory-store/SKILL.md
KIRA-Slack/.claude/skills/slack-proactive-intervention-patterns/SKILL.md
KIRA-Slack/.claude/skills/web-navigation-strategies/SKILL.md
KIRA-Slack/.claude/skills/xlsx/SKILL.md
KiraClaw/defaults/skills/channel-setup/SKILL.md
KiraClaw/defaults/skills/docx/SKILL.md
KiraClaw/defaults/skills/html-presentation/SKILL.md
KiraClaw/defaults/skills/pdf/SKILL.md
KiraClaw/defaults/skills/pptx/SKILL.md
KiraClaw/defaults/skills/skill-creator/SKILL.md
KiraClaw/defaults/skills/speak-natural/SKILL.md
KiraClaw/defaults/skills/xlsx/SKILL.md

Metadata

Files
0
Version
652dacb
Hash
87312505
Indexed
2026-08-20 12:24

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 13:26
浙ICP备14020137号-1 $방문자$