context-mode
减少误用 Bash 导致的大输出溢出或性能问题,适合处理日志/大文件场景。
包含对可执行命令的白名单与限制,执行时仍需谨慎授权和审查。
为处理大体量输出默认使用 context-mode 工具以避免直接执行大输出的 shell 命令。
处理会产出大量文本的任务时,优先用 context-mode(如 ctx_execute、ctx_execute_file)来分析日志、解析 JSON、抓取页面或测试快照,避免直接在 shell 里跑大输出。遇到测试输出、覆盖率报告、容器/磁盘状态或大文件分析这类高容量结果就用它。默认启用以更安全地审阅大输出,只有对明显小量输出才允许直接运行 Bash,并且有一份安全白名单命令。
▸ 展开 SKILL.md 英文原文
Use context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page snapshot", "browser snapshot", "DOM structure", "inspect page", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits", "diff between branches", "list containers", "pod status", "disk usage", "fetch docs", "API reference", "index documentation", "call API", "check response", "query results", "find TODOs", "count lines", "codebase statistics", "security audit", "outdated packages", "dependency tree", "cloud resources", "CI/CD output". Also triggers on ANY MCP tool output that may exceed 20 lines. Subagent routing is handled automatically via PreToolUse hook.
帮我安装这个 skill:https://raw.githubusercontent.com/chan9yu/docagents/main/skills/context-mode/SKILL.mdcurl -fsSL "https://raw.githubusercontent.com/chan9yu/docagents/main/skills/context-mode/SKILL.md"# Context Mode: Default for All Large Output
## MANDATORY RULE
<context_mode_logic>
<mandatory_rule>
Default to context-mode for ALL commands. Only use Bash for guaranteed-small-output operations.
</mandatory_rule>
</context_mode_logic>
Bash whitelist (safe to run directly):
- **File mutations**: `mkdir`, `mv`, `cp`, `rm`, `touch`, `chmod`
- **Git writes**: `git add`, `git commit`, `git push`, `git checkout`, `git branch`, `git merge`
- **Navigation**: `cd`, `pwd`, `which`
- **Process control**: `kill`, `pkill`
- **Package management**: `npm install`, `npm publish`, `pip install`
- **Simple output**: `echo`, `printf`
**Everything else → `ctx_execute` or `ctx_execute_file`.** Any