一键导入
strategic-compact
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
X/Twitter API integration for posting tweets, threads, reading timelines, search, and analytics. Covers OAuth auth patterns, rate limits, and platform-native content posting. Use when the user wants to interact with X programmatically.
Describes how skills and agents from the EGC library are surfaced to a target harness, and how to inspect or install the catalog. Use when the user asks which skills/agents EGC ships, or wants to discover or install a curated profile.
Use when auditing Gemini skills and commands for quality. Supports Quick Scan (changed skills only) and Full Stocktake modes with sequential subagent batch evaluation.
Autonomous loop that learns while it runs: recalls stored lessons before each iteration, saves new lessons on failures and wins, and reinforces known lessons instead of repeating mistakes. Orchestrates continuous-agent-loop patterns with the egc-memory lesson tools.
Automatically extract reusable patterns from Gemini Code sessions and save them as learned skills for future use.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents. v2.1 adds project-scoped instincts to prevent cross-project contamination.
| name | strategic-compact |
| description | Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction. |
Suggests manual /compact at strategic points in your workflow rather than relying on arbitrary auto-compaction.
Auto-compaction triggers at arbitrary points:
Strategic compaction at logical boundaries:
The suggest-compact.js script runs on PreToolUse (Edit/Write) and:
Add to your ~/.gemini/settings.json:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "node ~/.gemini/skills/strategic-compact/suggest-compact.js" }]
},
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "node ~/.gemini/skills/strategic-compact/suggest-compact.js" }]
}
]
}
}
Environment variables:
COMPACT_THRESHOLD: Tool calls before first suggestion (default: 50)Use this table to decide when to compact:
| Phase Transition | Compact? | Why |
|---|---|---|
| Research → Planning | Yes | Research context is bulky; plan is the distilled output |
| Planning → Implementation | Yes | Plan is in TodoWrite or a file; free up context for code |
| Implementation → Testing | Maybe | Keep if tests reference recent code; compact if switching focus |
| Debugging → Next feature | Yes | Debug traces pollute context for unrelated work |
| Mid-implementation | No | Losing variable names, file paths, and partial state is costly |
| After a failed approach | Yes | Clear the dead-end reasoning before trying a new approach |
Understanding what persists helps you compact with confidence:
| Persists | Lost |
|---|---|
| GEMINI.md instructions | Intermediate reasoning and analysis |
| TodoWrite task list | File contents you previously read |
Memory files (~/.gemini/memory/) | Multi-step conversation context |
| Git state (commits, branches) | Tool call history and counts |
| Files on disk | Nuanced user preferences stated verbally |
/compact with a summary: Add a custom message: /compact Focus on implementing auth middleware nextcontinuous-learning skill: Extracts patterns before session ends