Skip to content
Back to skills

Strategic Compact

ASecurity

任意の自動コンパクションではなく、タスクフェーズを通じてコンテキストを保持するための論理的な間隔での手動コンパクションを提案します。

  • 17 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 10, 2026
toolsnode

Security analysis

A100/100

Scanned September 10, 2026

npx -y skills add tensology/decisionsai --skill strategic-compact --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Strategic Compact?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Strategic Compact
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tensology-strategic-compact/badge)](https://www.skillsdirectory.com/skills/tensology-strategic-compact)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: strategic-compact
description: 任意の自動コンパクションではなく、タスクフェーズを通じてコンテキストを保持するための論理的な間隔での手動コンパクションを提案します。
---

# Strategic Compactスキル

任意の自動コンパクションに依存するのではなく、ワークフローの戦略的なポイントで手動の`/compact`を提案します。

## なぜ戦略的コンパクションか?

自動コンパクションは任意のポイントでトリガーされます:
- 多くの場合タスクの途中で、重要なコンテキストを失う
- タスクの論理的な境界を認識しない
- 複雑な複数ステップの操作を中断する可能性がある

論理的な境界での戦略的コンパクション:
- **探索後、実行前** - 研究コンテキストをコンパクト、実装計画を保持
- **マイルストーン完了後** - 次のフェーズのために新しいスタート
- **主要なコンテキストシフト前** - 異なるタスクの前に探索コンテキストをクリア

## 仕組み

`suggest-compact.js`スクリプトはPreToolUse(Edit/Write)で実行され:

1. **ツール呼び出しを追跡** - セッション内のツール呼び出しをカウント
2. **閾値検出** - 設定可能な閾値で提案(デフォルト:50回)
3. **定期的なリマインダー** - 閾値後25回ごとにリマインド

## フック設定

`~/.claude/settings.json`に追加:

```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)

## ベストプラクティス

1. **計画後にコンパクト** - 計画が確定したら、コンパクトして新しくスタート
2. **デバッグ後にコンパクト** - 続行前にエラー解決コンテキストをクリア
3. **実装中はコンパクトしない** - 関連する変更のためにコンテキストを保持
4. **提案を読む** - フックは*いつ*を教えてくれますが、*するかどうか*は自分で決める

## 関連

- [The Longform Guide](https://x.com/affaanmustafa/status/2014040193557471352) - トークン最適化セクション
- メモリ永続化フック - コンパクションを超えて存続する状態用

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…