Skill站外收录 @skilllib/skill-2117939930272414293
using-screenshots
具备跨平台截取屏幕图像并进行视觉分析的能力,能自动识别操作系统类型、调用对应截图工具完成区域选择与保存,再通过图像读取工具加载至上下文,支持对界面元素、布局异常、文字内容等开展实时观察与问题诊断。
软件开发 AI 技能
Skills.MD
# Taking and Analyzing Screenshots
## Overview
You CAN take screenshots by combining the Bash tool with platform-specific screenshot commands. Screenshots are saved as image files, then loaded into your context using the Read tool for visual analysis.
## When to Use
Use this skill when I ask you to:
- "Take a screenshot"
- "Look at my screen"
- "Analyze this UI bug visually"
- "Review what's currently displayed"
- "Capture and examine the interface"
## Quick Reference
| Platform | Command | Interactive Selection |
| -------- | ---------------------------------------- | -------------------------- |
| macOS | `screencapture` | `-i` flag (area selection) |
| Linux | `gnome-screenshot`, `scrot`, or `import` | `-a` or `-s` flag |
**Standard workflow**:
1. Detect platform with `uname -s`
2. Check for available screenshot tool
3. Capture to `/tmp/screenshot_$(date +%s).png`
4. Use Read tool with the file path
5. Analyze the image
6. Optionally clean up temp file
## Step-by-Step Instructions
### 1. Detect Platform
```bash
uname -s
```
- Returns `Darwin` for macOS
- Returns `Linux` for Linux
### 2. Check Available Tools
**macOS**: `screencapture` is always available (built-in)
**Linux**: Check in priority order:
```bash
which gnome-screenshot || which scrot || which import || echo "none"
```
Priority order (best compatibility):
1. `gnome-screenshot` - works on both X11 and Wayland
2. `scrot` - lightweight, X11 only
3. `import` - part of ImageMagick
### 3. Capture Screenshot
Use timestamped filename to avoid conflicts:
**macOS**:
```bash
screencapture -i /tmp/screenshot_$(date +%s).png
```
- `-i` enables interactive area selection
- User clicks and drags to select region
**Linux with gnome-screenshot**:
```bash
gnome-screenshot -af /tmp/screenshot_$(date +%s).png
```
- `-a` for area selection
- `-f` specifies filename
**Linux with scrot**:
```bash
scrot -s /tmp/screenshot_$(date +%s).png
```
- `-s` enables selection mode
**Linux with import**:
```bash
import /tmp/screenshot_$(date +%s).png
```
- Provides crosshair for click-and-drag selection
### 4. Load Image into Context
```bash
Read tool: file_path="/tmp/screenshot_12345.png"
```
The Read tool displays images visually. You'll see the screenshot and can analyze it.
### 5. Analyze the Image
Once loaded, you can:
- Identify UI elements
- Spot visual bugs
- Review design elements
- Read text content
- Examine layout issues
### 6. Optional Cleanup
```bash
rm /tmp/screenshot_12345.png
```
Only remove if I won't need the file again.
## Handling Missing Tools
If no screenshot tool is available on Linux:
1. **Inform me** which tool is missing
2. **Suggest installation**:
- Ubuntu/Debian: `sudo apt install gnome-screenshot`
- Fedora: `sudo dnf install gnome-screenshot`
- Arch: `sudo pacman -S gnome-screenshot`
- ImageMagick: `sudo apt install imagemagick` (or equivalent)
3. **Alternative**: Ask user to manually take screenshot and provide path
## Common Mistakes
### ❌ Saying "I cannot take screenshots"
**Reality**: You CAN via Bash + screenshot CLI tools
### ❌ Forgetting to use Read tool after capture
**Reality**: The screenshot file must be loaded with Read tool to see it
### ❌ Using relative paths
**Reality**: Always use absolute paths (`/tmp/...`) for Read tool
### ❌ Not checking for available tools on Linux
**Reality**: Must detect which tool is installed before attempting capture
## Example Workflow
```
User: "Take a screenshot and help me debug this UI bug"
1. Check platform:
uname -s → Linux
2. Check available tools:
which gnome-screenshot → /usr/bin/gnome-screenshot
3. Capture screenshot:
gnome-screenshot -af /tmp/screenshot_1729012345.png
→ User selects area, file saved
4. Load into context:
Read: file_path="/tmp/screenshot_1729012345.png"
→ Image displays visually
5. Analyze:
"I can see the button alignment is off. The 'Submit' button
is 5px lower than the 'Cancel' button..."
6. Optional cleanup:
rm /tmp/screenshot_1729012345.png
```
评论 0
还没有评论,来抢沙发。
相关内容
同类或同场景的收录内容
building-with-kafka-strimzi
在 Kubernetes 上构建基于 Apache Kafka 的事件驱动系统,支持高可靠的消息传递、事务性处理与精确一次语义,结合 Strimzi 运营商实现集群自动化管理,利用 Schema Registry 保障事件模式演进,适用于微服务间解耦通信与实时数据流处理场景。
站外数据与分析
609 0.0
personal-tool-builder
专注于从个人真实痛点出发快速构建实用工具,涵盖命令行程序、本地优先应用和自动化脚本的开发与演进,强调先满足自身需求再逐步扩展,通过持续自用打磨功能,避免过度设计,确保工具简洁有效且长期可维护。
站外商业与营销
196 0.0
threejs-lighting
实现三维场景中的光照与阴影控制,支持多种光源类型及环境光照明,提供从基础布光到高级阴影优化的完整方案,适用于需要真实感渲染或性能平衡的可视化项目。
站外效率工具
442 0.0
aggregation-helper
提供数据聚合场景的自动化辅助能力,涵盖 SQL 查询编写、统计分析建模、可视化方案设计及商业智能配置,支持从需求理解到生产级代码生成的全流程指导。
站外效率工具数据与分析
217 0.0
举报「using-screenshots」
举报信息仅审核团队可见,同一资产 24 小时内仅可举报一次