macos-automation
在 macOS 上执行端到端自动化任务:应用控制、系统设置、Finder/剪贴板、Shortcuts、Calendar、Notes、Mail、Messages、通知、Pages,以及基于 AX 的 UI 查询与动作。遇到 AppleScript/JXA、快捷指令编排、UI 自动化、模板执行、权限诊断、脚本安全控制、或需要把自然语言动作转为可执行自动化时,使用此 skill。
Best use case
macos-automation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
在 macOS 上执行端到端自动化任务:应用控制、系统设置、Finder/剪贴板、Shortcuts、Calendar、Notes、Mail、Messages、通知、Pages,以及基于 AX 的 UI 查询与动作。遇到 AppleScript/JXA、快捷指令编排、UI 自动化、模板执行、权限诊断、脚本安全控制、或需要把自然语言动作转为可执行自动化时,使用此 skill。
Teams using macos-automation should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/macos-automation/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How macos-automation Compares
| Feature / Agent | macos-automation | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
在 macOS 上执行端到端自动化任务:应用控制、系统设置、Finder/剪贴板、Shortcuts、Calendar、Notes、Mail、Messages、通知、Pages,以及基于 AX 的 UI 查询与动作。遇到 AppleScript/JXA、快捷指令编排、UI 自动化、模板执行、权限诊断、脚本安全控制、或需要把自然语言动作转为可执行自动化时,使用此 skill。
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
SKILL.md Source
# macOS Automation
优先用统一入口完成任务,同时保留自由脚本模式,确保“能快速落地 + 能深度定制”。
## 执行规则
1. 先跑环境预检。
2. 优先走模板或语义工具。
3. 需要灵活性时退回原始脚本。
4. 涉及 UI 层时走 AX 查询并自动兜底依赖。
5. 命中安全策略时先改写脚本,再决定是否降级策略。
## 快速开始
```bash
python scripts/check_env.py --prewarm-ax
python scripts/macos_automation.py list-tools
python scripts/macos_automation.py describe-tool --tool run_macos_script
python scripts/macos_automation.py call --tool get_frontmost_app --input-json '{}'
```
## 三种调用模式
### 1) 语义工具模式(推荐)
直接调用工具名,让 skill 自行完成“模板选择 + 占位符替换 + 执行”。
```bash
python scripts/macos_automation.py call \
--tool run_shortcut \
--input-json '{"name":"启动闪念"}'
```
### 2) 模板编排模式(中等自由度)
当你知道模板 ID,直接调用 `run_macos_template`,可控性更高。
```bash
python scripts/macos_automation.py call \
--tool run_macos_template \
--input-json '{"template_id":"system_launch_app","input_data":{"name":"Reminders"}}'
```
### 3) 原始脚本模式(最高自由度)
当模板不覆盖需求时,直接运行 AppleScript/JXA。
```bash
python scripts/macos_automation.py call \
--tool run_macos_script \
--input-json '{"script_content":"tell application \"Finder\" to get name of startup disk"}'
```
## AX 自动化
先确保 AX 依赖可用,再执行查询或动作。
```bash
python scripts/accessibility_query.py \
--payload-json '{"command":"query","locator":{"role":"AXWindow"}}'
```
若启用自动下载,优先配置 `MACOS_KIT_AX_DOWNLOAD_SHA256` 做完整性校验。
## 安全策略
- `balanced`(默认):阻断关键危险命令。
- `strict`:额外阻断 `curl | sh` 与二进制脚本文件。
- `off`:关闭风险扫描,仅在用户明确授权后使用。
执行被阻断时,先解释风险并给出等价安全替代方案。
## 资源导航
- 工具能力面:`references/tool-surface.md`
- 能力覆盖矩阵:`references/coverage-matrix.md`
- 工具输入 schema:`references/tool-schemas.md`
- 配置矩阵:`references/config-matrix.md`
- 模板目录:`references/template-catalog.md`
- AX 策略:`references/ax-strategy.md`
- 内置知识库:`assets/knowledge-base/`
- 机器可读 schema 清单:`assets/tool-schemas.json`Related Skills
xlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.
web-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for complex artifacts requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX artifacts.
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.
skill-creator
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, update or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
remotion
Best practices for Remotion - Video creation in React
pptx
Use this skill any time a .pptx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates, layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx filename, regardless of what they plan to do with the content afterward. If a .pptx file needs to be opened, created, or touched, use this skill.
Use this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill.
internal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation.
canvas-design
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.