claude/skills/grok-query/SKILL.md
Query X's Grok AI through agent-browser to get real-time analysis powered by X's live post data. Use this skill whenever the user wants to ask Grok a question, get Grok's opinion, leverage X/Twitter discussion data for analysis, or when the user says "ask Grok", "Grok 怎么看", "用 Grok 查一下", "问问 Grok", "Grok 分析", "帮我问 Grok", or references getting AI analysis that specifically needs X/Twitter's real-time post data. This skill is distinct from web search — Grok has access to live X posts and discussions that web search tools cannot reach.
npx skillsauth add dragonkid/dotfiles grok-queryInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Query X's Grok AI through browser automation to get analysis backed by real-time X post data.
Grok has direct access to X/Twitter's full post corpus — trending discussions, sentiment shifts, community reactions, breaking narratives. For crypto sentiment, breaking news reactions, community FUD/FOMO analysis, or any topic where X discussions are the primary signal, Grok provides data that web search tools cannot reach.
chrome://inspect/#remote-debugging checkbox)
and be logged into XChrome 144+ shows an "Allow remote debugging?" dialog on every new CDP WebSocket connection.
Never use --auto-connect open <url> — it bundles connection + navigation, and if the user
is slow to click Allow, agent-browser times out and retries, stacking dialogs that make
buttons appear unresponsive.
Always connect separately first, then navigate:
WS_PATH=$(sed -n '2p' ~/Library/Application\ Support/Google/Chrome/DevToolsActivePort)
agent-browser connect "ws://127.0.0.1:9222${WS_PATH}"
The user clicks Allow on Chrome's dialog. Once connect succeeds, all subsequent commands
in this session work without further dialogs.
Always open a new tab for each query — this preserves the user's existing tabs and allows clean cleanup after extraction.
agent-browser tab new "https://x.com/i/grok"
agent-browser wait --load networkidle
To resume a previous conversation:
agent-browser tab new "https://x.com/i/grok?conversation=<ID>"
agent-browser wait --load networkidle
Snapshot to find the input field, fill it, then re-snapshot to find the submit button.
Refs shift after fill — the ref you found before filling will point to a different element after. This is the most common source of bugs: clicking "专家" instead of "问 Grok 问题" because you used a stale ref.
# Find input, fill question
agent-browser snapshot -i -c | grep -E "textbox"
agent-browser fill @<input-ref> "<question>"
# MUST re-snapshot — refs have changed
agent-browser snapshot -i -c | grep -E "button.*(问|Grok 问题|submit)"
# Scroll into view and click — sometimes the button is obscured
agent-browser scrollintoview @<submit-ref>
agent-browser click @<submit-ref>
Do not press Enter — Grok's input intercepts it for newlines.
Don't use keyword detection ("思考"/"Thinking") — these words can appear in Grok's response text or cited tweets and cause the poll to never exit.
Instead, use content stabilization: poll until two consecutive reads return the same content, meaning Grok has finished writing.
sleep 10
PREV=""
for i in $(seq 1 24); do
CURR=$(agent-browser eval --stdin 2>&1 <<'JSEOF'
(() => (document.querySelector('main')?.innerText || '').length.toString())()
JSEOF
)
if [ -n "$PREV" ] && [ "$CURR" = "$PREV" ]; then
echo "Content stabilized at poll $i (length: $CURR)"
break
fi
PREV="$CURR"
sleep 5
done
Then extract the full response:
agent-browser eval --stdin <<'JSEOF'
(() => {
const main = document.querySelector('main');
return main ? main.innerText : 'ERROR: main element not found';
})()
JSEOF
If the response seems truncated (ends mid-sentence), scroll down and re-extract:
agent-browser scroll down 5000
sleep 2
# re-run the eval above
agent-browser eval --stdin <<'JSEOF'
(() => window.location.href)()
JSEOF
Save the conversation ID from x.com/i/grok?conversation=<ID> — use it for follow-ups
instead of starting new conversations.
Close only the Grok tab (not the entire browser session):
agent-browser tab close
This leaves the CDP connection alive and the user's other tabs untouched. Use
agent-browser close only when you're done with all browser automation for the session.
The raw main.innerText includes sidebar navigation mixed in. Clean it up:
To continue in the same conversation:
agent-browser tab new "https://x.com/i/grok?conversation=<ID>"agent-browser tab close when done| Problem | Solution |
|---------|----------|
| Dialog buttons unresponsive | Multiple dialogs stacked — agent-browser close, then reconnect with Step 1 |
| Connection timeout | Verify chrome://inspect/#remote-debugging checkbox is enabled |
| DevToolsActivePort not found | Chrome not running or remote debugging not enabled |
| Clicked wrong button | Refs shifted after fill — always re-snapshot before clicking |
| Poll loop never exits | Content length stabilization should handle this; if not, increase sleep interval |
| Partial/truncated response | Scroll down 5000px then re-extract |
| Empty main.innerText | Page still loading — agent-browser wait --load networkidle then retry |
| Lost conversation | Use saved conversation ID, or click "聊天历史记录" button |
tools
Use when user wants to manage TODO items - adding tasks, listing pending items, marking done, removing, or searching. Triggers on /todo command or TODO-related requests.
tools
Use when creating a new skill, updating an existing skill, or troubleshooting skill frontmatter, gating, or slash command registration issues in OpenClaw.
tools
手动触发自我改进与记忆维护。分析近期 memory 文件,维护工作区文件,提出改进提案。触发方式:/self_improve 或用户说"自我改进"、"self improve"。
testing
测试 OpenClaw 配置中 LLM provider 的可用性。触发方式:/provider_check 或用户问"测试 provider 可用性"、"检查 provider 状态"、"provider 健康检查"。