Add Claude Code skill: use /capture for on-demand screenshots
The skill now uses POST /capture?display=2 instead of GET /screenshot, removing the need to manually take screenshots before fetching. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
202f771434
commit
95413443a0
|
|
@ -0,0 +1,34 @@
|
|||
---
|
||||
name: screenshot
|
||||
description: Pull latest screenshot from Mac desktop
|
||||
---
|
||||
|
||||
# Skill: Pull Latest Screenshot from Mac
|
||||
|
||||
Captures a screenshot of Johan's Mac display and shows it.
|
||||
|
||||
## Usage
|
||||
|
||||
Run `/screenshot` to capture and display a screenshot.
|
||||
|
||||
## Instructions
|
||||
|
||||
1. Capture a fresh screenshot from the Mac:
|
||||
```bash
|
||||
curl -sf -X POST 'http://192.168.1.14:9123/capture?display=2' -o /tmp/latest_screenshot.png
|
||||
```
|
||||
|
||||
2. **Check the exit code.** If curl failed (non-zero exit), do NOT try to Read the file. Instead tell the user: "Could not capture screenshot. Check if the screenshot server is running on the Mac."
|
||||
|
||||
3. Only if curl succeeded (exit code 0), use the Read tool on `/tmp/latest_screenshot.png` to display it.
|
||||
|
||||
## Error Handling
|
||||
|
||||
- If curl fails to connect: the screenshot server may not be running on the Mac
|
||||
- NEVER try to Read the output file if curl failed
|
||||
|
||||
## Notes
|
||||
|
||||
- Uses the `/capture` endpoint which takes a live screenshot via `screencapture`
|
||||
- The file is automatically cleaned up server-side after serving
|
||||
- Use `?display=2` to capture a different display
|
||||
Loading…
Reference in New Issue