ClaudeSkillCollection / chrome-devtools-optimizer
CLAUDE.md7 starsChanged 14 months agoMITView on GitHub
Add this alias to ~/.bashrc for quick access: Without Gemini, you lose 50% of savings on visual analysis tasks. ~1,000 tokens (vs ~6,000 with screenshots)
- Installs packages
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- batch-security-migrationSkill
- chrome-devtools-optimizerSkill
- claude-guideSkill
- cybersecurity-policy-generatorSkill
- docx-smart-extractorSkill
- gdpr-auditorSkill
- incident-response-playbook-creatorSkill
- pdf-smart-extractorSkill
- plugin-security-checkerSkill
- sbomSkill
- security-hooksSkill
- security-memory-templatesSkill
- security-report-builderSkill
- xlsx-smart-extractorSkill
The file
We split this CLAUDE.md into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Add this alias to ~/.bashrc for quick access:
- Distinctive: line 53
Use optimized MCP tools (see decision tree below)
≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Chrome DevTools Optimizer
Daily Usage (Fast)
# Start Chrome (once per session)
chrome-debug
# Process any screenshot through Gemini (instead of viewing in Claude)
gemini-vision /tmp/screenshot.jpg
gemini-vision /tmp/screenshot.jpg "find all buttons"Add this alias to ~/.bashrc for quick access:
alias gemini-vision='node ~/ClaudeSkillCollection/chrome-devtools-optimizer/scripts/process-screenshot.js'Quick Decision
- Need to click/fill/automate? → Use
take_snapshot - Need to see visuals? → Save screenshot to file, then
gemini-vision <file> - Need both? → Snapshot first, Gemini only if visual issue
WSL2 Quick Setup
# Check Chrome → install if missing
which google-chrome || (wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && sudo apt update && sudo apt install -y google-chrome-stable)
# Check alias → add if missing
grep -q "chrome-debug" ~/.bashrc || echo "alias chrome-debug='mkdir -p /tmp/chrome-debug-profile && google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-profile --no-sandbox > /tmp/chrome.log 2>&1 &'" >> ~/.bashrc && source ~/.bashrc
# Check MCP config → add if missing (restart Claude Code after)
jq -e '.mcpServers["chrome-devtools"]' ~/.claude/settings.json >/dev/null 2>&1 || (jq '.mcpServers["chrome-devtools"] = {"command":"npx","args":["-y","chrome-devtools-mcp@latest","--browserUrl","http://localhost:9222"],"env":{}}' ~/.claude/settings.json > /tmp/s.tmp && mv /tmp/s.tmp ~/.claude/settings.json && echo "Restart Claude Code")Gemini API Setup (REQUIRED for full optimization)
# Test if configured
node chrome-devtools-optimizer/scripts/test-connection.js
# If not configured, run setup (get free key: https://aistudio.google.com/apikey)
node chrome-devtools-optimizer/scripts/setup.jsWithout Gemini, you lose 50% of savings on visual analysis tasks.
Usage
- Start Chrome:
chrome-debug - Verify Gemini:
node scripts/test-connection.js - Use optimized MCP tools (see decision tree below)
Token Optimization Decision Tree
| Need | Use | Tokens |
| Page structure/elements | take_snapshot | 300-1,500 |
| Visual appearance | take_screenshot → Gemini | ~300 |
| Single element visual | take_screenshot with uid | 400-800 |
| Form values/state | evaluate_script | 50-100 |
| Console errors | list_console_messages (filtered) | 100-300 |
| Network calls | list_network_requests (filtered) | 200-500 |
Anti-Patterns (Avoid)
- Screenshot after every action → Use snapshot or verify only when needed
- Multiple
fill()calls → Use singlefill_form() - Unfiltered console/network → Always use
types/resourceTypes+pageSize - Full page screenshot for one element → Use
uidparameter
Example: Optimized Login Flow
1. navigate_page → login URL
2. take_snapshot → get form UIDs
3. fill_form → all credentials at once
4. click → submit button by uid
5. evaluate_script → check URL (verify redirect)
6. take_snapshot → confirm dashboard~1,000 tokens (vs ~6,000 with screenshots)
Troubleshooting
# Chrome logs
cat /tmp/chrome.log
# Verify Chrome running
ps aux | grep chrome
# Test connection
curl http://localhost:9222/jsonDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

