Grok logo

Grok

Community
smithjohn78390
grok

Grok X 实时抓取:让 Claude 调用本地 grok-build 获取真实 X (Twitter) 帖子。 X 模式必须优先驱动 Grok 原生 X 工具族:x_keyword_search、x_semantic_search、 x_user_search、x_thread_fetch;必要时再用 web_search/open_page 交叉验证。 返回带 @用户名、点赞/浏览数、链接、时间的真实帖子。复用用户已登录的 grok.com 订阅, 调用零额外成本(不像 MCP 方案要 xAI API key 按 token 付费)。 三种模式:x(X 实时抓取,主力)、ask(把 Grok 当独立第二意见)、continue(续接追问)。 当用户需要真实 X/Twitter 实时数据时使用,例如: 问问 grok X 上在聊什么、让 grok 搜 X 上对某事的实时讨论、grok 看看 @某账号最近发了什么、 X 上现在怎么说、X 实时热点、X 实时趋势、ask grok what X is saying about、 grok 第二意见、consult grok。 排除(不要触发本 skill):写 X 推文 → 用 x-twitter-writer;大规模历史语料采集 → 用 x-sousuo;泛网络调研 → 用 smart-research。本 skill 的差异点是 Grok 对公共 X 搜索 工具有原生路径,适合可复核的 X 话语采样;不是 firehose,也不是事实裁判。 没有"公共 X 搜索 / X 实时反馈 / thread 上下文"诉求时不要用它。

Overview

Publishersmithjohn78390
Repositorysmith--skills
Skill namegrok
Stars
49
Forks
11
Bundled files
2
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 2 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by smithjohn78390 on GitHub. Read the source before you install it.

Installation

Install the Grok AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/smithjohn78390/smith--skills/tree/main/grok
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/smithjohn78390/smith--skills.git /tmp/smith--skills
mkdir -p .claude/skills
cp -r /tmp/smith--skills/grok .claude/skills/grok
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Grok in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Grok on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Grok is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

/grok — Claude 调用 Grok

主战场是 X (Twitter) 公共搜索与实时话语采样。x 模式要把任务显式交给 Grok 的 X 工具族:

  • x_keyword_search:精确关键词、账号操作符、日期、互动阈值、Top/Latest 排序
  • x_semantic_search:自然语言话题、模糊趋势、观点/情绪采样
  • x_user_search:用户或账号发现
  • x_thread_fetch:已知 post URL/ID/thread 的上下文抓取
  • web_search / open_page:事实核验、媒体报道、第三方趋势页补充

次要场景:把 Grok 当独立第二意见用。复用 grok.com 订阅,零额外成本(vs MCP 方案要 xAI API key 按 token 付)。

诚实声明:这个 skill 通过 Grok CLI 发 prompt,不能像 REST Responses API 那样在请求体里 强制声明 tools: [{type: "x_search"}]。它能做的是把工具选择、证据字段和输出格式写进 prompt, 让 Grok 在当前运行时暴露这些 X 工具时优先使用。它不是 firehose,也不能看 DM、私有账号、 个人级点赞/书签。

所有调用逻辑(filesystem boundary、模式模板、超时、错误处理、临时文件清理)都收敛在 scripts/grok-call.sh 一个脚本里。本 skill 只负责:识别模式 → 写 query 文件 → 调脚本 → 转达结果。

怎么调用(三步,所有模式通用)

  1. 用 Write 工具把用户问题原文写入临时文件,如 /tmp/grok-q-<时间戳>.txt。 为什么用 Write 而不是 shell heredoc:用户问题里若含 EOF、$、反引号、rm -rf 这类字符,heredoc 会被截断或触发命令注入。Write 把问题当纯数据落盘,脚本再 cat 读入,全程不经 shell 解析,从根上杜绝这个问题。

  2. 运行脚本,<mode> 取 x / ask / continue:

    bash
    bash ~/.cc-switch/skills/grok/scripts/grok-call.sh <mode> /tmp/grok-q-<时间戳>.txt

    脚本会自动拼好 filesystem boundary + 对应模式模板 + 用户问题,调 grok(超时 330s), 跑完自清理临时文件。它还自带前置检查:grok 不存在退出码 3,参数错退 2,超时退 124。

  3. stdout 即 grok 回复,原样转给用户,不要二次总结或改写风格。保留 @用户名、 互动数据、链接。按下面格式包一层:

    ━━━ Grok 回复 ━━━
    <grok stdout 原文>
    ━━━━━━━━━━━━━━━━

三个模式怎么选

解析用户输入决定 <mode>,模糊时用 AskUserQuestion 确认:

  • x(主力):要公共 X 数据、实时反馈、限定时间窗采样、账号近期动态、具体 thread 上下文。 触发:/grok x、"X 上 ..."、"推特上 ..."、"X 热点/趋势"、"grok 看看 @某账号"、 "抓这条 X thread"。脚本模板已强制 X 工具选择、证据链接、post ID、时间戳、互动数据和限制说明。
  • ask:通用问答 / 第二意见,非 X 场景。触发:/grok 后跟普通问题、"grok 第二意见"、 "consult grok"。脚本模板开放 web search,要 grok 给独立判断、不附和。
  • continue:续接最近一次 grok 对话追问。触发:"继续问 grok"、"接着问"。脚本带 -c, query 文件只放追问内容即可。注意 -c 续接的是当前工作目录最近的 session,跨目录不保证命中。

错误处理(脚本退出码)

  • 0 成功 — stdout 是 grok 回复
  • 124 超时(5.5 分钟)— 提示用户重试或简化问题
  • 3 环境错 — grok 没装(提示去 https://grok.com 安装)或 query 文件丢失
  • 2 参数错 — mode 不对或缺 query 文件
  • 其他 — grok 自身错误码,stderr 有诊断头两行

脚本把诊断信息写 stderr、正文写 stdout,所以 stdout 永远是干净正文。

何时不该用本 skill

  • 单纯查代码、改文件 → 用 Claude 自己,别绕道 grok
  • 需要多轮深聊(5+ 回合)→ 直接进 grok TUI(终端跑 grok 不带参数)更顺手
  • 写 X 推文 → x-twitter-writer
  • 大规模历史语料抓取、批量导出、定时采集 → x-sousuo
  • 泛网络调研、论文/新闻/网页为主 → smart-research
  • 只要读本地代码或改文件 → Claude 自己做,别绕道 grok

已知限制

  • 每次调用冷启动 3-5s + 抓 X 思考时间,单次可能 30s-2min,属正常
  • grok-build 是固定模型,不支持调思考深度(传 --effort 会报 400,脚本已不传)
  • X 搜索是公共索引采样,不是全量 firehose
  • X 精确互动数(赞/浏览/转发/回复/书签)可能缺字段,缺失时必须说明
  • X 数据不能单独当事实源;涉及事实判断时必须用网页来源交叉验证

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Grok AI skill do?

Grok X 实时抓取:让 Claude 调用本地 grok-build 获取真实 X (Twitter) 帖子。 X 模式必须优先驱动 Grok 原生 X 工具族:x_keyword_search、x_semantic_search、 x_user_search、x_thread_fetch;必要时再用 web_search/open_page 交叉验证。 返回带 @用户名、点赞/浏览数、链接、时间的真实帖子。复用用户已登录的 grok.com 订阅, 调用零额外成本(不像 MCP 方案要 xAI API key 按 token 付费)。 三种模式:x(X 实时抓取,主力)、ask(把 Grok 当独立第二意见)、continue(续接追问)。 当用户需要真实 X/Twitter 实时数据时使用,例如: 问问 grok X 上在聊什么、让 grok 搜 X 上对某事的实时讨论、grok 看看 @某账号最近发了什么、 X 上现在怎么说、X 实时热点、X 实时趋势、ask grok what X is saying about、 grok 第二意见、consult grok。 排除(不要触发本 skill):写 X 推文 → 用 x-twitter-writer;大规模历史语料采集 → 用 x-sousuo;泛网络调研 → 用 smart-research。本 skill 的差...

Why use Grok on TypingMind?

Because you install it once and use it with any model. Grok is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Grok in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/smithjohn78390/smith--skills/tree/main/grok. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Grok?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Grok?

As many as you like. As long as a model supports skills, you can use Grok with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Grok AI skill free?

It is published on GitHub by smithjohn78390. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇