context-mode

仓库创建 2026年7月27日最近提交 1 天前SkillHot 收录 1 天前
▸ 精选理由

减少误用 Bash 导致的大输出溢出或性能问题,适合处理日志/大文件场景。

▸ 风险提示

包含对可执行命令的白名单与限制,执行时仍需谨慎授权和审查。

这个 Skill 做什么

为处理大体量输出默认使用 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 开发管理大输出处理上下文工具安全执行通用
0
Stars
0
Forks
10
仓库内 Skill
积累中
7 日增星
安装 / 使用
给你的 Agent 一句话(通用)
帮我安装这个 skill:https://raw.githubusercontent.com/chan9yu/docagents/main/skills/context-mode/SKILL.md
或 curl 直取 SKILL.md
curl -fsSL "https://raw.githubusercontent.com/chan9yu/docagents/main/skills/context-mode/SKILL.md"
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 
via SKILL·HOT · 数据来自 GitHub 公开信息 · 原文版权归作者所有