context-mode
它能做什么
这个技能告诉 AI 智能体在探索代码、搜索文件和运行繁重命令时,如何使用 context-mode 工具。适合安装了 context-mode 工具并使用 Antigravity CLI 的用户。
适用场景
- ✓当智能体为了分析而探索代码库或阅读大量文件的时候。
- ✓当任务涉及统计、比较或解析大量数据的时候。
- ✓当请求需要获取并搜索网页内容,又不想占满对话的时候。
技能链接
https://github.com/mksglu/context-mode/blob/main/configs/antigravity-cli/skills/context-mode/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请探索这个代码库并统计 TODO 注释的数量,同时不要让我们的对话被大量内容淹没。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能会指引智能体使用 context-mode 工具,例如用于运行代码的沙箱,以及用于大型内容的本地搜索索引。智能体会直接使用这些工具,而不是把所有内容都读入对话中。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
context-mode for Antigravity CLI
context-mode MCP tools are available in agy as context-mode/<tool>.
Use these tools directly. Do not inspect cached schema files under
~/.gemini/antigravity-cli/mcp/context-mode/*.json, and do not run
ctx_execute just to discover tool names or schemas.
If agy uses the generic MCP wrapper, call call_mcp_tool with:
ServerName:"context-mode"ToolName: one of the tool names belowArguments: the JSON arguments for that tool
Tool List
context-mode/ctx_execute: run JavaScript, TypeScript, Python, shell, or other code in a sandbox. Print only the final answer.context-mode/ctx_execute_file: read one file intoFILE_CONTENTinside the sandbox and run code over it. This is the context-mode file-read surface.context-mode/ctx_batch_execute: run multiple repository commands in one batch, index large output, and answer follow-up queries.context-mode/ctx_index: store a file, directory, or content in the local FTS5 knowledge base for later search.context-mode/ctx_search: search indexed content and captured session memory. Batch related questions inqueries.context-mode/ctx_fetch_and_index: fetch web content, store it, then query withctx_search.context-mode/ctx_stats: show context savings and current-session stats.context-mode/ctx_doctor: diagnose context-mode runtime and hook health.context-mode/ctx_upgrade: provide upgrade or repair guidance.context-mode/ctx_purge: purge stored context-mode knowledge after confirmation.context-mode/ctx_insight: launch or report the Insight analytics app.
When the user asks "what context-mode tools are available", answer from this
list. Do not list ~/.gemini/antigravity-cli/mcp/context-mode and do not read
the JSON schema files.
File Reading
There is no separate ctx_read tool. Use context-mode/ctx_execute_file for
file reads that analyze, summarize, extract, count, filter, or compare.
Native Read / view_file is only right when editing needs exact bytes in the
conversation, or when the user explicitly asks to view a small known range.
Use JavaScript by default for lightweight file analysis:
{
"path": "README.md",
"language": "javascript",
"code": "const lines = FILE_CONTENT.split(/\\r?\\n/); console.log(lines.slice(0, 20).join('\\n'));"
}
Never print FILE_CONTENT wholesale unless the user explicitly asks for a full
file dump. Print selected lines, counts, matches, summaries, or structured
results.
Codebase Exploration
For repository exploration, prefer one context-mode/ctx_batch_execute call
instead of many native ListDir, Read, Grep, or shell calls.
For one-off computed answers, use context-mode/ctx_execute.
For one-file analysis, use context-mode/ctx_execute_file.
For durable recall across follow-up questions, use context-mode/ctx_index
with a descriptive source, then context-mode/ctx_search.
Return concise derived answers. Do not paste raw command dumps, full files, large search results, cached schemas, or raw HTML into the conversation.
常见问题
它使用哪些工具?
它使用 context-mode 工具来进行沙箱代码执行、文件索引、搜索和网页获取。
它需要特别的设置吗?
需要。context-mode 工具必须已安装,并能在 Antigravity CLI 中使用。
为什么要保持输出简短?
只输出最终答案,可以让对话保持聚焦,并避免大量原始输出。
详情
作者的原始描述
Mandatory routing rules for Antigravity CLI. Invoke when exploring a codebase, reading files for analysis, listing context-mode tools, searching, parsing, counting, comparing, summarizing, fetching web content, or running data-heavy commands.
repo: mksglu/context-mode
热度
- GitHub 星标
- 33k
- 排名
- #8508
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
context-mode
33k教你的智能体在沙箱中处理数据密集型的工作,只输出答案,让原始文件和网页不会淹没对话。
context-mode
33k教你的智能体在输出可能很大时(例如日志、JSON 或构建结果),使用 context-mode 工具代替普通的 shell 命令。
ctx-doctor
33k运行 context-mode 诊断,检查运行环境、钩子、搜索存储、插件设置和版本,然后显示清晰的通过或失败报告。
ctx-index
33k让你的智能体把本地项目或文件夹索引到可搜索的存储中,之后提问时可以直接找到相关片段,而无需重新阅读每个文件。