strategic-compact

Prompt manual session compaction at configurable thresholds and phase transitions.

2|2|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/zhmxiaowo/opencode-simple --skill strategic-compact-zhmxiaowo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strategic-compact
Source: https://github.com/zhmxiaowo/opencode-simple/tree/main/.opencode/skills/strategic-compact
Command: npx skills add https://github.com/zhmxiaowo/opencode-simple --skill strategic-compact-zhmxiaowo

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Strategic compaction guides users to perform manual context cleanups at logical boundaries to maintain coherence across multi-phase AI tasks, rather than relying on automatic, arbitrary context trimming.

Core Features & Use Cases

  • Threshold-based prompts: Monitors tool usage and suggests compaction when the session crosses a configured limit.
  • Phase-aware reminders: Emits reminders at key transitions (e.g., Research → Planning, Planning → Implementation).
  • Configurable workflow: Supports COMPACT_THRESHOLD environment variable and PreToolUse hooks to trigger compaction prompts.

Quick Start

Instruct the AI to perform a manual compact at a logical boundary, for example after completing a major milestone, by issuing a /compact.

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 AI-assisted sessions?

Preserve context in long-running AI sessions by prompting manual compaction at logical boundaries. This skill monitors tool usage and phase transitions, suggesting a context cleanup when a configured threshold is crossed to maintain coherence across multi-phase tasks.

When should I perform manual context compaction during multi-phase tasks?

Perform manual context compaction during multi-phase tasks at key phase transitions, such as shifting from Research to Planning or Planning to Implementation. This skill uses PreToolUse hooks to emit periodic reminders, guiding you to compact at logical boundaries.

How do I configure context management thresholds for AI workflows?

Configure context management thresholds for AI workflows by setting the COMPACT_THRESHOLD environment variable. This defines the tool usage limit that triggers the skill to prompt you for a manual session compaction, preventing arbitrary automatic context trimming.

What is the difference between manual compaction and automatic context trimming?

Manual compaction cleans up context at logical phase boundaries to maintain coherence, whereas automatic context trimming arbitrarily removes data. This skill provides threshold-based prompts and phase-aware reminders to guide manual context preservation.

How do I trigger a manual compact at a logical session boundary?

Trigger a manual compact at a logical session boundary by issuing a /compact command after completing a major milestone. The skill automates preservation by using configurable thresholds and PreToolUse hooks to prompt this cleanup action.

Does this context management skill work with multi-phase research and implementation tasks?

Yes, this context management skill applies to multi-phase AI-assisted tasks including research, planning, implementation, and testing. It uses phase-aware reminders to suggest compaction at key transitions, ensuring session context is preserved.