session-compression
Produces updated memory artifacts by compressing a session's key decisions, changes, and context into the structured memory garden. Use when: "compress this session", "save context", "end of session", "update memory", "wrap up".
- License 许可
- Apache-2.0
- 最近更新
- 2026-10-25
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- session-compression
- tier
- 1
- model
- sonnet
- agents
- [ "primary" ]
- inputs
- [ { "name": "memory_path", "type": "string", "required": true, "description": "Path to the memory directory containing MEMORY.md and memory files" } ]
- outputs
- [ { "name": "compression_report", "type": "text", "format": "markdown", "description": "Summary of memories updated, created, and open items carried forward" } ]
- category
- wisdom-garden
- triggers
- [ "compress this session", "save context", "end of session", "update memory", "wrap up" ]
- description
- Produces updated memory artifacts by compressing a session's key decisions, changes, and context into the structured memory garden. Use when: "compress this session", "save context", "end of session", "update memory", "wrap up".
- tool_dependencies
- [ "file_system" ]
03 SKILL.md 正文
Session Compression Skill
Philosophy
Memory is not a log — it is a garden. Session compression distills what happened into what matters for future sessions. The goal is not to record every action but to preserve the decisions, insights, and context that would otherwise be lost when the conversation ends. Good compression makes the next session start faster; bad compression creates noise that slows it down.
When to Use
- At the end of every substantial work session (3+ meaningful changes)
- After architectural decisions that affect future work
- When switching between major project areas
- Before a long break between sessions
Workflow
Phase 1: Gather Changes
- Run
git diffandgit statusacross the parent repo and all active sub-repos - Identify files changed, tests run, and their outcomes
- Note any tools or services configured or reconfigured
Phase 2: Extract Decisions
- Identify key decisions made during the session — architectural choices, convention changes, approach pivots
- For each decision, capture the why (not just the what)
- Identify any outstanding issues, blockers, or unresolved friction
Phase 3: Update Memory
- Check existing memory files for entries that need updating based on this session's work
- For each key insight or decision:
- If an existing memory covers this topic, update it in place
- If it's genuinely new, create a new memory file with proper frontmatter (name, description, type)
- Update MEMORY.md index if any files were added or removed
- Update the "Open Items" section in MEMORY.md with current state
Phase 4: Report
Output a summary: memories updated, memories created, open items carried forward
Output
The skill produces:
- Updated or new memory files with YAML frontmatter
- An updated MEMORY.md index
- A compression summary listing what was persisted
Examples
After a gateway refactor session:
/compress
> Updated: project_gateway_consolidation_plan.md (17→16 modules)
> Created: seed_two_handler_trap.md (new pattern discovered)
> Open items: protocol merge (2→1) still pending
> MEMORY.md: 142 lines (under 200 limit)
After a debugging session with no architectural changes:
/compress
> Updated: project_dojochat.md (v0.4 syntax highlighting shipped)
> No new memories needed — fix was mechanical
> Open items unchanged
Edge Cases
- Session with no meaningful changes: Report "no compression needed" rather than creating empty memories
- Memory file conflicts: If two sessions update the same memory, merge by keeping the more recent facts and preserving the why
- MEMORY.md approaching 200 lines: Consolidate related entries or inline short memories before adding new links
- Relative dates in user messages: Always convert to absolute dates when saving ("Thursday" becomes "2026-04-10")
- Session that only read code: Reading sessions rarely produce memories — only save if a non-obvious insight was discovered
Anti-Patterns
- Saving session logs as memory: Memory files are not activity reports. "Read 5 files and ran 3 tests" is not a memory.
- Duplicate memories: Always check existing files before creating new ones. Update, don't duplicate.
- Saving code patterns as memory: If it's derivable from the code itself, it doesn't belong in memory.
- Overly verbose descriptions: Memory descriptions are used for relevance matching. Keep them specific and under 150 characters.
- Forgetting to update Open Items: Stale open items cause future sessions to chase resolved issues.
04 同仓库更多 Skills
kata-test-echo
暂无简介
kata-plain
An ordinary prose skill; not dispatchable.
kata-broken
暂无简介
voice-before-structure
Read the project's design language and philosophy before writing structural artifacts. Ground manifests, READMEs, and descriptions in the project's voice, not boilerplate. Use when creating manifests or READMEs for established projects, writing ecosystem-level documentation, building plugin descriptions or marketplace metadata, or authoring metadata that carries a project's identity. Trigger phrases: 'write the manifest', 'create a README', 'describe this plugin', 'ground yourself in the philosophy', 'ecosystem-level work'.
system-prompt-archaeology
Produces a named ADA disposition preset (YAML) and a layered behavioral analysis (structural decomposition + evidence-cited classifications) from a system prompt. Use when: "analyze this system prompt", "extract disposition from prompt", "reverse-engineer agent behavior", "what patterns does this prompt use", "build a preset from this prompt".
session-lifecycle-automation
Designs and configures all three loops of solo-operator session automation — session bookends, background maintenance agents, and a delegation flywheel. Use when setting up a new workspace, recovering from the 44% zero-artifact session leak, or preparing to scale delegation across multiple concurrent agents.