원클릭으로
lore-compact
Compress knowledge window by merging, deduping, and summarizing buffer entries
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Compress knowledge window by merging, deduping, and summarizing buffer entries
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Automatically discover modules and partition knowledge into modular structure
Create and manage L0 prescriptive design specs before writing code
Compile knowledge increments into project snapshot with conflict detection
Auto-scan project structure and sync L1 knowledge layer with codebase
Manage L2 constraint layer - knowledge stabilization, protection, and indexing
Flush knowledge buffer into versioned increment files with source tracing
| name | lore-compact |
| description | Compress knowledge window by merging, deduping, and summarizing buffer entries |
| category | ai-context |
类比 Claude Code 的上下文 compaction,在知识窗口过大时自动压缩,保持 snapshot 精炼。
将 buffer 中的多条原始知识压缩为精炼的摘要,减少 snapshot 膨胀,同时保留完整追溯。
核心思想:不是简单 flush,而是先"消化"——合并同类、去除冗余、提取本质。
读取 .ai-context/buffer.md 中的所有原始知识条目。
按主题分组。判断标准:
对每组执行:
合并规则:
[CONFLICT],保留双方去重规则:
将合并后的条目压缩为精炼形式:
原始:
[round: 3] [DECISION] 支付超时改为 5s
- Detail: 上游 SLA 从 3s 升级为 5s
[round: 5] [DECISION] 支付超时不能超过 8s
- Detail: 超过会触发回退
压缩后:
[DECISION] 支付超时设为 5s(上游 SLA 升级),上限 8s(防止回退)
- 来源: round 3, 5
- 关联: PaymentService.java
写入 increment(详细版):
写入 snapshot 更新(精炼版):
清空 .ai-context/buffer.md。
git add .ai-context/increments/
git add .ai-context/snapshot.md
git add .ai-context/buffer.md
静默执行。完成后简要报告:
+ Compact complete:
- 12 raw entries → 4 summarized entries
- 2 groups merged, 1 conflict flagged
- Increment: 2026-04-24_compact-session.md
- Snapshot updated: Key Decisions, Constraints
| /digest | /compact | |
|---|---|---|
| 触发时机 | soft 阈值 (5) | compact 阈值 (8) |
| 动作 | 直接写入 increment | 先合并压缩,再写入 |
| snapshot 更新 | 否(等 /evolve) | 是(轻量更新) |
| 目的 | 防止丢失 | 防止膨胀 |
典型流程:
buffer 积累 → 达到 5 条 → /digest → increments
buffer 继续积累 → 达到 8 条 → /compact → snapshot 轻量更新 + increments
buffer 继续积累 → 达到 15 条 → 强制 /compact + /digest