capsule-compact

Solid

Compact a long capsule chain. Walks parent_capsule_id backward from a head capsule; if chain >= 5, summarizes oldest 3 into a chain-summary capsule. Manual invocation.

AI & Automation 18 stars 5 forks Updated 3 days ago MIT

Install

View on GitHub

Quality Score: 84/100

Stars 20%
43
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
67
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# /capsule-compact Run `python3 daemons/capsule-compact.py <head_capsule_id>` from the vault root. The script: 1. Walks `parent_capsule_id` chain backward from the head 2. If chain length >= 5, summarizes the oldest 3 capsules into a single `chain-summary-<head>-<date>.md` capsule 3. Updates pointers: boundary capsule's parent → summary; summary's parent → original chain root's parent 4. Marks each compacted capsule with `compacted_into: <summary_id>` (they stay on disk for archeology) ## When to run - /close Step 0.5 PART E (v0.4.5) emits `[CADDY:context] CHAIN — capsule chain length N` when threshold hit - Manually before a session-heavy week to keep /open Step 2.5 fast - After narrative-reconstruction archeology when the chain has grown unwieldy ## Defaults - Threshold: 5 capsules - Summarize-count: 3 oldest Override via `--threshold N` and `--summarize-count N` flags. ## What it does NOT do - Does not auto-compact at /close. Hints, you decide. - Does not delete compacted capsules. Each gets `compacted_into:` marker. - Does not LLM-summarize. Concatenates structured fields (objective, open_threads still live, held decisions). - Does not walk forks. parent_capsule_id is strictly linear. ## Cross-links - [[concepts/Somatic v0.4.5 Chain Compaction]] — spec - [[concepts/context-capsule]] — base capsule schema

Details

Author
wrg32786
Repository
wrg32786/aigent-os
Created
2 months ago
Last Updated
3 days ago
Language
JavaScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Solid

context-capsule

The capsule verb, invoked explicitly — reconcile from the live memory, write a resume-ready capsule, then stop. Mid-session checkpoint or completion capsule; a rolling best-effort version of the same write also runs automatically on every Stop event via daemons/stop-capsule-writer.mjs.

18 Updated 3 days ago
wrg32786
Code & Development Solid

memory-compact

Emergency single-pass memory compression when context window pressure is high mid-task. Activate when approaching token limits during active work. For scheduled end-of-phase cleanup, use memory-refresh instead.

160 Updated today
Fr-e-d
AI & Automation Listed

compact-plus

Secure everything the user approved before a context compaction so a later /compact can never lose or alter it. Writes verbatim intent and handoff state to disk and commits plus pushes the tracked work product in the correct repository, then reports whether it is safe to compact. It does NOT run /compact itself - it makes a later compact safe. Run this only when the limit plugin's injected ACTION line names it (session-context fill crossed a configured threshold) or when the user invokes it manually. Never self-trigger it proactively - that only wastes tokens. Accepts extra trailing instructions to perform in addition to the securing checklist. A minimal mode (invoke as /compact-plus min) secures only intent plus handoff to disk - no audit, no commit or push - for a quick token-cheap save.

13 Updated 2 days ago
Marcel-Bich