跳到正文
Skillpedia
智能体33k · #8508

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。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/mksglu/context-mode/blob/main/configs/antigravity-cli/skills/context-mode/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 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 below
  • Arguments: 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 into FILE_CONTENT inside 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 in queries.
  • context-mode/ctx_fetch_and_index: fetch web content, store it, then query with ctx_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

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能