بنقرة واحدة
lore-digest
Flush knowledge buffer into versioned increment files with source tracing
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Flush knowledge buffer into versioned increment files with source tracing
التثبيت باستخدام 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
Compress knowledge window by merging, deduping, and summarizing buffer entries
Manage L2 constraint layer - knowledge stabilization, protection, and indexing
| name | lore-digest |
| description | Flush knowledge buffer into versioned increment files with source tracing |
| category | ai-context |
Convert raw conversation knowledge (stored in .ai-context/buffer.md) into a structured, versioned increment file in .ai-context/increments/. Each increment includes author, timestamp, confidence, affected files, and evidence for full source tracing.
Read .ai-context/buffer.md. If empty or contains only lock markers, exit silently — no knowledge to flush.
Parse the buffer entries and reorganize them into a proper increment format with full metadata.
Buffer format (raw):
[round: 1] [DECISION] 支付超时改为 5s 因为上游 SLA 从 3s 升级
- Detail: 上游接口 SLA 从 3s 升级为 5s,支付超时需要同步调整...
Transform to increment format:
# YYYY-MM-DD payment-timeout-adjust
## Meta
- author: {{current agent name}}
- timestamp: YYYY-MM-DD HH:MM:SS
- trigger: auto-dialogue
- confidence: high
## Affected Files
- `PaymentService.java` → DECISION (payment timeout threshold)
- `payment-config.yaml` → CONSTRAINT (timeout rule)
## Changes
- `PaymentService.java`: timeout threshold changed from 3000ms to 5000ms
## Decisions
- Payment timeout adjusted to 5s
- 原因: upstream SLA changed from 3s to 5s, old timeout would trigger false rollback
- 讨论中提及: rule of thumb — timeout ≤ upstream SLA × 1.2
## Constraints
- Payment timeout must be ≤ upstream SLA × 1.2
- 来源: user explicitly stated in dialogue
## Evidence
- 来源: 利普, 2026-04-23, development dialogue
- 验证状态: unverified
- 验证人: —
Assign confidence level based on source:
| Source | Confidence |
|---|---|
| User corrected agent (direct feedback) | high |
| User explained business context | high |
| Agent inferred from code analysis | medium |
| Agent guessed from usage patterns | low |
For each knowledge entry, identify which files it relates to:
general (project-level knowledge, not file-specific)Write to .ai-context/increments/YYYY-MM-DD_<short-slug>.md following the template in templates/increment.md.
If an increment for today already exists, append to it (don't overwrite).
Overwrite .ai-context/buffer.md with an empty file.
Record the current timestamp for time-based flush triggers:
date +%s > .ai-context/.last-flush-time
If the buffer had a [LOCKED:commit] marker (from post-commit hook), ensure it's cleared.
git add .ai-context/increments/
git add .ai-context/buffer.md
git add .ai-context/.last-flush-time
If called from post-commit hook context, also:
git commit --amend --no-edit
Report silently — only confirm if the user asked. If no knowledge was in buffer, exit without any output.
If knowledge was flushed:
+ 1 increment written → .ai-context/increments/2026-04-23_payment-timeout-adjust.md
- 1 decision, 1 constraint
- confidence: high, status: unverified
- affected files: PaymentService.java, payment-config.yaml