anilcancakir/claude-code-plugins — Prompts
Prompt File 1: strategic-compact SKILL.md (verbatim excerpt)
Technique: Phase-detection pattern matching with explicit transition vocabulary.
---
name: strategic-compact
description: Context management intelligence for Claude Code sessions. ACTIVATE when context
filling up, phase transitions detected, user mentions "running out of context"...
---
# Strategic Compact
## Core Principle
**Manual compaction at strategic points > Auto-compaction at arbitrary points**
## When to Suggest Compaction
### Optimal Compaction Points
| Trigger | Reason |
|---------|--------|
| Exploration complete, implementation starting | Exploration context rarely needed for coding |
| Milestone completed | Clean slate for next phase |
| Plan finalized and documented | Plan captured, context can reset |
| Debug session resolved | Debug traces clutter future work |
| Switching to unrelated task | Previous context not relevant |
| 50+ tool calls in session | Accumulated context likely stale |
### Avoid Compaction During
| Scenario | Why |
|----------|-----|
| Mid-implementation | Loses code context and decisions |
| Active debugging | Loses diagnostic information |
| Incomplete task | May need earlier context |
| Code review in progress | Loses review thread |
## Phase Detection Patterns
Detect phase transitions by monitoring:
EXPLORATION → IMPLEMENTATION
- Many Read/Grep/Glob calls → Edit/Write calls starting
- Questions answered → Code being written
IMPLEMENTATION → TESTING
- Edit/Write heavy → Bash(test) calls
- Feature code done → Verification starting
Prompting technique: Decision-table encoding — uses tables to encode heuristics (when TO compact vs when NOT to), making the decision logic machine-readable and verifiable.
Prompt File 2: strategic-compact hooks.json (verbatim)
Technique: Lifecycle event registration with 5-point hook coverage.
{
"description": "Strategic compact hooks for intelligent context management",
"hooks": {
"SessionStart": [{"hooks": [{"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/session-init.sh", "timeout": 5}]}],
"PreToolUse": [{"matcher": ".*", "hooks": [{"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/track-and-suggest.sh", "timeout": 5}]}],
"PostToolUse": [{"matcher": "Bash", "hooks": [{"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/milestone-detector.sh", "timeout": 5}]}],
"PreCompact": [{"matcher": "manual|auto", "hooks": [{"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/compact-instructions.sh", "timeout": 5}]}],
"Stop": [{"hooks": [{"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/scripts/stop-check.sh", "timeout": 5}]}]
}
}
Prompting technique: Hook-as-injector pattern — shell scripts inject ephemeral guidance text into the conversation at lifecycle events, rather than loading static skill content. The matcher ".*" on PreToolUse catches all tools; the Bash-specific PostToolUse matcher targets milestone detection narrowly.