strategic-compact
任意の自動コンパクションではなく、タスクフェーズを通じてコンテキストを保持するための論理的な間隔での手動コンパクションを提案します。
- License 许可
- MIT
- 最近更新
- 2026-05-20
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- strategic-compact
- description
- 任意の自動コンパクションではなく、タスクフェーズを通じてコンテキストを保持するための論理的な間隔での手動コンパクションを提案します。
03 SKILL.md 正文
Strategic Compactスキル
任意の自動コンパクションに依存するのではなく、ワークフローの戦略的なポイントで手動の/compactを提案します。
なぜ戦略的コンパクションか?
自動コンパクションは任意のポイントでトリガーされます:
- 多くの場合タスクの途中で、重要なコンテキストを失う
- タスクの論理的な境界を認識しない
- 複雑な複数ステップの操作を中断する可能性がある
論理的な境界での戦略的コンパクション:
- 探索後、実行前 - 研究コンテキストをコンパクト、実装計画を保持
- マイルストーン完了後 - 次のフェーズのために新しいスタート
- 主要なコンテキストシフト前 - 異なるタスクの前に探索コンテキストをクリア
仕組み
suggest-compact.jsスクリプトはPreToolUse(Edit/Write)で実行され:
- ツール呼び出しを追跡 - セッション内のツール呼び出しをカウント
- 閾値検出 - 設定可能な閾値で提案(デフォルト:50回)
- 定期的なリマインダー - 閾値後25回ごとにリマインド
フック設定
~/.claude/settings.jsonに追加:
{
"hooks": {
"PreToolUse": [
{
"matcher": "Edit",
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
},
{
"matcher": "Write",
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
}
]
}
}
設定
環境変数:
COMPACT_THRESHOLD- 最初の提案前のツール呼び出し(デフォルト:50)
ベストプラクティス
- 計画後にコンパクト - 計画が確定したら、コンパクトして新しくスタート
- デバッグ後にコンパクト - 続行前にエラー解決コンテキストをクリア
- 実装中はコンパクトしない - 関連する変更のためにコンテキストを保持
- 提案を読む - フックはいつを教えてくれますが、するかどうかは自分で決める
関連
- The Longform Guide - トークン最適化セクション
- メモリ永続化フック - コンパクションを超えて存続する状態用
04 同仓库更多 Skills
webgpu-threejs-tsl
Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.
webgpu-threejs-tsl
Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.
verification-loop
暂无简介
tdd-workflow
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.
strategic-compact
Suggests manual context compaction at logical intervals to preserve context through task phases rather than arbitrary auto-compaction.
security-review
Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment/sensitive features. Provides comprehensive security checklist and patterns.