$npx -y skills add PleasePrompto/google-ai-mode-skill --skill google-ai-mode-skillUse this skill when the user requests current information, documentation, coding examples, or web research beyond the knowledge cutoff. Queries Google's AI Search mode to retrieve comprehensive AI-generated overviews with source citations from 100+ websites. Returns markdown with
| 1 | # Google AI Mode Skill |
| 2 | |
| 3 | Query Google's AI Search mode to retrieve comprehensive, source-grounded answers from across the web. |
| 4 | |
| 5 | ## When to Use This Skill |
| 6 | |
| 7 | Trigger this skill when the user: |
| 8 | - Requests current information beyond the knowledge cutoff (post-January 2025) |
| 9 | - Needs documentation or API references for libraries and frameworks |
| 10 | - Asks for coding examples or implementation patterns |
| 11 | - Wants technical comparisons or best practices |
| 12 | - Requires research with citations and sources |
| 13 | - Mentions "Google AI search", "Google AI mode", or "web research" |
| 14 | |
| 15 | ## CLI Flags |
| 16 | |
| 17 | ### Essential Flags |
| 18 | |
| 19 | **`--debug`** - Enable comprehensive logging |
| 20 | ```bash |
| 21 | python scripts/run.py search.py --query "..." --debug |
| 22 | ``` |
| 23 | - Saves detailed logs to `logs/search_YYYY-MM-DD_HH-MM-SS.log` |
| 24 | - Logs every step: browser launch, CAPTCHA detection, AI content waiting, citation extraction |
| 25 | - Essential for troubleshooting CAPTCHA issues or failed searches |
| 26 | - Log file path printed at completion |
| 27 | |
| 28 | **`--save`** - Save results to skill folder |
| 29 | ```bash |
| 30 | python scripts/run.py search.py --query "..." --save |
| 31 | ``` |
| 32 | - Saves markdown to `results/YYYY-MM-DD_HH-MM-SS_Query_Name.md` |
| 33 | - Timestamped filename for organized storage |
| 34 | - Results preserved in skill directory for future reference |
| 35 | - Use instead of `--output` for automatic naming |
| 36 | |
| 37 | **Combined usage** (recommended for debugging): |
| 38 | ```bash |
| 39 | python scripts/run.py search.py --query "..." --debug --save |
| 40 | ``` |
| 41 | |
| 42 | ### Other Flags |
| 43 | |
| 44 | **`--show-browser`** - Show browser window (for CAPTCHA solving) |
| 45 | ```bash |
| 46 | python scripts/run.py search.py --query "..." --show-browser |
| 47 | ``` |
| 48 | |
| 49 | **`--output <path>`** - Custom output file path |
| 50 | ```bash |
| 51 | python scripts/run.py search.py --query "..." --output result.md |
| 52 | ``` |
| 53 | |
| 54 | **`--json`** - Include JSON metadata in output |
| 55 | ```bash |
| 56 | python scripts/run.py search.py --query "..." --output result.md --json |
| 57 | ``` |
| 58 | |
| 59 | ## Query Optimization Strategy |
| 60 | |
| 61 | **CRITICAL**: Always optimize user queries before execution. Google AI Mode's quality depends on query precision. |
| 62 | |
| 63 | ### Optimization Template |
| 64 | |
| 65 | ``` |
| 66 | [Technology/Topic] [Version] [Year] ([Specific Aspect 1], [Aspect 2], [Aspect 3]). [Output format request]. |
| 67 | ``` |
| 68 | |
| 69 | ### Optimization Rules |
| 70 | |
| 71 | 1. **Include Current Year (2026)** for up-to-date results |
| 72 | 2. **Use parentheses** to list specific aspects needed |
| 73 | 3. **Request structured output** (tables, comparisons, categorized lists) |
| 74 | 4. **Include version numbers** for library/framework queries |
| 75 | |
| 76 | ### Examples |
| 77 | |
| 78 | | User Query | Optimized Query | |
| 79 | |-----------|----------------| |
| 80 | | "React hooks" | "React hooks best practices 2026 (useState, useEffect, custom hooks, common pitfalls). Provide code examples." | |
| 81 | | "What's new in Rust?" | "Rust 1.75 new features 2026 (async traits, impl Trait improvements, const generics, stabilized APIs). Include migration guide and code examples." | |
| 82 | | "PostgreSQL vs MySQL performance?" | "PostgreSQL vs MySQL performance comparison 2026 (query optimization, indexing strategies, concurrent writes, JSON handling, scaling patterns). Provide benchmark data and use case recommendations." | |
| 83 | | "How to handle errors in Go?" | "Go error handling patterns 2026 (error wrapping, custom errors, sentinel errors, panic vs error, testing error cases). Provide code examples and best practices comparison." | |
| 84 | | "Learn FastAPI basics" | "FastAPI tutorial 2026 (routing, dependency injection, async endpoints, request validation with Pydantic, OpenAPI documentation, testing). Include step-by-step implementation guide." | |
| 85 | |
| 86 | **Note:** If user provides an already detailed query with version numbers and requirements, use it as-is. |
| 87 | |
| 88 | ### Workflow |
| 89 | |
| 90 | 1. Receive user request |
| 91 | 2. Optimize query using template above |
| 92 | 3. Inform user: "Searching for: '[optimized query]'" |
| 93 | 4. Execute search with `--save --debug` flags |
| 94 | 5. Return results with inline citations [1][2][3] |
| 95 | |
| 96 | ## Script Execution |
| 97 | |
| 98 | **CRITICAL**: Always use the `run.py` wrapper. Direct script execution will fail. |
| 99 | |
| 100 | ### Basic Search |
| 101 | |
| 102 | ```bash |
| 103 | python scripts/run.py search.py --query "Your search query" |
| 104 | ``` |
| 105 | |
| 106 | ### Recommended Usage |
| 107 | |
| 108 | ```bash |
| 109 | python scripts/run.py search.py --query "..." --save --debug |
| 110 | ``` |
| 111 | |
| 112 | The `run.py` wrapper automatically: |
| 113 | - Creates `.venv` on first run |
| 114 | - Installs dependencies (patchright, beautifulsoup4, html-to-markdown) |
| 115 | - Activates virtual environment |
| 116 | - Executes search script |
| 117 | - Installs Google Chrome (not Chromium) for anti-detection |
| 118 | |
| 119 | ## How It Works |
| 120 | |
| 121 | 1. **Persistent Browser Context**: Uses saved browser profile at `~/.cache/google-ai-mode-skill/chrome_profile |