AgentSkillsCN

setup

为您的 macOS 环境配置 screenshotr。设置输出目录、文件格式、命名规则以及截屏偏好。

SKILL.md
--- frontmatter
name: setup
description: Configure screenshotr for your macOS environment. Sets output directory, format, naming, and capture preferences.
disable-model-invocation: true
allowed-tools: Read, Write, Bash, Glob, AskUserQuestion
argument-hint: "[reconfigure]"

screenshotr Setup

You are configuring the screenshotr plugin. Your job is to verify the environment, gather preferences, and write a config file.

Steps

1. Check for Existing Config

Read .claude/screenshotr.local.md if it exists. If found, tell the user their current settings and ask if they want to reconfigure. If $ARGUMENTS contains "reconfigure", skip the prompt and proceed to reconfigure.

2. Verify Environment

Run the following checks:

  • macOS: Run uname -s — must return "Darwin". If not, tell the user this plugin only works on macOS and stop.
  • screencapture: Run which screencapture — must be available. If not, something is very wrong with their macOS install.
  • sips: Run which sips — must be available. Same as above.
  • Python3/Quartz (optional): Run python3 -c "import Quartz". If this fails, note that window capture by app name will use a JXA fallback (slightly less reliable). Not a blocker.

Report the results briefly.

3. Gather Preferences

Use AskUserQuestion for each setting:

Output directory: Where should screenshots be saved?

  • ./screenshots (relative to project root) — recommended
  • ~/Desktop
  • ~/Screenshots
  • Custom path

Create the directory with mkdir -p after the user chooses.

Default format:

  • png (default, lossless)
  • jpg (smaller files)
  • heic (efficient, macOS-native)
  • pdf (for documents)

Naming convention: How should screenshot files be named?

  • "descriptive" — Claude generates a kebab-case name from context (e.g., finder-preferences-window.png)
  • "timestamp" — automatic timestamp (screenshot-2025-01-15-143022.png)
  • "both" — descriptive name with timestamp suffix (finder-preferences-143022.png)

Include window shadow:

  • No (recommended, cleaner screenshots)
  • Yes

Play capture sound:

  • No (recommended, silent operation)
  • Yes

Default delay: Seconds to wait before capturing.

  • 0 (immediate, recommended)
  • 1
  • 2
  • 3

Default max dimension: Automatically resize screenshots to a max dimension?

  • None — keep original resolution
  • 1280 — good for documentation
  • 1920 — good for presentations
  • Ask each time

If they choose a number, set default_max_dimension to that number. If "None", set to null. If "Ask each time", set to "ask".

4. Write Config File

Ensure .claude/ directory exists, then write .claude/screenshotr.local.md:

markdown
---
output_dir: "./screenshots"
default_format: png
naming: descriptive
include_shadow: false
play_sound: false
default_delay: 0
default_max_dimension: null
---

# screenshotr Configuration

This file was generated by `/screenshotr:setup`. Run it again to reconfigure.

Settings are used by the capture, screenshot, and list-windows skills.

5. Confirm

Tell the user their config has been saved and list the available skills:

  • /screenshotr:capture — capture a screenshot with full control over target, format, and post-processing
  • /screenshotr:list-windows — list open windows and their IDs
  • The screenshot skill can be invoked automatically by Claude when context suggests a screenshot is needed