Reflect Skill
Multi-pass adversarial extraction of personal insights from conversations.
Protocol reference: references/reflection-protocol.md — schemas, lens prompts, adversary rules, and storage conventions.
When to Use
- User types
/reflect explicitly
- Asks to "reflect on this conversation", "复盘", "what did I learn"
Runtime
Step 0: Load Context
- user_dna.json —
Read state/user_dna.json. If missing: "没有现有的自我模型做对比,建议先运行 value-discovery。"
- reflections.jsonl —
Read state/reflections.jsonl. Parse each line as JSON. Run integrity checks. Report: "reflections.jsonl: [N] 条, [M] 条损坏已跳过".
- protocol —
Read references/reflection-protocol.md for lens prompts and schemas.
- RAL records —
Read state/records.jsonl. Filter for processed_at: null. Include as additional signal sources alongside the conversation transcript. If a record has value_tags, pass them as "user self-tagged" signals — higher confidence.
- Pending experiments — Check most recent reflection for
action_experiments with status: "active". Determine age:
| Age |
Action |
| 0-4 days |
"上次复盘你选了 [N] 个行动实验。试了一下吗?" |
| 5-13 days |
Gentle nudge |
| 14+ days |
Auto-expire → status: "expired" |
Step 0.5: Preprocessing (long conversations)
- Short (<40 turns or <5k words): pass full transcript to all Lens agents
- Long (40+ turns or 5k+ words): extract 5-8 most signal-rich excerpts first
For long conversations, extract:
Moments with emotional weight, decisions, trade-offs, unprompted initiations, flow states. For each excerpt, include a one-line label and the verbatim exchange.
Lens agents receive: condensed signal map (primary) + full transcript (reference).
Step 1: Pass 1 — Parallel 3-Lens Extraction
Announce: "正在通过三个视角分析这次对话..."
Spawn three subagents in parallel using the Agent tool. Each receives the full conversation transcript (or condensed map from Step 0.5) + current user_dna.json + lens-specific prompt from references/reflection-protocol.md.
All three follow the same workflow: Segment → Focus → Extract.
Value Lens (label: "reflect:value-lens")
- Extract what the user is pursuing — direction, attraction, energy
- Schema: segments, focus_segments, candidate_values, attraction_signals, emotional_spikes, summary
Ability Lens (label: "reflect:ability-lens")
- Extract demonstrated and emerging capabilities
- Schema: segments, focus_segments, demonstrated_abilities, emerging_edges, new_connections, summary
Pattern Lens (label: "reflect:pattern-lens")
- Identify recurring patterns, cross-domain connections, energy signature, abstraction layers
- Schema: segments, focus_segments, identified_patterns, abstraction_layers, cross_domain_connections, energy_signature, recurring_dilemmas, decision_heuristics, summary
Step 1.5: Validation Gate
- Parse JSON — each agent output must be valid JSON
- Check required fields —
segments (non-empty), focus_segments (non-empty), summary (non-empty)
- Sanity check — do segment labels match actual conversation topics?
- Classify each lens:
passed | degraded | failed
Degraded mode:
| Survivors |
Action |
| 3/3 |
Proceed normally |
| 2/3 |
Proceed, relax cross-corroboration |
| 1/3 |
Proceed with heavy caveat |
| 0/3 |
Abort. "本轮复盘无法完成。" Save minimal event with status: "aborted". |
Step 2: Pass 2 — Adversary Agent
Spawn adversary using the Agent tool (label: "reflect:adversary").
Receives all three lens outputs. Uses the adversary prompt from references/reflection-protocol.md. Three roles:
- Truth calibration — verify claims have evidence
- Meaning expansion — alternative framings for each finding
- Action concretization — generate testable "If [trigger], then [action]" experiments
Step 3: Synthesize & Present
Present findings conversationally:
"这次对话中我注意到——"
情绪层面: [emotional highlights]
能力层面: [demonstrated abilities + emerging edges]
模式层面: [patterns + abstraction layers]
能量地图: [energizing vs. draining]
信号质量: [score] / 1.0
Present proposed user_dna.json diffs:
"基于以上信号,我建议对你的自我模型做以下调整:"
- 价值观: [key] [from → to] — 证据: [evidence]
- 信念: [add/modify/remove]
- 决策准则: [context]: [rule]
- 偏好: [field]: [from → to]
Present action experiments:
"以下是基于本轮发现的行动实验:"
| 洞察 | 行动规则 | 验证方式 |
Confirm: "请逐条确认——接受、拒绝、还是修改?"
Step 4: Persist
- Apply accepted diffs to user_dna.json — merge changes, keep existing fields
- Mark records processed — set
processed_at + linked_reflection_id
- Save experiments — selected:
status: "active", unselected: status: "skipped"
- Write reflection event to
state/reflections.jsonl — full schema from protocol
- Confirm: "已保存。复盘 ID: [id]。状态更新: user_dna.json 已更新 [N] 项 / reflections.jsonl 累计 [N] 条。"
Step 5: Auto-Suggest /distill
Calculate cumulative impact of unprocessed reflections. If impact >= threshold:
"你的复盘记录中累计影响分数为 [score],建议运行 /distill 进行一次阶段性合成。现在跑还是稍后?"
Cold Start
First /reflect (no reflections.jsonl or empty):
- Run FULL 3-agent protocol. Don't simplify.
- Pattern Lens: "First reflection — cross-referencing user_dna.json only."
- Adversary: "No historical data available — calibrate against user_dna.json and cross-lens corroboration only."
- Output: "这是你的第一次复盘——历史模式会随着更多复盘数据而浮现。"
Edge Cases
| Scenario |
Action |
| user_dna.json missing |
Run without. Note: "建议先运行 value-discovery。" |
| Lens agent fails |
Validation gate → degraded mode |
| All three lenses fail |
Abort with minimal event |
| All signals filtered |
No diffs proposed. Still save. |
| User rejects all |
No DNA update. Rejection IS signal — record it. |
| JSONL corrupt lines |
Skip. Report count. >50% → recommend manual recovery. |
| Short conversation |
Full protocol. Confidence naturally lower. |
Key Files
| File |
Purpose |
references/reflection-protocol.md |
Lens prompts, schemas, adversary rules |
state/user_dna.json |
Read as context, write accepted diffs |
state/reflections.jsonl |
Append full reflection event |
state/records.jsonl |
RAL records loaded as extra signal sources |
1---2name: reflect3description: Use when the user wants to reflect on a conversation or experience to extract personal insights — values, abilities, and patterns. Triggers: "/reflect", "reflect on this", "analyze this conversation", "what did I learn here", "extract insights from this", "复盘". Runs a multi-pass adversarial extraction: 3 parallel lens agents (Value, Ability, Pattern) → calibrated skeptic adversary → proposed self-model diffs. Output is saved to state/reflections.jsonl. The user confirms/rejects each proposed diff inline before any file is written. Also loads unprocessed RAL records from state/records.jsonl as additional signal sources.4---56# Reflect Skill78Multi-pass adversarial extraction of personal insights from conversations.910**Protocol reference**: `references/reflection-protocol.md` — schemas, lens prompts, adversary rules, and storage conventions.1112## When to Use1314- User types `/reflect` explicitly15- Asks to "reflect on this conversation", "复盘", "what did I learn"1617## Runtime1819### Step 0: Load Context20211. **user_dna.json** — `Read state/user_dna.json`. If missing: "没有现有的自我模型做对比,建议先运行 value-discovery。"222. **reflections.jsonl** — `Read state/reflections.jsonl`. Parse each line as JSON. Run integrity checks. Report: "reflections.jsonl: [N] 条, [M] 条损坏已跳过".233. **protocol** — `Read references/reflection-protocol.md` for lens prompts and schemas.244. **RAL records** — `Read state/records.jsonl`. Filter for `processed_at: null`. Include as additional signal sources alongside the conversation transcript. If a record has `value_tags`, pass them as "user self-tagged" signals — higher confidence.255. **Pending experiments** — Check most recent reflection for `action_experiments` with `status: "active"`. Determine age:2627| Age | Action |28|-----|--------|29| 0-4 days | "上次复盘你选了 [N] 个行动实验。试了一下吗?" |30| 5-13 days | Gentle nudge |31| 14+ days | Auto-expire → `status: "expired"` |3233### Step 0.5: Preprocessing (long conversations)3435- **Short** (<40 turns or <5k words): pass full transcript to all Lens agents36- **Long** (40+ turns or 5k+ words): extract 5-8 most signal-rich excerpts first3738For long conversations, extract:39> Moments with emotional weight, decisions, trade-offs, unprompted initiations, flow states. For each excerpt, include a one-line label and the verbatim exchange.4041Lens agents receive: condensed signal map (primary) + full transcript (reference).4243### Step 1: Pass 1 — Parallel 3-Lens Extraction4445Announce: "正在通过三个视角分析这次对话..."4647Spawn three subagents in parallel using the `Agent` tool. Each receives the full conversation transcript (or condensed map from Step 0.5) + current user_dna.json + lens-specific prompt from `references/reflection-protocol.md`.4849All three follow the same workflow: **Segment → Focus → Extract**.50511. **Value Lens** (label: "reflect:value-lens")52 - Extract what the user is pursuing — direction, attraction, energy53 - Schema: segments, focus_segments, candidate_values, attraction_signals, emotional_spikes, summary54552. **Ability Lens** (label: "reflect:ability-lens")56 - Extract demonstrated and emerging capabilities57 - Schema: segments, focus_segments, demonstrated_abilities, emerging_edges, new_connections, summary58593. **Pattern Lens** (label: "reflect:pattern-lens")60 - Identify recurring patterns, cross-domain connections, energy signature, abstraction layers61 - Schema: segments, focus_segments, identified_patterns, abstraction_layers, cross_domain_connections, energy_signature, recurring_dilemmas, decision_heuristics, summary6263### Step 1.5: Validation Gate64651. Parse JSON — each agent output must be valid JSON662. Check required fields — `segments` (non-empty), `focus_segments` (non-empty), `summary` (non-empty)673. Sanity check — do segment labels match actual conversation topics?684. Classify each lens: `passed` | `degraded` | `failed`6970**Degraded mode:**7172| Survivors | Action |73|-----------|--------|74| 3/3 | Proceed normally |75| 2/3 | Proceed, relax cross-corroboration |76| 1/3 | Proceed with heavy caveat |77| 0/3 | Abort. "本轮复盘无法完成。" Save minimal event with `status: "aborted"`. |7879### Step 2: Pass 2 — Adversary Agent8081Spawn adversary using the `Agent` tool (label: "reflect:adversary").8283Receives all three lens outputs. Uses the adversary prompt from `references/reflection-protocol.md`. Three roles:841. **Truth calibration** — verify claims have evidence852. **Meaning expansion** — alternative framings for each finding863. **Action concretization** — generate testable "If [trigger], then [action]" experiments8788### Step 3: Synthesize & Present8990Present findings conversationally:9192> "这次对话中我注意到——"93>94> **情绪层面**: [emotional highlights]95> **能力层面**: [demonstrated abilities + emerging edges]96> **模式层面**: [patterns + abstraction layers]97> **能量地图**: [energizing vs. draining]98> **信号质量**: [score] / 1.099100Present proposed **user_dna.json diffs**:101102> "基于以上信号,我建议对你的自我模型做以下调整:"103> - 价值观: [key] [from → to] — 证据: [evidence]104> - 信念: [add/modify/remove]105> - 决策准则: [context]: [rule]106> - 偏好: [field]: [from → to]107108Present **action experiments**:109110> "以下是基于本轮发现的行动实验:"111> | 洞察 | 行动规则 | 验证方式 |112113**Confirm**: "请逐条确认——接受、拒绝、还是修改?"114115### Step 4: Persist1161171. **Apply accepted diffs to user_dna.json** — merge changes, keep existing fields1182. **Mark records processed** — set `processed_at` + `linked_reflection_id`1193. **Save experiments** — selected: `status: "active"`, unselected: `status: "skipped"`1204. **Write reflection event** to `state/reflections.jsonl` — full schema from protocol1215. **Confirm**: "已保存。复盘 ID: [id]。状态更新: user_dna.json 已更新 [N] 项 / reflections.jsonl 累计 [N] 条。"122123### Step 5: Auto-Suggest `/distill`124125Calculate cumulative impact of unprocessed reflections. If impact >= threshold:126127> "你的复盘记录中累计影响分数为 [score],建议运行 `/distill` 进行一次阶段性合成。现在跑还是稍后?"128129## Cold Start130131First `/reflect` (no reflections.jsonl or empty):132- Run FULL 3-agent protocol. Don't simplify.133- Pattern Lens: "First reflection — cross-referencing user_dna.json only."134- Adversary: "No historical data available — calibrate against user_dna.json and cross-lens corroboration only."135- Output: "这是你的第一次复盘——历史模式会随着更多复盘数据而浮现。"136137## Edge Cases138139| Scenario | Action |140|----------|--------|141| user_dna.json missing | Run without. Note: "建议先运行 value-discovery。" |142| Lens agent fails | Validation gate → degraded mode |143| All three lenses fail | Abort with minimal event |144| All signals filtered | No diffs proposed. Still save. |145| User rejects all | No DNA update. Rejection IS signal — record it. |146| JSONL corrupt lines | Skip. Report count. >50% → recommend manual recovery. |147| Short conversation | Full protocol. Confidence naturally lower. |148149## Key Files150151| File | Purpose |152|------|---------|153| `references/reflection-protocol.md` | Lens prompts, schemas, adversary rules |154| `state/user_dna.json` | Read as context, write accepted diffs |155| `state/reflections.jsonl` | Append full reflection event |156| `state/records.jsonl` | RAL records loaded as extra signal sources |