gpd-compact-state

Archives historical STATE.md entries to STATE-ARCHIVE.md to keep project memory under 150 lines.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/MichaelsEngineering/sentinel-multiscale-field-dynamics --skill gpd-compact-state-michaelsengineering
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: gpd-compact-state
Source: https://github.com/MichaelsEngineering/sentinel-multiscale-field-dynamics/tree/main/.agents/skills/gpd-compact-state
Command: npx skills add https://github.com/MichaelsEngineering/sentinel-multiscale-field-dynamics --skill gpd-compact-state-michaelsengineering

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Long-running research projects accumulate decisions, session records, metrics, and resolved blockers in STATE.md until the file becomes too large to load efficiently into context. This Skill compacts STATE.md by moving historical entries to STATE-ARCHIVE.md while preserving recent and actively referenced content. ## Core Features & Use Cases - Threshold-Based Compaction: Measures STATE.md line count against a 150-line target and a 1500-line emergency budget, with a --force flag to bypass checks. - Selective Archival: Archives decisions and metrics from old phases, resolved blockers, and session records older than the last three, appending them to STATE-ARCHIVE.md with dated headers. - Verification and Recovery: Validates required sections after compaction, syncs state.json, and recovers from state.json or git if compaction was too aggressive. - Use Case: A research project's STATE.md has grown past 1500 lines across many phases. Run the compaction workflow to archive completed-phase decisions and old session records, commit the result, and keep the active context lean. ## Quick Start Ask the AI to compact STATE.md by archiving historical entries to STATE-ARCHIVE.md, optionally forcing compaction with the --force flag.

Frequently Asked Questions about gpd-compact-state

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

FAQPage Schema
How do I reduce the size of a STATE.md file in a GPD project?▼

Run the compact-state workflow, which measures the line count and delegates archival to the gpd state compact command. Entries from old phases, resolved blockers, and older session records are moved to STATE-ARCHIVE.md automatically.

What gets archived when compacting STATE.md?▼

The archival moves decisions and performance metrics from phases older than the current minus one, blockers marked resolved or struck through, and all but the last three session records. Archived content is appended to STATE-ARCHIVE.md with a dated header.

Can I force STATE.md compaction below the 1500-line threshold?▼

Yes, pass the --force flag to skip the line-count check and compact regardless of current size. Without it, files between 150 and 1500 lines only trigger a suggestion to trim manually.

What happens if compaction removes required STATE.md sections?▼

The workflow verifies sections like Current Position and Accumulated Context after compaction. If any are missing, it regenerates STATE.md from the authoritative state.json, or falls back to git checkout to restore the file.

Is archived STATE.md content recoverable after compaction?▼

Yes, all archived entries are preserved in STATE-ARCHIVE.md and verified after the run. The compaction changes are also committed to git, so the full historical record remains recoverable from version history.