Capture product screenshots using Claude's Computer Use API. Provides visual authentication (no session expiration!), intelligent content verification, and reliable screenshot capture. Screenshots are saved to configured directory for later upload to Pylon CDN.
Automate screenshot capture for product features using Claude's Computer Use API.
Capture consistent, high-quality screenshots of product features for use in documentation. Computer Use provides:
All screenshots are captured at a consistent viewport size (configured in config.yaml).
.envpip install anthropic pillow pyautoguiSee Computer Use Setup Guide for detailed configuration.
The user will provide:
Use the Task tool to explore the codebase and understand:
Routes and URLs: Where is this feature accessed?
UI Structure: What does the interface look like?
Visual Landmarks (for Computer Use):
Note: Computer Use doesn't require CSS selectors. Claude navigates visually, so focus on understanding what the user will see, not DOM structure.
Example exploration:
Task: Explore
Find all routes and components for the [feature name] feature.
Look for page components, route definitions, and main UI views.
Based on your research, create a screenshot plan:
screenshot_plan = [
{
'name': '[feature]-overview',
'url': '/[feature-path]',
'wait_for': '.[main-container-class]', # CSS selector (will be converted to visual description)
'wait_time': 2000 # Additional wait time in milliseconds
},
{
'name': '[feature]-detail',
'url': '/[feature-path]/detail',
'selector': '.[specific-section]', # Optional: capture specific element
'wait_for': '.[section-class]',
'wait_time': 1500
}
]
Note: With Computer Use, CSS selectors like .main-container-class are automatically converted to visual descriptions like "element with class 'main-container-class'". Claude then finds the element visually on screen.
Naming convention:
feature-name-view.pngdashboards-overview.png, dashboards-metrics-panel.png[feature]-[view].pngCreate a Python script in scripts/screenshot/ for this feature:
#!/usr/bin/env python3
"""
Capture screenshots for [Feature Name]
"""
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent))
from screenshot.factory import create_capturer_from_plan # Uses Computer Use by default
import config as cfg
def capture_[feature]_screenshots():
base_url = cfg.get_product_url()
screenshot_plan = [
# Add your screenshot plan here
]
print(f"📸 Capturing {len(screenshot_plan)} screenshots for [Feature Name]...")
create_capturer_from_plan(screenshot_plan, base_url) # Uses Computer Use automatically
print("✅ Screenshots captured successfully!")
if __name__ == '__main__':
capture_[feature]_screenshots()
Run the capture script:
cd /path/to/max-doc-ai
python3 scripts/screenshot/[feature]_capture.py
What happens (with Computer Use):
Expected duration:
Cost: ~$0.02 per screenshot with Claude Sonnet 4.5
Check the output directory (from config.yaml):
ls -lh output/screenshots/
Verify:
Create a summary of captured screenshots:
## Screenshots Captured for [Feature Name]
**Total:** [X] screenshots
**Location:** `output/screenshots/`
### Screenshot List:
1. **[feature]-overview.png**
- Description: Main overview of [feature]
- Size: [width]x[height]
- Shows: [what is visible]
2. **[feature]-detail.png**
- Description: Detailed view of [specific section]
- Size: [width]x[height]
- Shows: [what is visible]
[... continue for all screenshots ...]
### Next Steps:
1. Upload screenshots to Pylon CDN:
```bash
python3 scripts/pylon/upload.py --image output/screenshots/[feature]-overview.png
Use CloudFront URLs in documentation
Sync documentation to Pylon knowledge base
## Configuration
Screenshots are configured in `config.yaml`:
```yaml
screenshots:
viewport_width: 1280 # Display width (≤1280 recommended)
viewport_height: 800 # Display height (≤800 recommended)
format: "png"
quality: 90
model: "claude-sonnet-4-5"
max_iterations: 50
auth:
enabled: true
type: "sso" # or "username_password"
login_url: "${PRODUCT_URL}/login"
username: "${SCREENSHOT_USER}"
password: "${SCREENSHOT_PASS}"
sso_provider: "google"
output:
screenshots_dir: "./output/screenshots"
Viewport Size: Keep ≤1280x800 for optimal Computer Use coordinate accuracy. Consistent dimensions ensure professional-looking documentation.
Symptom: Screenshots show login page or authentication errors
Solution:
.env are correct: SCREENSHOT_USER and SCREENSHOT_PASSconfig.yamlmax_iterations in config (allows more time for auth)With Computer Use, session expiration is no longer an issue! Each capture session performs fresh authentication.
Symptom: Screenshots are blank or show loading state
Solution:
wait_time in screenshot planSymptom: Wrong element captured or content missing
Solution:
.dashboard-header better than .container-1)Symptom: Screenshot dimensions are wrong
Solution:
full_page=True in screenshot planselector parameterwait_time for animations or slow transitionsalt text when uploading to PylonFor complex scenarios requiring user interactions:
from screenshot.factory import create_capturer
with create_capturer() as capturer:
capturer.navigate('https://app.example.com/feature')
# Click to open modal
capturer.click('.open-modal-button')
capturer.wait(1000)
# Capture modal
capturer.capture('feature-modal', selector='.modal-container')
# Scroll to specific section
capturer.scroll_to('.metrics-section')
capturer.wait(500)
# Capture after scroll
capturer.capture('feature-metrics')
Note: With Computer Use, these interactions are handled visually by Claude. The click() and scroll_to() methods translate to natural language prompts that Claude executes by seeing the screen.
Capture different states of the same view:
from screenshot.factory import create_capturer
with create_capturer() as capturer:
# Empty state
capturer.navigate('/dashboards?empty=true')
capturer.capture('dashboards-empty-state')
# With data
capturer.navigate('/dashboards')
capturer.capture('dashboards-with-data')
Note: Complex state manipulation (like triggering loading states) requires Claude to interact with the UI naturally. If you need specific states, consider using URL parameters or asking Claude to perform the necessary actions via prompts.
After successful execution:
📸 Capturing 2 screenshots for [Feature Name]...
🌐 Starting Computer Use session...
Viewport: 1280x800
Model: claude-sonnet-4-5
🔐 Authenticating...
✅ Authentication complete
📍 Navigating to: https://app.example.com/feature
✅ Page loaded
📸 Capturing: feature-overview.png
✅ Saved: output/screenshots/feature-overview.png
📍 Navigating to: https://app.example.com/feature/detail
✅ Page loaded
📸 Capturing: feature-detail.png
✅ Saved: output/screenshots/feature-detail.png
✅ Session closed
✅ Screenshots captured successfully!
This skill is typically invoked as the first step in the release workflow:
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer