geo-query-mining
Skill0 starsChanged 3 months agoMITView on GitHub
Reverse-engineers the exact web-search queries ChatGPT issues when answering a user prompt, by driving a logged-in Chrome session via the chrome-devtools MCP and parsing the conversation's network traffic. Outputs a deduped query list, an SEO/GEO content brief, and a keyword-map CSV ready for blog production. Use when the user says "mine ChatGPT queries", "GEO query mining", "what queries does ChatGPT run for X", "AI search intent", or asks to build SEO content from real LLM search behaviour.
In this repository5 other files it gives its agents.
- fish-audio-ttsSkill
- google-ads-transparencySkill
- human-writing-filterSkill
- sa-compliance-officerSkill
- tidy-downloadsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 3 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
If any prerequisite fails, surface a clear instruction and stop — do not try workarounds.
- Distinctive: line 33
Keep prompts natural and intent-rich.
- Very specific: line 45
Prefer evaluate_script to set the composer's value + dispatch input events, then click send.
- Very specific: line 50
No new network request for ≥ 3 seconds (poll list_network_requests).
- Very specific: line 59
If body is SSE (data: lines), split on \n\n and JSON-parse each data: payload.
- Very specific: line 63
If no queries are found, fall back to grepping the raw body for "query": / "q": patterns — ChatGPT's schema mutates often, and a regex pass …
- Very specific: line 76
Write three artefacts to ./geo-mining-output/<topic-slug>/:
- Very specific: line 100
All artefacts go to ./geo-mining-output/<topic-slug>/ relative to the current working directory.
- Distinctive: line 102
Never overwrite an existing folder without confirmation — append a date suffix instead.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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
GEO Query Mining
Find the queries ChatGPT actually fires at the web when a user asks it a question, then turn those queries into SEO-optimised blog briefs. Higher signal than guessing keywords — these are the literal strings the LLM uses to retrieve sources it cites.
When to use
- User wants to write content that ChatGPT/Perplexity/Claude will cite (GEO, not just SEO)
- User has a target topic or business vertical and wants to know what an LLM searches for when asked about it
- User is building a content cluster and wants the LLM's view of intent, not Google Keyword Planner's
Prerequisites — verify before starting
- Chrome started with remote debugging. The user must launch Chrome with
--remote-debugging-port=9222(or whatever port chrome-devtools MCP is configured for). Ifmcp__chrome-devtools__list_pagesreturns empty or errors, stop and instruct the user to relaunch Chrome with debugging enabled. - ChatGPT logged in. A tab at
https://chatgpt.com/must be open and signed in. Iflist_pagesshows no chatgpt.com tab, ask the user to open one. - Web search enabled in the conversation. The user should be in a model that uses web search (GPT-4o / GPT-5 with the Search tool on). If responses come back without web citations, the queries won't be in the network traffic.
If any prerequisite fails, surface a clear instruction and stop — do not try workarounds.
Workflow
1. Gather seed prompts
Work with the user to draft 3–10 user-style prompts that real searchers would type into ChatGPT for their business or topic. Examples for a financial services client:
- "best retirement annuity providers in South Africa 2026"
- "how does Section 12J compare to a TFSA"
- "is Acme Financial FSP licensed"
Keep prompts natural and intent-rich. Avoid generic queries — the goal is to capture how ChatGPT decomposes a realistic question.
Confirm the list with the user before running.
2. Set up the capture session
For each prompt, run this sequence using the chrome-devtools MCP:
list_pages→ find the chatgpt.com tab;select_pageit.evaluate_script→() => window.location.pathnameto capture the current conversation ID (last URL segment, e.g./c/abcd-1234-...). If the user explicitly wants a fresh conversation per prompt,navigate_pagetohttps://chatgpt.com/first.list_network_requestsonce before sending the prompt — note the count, so step 5 only diffs new requests.- Submit the prompt:
- Prefer
evaluate_scriptto set the composer's value + dispatch input events, then click send. The textarea selector and send-button selector drift; usetake_snapshotfirst to find them by role/aria. - Fallback:
fillthe composer by selector, thenclickthe send button.
- Prefer
wait_fora stable end-of-stream marker. Reliable signals (in order of preference):- The send button re-enables (was disabled while streaming).
- A "Regenerate" / "Copy" button appears on the last assistant message.
- No new network request for ≥ 3 seconds (poll
list_network_requests).
list_network_requestsfiltered by URL substring matching the conversation ID. Pull every matching request.
3. Extract the queries
ChatGPT's web search tool calls appear in the streaming response body of POST /backend-api/conversation (or the newer /backend-api/f/conversation variant). They are SSE events containing tool_calls / tool_use blocks where the tool name is web / search / browser (the exact name has changed over time — match any of: search, browser.search, web.run, bing, web_search).
For each matched request, get_network_request to read the body, then:
- If body is SSE (
data:lines), split on\n\nand JSON-parse eachdata:payload. - Walk the JSON for any field whose key contains
query,queries,search_query,q, orinputdirectly under a search/browser tool call object. - Collect every string. Strip whitespace. Lowercase for dedup but keep original casing for the output.
If no queries are found, fall back to grepping the raw body for "query": / "q": patterns — ChatGPT's schema mutates often, and a regex pass over the streamed JSON catches most variants. Log the request IDs you parsed so the user can spot-check.
See references/network-parsing.md for current ChatGPT payload shapes and known schema drift.
4. Cluster and write outputs
Dedupe queries across all seed prompts. Group by inferred intent (informational, commercial, navigational, comparison, location-specific). For each cluster:
- Primary query — the strongest representative
- Variants — other queries in the cluster
- Intent — one of: informational, commercial-investigation, transactional, navigational, local
- GEO signal — what an LLM is hoping to find (a definition, a comparison table, a price, a licence number, a process)
Write three artefacts to ./geo-mining-output/<topic-slug>/:
queries.md— flat deduped list grouped by cluster, with the originating ChatGPT prompt(s) for each.brief.md— SEO/GEO content brief using templates/brief-template.md. One brief per major cluster (don't bundle unrelated intents into one post).keyword-map.csv— using templates/keyword-map.csv headers. Leave volume/difficulty columns blank for the user to fill from Ubersuggest or similar.
5. Hand off
- Briefs are designed to feed straight into your content-drafting workflow.
- For financial-services client work, the draft must still pass human-writing-filter (step 4.5) and sa-compliance-officer (financial services) before delivery.
- Mention the hand-off in the final response so the user knows the next command.
Failure modes — handle explicitly
| Symptom | Cause | Action |
list_pages empty | Chrome not launched with debug port | Tell user to relaunch Chrome with --remote-debugging-port=9222; stop. |
| No chatgpt.com tab | Not logged in / closed | Ask user to open and sign in; stop. |
| Network request body empty | ChatGPT served from cache or request not captured live | Refresh the page (navigate_page to same URL), re-run the prompt. |
Body has no tool_calls / search events | Model didn't use web search for this prompt | Note in output; either prompt was too generic or web search was off. Suggest re-running with a more search-triggering phrasing. |
| Schema doesn't match references | ChatGPT updated their backend | Fall back to regex over the raw body; log the new shape; flag for references/network-parsing.md update. |
Output location
All artefacts go to ./geo-mining-output/<topic-slug>/ relative to the current working directory. <topic-slug> is a kebab-case slug derived from the user's stated topic (e.g. retirement-annuities).
Never overwrite an existing folder without confirmation — append a date suffix instead.
Ethics and scope
This skill reads the user's own logged-in ChatGPT conversations via DevTools they already have access to. It does not bypass auth, scrape other users' sessions, or violate OpenAI's ToS as long as the user is mining their own queries. If the user asks to capture someone else's conversation or to automate at scale beyond personal use, stop and flag it.
Does 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.

