Claude-skill-registry ai-analysis
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/ai-analysis" ~/.claude/skills/majiayu000-claude-skill-registry-ai-analysis && rm -rf "$T"
skills/data/ai-analysis/SKILL.mdAI Analysis Tools
Important: Use Scripts First
ALWAYS prefer the scripts in
over raw scripts/
API calls. Scripts
are located in the curl
scripts/ subdirectory of this skill's folder. They provide
features that raw commands do not:
- Proper image encoding (WebP conversion, alpha removal)
- Appropriate model selection for each task
- Structured output handling (boolean responses via exit codes)
- Meaningful exit codes for shell integration
When to read the script source: If a script doesn't do exactly what you need, or fails due to missing dependencies, read the script source. The scripts encode Gemini API best practices (image ordering, structured output schemas, model selection) that may not be obvious—use them as reference when building similar functionality.
Quick Start
Environment: Set
GEMINI_API_KEY before running any commands.
Dependencies:
curl, jq (all tools); base64, magick (image tools
only)
# Describe an image (generate alt-text) scripts/screenshot-describe screenshot.png # Compare two images for visual differences scripts/screenshot-compare before.png after.png # Generate essay-length analysis from text scripts/emerson "Summarize the key changes" < documentation.md # Evaluate a boolean condition against text echo "Hello world" | scripts/satisfies "is a greeting"
Script Overview
screenshot-describe
Generate concise alt-text for an image. Optimized for UI captures.
scripts/screenshot-describe IMAGE [PROMPT]
Exit codes: 0 success, 1 error, 127 missing dependency
screenshot-compare
Compare two images for visual differences. Identifies layout shifts, color changes, padding, and text updates.
scripts/screenshot-compare IMAGE1 IMAGE2 [PROMPT]
Exit codes: 0 differences found, 1 error, 2 images identical, 127 missing dependency
emerson
Generate essay-length (~3000 words) analysis from text input. Produces authoritative, footnoted Markdown.
scripts/emerson "PROMPT" < input.txt
Exit codes: 0 success, 1 error, 127 missing dependency
satisfies
Evaluate whether input text satisfies a condition. Returns boolean via exit code.
echo "text" | scripts/satisfies "CONDITION"
Exit codes: 0 true (satisfies), 1 false (does not satisfy), 127 missing dependency
Examples:
# Check if file mentions a topic cat file.txt | scripts/satisfies "mentions Elvis" && echo "Found it" # Validate content type cat response.json | scripts/satisfies "is valid JSON with an 'id' field" # Use in conditionals if cat log.txt | scripts/satisfies "contains error messages"; then echo "Errors detected" fi
Image Encoding Notes
- Images converted to lossless WebP for consistent encoding
- Alpha channel removed (
) so transparency-only differences are ignored-alpha off - Base64: use
(Linux) or-w 0
(macOS) for single-line output-b 0 - Single-image prompts: image before text (Gemini best practice)
- Multi-image comparison: text before images (Gemini best practice)
Safety Notes
- Scripts require network access to the Gemini API
must be set in the environmentGEMINI_API_KEY- API calls may incur usage costs
- Large images increase request size and latency
- Scripts do not store or log input data
References
- Command Index - Detailed documentation for each script
- Troubleshooting - Common issues and solutions