Context Mode

mksglu/context-mode/configs/antigravity-cli/skills/context-mode

作者 mksglua6c43765d26b无许可证25K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

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.

仅含说明AI & Agents
AI 生成的概览

在 Antigravity CLI 中使用 context-mode MCP 工具进行文件读取、代码库探索、索引与搜索的路由规则。

功能
该技能是一份纯说明文档,指导智能体如何在 Antigravity CLI 中调用 context-mode MCP 工具,既可直接使用 context-mode/ ,也可通过通用 MCP 包装器调用。它列出可用工具,例如 ctx_execute、ctx_execute_file、ctx_batch_execute、ctx_index、ctx_search、ctx_fetch_and_index、ctx_stats、ctx_doctor、ctx_upgrade、ctx_purge 和 ctx_insight,并说明各自用途。它还规定了文件读取、代码库探索和回答风格的规则,倾向于输出精炼的派生结果而非原始转储。
适用场景
适用于在 Antigravity CLI 中读取或分析文件、探索代码库、索引或搜索内容、抓取网页,或检查 context-mode 运行时健康状况的场景。也用于回答有哪些 context-mode 工具可用。它不适用于需要在对话中保留精确字节的编辑操作,也不适用于查看已知的小范围内容。
运行要求
不附带脚本,仅为说明文档。它假定 Antigravity CLI(agy)中已提供 context-mode MCP 服务器及其工具,并具备本地 FTS5 知识库;抓取网页内容需要网络访问。

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:

json
{  "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.

来源与署名

来源:mksglu/context-mode位于configs/antigravity-cli/skills/context-mode提交a6c4376

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架