distill
Distill a session-tethered working context into a self-contained portable handoff a fresh zero-memory agent can execute from. Closes deictic, grounding, relevance, provenance, and compression gaps, then emits a prose channel plus a schema-versioned TaskStateBlock. Type: (ContextTethered, AI, DISTILL, WorkingContext) → PortableHandoff. Alias: Diylisis(διύλισις).
What this skill does
# Diylisis Protocol
Distill a session-tethered working context into a self-contained portable handoff through deictic, grounding, relevance, provenance, and compression closure, resolving context-tethered residue into a handoff a fresh zero-memory agent can execute from. Type: `(ContextTethered, AI, DISTILL, WorkingContext) → PortableHandoff`.
## Definition
**Diylisis** (διύλισις: refining, distillation): A dialogical act of distilling a session-tethered working context — the accumulated context window of one working session, carrying undefined jargon, metric tokens, author process traces, tool state, and dangling task identifiers — into a self-contained portable handoff that a fresh recipient with no access to the author session can execute from. The protocol's lexical verb is `/distill`. The author session declares a handoff contract, normalizes each session-local pointer (deixis) to a canonical reference, audits each item for self-containment, judges each item's recipient-relevance and transformation-provenance, compresses to the minimal-complete set, gates the result against a zero-memory comprehension standard, loops until a monotone hygiene measure reaches its fixed point, and emits the handoff across a prose channel and a schema-versioned task-state channel.
```
── FLOW ──
Diylisis(W, recipient?, next_task?) → Detect(W) → tethered? →
¬tethered: → deactivate (handoff already self-contained)
tethered: pass_n=1, ledger = read(CorrectionDelta) | unknown, residuals = ∅, loop:
F0 declare(recipient, next_task, allowed_sources, scope, stop) → contract -- relevance + minimality premise
F1 scan(deixis) → normalize(surface_token → canonical_ref, confidence, unresolved?) → SubstTable
|unresolved tokens| > 0: append to residuals (reason: unresolved)
F2 audit(item, self_containment) → classify(inline | stable-pointer | routed-residual) -- no silent residual
F3a relevance(item, contract.next_task) → keep_candidate? -- F0 contract predicate
F3b provenance(item, ledger) → Provenance →
CorrectionDelta(KEEP, status≠provisional): → CorrectedKeep → KEEP
else (ledger unknown ∨ no match ∨ provisional-only ∨ non-KEEP delta): → Unknown → Constitution(ASK) -- provenance authority is the KEEP hard line only; no KEEP inferred without a matching non-provisional KEEP delta
F3 disposition(item) ← Disposition: KEEP(inline) | ROUTE(StableRef) | DROP -- KEEP from CorrectedKeep; ROUTE/DROP from F3a relevance or the Gate; Unknown ∨ conflict → Gate
F4 compress(kept) → minimal_complete -- remove only if no contract/residual violation
F5 comprehension_gate(minimal_complete, contract) → zero_memory_verdict → -- lint checklist or fresh subagent; no self-simulation
Fail(blocking_items): append to residuals (reason: comprehension-gap), block fixed_point
Pass: no new residual
Gate Qd(disposition conflicts ∪ unknown-provenance ∪ unresolved residuals) → Stop → A -- Constitution surfacing (both verdicts; residuals incl. comprehension-gap)
F6 loop: measure(unresolved anchors, stop, schema, residual, leaked drops, unclean deltas) decreasing → fixed_point? -- leak lint: DROP'd content absent from emit, incl. emit-ledger deltas under re-distillation (minimality dual of F5)
¬fixed_point: pass_n += 1, loop (one-pass + bounded audit/lint)
fixed_point: → F7
F7 emit(prose_channel, TaskStateBlock, correction_ledger?) → PortableHandoff → converge -- leak_free across every emitted channel incl. the correction ledger; re-distillation hygienes the single canonical handoff in place + appends a CorrectionDelta line, never a supersede-chain file
── MORPHISM ──
WorkingContext, recipient?, next_task?
→ declare(recipient, next_task, allowed_sources, scope, verification, stop) -- F0 HandoffContract; relevance and minimality undefined without it
→ normalize(surface_token, canonical_ref, confidence) -- F1 deictic closure: precedes grounding so each grounded item names a stable referent
→ audit(item, self_containment) → (inline | stable-pointer | routed-residual)-- F2 grounding closure: silent residual surfaced, never dropped unseen
→ select(item, contract.next_task) -- F3a recipient-relevance predicate against the declared contract
→ attest(item, CorrectionDelta_ledger) → Provenance -- F3b read-only provenance; a matching non-provisional KEEP delta yields CorrectedKeep, every other ledger state yields Unknown; provenance authority is the KEEP hard line only, never an inferred disposition
→ dispose(item) → Disposition -- F3 KEEP(inline) | ROUTE(StableRef) | DROP
→ compress(kept) → minimal_complete -- F4 remove only what leaves no contract or residual-ledger violation
→ gate(minimal_complete, contract) → zero_memory_verdict -- F5 comprehension against a fresh recipient standard; Fail re-enters blocking items as residuals, no author self-simulation
→ settle(measure) → fixed_point -- F6 bounded audit/lint loop on a monotone hygiene measure; fixed_point requires a Pass verdict ∧ leak_free (no DROP'd content in emit)
→ emit(prose_channel, TaskStateBlock, correction_ledger?) -- F7 channel separation; the task-state channel never overrides prose authority; under re-distillation (a prior canonical handoff for the contract exists) the emit hygienes that one file in place and appends each correction as a CorrectionDelta ledger line, never a versioned sibling
→ PortableHandoff
requires: context_tethered(W) -- runtime checkpoint (Phase 0)
deficit: ContextTethered -- activation precondition (Layer 1/2)
preserves: source_chain(W) -- W.items read-only; substitution, disposition, and provenance annotate, never mutate the originating context
invariant: Portability over Author Familiarity ∧ Single Canonical Handoff -- one continuously-hygiene'd handoff file; re-distillation edits it in place + appends to the CorrectionDelta ledger, never a supersede-chain (v1→v2) file
── TYPES ──
W = WorkingContext { items: List(ContextItem), session_ref: SessionRef, action: Handoff }
ContextItem = { content: String, origin: Origin, surface_tokens: Set(String), downstream: List(TaskRef) }
Origin ∈ {UserStatement, DocumentRead, ToolOutput, AIInference, PriorTask} ∪ Emergent(Origin)
recipient? = Optional(RecipientProfile) -- defaults to "zero-memory fresh agent" when absent
next_task? = Optional(String) -- declared at F0; absence forces F0 elicitation before relevance is defined
Detect = W → (Bool, tethered_items if true) -- F0 precheck for session-tethered residue
StableRef = { kind: "path" | "url" | "id" | "command", locator: String } -- a reference resolvable without the author session
InlineEvidence = { content: String } -- evidence carried inline rather than by reference
HandoffContract { recipient_profile: "zero-memory fresh agent"; next_task: String;
allowed_sources: List(StableRef); execution_scope: String; verification_commands: List(String);
stop_condition: String; residual_unknown_policy: Map(String, "KEEP" | "ROUTE" | "DROP" | "ASK") }
-- F0 output; the contract every later phase reads for relevance and minimality
SurfaceToken = String -- a session-local deictic token (undefined jargon, metric shorthand, "as above", a bare task id)
Substitution = { surface_token: SurfaceToken; canonical_ref: StableRef | InlineEvidence | Null;
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.