# Distill

> Use when the user wants to synthesize accumulated reflections and digest gap reports into a growth report on their technical cognition. 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 technical-cognition updates (to state/reflections.jsonl + digest_gaps.jsonl, never into the interest profile). Writes a markdown report to state/distill_reports/ and presents a conversational summary for user confirmation.

- Skill: `flingjie/distill-2` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add flingjie/distill-2`
- Raw SKILL.md: https://api.skillmd.com/api/skills/flingjie/distill-2/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Marketing & Growth
- Author: flingjie (https://skillmd.com/u/flingjie)
- Updated: 2026-09-22
- Page: https://skillmd.com/skills/flingjie/distill-2

---


# Distill Skill

You are a Distill Agent. Your goal is to synthesize accumulated reflections into a coherent **technical-cognition** growth narrative — identifying cross-event patterns in how the user learns, verifies, and builds — and propose updates to `state/reflections.jsonl` + `state/digest_gaps.jsonl`, all gated by user confirmation.

> **Convergence note (P4):** distill synthesizes *technical cognition* only. It does **not** maintain a personality/values self-model. Never write `values`/`beliefs`/`criteria`/`cognitive_patterns` into `state/builder_interest_profile.json` — that file holds only the 6-field interest profile. Cognitive blind-spots are `state/digest_gaps.jsonl`.

**Protocol reference**: `references/reflection-protocol.md` — the single source of truth for the distill report template, reflection update 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

1. **Read `state/reflections.jsonl`** — parse all lines as JSON objects.
2. **Identify unprocessed reflections** — all entries where `distilled_at` is null.
3. **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 等字段。"
4. **Read `state/records.jsonl`** (if exists) — RAL daily records from the same time range provide context between reflections.
5. **Read `state/builder_interest_profile.json`** (if exists) — interest profile for context (read-only).
6. **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.
7. **Read `references/reflection-protocol.md`** — for the distill report template.
8. **Read radar decision outcomes (optional)** — `state/concepts.jsonl`, `state/concept_evidence.jsonl`, and `state/radar_reviews.jsonl` (plus any `output/radar/*.json` run payloads), if present. Read-only calibration evidence from the `concept-radar` skill — see "Calibration Evidence" below. If absent, skip; radar evidence is optional.

If there are ZERO unprocessed reflections:

> "没有新的复盘记录需要合成。你最近一次蒸馏是在 [last distill date]，处理了 [N] 条记录。需要我重新生成报告或查看历史报告吗？"

If the file doesn't exist or is empty:

> "还没有复盘记录。先运行 `/reflect` 对几次对话进行复盘，积累一些数据后再运行 `/distill`。"

## Calibration Evidence (radar decisions)

Radar state (concept cards, evidence records, radar reviews, radar run payloads)
may be cited as **optional** calibration evidence alongside reflections and digest
gaps. The five calibration dimensions and their radar signals:

| Dimension | Radar signal to read |
|-----------|----------------------|
| Novelty bias | Cards advanced on `why_now` energy with thin evidence; predictions later rejected |
| Authority bias | Evidence weighted by author/popularity rather than `directness`/`strength` |
| Hype sensitivity | `hype` penalty (0-3) and hype keyword groups in `why_now`/notes |
| Source precision | Source coverage gaps (`partial`/`unavailable`) vs. conclusions drawn as if complete |
| Recurring over/underestimation | Prediction vs. recorded outcome across reviews |

**Hard constraint.** Radar artifacts are **read-only** during distillation. A
distill report may *explain* a recurring judgment error — e.g. "hype sensitivity:
repeatedly over-ranked viral claims" — and fold that explanation into a proposed
`builder_interest_profile.json` diff (including `cognitive_patterns`), but it must **never alter
evidence strength, maturity, or source records**. Those corrections belong to the
`concept-radar` skill. Proposed user-DNA changes still flow through the existing
confirmation rules in Step 6 unchanged.

### 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: decision_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 `builder_interest_profile.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 Technical-Cognition Updates

Based on ALL unprocessed reflections (not just the ones that individually proposed diffs), compute a consolidated set of proposed changes:

**Decisions:**
- If the same decision criterion shifted in multiple reflections → stronger signal → propose with higher confidence
- If decisions shifted in opposite directions across reflections → flag as unresolved tension, don't propose a single update
- **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 interest

**Assumptions:**
- New assumptions that appear in multiple reflections → propose adding
- Existing assumptions contradicted by recent evidence → propose modifying or removing
- Check against builder_interest_profile.json: if an assumption already exists with high confidence, require stronger evidence to modify

**Decision rules (criteria):**
- New decision rules that appear consistently → propose adding
- Old rules that the user violated repeatedly → propose modifying

**Build constraints:**
- Stable shifts in team size, complexity, or stage preference → propose updating `build_constraints`

**Action experiment outcomes** (new in v4):
- If the same `action_experiment` was tried across multiple reflections with positive outcomes → propose converting to a decision rule or assumption
- 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 cognitive blind-spot patterns to be written to
`state/digest_gaps.jsonl` (technical-cognition tracking — **not** the interest
profile in `state/builder_interest_profile.json`):

```json
{
  "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"}
    ],
    "structural_note": "倾向于概念性理解，推导步骤需刻意练习",
    "last_updated": "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]
>
> **建议的模型更新**:
> - [diff 1]: [rationale]
> - [diff 2]: [rationale]
>
> "详细报告已保存到 `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:

1. **Record accepted cognitive-pattern updates to `state/digest_gaps.jsonl`** — append, never rewrite. Do **not** write into `state/builder_interest_profile.json` (the interest profile is not a distill target).
2. **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.)

3. **Index distill report in claude-mem** (if claude-mem MCP tools are available):
   ```json
   {
     "content": "Distill: [central tension summary] | [key shifts]",
     "kind": "distill",
     "metadata": {
       "type": "distill",
       "batch_id": "<uuid>",
       "reflection_count": <N>,
       "date_range": "<start> → <end>",
       "timestamp": "<ISO>"
     }
   }
   ```

4. **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. |
| digest_gaps.jsonl has records from a domain the user never talks about in reflections | Still include in analysis — this is expected. Cognitive verification and behavioral reflection are different activities. |

## Key Files

| File | Purpose |
|------|---------|
| `references/reflection-protocol.md` | Single source of truth — report template, diff format, threshold |
| `state/builder_interest_profile.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/builder_interest_profile.py` | Interest profile schema |

