screenshot
它能做什么
这项技能截取你电脑屏幕的画面,可以是整个桌面、某个窗口或某个区域。适合需要保存屏幕内容图片的人。
适用场景
- ✓当你明确要求截取桌面或某个应用的截图时。
- ✓当你想把屏幕的某个区域保存到你选择的路径时。
- ✓当浏览器或设计工具无法截取你需要的内容,必须使用操作系统截图功能的时候。
技能链接
https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/media/screenshot/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请截取我的整个屏幕,并保存到我指定的文件夹中。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会在你的电脑上运行截图脚本,把图片保存到你给出的路径,或系统默认的截图文件夹。在 Mac 上,它会先检查屏幕录制权限。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Screenshot Capture
Follow these save-location rules every time:
- If the user specifies a path, save there.
- If the user asks for a screenshot without a path, save to the OS default screenshot location.
- If Codex needs a screenshot for its own inspection, save to the temp directory.
Tool priority
- Prefer tool-specific screenshot capabilities when available (for example: a Figma MCP/skill for Figma files, or Playwright/agent-browser tools for browsers and Electron apps).
- Use this skill when explicitly asked, for whole-system desktop captures, or when a tool-specific capture cannot get what you need.
- Otherwise, treat this skill as the default for desktop apps without a better-integrated capture tool.
macOS permission preflight (reduce repeated prompts)
On macOS, run the preflight helper once before window/app capture. It checks Screen Recording permission, explains why it is needed, and requests it in one place.
The helpers route Swift's module cache to $TMPDIR/codex-swift-module-cache
to avoid extra sandbox module-cache prompts.
bash <path-to-skill>/scripts/ensure_macos_permissions.sh
To avoid multiple sandbox approval prompts, combine preflight + capture in one command when possible:
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
For Codex inspection runs, keep the output in temp:
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "<App>" --mode temp
Use the bundled scripts to avoid re-deriving OS-specific commands.
macOS and Linux (Python helper)
Run the helper from the repo root:
python3 <path-to-skill>/scripts/take_screenshot.py
Common patterns:
- Default location (user asked for "a screenshot"):
python3 <path-to-skill>/scripts/take_screenshot.py
- Temp location (Codex visual check):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp
- Explicit location (user provided a path or filename):
python3 <path-to-skill>/scripts/take_screenshot.py --path output/screen.png
- App/window capture by app name (macOS only; substring match is OK; captures all matching windows):
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex"
- Specific window title within an app (macOS only):
python3 <path-to-skill>/scripts/take_screenshot.py --app "Codex" --window-name "Settings"
- List matching window ids before capturing (macOS only):
python3 <path-to-skill>/scripts/take_screenshot.py --list-windows --app "Codex"
- Pixel region (x,y,w,h):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp --region 100,200,800,600
- Focused/active window (captures only the frontmost window; use
--appto capture all windows):
python3 <path-to-skill>/scripts/take_screenshot.py --mode temp --active-window
- Specific window id (use --list-windows on macOS to discover ids):
python3 <path-to-skill>/scripts/take_screenshot.py --window-id 12345
The script prints one path per capture. When multiple windows or displays match, it prints multiple paths (one per line) and adds suffixes like -w<windowId> or -d<display>. View each path sequentially with the image viewer tool, and only manipulate images if needed or requested.
Workflow examples
- "Take a look at <App> and tell me what you see": capture to temp, then view each printed path in order.
bash <path-to-skill>/scripts/ensure_macos_permissions.sh && \
python3 <path-to-skill>/scripts/take_screenshot.py --app "<App>" --mode temp
- "The design from Figma is not matching what is implemented": use a Figma MCP/skill to capture the design first, then capture the running app with this skill (typically to temp) and compare the raw screenshots before any manipulation.
Multi-display behavior
- On macOS, full-screen captures save one file per display when multiple monitors are connected.
- On Linux and Windows, full-screen captures use the virtual desktop (all monitors in one image); use
--regionto isolate a single display when needed.
Linux prerequisites and selection logic
The helper automatically selects the first available tool:
scrotgnome-screenshot- ImageMagick
import
If none are available, ask the user to install one of them and retry.
Coordinate regions require scrot
常见问题
截图保存到哪里?
保存到你指定的路径。如果你没有指定,会保存到系统默认的截图位置。
在 Mac 上需要特殊权限吗?
需要。在截取窗口或应用之前,这项技能会检查屏幕录制权限。
什么时候不应该用它?
如果有集成度更高的工具可以截取内容,例如设计工具或浏览器工具,这项技能会优先使用那些工具。
详情
作者的原始描述
Use when the user explicitly asks for a desktop or system screenshot (full screen, specific app or window, or a pixel region), or when tool-specific capture capabilities are unavailable and an OS-level capture is needed.
热度
- GitHub 星标
- 33k
- 排名
- #8859
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。