/SKILL.md
通过 vite-plugin-pilot 在浏览器中测试页面。当需要查看页面状态、与页面元素交互、验证前端功能时使用。前置条件:vite-plugin-pilot 已安装且 dev server 已启动。
npx skillsauth add 2234839/vite-plugin-pilot pilotInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
4 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
通过 HTTP API + SSE 在浏览器执行 JS,用于查看页面状态、交互和验证功能。
vite-plugin-pilot,如果没有则执行 pnpm add -D vite-plugin-pilot,并确认 vite.config.ts 的 plugins 数组中包含 pilot()pilot({ locale: 'zh' }) 或 pilot({ locale: 'en' })。判断依据:项目中的 UI 文本、README 语言、i18n 配置等。已有 pilot({...}) 配置时只追加 locale 字段,不覆盖其他配置。默认 zhpilot({ checkUpdate: false })。已有 pilot({...}) 配置时只追加 checkUpdate 字段.pilot 已添加到 .gitignore(运行时数据目录,不应提交)npx pilot server 启动独立 HTTP server.pilot/bridge.js 内容到目标浏览器控制台执行.pilot/userscript.user.js 到 Tampermonkey(自动在所有页面运行)npx pilot server 已运行,浏览器已连接npx pilot page # 查看页面状态(compact snapshot)
npx pilot run 'code' # 执行 JS + 结果 + 日志 + 页面快照(默认全附带)
npx pilot run 'code' nopage # 执行 JS + 结果 + 日志(不附带页面快照)
npx pilot run 'code' nologs # 执行 JS + 结果 + 页面快照(不附带日志)
npx pilot run 'code' instance:abc # 指定目标实例(支持前缀模糊匹配)
npx pilot instance:abc page # instance: 参数可放在任意位置
npx pilot logs # 查看最近控制台日志
npx pilot status # 列出已连接的实例(含 type、url、title)
npx pilot server [port] # 启动独立 HTTP server(不依赖 Vite)
npx pilot bridge # 输出 Console Bridge 脚本
npx pilot userscript # 输出 Tampermonkey Userscript
npx pilot help # 查看辅助函数列表
使用模式:run 'code' 默认返回结果+日志+页面快照,一步即可看到完整信息。page 单独查看 compact snapshot。
输出格式:run 命令的输出按优先级排列:
--- runcode --- 执行的代码预览ERROR: 错误信息 + 修复建议 — agent 最关心的信息,紧跟 runcode--- exec logs --- 执行期间的控制台日志(仅在有日志时输出)--- context logs --- 执行前的上下文日志(仅在有 exec 日志时输出)--- page snapshot --- 页面快照(默认附带,nopage 模式下 exec 失败时也自动附带帮助诊断)--- hint --- 辅助函数提示(仅在检测到原生 DOM 操作且未使用过 __pilot_ 函数时出现,使用一次后永久消失)上下文聚焦:操作元素时(如 clickByText、typeByPlaceholder),snapshot 自动聚焦到操作区域——被操作的元素用 → 标记,上下各 4 行保留,远离操作的区域用 · 折叠。无元素操作时返回完整 snapshot。
纯操作(如 __pilot_clickByText("登录"))无返回值时,不输出空的 undefined,直接跳到日志或快照。
实例选择:多个浏览器 tab 打开时,执行结果末尾会显示可用实例列表(--- instances ---),用 ← 标记当前实例。每个实例有 type 标识([vite] / [console] / [userscript])、hostname label 和页面 title。切换实例用 instance:xxx 参数(支持前缀模糊匹配,如 instance:1316 匹配 131646c7)或 PILOT_INSTANCE 环境变量。npx pilot status 查看所有实例详情(含 type、url、title、lastSeen)。
以下函数在 npx pilot run '...' 中作为浏览器端 JS 执行,完整列表见 npx pilot help。
| 函数 | 说明 |
|------|------|
| __pilot_clickByText(text, nth?) | 按文本点击元素 |
| __pilot_dblclickByText(text, nth?) | 按文本双击元素 |
| __pilot_typeByPlaceholder(ph, value) | 输入并按 Enter(触发 input 事件) |
| __pilot_setValueByPlaceholder(ph, value, nth?) | 设置输入框值(触发 input 事件,不触发 Enter) |
| __pilot_selectValueByText(text, nth?) | 选择下拉框选项 |
| __pilot_checkByText(text, nth?) | 勾选复选框 |
| __pilot_uncheckByText(text, nth?) | 取消勾选复选框 |
| __pilot_checkMultipleByText([t1, t2, ...]) | 批量勾选多个复选框 |
| __pilot_keydownByText(text, key) | 在元素上触发按键 |
| __pilot_findByText(text) | 查找元素 → [{idx, tag, text}] |
| __pilot_waitFor(text, timeout?, disappear?) | 等待文本出现/消失 |
| __pilot_waitEnabled(text, timeout?) | 等待禁用元素变为可用 |
#N,适合精确操作)| 函数 | 说明 |
|------|------|
| __pilot_click(i) | 点击元素 |
| __pilot_dblclick(i) | 双击元素 |
| __pilot_type(i, v) | 输入并按 Enter(触发 input 事件) |
| __pilot_setValue(i, v) | 设置值(触发 input 事件,不触发 Enter) |
| __pilot_hover(i) | 悬停元素 |
| __pilot_scrollIntoView(i) | 滚动到元素 |
| __pilot_getRect(i) | 获取元素位置和尺寸 |
| __pilot_check(i) | 勾选复选框 |
| __pilot_uncheck(i) | 取消勾选复选框 |
| 函数 | 说明 |
|------|------|
| __pilot_wait(ms) | 等待毫秒 |
| __pilot_snapshot() | 获取完整 JSON 快照 |
compact snapshot 格式:tag#idx[val=V][check=选中项][type:T][ph=P][href:路径][disabled] text
#idx 是元素的序号,可直接传给 __pilot_click(idx) 等函数check= 后跟当前选中项文本(select 为选中 option,checkbox 为勾选项列表,radio 为选中项文本)href: 显示链接目标路径(外部链接含 host,内部链接仅 pathname+hash)[disabled] 标记的元素不可操作await __pilot_wait(0) 让 Vue scheduler 处理响应式更新typeByPlaceholder:Vue/React v-model 需要 input 事件,type 触发 input 事件+Enter 键,setValue 触发 input 事件但不触发 Enter(表单填写推荐 setValueByPlaceholder)npx pilot page cached 读缓存(0.03s),不需要最新状态时用#idx 精确操作await __pilot_waitFor("目标文本") 等待渲染完成再点击__pilot_checkByText/__pilot_uncheckByText,不要手动设置 el.checked默认开启。按住 Alt 键移动鼠标可高亮页面元素,Alt+Click 选中元素后弹出提示词面板:
关闭 Element Inspector:在 vite.config.ts 中设置 pilot({ inspector: false })
浏览器中 Alt+Click 的提示词可直接发送到当前 Claude Code session。
前置条件:Claude Code v2.1.80+、claude.ai 登录。Channel 功能处于 Research Preview,需
--dangerously-load-development-channels server:pilot-channel启动。注意:此功能未经作者实际验证,欢迎反馈。
架构:
.pilot/channel-pending.txt → UserPromptSubmit hook → Claude Code 自动附加首次配置(skill 自动执行):
pilot-channel.js 依赖 @modelcontextprotocol/sdk,为避免影响包体积,该依赖未内置):pnpm add @modelcontextprotocol/sdk
.mcp.json,内容如下(不存在则创建):{
"mcpServers": {
"pilot-channel": {
"command": "node",
"args": ["node_modules/vite-plugin-pilot/bin/pilot-channel.js"]
}
}
}
.claude/settings.local.json 存在并包含 hook 配置(不存在则创建,已有 hooks 时合并):{
"hooks": {
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "node node_modules/vite-plugin-pilot/bin/pilot-hook-channel.js"
}
]
}
]
}
}
浏览器端「发送给 Claude」按钮会在 pilot-channel server 运行时自动可用(Claude Code 启动时通过 .mcp.json 自动拉起)。未连接时按钮自动禁用,「复制提示词」始终可用。
tools
Use when work should span one or more detached tasks but still behave like one job with a single owner context. TaskFlow is the durable flow substrate under authoring layers like Lobster, ACPX, plugins, or plain code. Keep conditional logic in the caller; use TaskFlow for flow identity, child-task linkage, waiting state, revision-checked mutations, and user-facing emergence.
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
# Lobster Lobster executes multi-step workflows with approval checkpoints. Use it when: - User wants a repeatable automation (triage, monitor, sync) - Actions need human approval before executing (send, post, delete) - Multiple tool calls should run as one deterministic operation ## When to use Lobster | User intent | Use Lobster? | | ------------------------------------------------------ | --------------------------
tools
A CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.