strategic-compact

Track tool invocation counts and prompt manual context compaction via PreToolUse hooks.

Updated Jul 28, 2024
One-click install
npx skills add https://github.com/fredericvahrenhorst/share-app --skill strategic-compact-fredericvahrenhorst
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/fredericvahrenhorst/share-app/tree/main/.cursor/skills/strategic-compact
Command: npx skills add https://github.com/fredericvahrenhorst/share-app --skill strategic-compact-fredericvahrenhorst

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Promotes manual context compaction at logical milestones to preserve important information across task phases, avoiding loss from arbitrary auto-compaction.

Core Features & Use Cases

  • Tracks tool usage and suggests compacting context at strategic boundaries (e.g., after exploration or milestone completion).
  • Supports a configurable COMPACT_THRESHOLD and periodic reminders after crossing the threshold.
  • Integrates with PreToolUse hooks to prompt running the suggest-compact.sh script.

Quick Start

Install the skill and configure the PreToolUse hook to invoke suggest-compact.sh.

Frequently Asked Questions about strategic-compact

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent context loss during automated workflow transitions?

Preventing context loss during automated workflow transitions requires prompting manual context compaction at logical milestones. Tracking tool invocation counts identifies strategic boundaries like exploration-to-execution shifts, preserving important information before arbitrary auto-compaction can discard it.

What is milestone-based context compaction and when should I use it?

Milestone-based context compaction is prompting context preservation at logical task boundaries rather than arbitrary limits. Use it when transitioning between exploration and execution phases or completing milestones, ensuring critical information survives across task phases in long workflows.

How do I configure a threshold for context compaction reminders?

Configuring a threshold for context compaction reminders involves setting a COMPACT_THRESHOLD value that tracks tool invocations. After crossing this threshold, periodic reminders prompt manual compaction via a PreToolUse hook executing the suggest-compact script.

Can I integrate context compaction prompts with PreToolUse hooks?

Integrating context compaction prompts with PreToolUse hooks is fully supported. The hook invokes the suggest-compact script, which monitors tool usage counts and triggers manual compaction suggestions once the configured threshold is crossed.

Does manual context compaction work without external dependencies?

Manual context compaction works without external dependencies. The skill relies solely on its internal scripts to track tool invocations and trigger suggestions through PreToolUse hooks, requiring no additional packages or external libraries to function.

Why does auto-compaction lose important information across task phases?

Auto-compaction loses important information across task phases because it triggers at arbitrary limits rather than logical boundaries. Manual compaction at milestone transitions preserves context by targeting natural breakpoints between exploration and execution stages.