Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/luohaothu-strategic-compact
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/strategic-compact
What's inside
- Skill name
strategic-compact- Description
- 建议在逻辑间隔处进行手动上下文压缩,以在任务阶段中保留上下文,而非任意的自动压缩。
- License
- MIT
- Instructions
- 63 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# 战略精简技能
建议在你的工作流程中的战略节点手动执行 `/compact`,而不是依赖任意的自动精简。
## 为何采用战略精简?
自动精简会在任意时间点触发:
* 通常在任务中途,丢失重要上下文
* 无法感知逻辑任务边界
* 可能中断复杂的多步骤操作
在逻辑边界进行战略精简:
* **探索之后,执行之前** - 精简研究上下文,保留实施计划
* **完成一个里程碑之后** - 为下一阶段全新开始
* **主要上下文切换之前** - 在不同任务开始前清理探索上下文
## 工作原理
`suggest-compact.sh` 脚本在 PreToolUse(编辑/写入)时运行并执行:
1. **追踪工具调用** - 计算会话中的工具调用次数
2. **阈值检测** - 在可配置的阈值(默认:50 次调用)处建议精简
3. **定期提醒** - 在达到阈值后,每 25 次调用提醒一次
## 钩子设置
添加到你的 `~/.claude/settings.json`:
```json
{
"hooks": {
"PreToolUse": [{
"matcher": "tool == \"Edit\" || tool == \"Write\"",
"hooks": [{
"type": "command",
"command": "~/.claude/skills/strategic-compact/suggest-compact.sh"
}]
}]
}
}
```
## 配置
环境变量:
* `COMPACT_THRESHOLD` - 首次建议前的工具调用次数(默认:50)
## 最佳实践
1. **规划后精简** - 一旦计划确定,精简以全新开始
2. **调试后精简** - 在继续之前,清理错误解决上下文
3. **不要在实施中途精简** - 保留相关更改的上下文
4. **阅读建议** - 钩子告诉你*何时*,由你决定*是否*
## 相关
* [长篇指南](https://x.com/affaanmustafa/status/2014040193557471352) - 令牌优化部分
* 内存持久化钩子 - 用于在精简后保留的状态From Luohaothu/everything-codex, MIT.
More from Luohaothu/everything-codex
- 0.493score
build-fix
Luohaothu
Build and compilation error resolution specialist.
SkillDFreshness: D★ 26Claude Code +9 - 0.493score
architect
Luohaothu
Software architecture specialist for system design, scalability, and technical decision-making.
SkillDFreshness: D★ 26Claude Code +9 - 0.490score
code-review
Luohaothu
Expert code review for quality, security, and maintainability.
SkillDFreshness: D★ 26Claude Code +9 - 0.490score
checkpoint
Luohaothu
Create or verify workflow checkpoints using git commits and state tracking.
SkillDFreshness: D★ 26Claude Code +9 - 0.487score
springboot-security
Luohaothu
Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。
SkillDFreshness: D★ 26Claude Code +9 - 0.487score
tdd-workflow
Luohaothu
在编写新功能、修复错误或重构代码时使用此技能。强制执行测试驱动开发,包含单元测试、集成测试和端到端测试,覆盖率超过80%。
SkillDFreshness: D★ 26Claude Code +9 - 0.487score
springboot-tdd
Luohaothu
使用JUnit 5、Mockito、MockMvc、Testcontainers和JaCoCo进行Spring Boot的测试驱动开发。适用于添加功能、修复错误或重构时。
SkillDFreshness: D★ 26Claude Code +9 - 0.487score
springboot-patterns
Luohaothu
Spring Boot 架构模式、REST API 设计、分层服务、数据访问、缓存、异步处理和日志记录。适用于 Java Spring Boot 后端工作。
SkillDFreshness: D★ 26Claude Code +9 - 0.484score
jpa-patterns
Luohaothu
Spring Boot中的JPA/Hibernate实体设计、关系、查询优化、事务、审计、索引、分页和连接池模式。
SkillDFreshness: D★ 26Claude Code +9 - 0.484score
postgres-patterns
Luohaothu
基于Supabase最佳实践的PostgreSQL数据库模式,用于查询优化、架构设计、索引和安全。
SkillDFreshness: D★ 26Claude Code +9 - 0.484score
eval-harness
Luohaothu
克劳德代码会话的正式评估框架,实施评估驱动开发(EDD)原则
SkillDFreshness: D★ 26Claude Code +9 - 0.484score
continuous-learning-v2
Luohaothu
基于本能的学习系统,通过钩子观察会话,创建具有置信度评分的原子本能,并将其演化为技能/命令/代理。
SkillDFreshness: D★ 26Claude Code +9
Signals
- Stars
- 26
- Forks
- 5
- Open issues
- 0
- Last commit (this folder)
- Feb 5, 2026 (8 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/Luohaothu/everything-codex
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from Luohaothu
- 0.493score
architect
Luohaothu
Software architecture specialist for system design, scalability, and technical decision-making.
SkillDFreshness: D★ 26Claude Code +9 - 0.493score
build-fix
Luohaothu
Build and compilation error resolution specialist.
SkillDFreshness: D★ 26Claude Code +9 - 0.490score
code-review
Luohaothu
Expert code review for quality, security, and maintainability.
SkillDFreshness: D★ 26Claude Code +9 - 0.490score
checkpoint
Luohaothu
Create or verify workflow checkpoints using git commits and state tracking.
SkillDFreshness: D★ 26Claude Code +9 - 0.487score
springboot-patterns
Luohaothu
Spring Boot 架构模式、REST API 设计、分层服务、数据访问、缓存、异步处理和日志记录。适用于 Java Spring Boot 后端工作。
SkillDFreshness: D★ 26Claude Code +9 - 0.487score
springboot-security
Luohaothu
Java Spring Boot 服务中关于身份验证/授权、验证、CSRF、密钥、标头、速率限制和依赖安全的 Spring Security 最佳实践。
SkillDFreshness: D★ 26Claude Code +9
Cite this page
strategic-compact skill. Agent Mart. https://agentmart.dev/skills/luohaothu-strategic-compact (last updated 2026-10-24)