src/skills/runtime/ghost-mcp/SKILL.md
ghost-os 桌面 computer-use 说明书。msgcode 直接暴露 `ghost_*` 原生工具;先读外部真相源 GHOST-MCP,再按本文的本地安装、探测和失败口径执行。
npx skillsauth add 42atom/msgcode Ghost MCPInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
网页内容获取(抓文本、点普通按钮、表单填写、页面跳转)默认不要上 ghost_*。
browser(更快、更稳定、可复现)browser 明显受阻(强反爬/复杂交互/页面被遮罩/DOM 不可达/需要原生系统弹窗)才降级用 ghost_*/Users/admin/GitProjects/GithubDown/ghost-os/GHOST-MCP.md/Users/admin/.config/msgcode/log先读 GHOST-MCP.md,它定义了 ghost_* 工具的用法、失败路径和桌面操作规则。本文只补 msgcode 本地接入口径,不重写 provider 文档。
ghost_* 原生工具给 Agent模型 -> ghost_* -> ghost mcp -> 真实结果 -> 模型desktop.* -> ghost_* 翻译层brew install ghostwright/ghost-os/ghost-os
ghost setup
ghost doctor
ghost status
ghost-osghost 缺失时,ghost_* 工具会直接返回缺失事实和安装指引ghost status 未 ready 时,msgcode 会补跑一次 ghost doctor,把最小诊断事实回给模型msgcode start),ghost_* 的截图/视觉类能力需要给 daemon 宿主进程授权(通常是 launchd 里的 node),仅授权 Terminal 不一定生效。用 msgcode ghost permissions --open 打开系统设置并查看 daemon 宿主事实。ghost_recipesghost_contextdom_idghost_annotateghost_screenshotghost_groundghost_recipes,能 ghost_run 就不要手搓流程。ghost_context,确认前台 app、窗口与焦点元素都对。dom_id;原生 App 优先 identifier;不要长期依赖模糊 query。app,避免对错窗口执行。ghost_wait 等“输入行/按钮可交互”再继续;不要边加载边疯狂 find。ghost_find 最多 3 次,超出就换策略(annotate/screenshot/ground)或停下向用户确认状态。ghost_ground 的 description 要写清“是什么 + 在哪 + 旁边锚点”,并尽量传 crop_box 提速与降误判。ghost_screenshot(截图)ghost status 必须是 Status: Ready;Screen Recording 必须已授权。app: 尽量传目标应用名(例如 "Safari"),避免截到别的窗口。full_resolution: 默认 false;除非你需要看清小字再开 true。ghost_state,把返回事实贴出来。ghost_context 确认前台应用与焦点窗口是否真是目标 app。ghost_ground(视觉定位)description 必须提供。不传就会失败。ghost_context,把目标 app 拉到前台;否则 grounding 可能对错窗口做推理。description 的标准(越具体越好):
app: 传 "Safari" / "Terminal" 等,减少误定位。crop_box: 只要你能估出大概区域,就传,能显著提速并减少误判。ghost_ground 1-2 次。超过就停下让用户确认页面状态,不要死磕。ghost_* 时不会要求你去管理 ghost mcp 常驻进程;每次调用都会按需启动并在调用结束后退出。ghost_ground 会用到 ghost-vision sidecar;它会在需要时启动,并在空闲约 600 秒后自动退出。ghost doctor 看状态。ghost_* 能力面保持完整;msgcode 不为它额外加 confirm gatedom_idghost_find 找不到按钮时,不要死磕同一个 queryghost_contextghost_find(优先 dom_id)ghost_annotateghost_screenshotghost_groundghost_contextghost_annotateghost_screenshotghost_ground你可以“感知”到 modal,但需要你主动去取证。Ghost OS 文档也明确:很多失败是因为被 modal 阻挡。
命中任意一条就进入 modal-first:
cmd+s、Export/Save/Print、打开文件、系统权限提示等ghost_click/ghost_type 连续失败,但元素“按理应该在那”ghost_wait 超时/失败两次以上(尤其是你在等“某按钮出现/消失”)ghost_context app:"<目标应用>"ghost_read app:"<目标应用>"ghost_annotate app:"<目标应用>"(拿到带编号的可点坐标)Cancel / 取消Save / 保存 / Export / 导出ghost_screenshot + feishu_send_file,不要走应用内导出把自己卡在保存面板里。ghost_click(点文件名输入框或 Save/Cancel)ghost_type(输入文件名)ghost_click(点 Save/保存)ghost_wait condition:"elementGone" value:"Cancel" app:"<目标应用>"(确认对话框消失)ghost_annotate 产物(截图 + 编号索引)作为证据回给用户,请用户手动点掉或给出明确指令(保存/取消/替换/不保存)。ghost_wait 或 ghost_click。ghost-os 是外部 provider,不是 msgcode coreghost setup/doctor 的业务逻辑搬进 msgcodedata-ai
This skill should be used when the model needs detailed image understanding beyond the system preview summary, and needs a provider-neutral capability index.
development
# todo skill 触发:任务记录、查看待办、标记完成。 优先入口:`~/.config/msgcode/skills/todo/main.sh` 默认 workspace:当前目录 `$PWD`(可被 `--workspace` 覆盖)。 常用: - `bash ~/.config/msgcode/skills/todo/main.sh add "补充测试报告" --json` - `bash ~/.config/msgcode/skills/todo/main.sh list --json` - `bash ~/.config/msgcode/skills/todo/main.sh done <taskId> --json`
development
# thread skill 触发:查看/切换会话线程,读取线程消息。 优先入口:`msgcode thread ...` 常用: - `msgcode thread list --json` - `msgcode thread active --json` - `msgcode thread messages <thread-id> --limit 20 --json` - `msgcode thread switch <thread-id> --json`
development
This skill should be used when the model needs to create, inspect, enable, disable, or remove recurring schedules in msgcode, or when diagnosing schedule state in the current workspace.