| name | me-distill |
| description | Distill stack-agnostic personal profile (~/Documents/me-profile/) from raw personal resource (Gmail md dumps, Calendar export, Drive notes, etc.) into a dual-layer always-on inject system - about_me.md (Layer A, 60-line cap, Tier 1, always loaded) plus on-demand facet detail files split across three axes (life Tier 1, work Tier 1, sensitive Tier 2). Use when user invokes "蒸餾我這個人" / "me distill" / "建 me profile" / "更新 me profile" / "重蒸 X facet" / "refresh my profile" / "re-extract <axis>" / "incremental run" / "daily delta" / "add new source" / "把 me 接進 OpenClaw" / "persona distillation" / "個人蒸餾" / similar Chinese-English triggers, or asks to refresh a stale profile, add a new facet, re-extract a single axis, append a new source (Calendar, work Gmail, Drive notes), trigger a daily delta run, or wire about_me into Claude Code memory / OpenClaw workspace / future life assistant. Supports four modes - from-scratch (initial extraction), incremental (merge delta into existing baseline without re-extracting unchanged facets), refresh (force re-extract specific facet), backfill (one-shot build v2.0 manifest from existing R1 state). Runs five phases - Phase A unsupervised discovery to inventory facets, Phase B user-confirmed facet map with axis classification, Phase C parallel per-axis extraction (life/work/sensitive subagents), Phase D meta-distill of about_me.md, Phase E confirm-and-optional-wire. Enforces evidence-tier tagging (verbatim/artifact/impression), kill-list filter, swap test, contradiction preservation, read-only on raw source, and human review gate between every phase. Incremental mode adds append-only on facet files (existing 7-section content immutable), Phase D quality gate auto-rollback, and snapshot-before-synthesize discipline via scripts/manifest_tool.py + scripts/quality_check.py. |
me-distill
Distill a stack-agnostic personal profile from raw resource into a dual-layer inject system. Replaces ad-hoc note-taking with a disciplined five-phase pipeline.
Trigger
Invoke this skill for any of the following user signals:
- "蒸餾我這個人" / "me distill" / "建 me profile" / "個人蒸餾"
- "更新 me profile" / "重蒸 X" / "refresh my profile" / "incremental run" / "daily delta"
- "add new source" / "merge in <Calendar / Drive / 工作 Gmail>"
- "把 me 接進 OpenClaw" / "wire about_me into CC" / "接到 life assistant"
- "persona distillation" / "personal context extract"
- Any request to (re-)extract facets from raw personal sources for use as AI inject context
Default mode is conversational - no CLI flags. Expert mode (--discover / --wire openclaw / --axis sensitive / --incremental / --from-scratch / --force-synthesize) only when user explicitly types flags.
Modes
The skill runs in one of four modes. Mode selection is automatic based on the state of ~/Documents/me-profile/:
| Mode | When | Behaviour |
|---|
| from-scratch | ~/Documents/me-profile/ is empty / missing OR user passes --from-scratch | Run full Phase A-E pipeline against all source. Overwrites everything. Use for R1 (initial distill) or full rebuild. |
| incremental | _manifest.json (v2.0) exists AND new source added OR existing source cursor advanced OR user invokes --incremental | Merge delta. Facet files: append-only (existing 7 sections immutable, new evidence goes to ## Evidence Log section). about_me: re-synthesize only if delta_evidence ≥ 20 OR conflicts_pending > 0 OR age > 7 days. See references/incremental.md. |
| refresh | User explicitly asks "re-extract " or "重蒸 " | Forces single facet through Phase C even if needs_reextract == false. Other facets untouched. |
| backfill | ~/Documents/me-profile/ has R1 facet files but NO _manifest.json (or older version). Run python3 scripts/r1_backfill.py once. | One-shot helper, builds v2.0 manifest reflecting current state. No re-extraction, no source modification. Prerequisite before first incremental run on a legacy R1 profile. |
Output structure
~/.claude/skills/me-distill/
├── SKILL.md
├── scripts/
│ ├── manifest_tool.py # Deterministic manifest helper (init/read/write/fingerprint/snapshot/rollback/enqueue/dequeue/mark_done/add_conflict/dedup_check)
│ ├── quality_check.py # 6-dimension PASS/FAIL gate for about_me.md (used by Phase D auto-rollback)
│ └── r1_backfill.py # One-shot helper: builds _manifest.json v2.0 from existing R1 me-profile/ state
└── references/ # Per-phase + incremental subagent prompts (see ## Detailed reference files)
~/Documents/me-profile/
├── about_me.md # Layer A, 60-line hard cap, always-on inject, Tier 1
├── _manifest.json # v2.0 state: last_run, source_paths (with cursor/fingerprint), facet_list, axis_classification, queue, snapshots, conflicts_pending, wired_targets — see PLAN-incremental.md § 2.2 for full schema
├── _snapshots/ # about_me.md history (kept per snapshot_retention cap, default 10)
├── discover-out/
│ ├── facet-inventory.md # Phase A from-scratch output (R1 baseline); incremental runs APPEND ## Incremental run sections
│ ├── facet-map-approved.md # Phase B confirmations; incremental runs APPEND ## R<N> Addendum sections
│ └── inventory-addendum-R<N>.md # Per-round delta inventory (incremental only)
├── life/ # Layer B detail, Tier 1, ~10-12 facets — 7 sections IMMUTABLE in incremental, new evidence in ## Evidence Log section
├── work/ # Layer B detail, Tier 1, ~10-12 facets — same append-only contract
└── sensitive/ # Layer B detail, Tier 2 (life assistant only, NOT work assistant), ~5-8 facets — same append-only + sensitive masking
See PLAN-incremental.md § 2.2 for the full _manifest.json v2.0 schema.
Dual-layer architecture
- Layer A
about_me.md = always-on inject, hard cap 60 lines, 7 sections, high-level "who they are". Read by every CC / OpenClaw / assistant session. Optimised for density per line, not completeness.
- Layer B
{life,work,sensitive}/*.md = on-demand detail. Each facet 50-100 lines. AI only reads when conversation actually surfaces that topic. Source of truth for any drill-down.
Three-axis routing
- life (Tier 1) - Consumer / entertainment / social / food / gaming / travel facets. Safe for any assistant.
- work (Tier 1) - Job / career / dev tool / recruitment / company / professional facets. Safe for any assistant.
- sensitive (Tier 2) - Finance (banks, cards), mental health (counseling), age-restricted preferences (adult ACG platforms), security/identity. Only loaded by life-assistant context. Excluded from work-assistant context.
Ambiguous facets (e.g. design tool subscription = work resource or life hobby?) are resolved with the user in Phase B Q3.
Phase A - Unsupervised Discovery
Goal: Without any user-supplied hypothesis, enumerate every distinct facet present in the raw resource, with evidence count and Tier classification.
Input: A raw resource directory (default ~/.openclaw/workspace/memory/personal/ for Gmail md dumps; user may specify other path).
Output: _inventory.md at ~/Documents/me-profile/ (or a versioned subdir like v3-discover-sonnet/_inventory.md if iterating).
Subagent dispatch (parallel allowed for cross-validation): See references/phase-a-discover.md for the full subagent prompt covering three-stage discovery (explore → quantify → write inventory), read-only enforcement, and inventory output format.
Incremental mode: When _manifest.json exists, Phase A only scans the delta range past each source's cursor. New facets are surfaced; existing facets get evidence_count increments + needs_reextract = true. Output appends to discover-out/facet-inventory.md (not overwrite) + writes discover-out/inventory-addendum-R<N>.md. See references/incremental.md for the full incremental contract.
Quality bar:
- Must reach evidence-count cardinality (not just topic list)
- Must include facets with evidence < 10 if distinct (don't suppress long-tail signal)
- Must surface emergent cross-facet pattern (Section "跨 facet pattern / Emergent insight")
- Must declare limits / blind spots (Section "盲點 / Limit")
- Read-only on raw resource - never modify, move, delete source files
After Phase A completes, present _inventory.md to user and gate on review.
Phase B - User-Confirmed Facet Map
Goal: Convert the discovered inventory into a per-facet axis assignment that the user has actually confirmed.
Questions (ask in sequence, do not batch):
- Q1. Which facets to distill? (default: all; user may exclude noise like "EDM 促銷 facet")
- Q2. Confirm axis for each facet: life / work / sensitive
- Q3. Ambiguous cases - present each one with reasoning, let user decide:
- Design tool subscriptions (a design-stock / code-sandbox SaaS): work tool or life hobby?
- Job-search resources (a professional network / a job board): work (career progression) or sensitive (income / negotiation context)?
- Gaming purchases: life (entertainment) or sensitive (spending pattern)?
- Q4. Confirm Tier 2 (sensitive) handling rules - see
references/sensitive-handling.md
- Q5. Naming convention for facet files (default: short kebab-case = sender domain or brand)
- Q6. Output destination - confirm
~/Documents/me-profile/ or override
Write resolved axis map into _manifest.json before Phase C.
Incremental mode: Only NEW facets + ambiguous re-classify candidates are surfaced (R1-confirmed assignments are not re-asked). Q4-Q6 are skipped. If new_facet_count == 0 AND ambiguous_count == 0, auto-take subagent recommendation without PENDING_USER_ACTION. Confirmation appends to discover-out/facet-map-approved.md under ## R<N> Addendum section.
Phase C - Per-Axis Parallel Extraction
Goal: For each axis, dispatch a subagent that reads only the relevant facets' raw evidence and writes one .md per facet under {axis}/.
Dispatch: Three subagents in parallel - one per axis. Each owns its own facet list from _manifest.json.
Subagent prompts:
references/phase-c-life.md - life axis specific discipline
references/phase-c-work.md - work axis specific discipline
references/phase-c-sensitive.md - sensitive axis specific discipline + references/sensitive-handling.md
Shared discipline (all three subagents):
- Apply 7-section facet template (TL;DR / 核心 fact / Pattern / 時間性 / 矛盾 / 數據點 / 不足) - see
references/about-me-template.md
- Tag every claim with evidence-tier:
verbatim / artifact / impression
- Apply kill list (see
references/about-me-template.md)
- Apply swap test (see
references/about-me-template.md)
- Preserve contradiction (do not paper over time-based / domain-based / essential conflicts)
- Read-only on raw resource
After Phase C, present sample 2-3 facet files (one per axis) to user and gate on review.
Incremental mode: Axis-level subagent dispatch (per SD3 hybrid) — if an axis has 0 facets needing re-extract, the entire axis subagent is skipped. For each facet that does run, existing 7 sections are IMMUTABLE; new evidence is appended to ## Evidence Log > ### R<N> Addendum section at file end. Conflicts (new evidence contradicts existing claim) write to ## Conflicts to Review sub-section AND register via manifest_tool.py add_conflict. A special reframe conflict class applies when a new source overturns an existing facet's TL;DR / core thesis (not a local data-point clash) — Phase C prepends a controlled ## ⚠️ R<N> Reframe banner above TL;DR as the sole write outside the Evidence Log. See references/incremental.md § "Reframe banner".
Phase D - Synthesize about_me.md
Goal: Meta-distill all Layer B facet files into Layer A about_me.md with 60-line hard cap and 7 sections.
Subagent prompt: references/phase-d-synthesize.md
Sections (in order):
- Who I Am - identity, primary role, current setup
- Domain Expertise - what they actually do well
- Communication Style - how they show up across channels
- Opinions / 行為傾向 - durable behavioural patterns
- Stories & Lessons - 2-4 concrete anecdotes with date / amount / outcome
- Presence & Distribution - where they exist online + identity scheme
- Strengths & Gaps - honest both sides
Hard rules:
- 60-line cap including frontmatter
- Every section must be high-density (no filler sentences)
- Apply kill list aggressively (a sentence with "passionate / authentic / 重視 / 熱愛 / 深度" = rewrite)
- Apply swap test (a sentence that could describe a different person = rewrite)
- Stories must have specific date + specific amount + specific outcome (no vague "often" / "sometimes")
- Preserve contradiction visibly (e.g. "necessary expense miserly + impulse buy lavish")
After Phase D, present about_me.md to user and gate on review.
Incremental mode: Phase D is gated by a hybrid threshold — runs only when delta_evidence ≥ 20 OR conflicts_pending > 0 OR last_about_me_age > 7 days OR --force-synthesize. Snapshot-before-synthesize mandatory; after synthesize, scripts/quality_check.py runs a 6-dimension gate, but only the 5 hard-fail dimensions (line_count / kill_list / swap_test_density / section_count / stories_anchored) trigger auto-rollback on FAIL (via manifest_tool.py rollback about_me + PENDING_USER_ACTION); the 6th, sensitive_leak, is warn-not-fail — it emits WARN, is excluded from all_pass / exit code, and never rolls back (三軸全開 architectural decision). See references/incremental.md § "Snapshot-then-synthesize flow".
Phase E - Confirm and Optional Wire
Goal: Show final output, ask wire target, optionally create symlink / source-path config.
Questions:
- "Connect this to OpenClaw workspace? (writes symlink in workspace config)"
- "Connect this to CC memory dir? (registers in CC project memory)"
- "Both? Neither (just leave at
~/Documents/me-profile/)?"
If wire:
- Create symlink at the target location pointing at
~/Documents/me-profile/about_me.md
- Append target to
_manifest.json under wired_targets
Always:
- Write final
_manifest.json with: last_run, source_path, source_hash, facet_list, axis_classification, wired_targets, agent_used per phase
Quality discipline (PoC-validated, cross-phase)
These rules apply throughout. Detailed templates in references/about-me-template.md.
- Evidence-tier tagging mandatory - every fact-bearing sentence in every facet file ends with
verbatim (direct quote / exact string from source), artifact (count / ID / structural pattern derivable from source), or impression (inference - lowest weight). Sentences without a tier marker fail review.
- Kill list self-check - the following words / phrases are forbidden in output unless lifted as a direct quote:
passionate / authentic / 重視 / 熱愛 / 深度 / 全心投入 / 用心 / 致力於 / 注重 / 在乎. Catch yourself writing them = rewrite that sentence.
- Swap test - read each output sentence and ask "could this sentence describe a different person?" If yes, the sentence is generic = rewrite with specifics (name, date, amount, count).
- Preserve contradiction - three contradiction types are kept, not resolved:
- Temporal (3-month-ago behaviour vs current behaviour)
- Domain (work-self vs life-self - different communication styles)
- Essential (genuinely conflicting traits - e.g. miserly on commute + lavish on streamer gift)
- Read-only on input - the raw resource directory is read-only. Never delete, move, modify, rename source files.
- Human review gate - between Phase A→B, B→C, C→D, D→E, present output and explicitly ask for confirmation before proceeding. Never run the full pipeline unattended unless user invokes
--auto flag.
Conversational UX
- Default mode is conversational - ask questions one at a time, not in batches
- Each phase ends with a review gate
- Don't show CLI flags unless user explicitly types one
- Expert mode (
--discover / --wire openclaw / --axis sensitive / --auto) for power users
Detailed reference files
For complete subagent prompts and discipline templates:
references/phase-a-discover.md - Phase A unsupervised discovery prompt (with incremental mode section)
references/phase-c-life.md - Phase C life axis prompt (with incremental mode section)
references/phase-c-work.md - Phase C work axis prompt (with incremental mode section)
references/phase-c-sensitive.md - Phase C sensitive axis prompt (with incremental mode section)
references/phase-d-synthesize.md - Phase D about_me synthesis prompt (with incremental mode + quality gate section)
references/incremental.md - Full incremental flow contract — when to use, 5-stage flow, manifest_tool.py cheatsheet, merge policy (dedup / facet collision / append-only), conflict surface format, completion report template, daily cron context
references/about-me-template.md - shared 7-section template + kill list + swap test + evidence-tier spec + contradiction taxonomy
references/sensitive-handling.md - sensitive axis specific rules (finance / mental health / ACG / identity masking)
Helper scripts (stdlib only):
scripts/manifest_tool.py - manifest helper (run python3 scripts/manifest_tool.py --help)
scripts/quality_check.py - about_me 6-dimension quality gate
scripts/r1_backfill.py - one-shot R1 → v2.0 manifest backfill