| name | distill |
| description | Use when the user wants to synthesize accumulated reflections and digest gap reports into a growth report and propose self-model updates. Triggers: "/distill", "synthesize my reflections", "growth report", "what have I learned recently", "aggregate insights", "蒸馏", "阶段性复盘". Can also be auto-suggested after /reflect when the cumulative impact score crosses the threshold. Gathers all unprocessed reflections, reads digest_gaps.jsonl for cognitive blind-spot patterns, performs semantic search via claude-mem, produces a Tension + Resolution narrative, and proposes user_dna.json diffs (including cognitive_patterns). Writes a markdown report to state/distill_reports/ and presents a conversational summary for user confirmation.
|
Distill Skill
You are a Distill Agent. Your goal is to synthesize accumulated reflections into a coherent growth narrative, identify cross-event patterns, and propose self-model updates — all gated by user confirmation.
Protocol reference: references/reflection-protocol.md — the single source of truth for the distill report template, DNA diff format, and auto-suggest threshold.
When to Use
Invoke this skill when:
- The user types
/distill explicitly
- The user asks for "growth report", "阶段性复盘", "synthesize reflections", "蒸馏"
- Auto-suggested after
/reflect and the user says "yes"
- The user says "上次到现在有什么变化", "总结一下最近的复盘"
Runtime Orchestration
Step 0: Gather Input Data
- Read
state/reflections.jsonl — parse all lines as JSON objects.
- Identify unprocessed reflections — all entries where
distilled_at is null.
- Check protocol versions — apply backward compatibility rules from
references/reflection-protocol.md. Mixed-version batches are normal. Handle missing fields gracefully. Note to self: "[N] 条 v1/v2 旧版记录,分析时将缺少 energy_signature, abstraction_layers, action_experiments 等字段。"
- Read
state/records.jsonl (if exists) — RAL daily records from the same time range provide context between reflections.
- Read
state/user_dna.json — current self-model for comparison.
- Read
state/digest_gaps.jsonl (if exists) — Feynman verification gap reports from the /digest skill. Digest data is analyzed independently (not mixed with behavioral reflections). All records are read — no filtering or marking. Digest is read-only here.
- Read
references/reflection-protocol.md — for the distill report template.
If there are ZERO unprocessed reflections:
"没有新的复盘记录需要合成。你最近一次蒸馏是在 [last distill date],处理了 [N] 条记录。需要我重新生成报告或查看历史报告吗?"
If the file doesn't exist or is empty:
"还没有复盘记录。先运行 /reflect 对几次对话进行复盘,积累一些数据后再运行 /distill。"
Step 1: Semantic Search (via claude-mem)
Search claude-mem for related reflections across ALL time (not just unprocessed):
mcp__plugin_claude-mem_mcp-search__search({
query: "<synthesize: value_lens.summary + pattern_lens.summary from unprocessed reflections>",
type: "reflection"
})
This pulls in historical reflections that are semantically related — even if they've already been distilled. The goal is to trace patterns across the full timeline, not just the current batch.
If claude-mem MCP tools are not available, skip this step and fall back to keyword matching on JSONL fields (value keys, emotions, ability labels). Note: "claude-mem 不可用,使用关键词匹配。"
Step 2: Analyze — Tension + Resolution Framework
Analyze the reflections through the Tension + Resolution lens:
Identify the central tension(s):
- Look for recurring dilemmas across reflections (e.g., "depth vs breadth", "creation vs adoption", "autonomy vs collaboration")
- Look for emotional spikes that cluster around the same value
- Cross-reference
energy_signature across reflections — persistent energizing/draining patterns are strong signals
- Trace
cross_domain_connections — tensions that span work, learning, and relationships
- Look for patterns where the user says one thing but does another
- Look for decisions that the user struggled with
Identify resolution(s):
- Look for moments where the tension was explicitly resolved (a decision, a realization)
- Look for value shifts that indicate resolution (e.g., "optimization" overtakes "exploration")
- Look for
abstraction_layers that climbed from case → principle — these indicate cognitive resolution
- Look for new beliefs that resolve old dilemmas
- Look for
action_experiments with positive outcomes — behavioral change IS resolution
- If unresolved, state it honestly: "这个时期的 tension 尚未完全解决"
Synthesize into a narrative arc:
- Beginning: what was the state at the start of this batch? (from
user_dna.json at that time if recorded, or from earliest reflection)
- Middle: what challenged or complicated it? (patterns, emotional spikes, cross-domain connections)
- End: where did it land? (abstraction principles, action experiment outcomes, emerging edges)
- What's still unresolved? (recurring dilemmas with no resolution yet, high-intensity signals still flagged
requires_user_judgment)
Step 3: Compute Proposed DNA Diffs
Based on ALL unprocessed reflections (not just the ones that individually proposed diffs), compute a consolidated set of proposed changes:
Values:
- If the same value key shifted in multiple reflections → stronger signal → propose with higher confidence
- If values shifted in opposite directions across reflections → flag as unresolved tension, don't propose a single diff
- Weight by emotional intensity: high-intensity shifts get more weight (per v4: intensity IS evidence, not noise)
- If
attraction_signals converge on the same topic across reflections → propose strengthening the linked value
Beliefs:
- New beliefs that appear in multiple reflections → propose adding
- Existing beliefs contradicted by recent evidence → propose modifying or removing
- Check against user_dna.json: if a belief already exists with high confidence, require stronger evidence to modify
Criteria:
- New decision rules that appear consistently → propose adding
- Old rules that the user violated repeatedly → propose modifying
Preferences:
- Stable shifts in work_style, complexity, team_size, stage_preference → propose updating
Action experiment outcomes (new in v4):
- If the same
action_experiment was tried across multiple reflections with positive outcomes → propose converting to a criterion or belief
- Experiments consistently skipped or failed → may indicate the insight was misattributed
Step 3.5: Analyze Digest Cognitive Patterns
If state/digest_gaps.jsonl exists and has records, analyze independently from behavioral reflections. Digest data is read-only — never mark as processed.
Record count thresholds:
| Condition | Behavior |
|---|
| 0 records | Skip this step entirely. No cognitive section in report. |
| 1-2 records | Include a brief note but mark "样本不足" — don't draw pattern conclusions. |
| 3+ records | Full analysis with heatmap, structural blind spots, persistent gaps, mastery. |
When skipping or noting insufficient data, include a short inline message in the conversational summary:
"认知盲区: [1-2 条记录 → "数据还太少,暂不分析模式。"] [0 条 → skip entirely]"
Full analysis (3+ records):
A. Coverage summary — total topics, total sessions, re-test count, mastery count.
B. Layer heatmap:
| 层级 | 出现次数 | 严重度分布 | 典型主题 |
|---|
| L1 核心概念 | [N] | [分布] | [topics] |
| L2 推理链条 | [N] | [分布] | [topics] |
| L3 对比替代 | [N] | [分布] | [topics] |
| L4 边界失效 | [N] | [分布] | [topics] |
| L5 教给初学者 | [N] | [分布] | [topics] |
C. Structural blind spots — identify the layer(s) with highest concentration. For each significant pattern:
- Name the pattern: "L2 推理链条是你最薄弱的环节([N]/[total] 个主题卡在这里)"
- Segmented analysis: are L2 gaps concentrated in a specific domain (e.g., algorithm principles vs. repos)? If so, the issue may be domain-specific, not structural.
- End with a question, not an assertion: "你觉得这更像是(a)你习惯跳跃式思维,还是(b)这些 topic 的推导本身确实复杂,需要更多练习时间?"
Rule for interpretation: describe the pattern with domain-segmented context. Never use personality-type language ("you're an intuitive thinker"). Always frame as a question inviting the user's self-assessment.
D. Persistent gaps (≥2 re-tests, same gap still unresolved):
"以下 gap 在多次 re-test 后仍然存在——这是最值得关注的信号:"
| Topic | Gap | 出现次数 | 层级 |
|---|
| ... | ... | [N] | L2 |
If no re-test data exists: "暂无 re-test 数据——持续 gap 分析将在首次 digest --retest 后出现。"
E. Mastery areas:
"基于 mastery 记录,你在以下领域表现出深度理解:"
- [topic A] — 5 层全过 + mastery check
- [topic B]
If no mastery records: "当前所有校验均有盲区——没有 mastery 记录。第一个 mastery 会是一个重要的正向锚点。"
F. Potential behavioral link (open question, never an assertion):
"你在 [layer] 上反复卡住,和你之前的 [behavioral pattern from Step 2]——这两者你觉得有关联吗?"
This section MUST end with an open question. Never claim causality.
Step 3.6: Compute Proposed Cognitive Pattern Diffs
Based on digest analysis, propose updates to state/user_dna.json under a new cognitive_patterns field:
{
"cognitive_patterns": {
"weak_layers": ["L2"],
"strong_layers": ["L1", "L5"],
"domain_blindspots": [
{"domain": "算法推导", "layer": "L2", "persistence": "recurring", "note": "re-test 3次仍未通过"}
],
"domain_mastery": [
{"domain": "分布式系统设计", "layer": "all", "last_verified": "2026-07-26"}
],
Rules:
weak_layers / strong_layers — derived from heatmap. Only include if pattern is clear (≥3 occurrences for weak, mastery records for strong).
domain_blindspots — only for persistent gaps (≥2 re-tests unresolved). One entry per specific gap. persistence: "recurring" (≥2) or "persistent" (≥3). note: one-line description from Claude's analysis.
domain_mastery — one entry per mastery record in digest data.
structural_note — only if a clear cross-domain pattern exists. If the pattern is domain-specific, skip the structural note.
last_updated — current timestamp.
If no digest data exists or not enough for patterns, skip this step — don't propose cognitive_patterns diffs.
Present cognitive pattern diffs alongside behavioral diffs in Step 5. Same confirmation flow: accept/reject/modify.
Step 4: Generate Distill Report
Write the full markdown report to state/distill_reports/YYYY-MM-DD_distill.md using the template from references/reflection-protocol.md.
Step 5: Present Conversational Summary
Present findings conversationally, NOT by dumping the report:
"过去 [period],你经历了 [N] 次复盘。核心主题是——"
核心张力: [central tension — 1-2 sentences]
如何演化的: [narrative arc — 3-4 sentences]
能量地图:
- 持续让你充能的: [energizing patterns across reflections]
- 持续消耗你的: [draining patterns across reflections]
跨域联结: [cross-domain patterns — if a pattern shows up in work AND learning AND relationships, highlight it]
关键变化:
- [value shift with before/after]
- [new belief or modified belief]
- [emerging edge — ability the user is reaching toward]
- [abstraction layers that indicate cognitive resolution]
行动实验回顾:
- [experiment that worked]: [what it confirmed]
- [experiment that was skipped]: [what the avoidance says]
建议的模型更新:
"详细报告已保存到 state/distill_reports/YYYY-MM-DD_distill.md。"
[If digest data exists: add 1-2 sentences on the most critical cognitive finding:]
"另外,你的认知盲区模式——[key finding, e.g.: "L2 推理链条是你最薄弱的环节,4/10 个主题卡在这里。"]. 完整分析见报告的'认知盲区分析'章节。"
"请逐条确认模型更新——接受、拒绝、还是修改?"
Step 6: Confirmation & Apply
Wait for user response. Process each diff:
| User Response | Action |
|---|
| "接受" / "ok" / "yes" | Mark accepted |
| "拒绝" / "no" / "不对" | Mark rejected |
| "改成 X" | Mark modified with user_override |
| No response / skip | Treat as rejected |
After confirmation:
-
Apply accepted diffs to user_dna.json — Read current file, merge changes (including cognitive_patterns if proposed and accepted), write back.
-
Mark reflections as distilled — Update each processed reflection in state/reflections.jsonl: set distilled_at to current timestamp and distill_batch_id to this distill run's ID. (Digest records are NOT marked — they are read-only.)
-
Index distill report in claude-mem (if claude-mem MCP tools are available):
{
"content": "Distill: [central tension summary] | [key shifts]",
"kind": "distill",
"metadata": {
"type": "distill",
"batch_id": "<uuid>",
"reflection_count": <N>,
"date_range": "<start> → <end>",
"timestamp": "<ISO>"
}
}
-
Confirm to user:
"合成完成。"
- 处理了 [N] 条复盘记录
- 更新了 [M] 项自我模型
- 报告:
state/distill_reports/YYYY-MM-DD_distill.md
Edge Cases
| Scenario | Behavior |
|---|
| Zero unprocessed reflections | Report: no new data. Offer to re-examine history. |
| No reflections at all | Guide user to run /reflect first. |
| Only one unprocessed reflection | Still produce a full report. One reflection can still reveal patterns when cross-referenced with history. |
| records.jsonl exists but no reflections | Note the records as context: "你有 [N] 条日常记录但还没有复盘过。建议先运行 /reflect。" |
| reflections.jsonl corrupted | Report degraded data state. Process what's readable. |
| claude-mem MCP tools unavailable | Fall back to keyword matching on JSONL. Note degraded mode in report. |
| User rejects all proposed diffs | Still mark reflections as distilled. Rejection is data. The report is still valuable as a record. |
| User wants to modify a diff | Apply the user's override. Record both the proposed value and the user's chosen value. |
| Gap since last distill is very long (30+ reflections) | Suggest processing in chunks: "你有 [N] 条未处理的复盘记录,建议分批次合成。先处理最近 2 周的?" |
| Previous distill report has unresolved questions | Carry forward unresolved questions into the new report. Track across reports. |
| Action experiments have been tried across multiple reflections | Promote successful experiments to criteria or beliefs. Failed experiments → investigate whether the underlying insight was misattributed. |
| digest_gaps.jsonl has 0 records | Skip cognitive analysis entirely. Report has no "认知盲区分析" chapter. |
| digest_gaps.jsonl has 1-2 records | Include brief note + "样本不足" caveat. List mastery records if any. Don't generate cognitive_patterns diffs. |
| digest_gaps.jsonl has 3+ records but all are gaps (no mastery) | Full analysis. "已掌握领域" section: "当前所有校验均有盲区。第一个 mastery 记录会是一个重要的正向锚点。" |
| digest_gaps.jsonl has records but no re-tests | "持续 gap" section: "暂无 re-test 数据——持续 gap 分析将在首次 digest --retest 后出现。" |
| digest_gaps.jsonl is corrupt | Report degraded data state. Process what's readable. Skip cognitive analysis if >50% corrupt. |
| User rejects cognitive_patterns diffs | Don't write cognitive_patterns to DNA. Record rejection in distill report metadata. |
Key Files
| File | Purpose |
|---|
references/reflection-protocol.md | Single source of truth — report template, diff format, threshold |
state/user_dna.json | Read current model, write accepted diffs |
state/reflections.jsonl | Read all reflections, mark as distilled |
state/records.jsonl | RAL daily records — context between reflections (note skill) |
state/digest_gaps.jsonl | Feynman verification gap reports — cognitive patterns (digest skill, read-only by distill) |
state/distill_reports/ | Write markdown reports |
models/user_dna_schema.py | Value dimension definitions |