smart-compact
Skill4 starsChanged 7 months agoMITView on GitHub
智能压缩决策 skill。根据当前 session 上下文类型自动选择压缩策略(量化策略量化/代码开发/日常对话/混合),分析后报告预计保留率,等 Boss 确认后再执行。注册为 /smart-compact 命令。
2 other projects use a version of this.
Adopted by
Most recently taken up by
- KangDongGwon/claude-skillstheir own version, first seen May 18, 2026
- s-choung/Research-Skillstheir own version, first seen May 16, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- s-choung/Research-Skills★ 34same name
- KangDongGwon/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository14 other files it gives its agents.
- AGENTS.mdAGENTS.md
- llms.txtllms.txt
- SKILL.mdSkill
- behavior-analyzerSkill
- cache-monitorSkill
- compact-guardianSkill
- evolveSkill
- fusion-engineSkill
- knowledge-federationSkill
- memory-compactionSkill
- rule-optimizerSkill
- safe-execSkill
- self-evalSkill
- yolo-permissionsSkill
The file
Files
Smart Compact — 智能压缩策略选择
功能
分析当前 session 上下文,自动选择压缩策略,避免一刀切压缩。
四种策略
| 策略 | 适用场景 | 保留 token |
| A — 量化策略量化 | 回测数据、选股结果、因子分析、策略参数 | ~12k |
| B — 代码开发 | 大量代码块、git 操作、文件路径 | ~10k |
| C — 日常对话 | 普通对话、寒暄、过程性讨论 | ~6k |
| D — 混合session | 同时包含多种类型 | 按比例分配 |
执行流程
- 分析:读取当前 session 历史,判断策略类型
- 报告:发 Telegram 报告策略和预计保留率
- 确认:Boss 回复
确认后执行压缩 - 完成:报告「压缩前 Xk → 压缩后 Yk,保留率 Z%」
核心文件
| 文件 | 作用 |
scripts/smart_compact.py | 分析脚本(dry-run + 策略判断) |
命令注册
注册为 /smart-compact 命令,触发 smart_compact.py --dry-run。
Dry-run 用法
python3 ~/.openclaw/workspace/skills/smart-compact/scripts/smart_compact.py --dry-run策略详情
策略 A — 量化策略量化
保留:策略结论、参数配置、回测结果摘要、未完成任务
丢弃:中间计算过程、重复数据行、调试输出
策略 B — 代码开发
保留:当前任务目标、已完成的改动摘要、待完成事项、关键报错
丢弃:完整代码块(只保留函数签名)、成功执行的中间命令
策略 C — 日常对话
保留:用户的核心问题、结论性回答、待跟进事项
丢弃:寒暄、重复确认、过程性讨论
策略 D — 混合session
保留:按各类型比例分配预算,优先保留最近 30% 内容
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

