一键导入
compact-state
Extract historical content from STATE.md into cycle files (burst logs, adversary passes, session checkpoints, lessons). Slims STATE.md to <200 lines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Extract historical content from STATE.md into cycle files (burst logs, adversary passes, session checkpoints, lessons). Slims STATE.md to <200 lines.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Browser-based visual companion for showing mockups, diagrams, and interactive options during brainstorming, brief creation, and architecture design. Runs a local Node.js server that watches for HTML files and serves them with live reload. Optional — requires Node.js.
Write a verified HANDOFF.md (9 base required fields) and an atomically co-committed wave-state.yaml (6 required fields) to the factory-artifacts branch at wave close. Provides the lossless wave-boundary checkpoint required by BC-5.41.001 and BC-5.41.002.
Computes wave-based implementation order from story dependencies. Groups stories into waves for parallel execution within each wave.
Diagnostic check of STATE.md — validates structure, size, phase numbering, frontmatter, and content routing compliance. Reports HEALTHY, WARNINGS, or NEEDS-COMPACT.
Rehydrate session context at the start of a new session after a wave-boundary reset. Reads wave-state.yaml EXCLUSIVELY from the factory-artifacts branch via git show, injects exactly the listed spec files (Set(stories[*].spec_files) ∪ Set(arch_files) ∪ {state_pointer}), and pauses for operator confirmation before any pipeline work begins. Satisfies BC-6.24.001 postconditions 1–8 and VP-088 §1–§4.
Full wave-boundary reset procedure. Clears the current session, starts a new session, and runs /rehydrate-wave as the mandatory first step to restore exactly the next-wave spec context from wave-state.yaml on factory-artifacts. Pairs with /wave-handoff (which produces the manifest) to provide lossless context-window transitions (CAP-032).
| name | compact-state |
| description | Extract historical content from STATE.md into cycle files (burst logs, adversary passes, session checkpoints, lessons). Slims STATE.md to <200 lines. |
| disable-model-invocation | false |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Extract historical content from a bloated STATE.md into proper cycle-scoped files, leaving a lean status document.
Read and follow the output format in:
${CLAUDE_PLUGIN_ROOT}/templates/burst-log-template.md — burst narrative log${CLAUDE_PLUGIN_ROOT}/templates/convergence-trajectory-template.md — finding progression + per-pass details${CLAUDE_PLUGIN_ROOT}/templates/session-checkpoints-template.md — archived session resume checkpoints${CLAUDE_PLUGIN_ROOT}/templates/lessons-template.md — lessons learned by category${CLAUDE_PLUGIN_ROOT}/templates/blocking-issues-resolved-template.md — resolved blocking issuesBefore any other action, say verbatim:
I'm using the compact-state skill to extract historical content from STATE.md into cycle files.
.factory/STATE.md exists.factory/ is a git worktree on factory-artifactscurrent_cycle is set in STATE.md frontmatter (or .factory/current-cycle exists)current_cycle or .factory/current-cyclecycles/<cycle>/ directory exists (create if needed)Scan for these section patterns that should be moved to cycle files:
| Pattern | Target File |
|---|---|
## Burst N sections (burst narratives) | cycles/<cycle>/burst-log.md |
## Pass N sections (adversary pass summaries) | cycles/<cycle>/convergence-trajectory.md |
adversary_pass_* frontmatter fields | cycles/<cycle>/convergence-trajectory.md |
## Session Resume Checkpoint sections (all except the LAST one) | cycles/<cycle>/session-checkpoints.md |
## Lessons section content | cycles/<cycle>/lessons.md |
Resolved rows from ## Blocking Issues table | cycles/<cycle>/blocking-issues-resolved.md |
## Session Chain Summary sections | cycles/<cycle>/session-checkpoints.md |
For each extractable section:
# <Title> — <Cycle Name>## Extracted from STATE.md on <date>Each cycle file follows its template (see Templates section above). Key points:
## Burst N section per burst, with agents, files, versions, summaryadversary_pass_* frontmatter fields to table rows.After extracting, rewrite STATE.md keeping ONLY:
adversary_pass_* fields. Keep: project, mode, phase, status, current_step, awaiting, current_cycle, dtu_required, plugin_version_adopted, historical_cyclesReplace extracted sections with pointers:
## Historical Content
Burst logs, adversary pass details, session checkpoints, and lessons
have been extracted to cycle files:
- Burst history: `cycles/<cycle>/burst-log.md`
- Convergence trajectory: `cycles/<cycle>/convergence-trajectory.md`
- Session checkpoints: `cycles/<cycle>/session-checkpoints.md`
- Lessons learned: `cycles/<cycle>/lessons.md`
- Resolved blockers: `cycles/<cycle>/blocking-issues-resolved.md`
cd .factory
git add -A
git commit -m "factory(state): compact STATE.md — extract historical content to cycle files"
Report:
STATE.md compaction complete:
Before: <N> lines
After: <N> lines
Extracted:
- <N> burst narratives → cycles/<cycle>/burst-log.md
- <N> adversary passes → cycles/<cycle>/convergence-trajectory.md
- <N> session checkpoints → cycles/<cycle>/session-checkpoints.md
- <N> lessons → cycles/<cycle>/lessons.md
- <N> resolved blockers → cycles/<cycle>/blocking-issues-resolved.md
/compact-state(this skill) vsPreCompacthook event — these are distinct mechanisms.
| Concept | What it is | When it fires |
|---|---|---|
/compact-state (this skill) | A manually invoked skill that extracts historical content from STATE.md into cycle files (burst logs, adversary passes, session checkpoints, lessons) and slims STATE.md to <200 lines. It does NOT invoke the Claude Code /compact command — it reorganizes the STATE.md file, not the conversation context. | Only when an operator or agent explicitly invokes /compact-state. |
PreCompact hook event | A Claude Code harness event fired automatically before the harness performs context compaction. Triggers the precompact-flush PreCompact WASM plugin (precompact-flush.wasm) (S-18.04a deliverable, native WASM per ADR-028 §Decision 2), which persists wave-boundary state to factory-artifacts before context is lost. | Only when the Claude Code harness triggers automatic compaction (e.g., when context usage reaches the configured autocompact threshold). |
PostCompact hook event | A Claude Code harness event fired automatically after compaction completes. Triggers postcompact-reanchor.sh (S-18.05 deliverable), which emits a [PostCompact Re-anchor] block to stdout so the LLM session can re-ground itself after compaction. | Only when the Claude Code harness triggers automatic compaction (same trigger condition as PreCompact). |
Invoking /compact-state does NOT fire the PreCompact hook chain. The precompact-flush WASM plugin fires automatically before Claude Code compacts — not during a manual /compact-state invocation. These are independent paths: /compact-state reorganizes STATE.md content into cycle files; the PreCompact/PostCompact hook chain persists and restores session context across a harness-driven compaction event.
After any session clear or context reset, the mandatory first step before any pipeline work is /rehydrate-wave. See plugins/vsdd-factory/skills/rehydrate-wave/SKILL.md for the full invocation contract (BC-6.24.001 / ADR-026 §Decision 4).