agentleFS
MDizzleZAMDizzleZA/claude-skills/geo-query-mining/SKILL.md

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.

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
  1. Distinctive:

    If any prerequisite fails, surface a clear instruction and stop — do not try workarounds.

    line 22
  2. Distinctive:

    Keep prompts natural and intent-rich.

    line 33
  3. Very specific:

    Prefer evaluate_script to set the composer's value + dispatch input events, then click send.

    line 45
  4. Very specific:

    No new network request for ≥ 3 seconds (poll list_network_requests).

    line 50
  5. Very specific:

    If body is SSE (data: lines), split on \n\n and JSON-parse each data: payload.

    line 59
  6. Very specific:

    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 …

    line 63
  7. Very specific:

    Write three artefacts to ./geo-mining-output/<topic-slug>/:

    line 76
  8. Very specific:

    All artefacts go to ./geo-mining-output/<topic-slug>/ relative to the current working directory.

    line 100
  9. Distinctive:

    Never overwrite an existing folder without confirmation — append a date suffix instead.

    line 102

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Chrome started with remote debugging. The user must launch Chrome with --remote-debugging-port=9222 (or whatever port chrome-devtools MCP is configured for). If mcp__chrome-devtools__list_pages returns empty or errors, stop and instruct the user to relaunch Chrome with debugging enabled.
  2. ChatGPT logged in. A tab at https://chatgpt.com/ must be open and signed in. If list_pages shows no chatgpt.com tab, ask the user to open one.
  3. 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:

  1. list_pages → find the chatgpt.com tab; select_page it.
  2. evaluate_script → () => window.location.pathname to capture the current conversation ID (last URL segment, e.g. /c/abcd-1234-...). If the user explicitly wants a fresh conversation per prompt, navigate_page to https://chatgpt.com/ first.
  3. list_network_requests once before sending the prompt — note the count, so step 5 only diffs new requests.
  4. Submit the prompt:
    • Prefer evaluate_script to set the composer's value + dispatch input events, then click send. The textarea selector and send-button selector drift; use take_snapshot first to find them by role/aria.
    • Fallback: fill the composer by selector, then click the send button.
  5. wait_for a 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).
  6. list_network_requests filtered 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\n and JSON-parse each data: payload.
  • Walk the JSON for any field whose key contains query, queries, search_query, q, or input directly 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>/:

  1. queries.md — flat deduped list grouped by cluster, with the originating ChatGPT prompt(s) for each.
  2. brief.md — SEO/GEO content brief using templates/brief-template.md. One brief per major cluster (don't bundle unrelated intents into one post).
  3. 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

SymptomCauseAction
list_pages emptyChrome not launched with debug portTell user to relaunch Chrome with --remote-debugging-port=9222; stop.
No chatgpt.com tabNot logged in / closedAsk user to open and sign in; stop.
Network request body emptyChatGPT served from cache or request not captured liveRefresh the page (navigate_page to same URL), re-run the prompt.
Body has no tool_calls / search eventsModel didn't use web search for this promptNote 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 referencesChatGPT updated their backendFall 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.