desktop-automation

desktop-automation is a skill for Claude Code, Codex from ntygod/ZhiWei. It costs 45 tokens per session (697 once invoked), scanned A, original, MIT.

A Windows desktop automation skill for controlling application windows, buttons, menus, the mouse, keyboard, screenshots, and pop-up dialogs. It uses Python tools to locate and operate controls in desktop apps.

In plain words
What is it for?
Use it to automate Windows applications, manage windows, dismiss dialogs, locate controls, take screenshots, and perform repeated keyboard or mouse actions. It does not cover web automation or desktop automation on macOS or Linux.
Why use it?
It handles repetitive desktop actions while requiring the current screen to be checked first. It also includes safeguards for stopping automation and avoiding accidental destructive actions.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to automate Windows applications, manage windows, dismiss dialogs, locate controls, take screenshots, and perform repeated keyboard or mouse actions. It does not cover web automation or desktop automation on macOS or Linux.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ntygod/zhiwei/desktop-automation
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ntygod/ZhiWei --skill desktop-automation
Clone the repo
git clone --depth 1 https://github.com/ntygod/ZhiWei

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for desktop-automation

README.md
[![agentmods](https://agentmods.dev/badge/skills/ntygod/zhiwei/desktop-automation/github.svg)](https://agentmods.dev/skills/ntygod/zhiwei/desktop-automation)
Your own site
<a href="https://agentmods.dev/skills/ntygod/zhiwei/desktop-automation"><img src="https://agentmods.dev/badge/skills/ntygod/zhiwei/desktop-automation/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for desktop-automation

Your own site · 80×15
<a href="https://agentmods.dev/skills/ntygod/zhiwei/desktop-automation"><img src="https://agentmods.dev/badge/skills/ntygod/zhiwei/desktop-automation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 45 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 697 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00045 $0.00697
Opus 5 $0.00023 $0.00349
Sonnet 5 $0.00009 $0.00139
Haiku 4.5 $0.00005 $0.00070

Measured 11d ago against content hash 882f0a240fd6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

desktop-automation scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

src/main/resources/skills/desktop-automation/SKILL.md · 55 lines

What it actually says

桌面自动化指南

pyautogui + pywinauto 控制 Windows 桌面应用。仅 Windows,且必须用 shell_exec 走宿主 Python 进程code 是沙箱,访问不到真实屏幕和窗口)。核心约束:操作前必须截图确认状态,不盲操作。

适用场景

  • Windows 应用 UI 自动化
  • 窗口管理(查找 / 激活 / 调整大小)
  • 对话框 / 弹窗处理
  • 键鼠模拟 / 控件操作
  • 屏幕截图 / UI 元素定位
  • 重复性桌面操作批量执行

不适用场景

  • 网页自动化 → browser-automation
  • 命令行操作 → shell_exec
  • Linux / macOS 桌面 → 当前不支持

工作流

  1. 依赖检查shell_exec(command="python -c \"import pyautogui, pywinauto\""),缺则提示用户 pip install pyautogui pywinauto pillow
  2. 写脚本到文件:操作步骤写到 cwd 下脚本文件(路径取自工具返回的 workingDirectory),再 shell_exec(command="python <脚本路径>") 执行;不用 python -c 拼复杂多行
  3. 截图先:操作前必须截图看到当前状态,不盲操作
  4. 优先 pywinauto 控件定位:通过控件树拿元素(标题 / class / 自动化 ID),比坐标点击稳得多(窗口移动 / 分辨率变都不会失效)
  5. 加等待:每个键鼠操作之间 time.sleep(0.3-1.0) 等 UI 响应;点完按钮等加载完再下一步
  6. FAILSAFE 必开:脚本顶部 pyautogui.FAILSAFE = True,鼠标移到屏幕角即终止脚本(紧急退出)
  7. 破坏性操作要确认:删文件 / 关闭未保存窗口 / 提交表单等,必须用户授权后才动手
  8. 失败回退:连续 2 次定位不到控件 → 重新截图比对,可能是窗口状态变了

详细参考

  • pyautogui + pywinauto 脚本片段(截图 / 定位 / 操作 / 键鼠组合):{skill_dir}/references/pyautogui-recipes.md
Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 55 lines · 45 tokens per session scan A 882f0a240fd6

Subscribe to this mod's changes

desktop-automation is a skill published in the GitHub repository ntygod/ZhiWei (138 stars, last pushed 1mo ago), licensed MIT. It adds 45 tokens to every session and 697 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.