strategic-compact

Prompt manual compaction at workflow boundaries via PreToolUse hooks.

1|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/Mark393295827/house-maint-ai --skill strategic-compact-mark393295827
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/Mark393295827/house-maint-ai/tree/main/skills/strategic-compact
Command: npx skills add https://github.com/Mark393295827/house-maint-ai --skill strategic-compact-mark393295827

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Prompts users to perform manual compaction at logical workflow boundaries to preserve context.

Core Features & Use Cases

  • Hook-based integration with PreToolUse to trigger compaction prompts.
  • Configurable thresholds via COMPACT_THRESHOLD to tailor when prompts appear.
  • Phase-aware guidance for transitions between research, planning, implementation, and testing.

Quick Start

Set up the PreToolUse hook to run the suggested-compact script so you receive prompts at strategic points during long sessions.

Frequently Asked Questions about strategic-compact

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

FAQPage Schema
How do I preserve context in long-running, multi-phase workflow sessions?

To preserve context in long-running sessions, you can use a hook-based integration that prompts manual compaction at logical workflow boundaries like phase transitions. This prevents context loss during research, planning, implementation, and testing phases.

What is the best way to trigger manual compaction prompts during an automation workflow?

The best way to trigger manual compaction prompts is by setting up a PreToolUse hook. This hook counts tool invocations and automatically suggests compaction after a configurable threshold is reached, ensuring strategic context preservation.

Can I configure the tool invocation threshold for context preservation prompts?

Yes, you can configure the threshold for context preservation prompts using the COMPACT_THRESHOLD environment variable. This allows you to tailor exactly when the compaction prompts appear during your workflow sessions.

When should I perform manual compaction to avoid losing context between workflow phases?

You should perform manual compaction during transitions between research, planning, implementation, and testing phases. Prompting at these logical workflow boundaries ensures you preserve context without interrupting active tasks.

Does hook-based context preservation work without dependencies?

Yes, hook-based context preservation works without dependencies. It relies entirely on a standalone script integrated via the PreToolUse hook to count invocations and trigger prompts based on your configured threshold.

Why use strategic compaction instead of continuous automatic context compaction?

Strategic compaction prompts you at logical workflow boundaries rather than continuously, preserving context at phase transitions without disrupting active tool invocations. This phase-aware approach maintains session continuity better than continuous automatic compaction.