Context Mode

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

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

MANDATORY routing rules for context-mode. Invoke whenever you analyze, count, filter, compare, search, parse, or transform data; fetch a URL; or run a data-heavy command — so raw bytes stay out of the context window.

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

通过使用 context-mode MCP 工具而非直接命令,将原始数据排除在上下文窗口之外的路由规则。

功能
该技能为在 GitHub Copilot CLI 中使用 context-mode MCP 工具提供强制性路由规则。它指示代理编写代码来分析、计数、过滤、比较、搜索、解析或转换数据,使只有答案而非原始字节进入上下文窗口。它还要求通过索引和沙箱执行工具进行 URL 获取和大文件分析,并建议将产物写入文件并返回路径及一行描述。
适用场景
在可使用 context-mode MCP 工具且任务涉及数据密集型命令、网页获取或大文件分析的环境中使用。其目的是防止原始命令输出或 HTTP 响应导致上下文泛滥。
运行要求
需要 GitHub Copilot CLI 并可使用 context-mode MCP 工具。不附带脚本,仅为说明文档。

context-mode — MANDATORY routing rules

context-mode MCP tools are available in GitHub Copilot CLI. These rules protect the context window from flooding — one unrouted command can dump tens of KB into the conversation. Follow them strictly.

Think in Code — MANDATORY

Analyze / count / filter / compare / search / parse / transform data: write code via ctx_execute(language, code) and console.log() only the answer. Do NOT read raw data into context. PROGRAM the analysis, do not COMPUTE it by reading. One script replaces ten tool calls.

BLOCKED — do NOT use

  • curl / wget — dumps raw HTTP into context. Use ctx_fetch_and_index(url, source) then ctx_search(queries).
  • Inline HTTP (node -e "fetch(...)", python -c "requests.get(...)") — use ctx_execute(language, code); only stdout enters context.
  • Reading large files to analyze — use ctx_execute_file(path, language, code).

Tool selection

  1. GATHER: ctx_batch_execute(commands, queries) — runs all commands, auto-indexes, returns search. One call replaces dozens.
  2. PROCESS: ctx_execute / ctx_execute_file — sandbox; only stdout enters context.
  3. WEB: ctx_fetch_and_index(url, source) then ctx_search(queries) — raw HTML never enters context.
  4. SEARCH: ctx_search(queries: [...]) — all questions in one call.

Write artifacts to FILES; return a path + one-line description, not inline dumps.

来源与署名

来源:mksglu/context-mode位于configs/copilot-cli/skills/context-mode提交51a716f

许可证: 无许可证

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

举报或申请下架