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

context-mode

它能做什么

这个技能为在 GitHub Copilot CLI 中使用 context-mode 工具的 AI 智能体设定路由规则。适合分析大型文件、日志或网页,并希望保持对话精简的人。

适用场景

  • ✓当智能体需要统计、过滤、比较或解析大量数据的时候。
  • ✓当任务涉及获取一个网页,而该网页否则会把原始 HTML 倾倒进对话的时候。
  • ✓当某个命令产生了大量输出,需要处理而不是全部阅读的时候。

技能链接

https://github.com/mksglu/context-mode/blob/main/configs/copilot-cli/skills/context-mode/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

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

可以这样问 AI

“请统计这个大型日志文件中失败的测试数量,但不要把整个日志粘贴到我们的聊天中。”

每周 5 个新技能,1 分钟读完。

工作原理

这个技能会告诉智能体编写在沙箱中运行的代码,并只返回最终答案。大型输出会被保存并搜索,而不是被完整阅读。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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.

常见问题

它依赖哪些工具?

它依赖 context-mode 工具,例如沙箱代码执行、批处理命令、索引搜索和网页获取。

它会阻止普通命令吗?

它会阻止少数会倾倒原始输出的命令,例如 curl 和 wget,并要求智能体改用沙箱。

我需要安装 context-mode 工具吗?

需要。context-mode 工具必须在 GitHub Copilot CLI 中可用,这些规则才能生效。

详情

作者的原始描述

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.

repo: mksglu/context-mode

热度

GitHub 星标
33k
排名
#8509
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能