# Openai Screenshot > Úsalo cuando el usuario pida explícitamente una captura de pantalla de escritorio o del sistema, o cuando no haya una herramienta de captura específica disponible. Fuente: https://skillsagentes.com/skills/trailofbits/skills-curated/openai-screenshot Markdown: https://skillsagentes.com/skills/trailofbits/skills-curated/openai-screenshot.md Repositorio: https://github.com/trailofbits/skills-curated Autor: trailofbits Licencia: CC-BY-SA-4.0 Actualizado: hace 9 meses Coste de contexto: 67 tok instalada, 2k tok al activarse, 9.8k tok con todos los archivos del bundle Bundle: 7 archivos, 38 KB Permisos que pide: bash, read, grep, glob, write, edit ## Instalación Un skill son archivos markdown: los mismos archivos valen para cualquier agente y lo único que cambia es el directorio de destino, es decir la bandera `--agent`. Añade `-g` para instalarlo en todos los proyectos de la máquina. ```bash # Claude Code npx -y skills add trailofbits/skills-curated --skill openai-screenshot --agent claude-code # Cursor npx -y skills add trailofbits/skills-curated --skill openai-screenshot --agent cursor # Codex npx -y skills add trailofbits/skills-curated --skill openai-screenshot --agent codex # Gemini CLI npx -y skills add trailofbits/skills-curated --skill openai-screenshot --agent gemini # Windsurf npx -y skills add trailofbits/skills-curated --skill openai-screenshot --agent windsurf # Cline npx -y skills add trailofbits/skills-curated --skill openai-screenshot --agent cline ``` ## Qué hace - Captura pantallazos de escritorio completos, de una app/ventana concreta o de una región de píxeles, en macOS, Linux y Windows - Decide la ruta de guardado según reglas fijas: ruta indicada, ubicación por defecto del SO o carpeta temporal para inspección del propio agente - Gestiona el permiso de Screen Recording en macOS mediante un script de preflight antes de capturar - Selecciona automáticamente la herramienta disponible en Linux (scrot, gnome-screenshot o ImageMagick import) - Imprime la ruta de cada captura guardada, incluso cuando hay varias ventanas o pantallas ## Cuándo usarla - El usuario pide explícitamente una captura de pantalla de escritorio o del sistema (pantalla completa, app, ventana o región de píxeles) - No hay una herramienta de captura específica disponible (por ejemplo, Playwright para navegadores o un MCP de Figma) y hace falta una captura a nivel de sistema operativo - El propio agente necesita una captura para inspeccionar visualmente algo ## Cuándo no - Existe una herramienta de captura más integrada disponible, como un MCP/skill de Figma para archivos de Figma o Playwright/agent-browser para navegadores y apps Electron ## Qué la activa - "Haz una captura de pantalla completa y guárdala en output/screen.png" - "Échale un vistazo a la app y dime qué ves" - "Captura solo la ventana de Configuración de la app" - "Haz una captura de la región 100,200,800,600 de la pantalla" ## Antes de instalar - En macOS requiere permiso de Screen Recording (gestionado con el script ensure_macos_permissions.sh); en Linux necesita scrot, gnome-screenshot o ImageMagick instalados. - Necesita en el PATH: python3 - Variables de entorno: BASH_SOURCE, CODEX_SANDBOX, MODULE_CACHE, PERM_SWIFT, SCRIPT_DIR, TEST_DISPLAYS_ENV, TEST_MODE_ENV, TEST_PLATFORM_ENV, TEST_WINDOWS_ENV - runs shell commands - writes to your files - reads environment config ## Archivos - SKILL.md — 8 KB - scripts/ensure_macos_permissions.sh — 2 KB - scripts/macos_display_info.swift — 482 B - scripts/macos_permissions.swift — 929 B - scripts/macos_window_info.swift — 4 KB - scripts/take_screenshot.ps1 — 5 KB - scripts/take_screenshot.py — 19 KB ## SKILL.md Reproducido tal cual desde trailofbits/skills-curated bajo CC-BY-SA-4.0. Esta sección es el documento original y está en inglés. # Screenshot Capture Follow these save-location rules every time: 1) If the user specifies a path, save there. 2) If the user asks for a screenshot without a path, save to the OS default screenshot location. 3) If the agent 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 bash {baseDir}/scripts/ensure_macos_permissions.sh ``` To avoid multiple sandbox approval prompts, combine preflight + capture in one command when possible: ```bash bash {baseDir}/scripts/ensure_macos_permissions.sh && \ python3 {baseDir}/scripts/take_screenshot.py --app "the agent" ``` For the agent inspection runs, keep the output in temp: ```bash bash {baseDir}/scripts/ensure_macos_permissions.sh && \ python3 {baseDir}/scripts/take_screenshot.py --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: ```bash python3 {baseDir}/scripts/take_screenshot.py ``` Common patterns: - Default location (user asked for "a screenshot"): ```bash python3 {baseDir}/scripts/take_screenshot.py ``` - Temp location (the agent visual check): ```bash python3 {baseDir}/scripts/take_screenshot.py --mode temp ``` - Explicit location (user provided a path or filename): ```bash python3 {baseDir}/scripts/take_screenshot.py --path output/screen.png ``` - App/window capture by app name (macOS only; substring match is OK; captures all matching windows): ```bash python3 {baseDir}/scripts/take_screenshot.py --app "the agent" ``` - Specific window title within an app (macOS only): ```bash python3 {baseDir}/scripts/take_screenshot.py --app "the agent" --window-name "Settings" ``` - List matching window ids before capturing (macOS only): ```bash python3 {baseDir}/scripts/take_screenshot.py --list-windows --app "the agent" ``` - Pixel region (x,y,w,h): ```bash python3 {baseDir}/scripts/take_screenshot.py --mode temp --region 100,200,800,600 ``` - Focused/active window (captures only the frontmost window; use `--app` to capture all windows): ```bash python3 {baseDir}/scripts/take_screenshot.py --mode temp --active-window ``` - Specific window id (use --list-windows on macOS to discover ids): ```bash python3 {baseDir}/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` or `-d`. View each path sequentially with the image viewer tool, and only manipulate images if needed or requested. ### Workflow examples - "Take a look at and tell me what you see": capture to temp, then view each printed path in order. ```bash bash {baseDir}/scripts/ensure_macos_permissions.sh && \ python3 {baseDir}/scripts/take_screenshot.py --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 `--region` to isolate a single display when needed. ### Linux prerequisites and selection logic The helper automatically selects the first available tool: 1) `scrot` 2) `gnome-screenshot` 3) ImageMagick `import` If none are available, ask the user to install one of them and retry. Coordinate regions require `scrot` or ImageMagick `import`. `--app`, `--window-name`, and `--list-windows` are macOS-only. On Linux, use `--active-window` or provide `--window-id` when available. ## Windows (PowerShell helper) Run the PowerShell helper: ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 ``` Common patterns: - Default location: ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 ``` - Temp location (the agent visual check): ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 -Mode temp ``` - Explicit path: ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 -Path "C:\Temp\screen.png" ``` - Pixel region (x,y,w,h): ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 -Mode temp -Region 100,200,800,600 ``` - Active window (ask the user to focus it first): ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 -Mode temp -ActiveWindow ``` - Specific window handle (only when provided): ```powershell powershell -ExecutionPolicy Bypass -File {baseDir}/scripts/take_screenshot.ps1 -WindowHandle 123456 ``` ## Direct OS commands (fallbacks) Use these when you cannot run the helpers. ### macOS - Full screen to a specific path: ```bash screencapture -x output/screen.png ``` - Pixel region: ```bash screencapture -x -R100,200,800,600 output/region.png ``` - Specific window id: ```bash screencapture -x -l12345 output/window.png ``` - Interactive selection or window pick: ```bash screencapture -x -i output/interactive.png ``` ### Linux - Full screen: ```bash scrot output/screen.png ``` ```bash gnome-screenshot -f output/screen.png ``` ```bash import -window root output/screen.png ``` - Pixel region: ```bash scrot -a 100,200,800,600 output/region.png ``` ```bash import -window root -crop 800x600+100+200 output/region.png ``` - Active window: ```bash scrot -u output/window.png ``` ```bash gnome-screenshot -w -f output/window.png ``` ## Error handling - On macOS, run `bash {baseDir}/scripts/ensure_macos_permissions.sh` first to request Screen Recording in one place. - If you see "screen capture checks are blocked in the sandbox", "could not create image from display", or Swift `ModuleCache` permission errors in a sandboxed run, rerun the command with escalated permissions. - If macOS app/window capture returns no matches, run `--list-windows --app "AppName"` and retry with `--window-id`, and make sure the app is visible on screen. - If Linux region/window capture fails, check tool availability with `command -v scrot`, `command -v gnome-screenshot`, and `command -v import`. - If saving to the OS default location fails with permission errors in a sandbox, rerun the command with escalated permissions. - Always report the saved file path in the response. ## When to Use ## When NOT to Use ## Dónde encaja - Categoría: [Herramientas para desarrolladores](https://skillsagentes.com/categorias/herramientas-desarrollo.md) — Skills que cambian cómo tu agente escribe, revisa y despliega código. - Creador: [trailofbits](https://skillsagentes.com/creators/trailofbits.md) — 117 skills en el directorio - [Todas las skills](https://skillsagentes.com/skills.md) - [Ranking de instalaciones](https://skillsagentes.com/ranking.md) ## Otras skills del mismo repositorio - [Grilling](https://skillsagentes.com/skills/trailofbits/skills-curated/grilling.md): Interroga al usuario sin descanso sobre un plan, decisión o idea hasta resolver cada rama del árbol de decisión, o cuando dice "grill me on this". - [Handoff](https://skillsagentes.com/skills/trailofbits/skills-curated/handoff.md): Compacta la conversación actual en un documento de traspaso para que un agente nuevo pueda continuar el trabajo en otra sesión. - [Teach](https://skillsagentes.com/skills/trailofbits/skills-curated/teach.md): Enseña al usuario una nueva habilidad o concepto a lo largo de varias sesiones, usando el directorio actual como un espacio de enseñanza con estado, con lecciones, registros de aprendizaje y materiales de referencia. - [Writing Great Skills](https://skillsagentes.com/skills/trailofbits/skills-curated/writing-great-skills.md): Referencia para escribir y editar bien skills de agentes: el vocabulario y los principios que hacen que un skill sea predecible. Consúltalo al redactar, revisar o podar un SKILL.md. - [Ffuf Web Fuzzing](https://skillsagentes.com/skills/trailofbits/skills-curated/ffuf-web-fuzzing.md): Guía experta para el fuzzing web con ffuf en pentesting autorizado: descubrimiento de directorios y subdominios, fuzzing de parámetros, peticiones autenticadas y análisis de resultados. ## Skills relacionadas - [Finishing A Development Branch](https://skillsagentes.com/skills/obra/superpowers/finishing-a-development-branch.md): Úsalo cuando la implementación esté completa, todos los tests pasen, y necesites decidir cómo integrar el trabajo. - [Using Git Worktrees](https://skillsagentes.com/skills/obra/superpowers/using-git-worktrees.md): Úsalo al empezar trabajo de feature que necesita aislamiento del workspace actual, o antes de ejecutar planes de implementación: asegura un workspace aislado vía herramientas nativas o fallback a git worktree. - [Writing Skills](https://skillsagentes.com/skills/obra/superpowers/writing-skills.md): Úsala al crear nuevas skills, editar skills existentes o verificar que funcionan antes de desplegarlas. - [Code Review](https://skillsagentes.com/skills/mattpocock/skills/code-review.md): Revisa los cambios desde un punto fijo por dos ejes — Standards (¿sigue los estándares del repo?) y Spec (¿hace lo que pedía el issue?) — en sub-agentes paralelos, y los reporta lado a lado. - [Codebase Design](https://skillsagentes.com/skills/mattpocock/skills/codebase-design.md): Vocabulario compartido para diseñar módulos profundos. Úsalo para diseñar o mejorar la interfaz de un módulo, decidir dónde va un seam, o hacer el código más testeable y navegable para una IA. --- Skills Agentes · [Índice de páginas en markdown](https://skillsagentes.com/sitemap.md) · [Inicio](https://skillsagentes.com/index.md)