agentleFS
komlukkomluk/scaffolding/skills/distill/SKILL.md

distill

Skill16 starsChanged 5 days agoMITView on GitHub

Knowledge distillation: candidate extraction, confidence scoring, tier routing. Invoked by /learn and the memory-ingest Stop hook, not loaded proactively by agents. TRIGGER when: /learn or the Stop hook asks to distill, or scoring a candidate. SKIP: file memory writes (use agent-memory); vector store (use semantic-memory-mcp).

75 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use layout, shape and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • owshq-mecSkill

    layout

    Improve layout, spacing, and visual rhythm. Fixes monotonous grids, inconsistent spacing, and weak visual hierarchy. Use when the user mentions layout feeling off, spacing issues, visual hierarchy, crowded UI, alignment problems, or wanting better composition.

    Also in 8 projects that use this

  • HAR5HA-7663Skill

    shape

    Plan the UX and UI for a feature before writing code. Runs a structured discovery interview, then produces a design brief that guides implementation. Use during the planning phase to establish design direction, constraints, and strategy before any code is written.

    Also in 11 projects that use this

  • ReScienceLabSkill

    archive

    Archive session learnings, debugging solutions, and deployment logs to .archive/yyyy-mm-dd/ as indexed markdown with searchable tags. Use when completing a significant task, resolving a tricky bug, deploying, or when the user says \"archive this\". Maintains .archive/MEMORY.md index for cross-session knowledge reuse.

    Also in 3 projects that use this

  • klauswgSkill

    ckm:design-system

    Token architecture, component specifications, and slide generation. Three-layer tokens (primitive→semantic→component), CSS variables, spacing/typography scales, component specs, strategic slide creation. Use for design tokens, systematic design, brand-compliant presentations.

    Also in 3 projects that use this

  • iovisorSkill

    evolve

    Evolve uBPF through a gated spec-first workflow that propagates approved changes through requirements, design, validation, implementation, and RFC alignment artifacts.

    Also in 3 projects that use this

  • termdockSkill

    recall

    Retrieves cross-session memories about past decisions, lessons, and patterns. Use when user asks about prior work, past decisions, or mentions a feature. Triggers include check memory, what did we decide, how did we solve.

    Also in 5 projects that use this

The file

We split this skill into the rules it gives an agent

2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 71 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Overflow: if KNOWLEDGE.md would exceed 200 lines, route the candidate to the most relevant agent file.

    line 41
  2. Distinctive:

    Apply: Create timestamped backup, then write merged content

    line 67

“Common” is measured: kept by at least 6 in 10 of the 71 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Distill Methodology

Guidelines for automated knowledge extraction and consolidation across memory systems.

Knowledge Candidate Criteria

An insight qualifies as a knowledge candidate when it meets ANY of these:

CriterionSourceExample
Cross-conversation pattern3+ context.md files contain the same insight"Redis pool exhaustion under SSE load"
Architectural decisiondesign.md contains explicit Decision/Rationale section"Use pgvector for semantic search"
Recurring gotcha/bugKeyword match in specs: gotcha, bug, pattern, lesson"POST 301 redirect strips body"
Stale referenceFile path in memory points to non-existent file"app/backend/old_module.py"
Cross-tier duplicateSame entry in both KNOWLEDGE.md and agent MEMORY.mdDuplicated bullet point

Confidence Scoring

OccurrencesConfidenceTier Recommendation
5+ conversations0.5 - 1.0shared (KNOWLEDGE.md)
3-4 conversations0.3 - 0.5shared (with review)
1-2 conversations0.1 - 0.2agent-specific MEMORY.md
Decision section0.7 fixedshared
Pattern keyword0.5 fixedshared
Stale reference0.9 fixedcleanup action

Auto-store threshold: candidates scoring >= 0.8 are auto-stored to the vector store (silent, cold layer) via semantic_store — see the memory-ingest Stop hook. This is the single source of truth for that threshold.

Tier Routing

Tier paths and what belongs in each are defined in the agent-memory skill (§ Memory Tiers) -- do not restate them here. Route shared candidates to KNOWLEDGE.md and agent:{name} candidates to that agent's MEMORY.md.

Overflow: if KNOWLEDGE.md would exceed 200 lines, route the candidate to the most relevant agent file.

Output Format

Candidates are structured as:

- content: The knowledge text (max 500 chars)
- source: File path or "conversations:N_occurrences"
- source_type: conversation | spec | memory | semantic
- confidence: 0.0-1.0
- target_tier: shared | agent:{name}
- tags: categorization tags

200-Line Limit Enforcement

KNOWLEDGE.md has a hard limit of 200 lines (read in full by agents). When merging would exceed this limit:

  1. High-confidence candidates (>= 0.7) get priority
  2. Lower-confidence candidates overflow to agent-specific files
  3. The orchestrator routes overflow to the most relevant agent based on tags

Dry-Run vs Apply

  • Dry-run (default): Report what would change, write nothing
  • Apply: Create timestamped backup, then write merged content
  • Restore: Revert files from any backup timestamp

Conversation-Scoped Distillation

The /learn command runs distillation against a single conversation rather than mining all of .scaffolding/conversations/. This mode is backend-free and self-contained — no session-log mining, no database.

Inputs for one conversation_id (a UUID xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). .scaffolding/conversations/ is a symlink to <share>/projects/<repo-name>/conversations; paths are unchanged:

InputPathRole
Conversation memory.scaffolding/conversations/{id}/agent-memory/context.mdDecisions and findings recorded during the chain
Design decisions.scaffolding/conversations/{id}/specs/design.md (## Decisions section, if present)Architectural choices + rationale
Action timeline.scaffolding/conversations/{id}/timeline.md (if present)Deterministic, metadata-only per-run record (files edited, commands, errors, repeated failures). Never contains raw tool output

Apply the Knowledge Candidate Criteria and Confidence Scoring above against these files only. With a single conversation, the "Cross-conversation pattern" criterion does not apply; rely on the Decision-section and pattern-keyword criteria. If context.md is absent, there is nothing to distill — exit cleanly.

Repeated failures (from timeline.md). A line under repeated failures (the same tool + normalized target failed >= 2 times in a run) becomes a gotcha candidate with a fixed confidence of 0.5. At 0.5 it is below the 0.8 auto-store threshold, so it goes to .scaffolding/.ingest-queue / /learn for propose-then-confirm and is NEVER auto-stored. Describe the failing command or tool and the count only; the timeline holds no output, so do not invent a cause.

Skill Promotion Criterion

Each distilled candidate routes to one of two destinations:

Candidate shapeDestinationDecision rule
Situational insight, gotcha, or one-off decisionMemory entry — shared, agent:{name}, or conversation tier per the Tier Routing rules aboveThe knowledge is a fact about this codebase.
Repeatable procedure or methodologyNew skill — propose a /create-skill invocation with a pre-filled draftThe knowledge is a reusable how-to an agent would follow on future, unrelated tasks.

Promote to a skill only when the candidate is a generalizable procedure, not a single fact. A one-off fact ("module X has a 301 redirect bug") is a memory entry; a recurring procedure ("how to safely roll a zero-downtime migration") is a skill. When in doubt, prefer a memory entry — skills carry an auto-invocation cost and should stay few and sharp.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.