ecc-resources/docs/zh-CN/skills/strategic-compact/SKILL.md
建议在逻辑间隔处手动压缩上下文,以在任务阶段中保留上下文,而非任意的自动压缩。
npx skillsauth add oabdelmaksoud/agi-farm-plugin strategic-compactInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
建议在你的工作流程中的战略节点手动执行 /compact,而不是依赖任意的自动精简。
自动精简会在任意时间点触发:
在逻辑边界进行战略精简:
suggest-compact.js 脚本在 PreToolUse (Edit/Write) 时运行,并且:
添加到你的 ~/.claude/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }]
},
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "node ~/.claude/skills/strategic-compact/suggest-compact.js" }]
}
]
}
}
环境变量:
COMPACT_THRESHOLD — 首次建议前的工具调用次数(默认:50)使用此表来决定何时压缩:
| 阶段转换 | 压缩? | 原因 | | ------------------------ | ------ | -------------------------------------------------------------------- | | 研究 → 规划 | 是 | 研究上下文很庞大;规划是提炼后的输出 | | 规划 → 实施 | 是 | 规划已保存在 TodoWrite 或文件中;释放上下文以进行编码 | | 实施 → 测试 | 可能 | 如果测试引用最近的代码则保留;如果要切换焦点则压缩 | | 调试 → 下一项功能 | 是 | 调试痕迹会污染不相关工作的上下文 | | 实施过程中 | 否 | 丢失变量名、文件路径和部分状态代价高昂 | | 尝试失败的方法之后 | 是 | 在尝试新方法之前,清理掉无效的推理过程 |
了解哪些内容会保留有助于您自信地进行压缩:
| 保留的内容 | 丢失的内容 |
| ---------------------------------------- | ---------------------------------------- |
| CLAUDE.md 指令 | 中间的推理和分析 |
| TodoWrite 任务列表 | 您之前读取过的文件内容 |
| 记忆文件 (~/.claude/memory/) | 多轮对话的上下文 |
| Git 状态(提交、分支) | 工具调用历史和计数 |
| 磁盘上的文件 | 口头陈述的细微用户偏好 |
/compact — 添加自定义消息:/compact Focus on implementing auth middleware nextcontinuous-learning 技能 — 在会话结束前提取模式development
Interactive setup wizard that creates a fully working multi-agent AI team on OpenClaw. One command bootstraps agents, SOUL.md personas, comms infrastructure (inboxes/outboxes/broadcast), cron jobs, auto-dispatcher (HITL + rate-limit backoff + dependency checking), and a portable GitHub bundle — all customized to team name, size (3/5/11 agents), domain, and frameworks (autogen/crewai/langgraph). Includes a React + SSE live ops dashboard with file-watcher (~350ms push latency) and persistent macOS LaunchAgent. Model-selection guidance built in. Commands: setup | status | rebuild | export | dashboard | dispatch
documentation
Translate visa application documents (images) to English and create a bilingual PDF with original and translation
development
A comprehensive verification system for Claude Code sessions.
development
Use this skill when writing new features, fixing bugs, or refactoring code. Enforces test-driven development with 80%+ coverage including unit, integration, and E2E tests.