Besides document SOPs, you can use the open-source cangjie-skill library to distill structured knowledge into Skills. This chapter details how to convert methodologies from books and videos into executable Skills, and how this differs from traditional RAG.
The Challenge: Static Knowledge vs Active Execution
AI models ingest massive books during training, but in chats they often output generic fluff. This is a retrieval trigger issue, not hallucination: the AI knows what is in the book, but does not know when to trigger specific frameworks in practical contexts. Human readers face the same issue; after reading a book, notes are kept but not applied. Knowledge distillation solves this "learned but unused" problem.
Definition of Knowledge Distillation
Knowledge Distillation for Skills refers to extracting atomic units of execution (Skills) with distinct triggers and steps from books or videos, allowing the Agent to trigger and execute them automatically when encountering corresponding scenarios.
Like chemical distillation separating mixtures by boiling points, knowledge distillation separates raw texts into "frameworks, principles, cases, anti-cases, and terminology", compiling useful parts into executable Skills.
Knowledge distillation is:
- NOT summarization (which compresses text).
- NOT note-taking (which structures text).
- NOT RAG indexing (which stores text snippets for search).
- IT IS converting methodology into executable units that an Agent can call automatically in real scenarios.
Six-Stage Distillation SOP
The cangjie-skill tool distills a book or video set into Skills in six stages.
flowchart TD
A[Stage 0: Full Book / Video Comprehension] --> B[Stage 1: Five-Agent Parallel Extraction]
B --> C[Stage 1.5: Three-Tier Validation Filtering]
C --> D[Stage 2: Structuring the Skill]
D --> E[Stage 4: Establishing Skill Relations]
E --> F[Stage 5: Adversarial Stress Testing]Stage 0: Full Book / Video Comprehension
Do not start by copying quotes. Understand the skeleton of the material first:
- What is the main thesis?
- How is the argumentation structured?
- How does the author define key terms?
- What are the limitations and biases of the author? Skipping this step leads to extracting arguments the author actually opposes.
Stage 1: Five-Agent Parallel Extraction
Five Agents scan the text concurrently across five dimensions:
- Framework Extraction Agent: Decision-making or analytical models.
- Principle Extraction Agent: Reusable action rules.
- Case Extraction Agent: Positive examples and successful runs.
- Anti-case Extraction Agent: Failures and negative lessons.
- Terminology Dictionary Agent: Proprietary definitions.
Stage 1.5: Three-Tier Validation Filtering
Each candidate Skill must pass three tests or be discarded:
- Cross-domain generality: The rule appears in at least two independent scenarios in the text.
- Predictive utility: Can it resolve problems not directly discussed in the text?
- Conceptual uniqueness: Is it more than generic common sense? Common sense does not make a Skill. Typically, out of 50-100 candidates, only 10-25 are retained.
Stage 2: Structuring the Skill
Build the Skill with triggers at its core:
- Under what scenarios does it activate?
- What steps are executed?
- What are the boundary limits (when not to use)?
- What is the validation standard?
Stage 4: Establishing Skill Relations (Linking)
Establish the connection network:
- Dependency: Skill A requires Output of Skill B.
- Comparison: Skill A and B apply to similar but opposite contexts.
- Composition: Skill A and C work better combined. This allows the Agent to select groups of Skills for complex tasks.
Stage 5: Adversarial Stress Testing
- Decoy Testing: Feed scenarios where the Skill should NOT trigger to test boundary containment.
- Execution Verification: Verify that output consists of concrete steps, not generic summaries.
Structure of Distilled Skill Output
The output is compiled into a directory structure:
book-skill/
├── README.md # Book info, usage guidelines
├── skills/
│ ├── skill-01.md # Individual Skill files
│ ├── skill-02.md
│ └── ...
├── index.md # Skill relationship matrix (linking layer)
└── tests/
├── skill-01-test.md # Unit tests for each Skill
└── ...Each Skill file contains triggers, execution steps, formats, boundaries, and test cases compatible with auto-evolution tools.
Differences: Knowledge Distillation vs. RAG Systems
| Metric | RAG | Knowledge Distillation (Skill) |
|---|---|---|
| Essence | Retrieval: find relevant text snippets | Distillation: extract executable methodologies |
| Prerequisites | User must know what specific query to type | User describes the task, and the Skill triggers |
| Quality Control | None: any text chunks can be indexed | Triple-validation filters for high-quality entries |
| Invocation | Passive query matching | Active trigger matching and execution |
| Data Form | Stores raw texts (remembers knowledge) | Compiles steps (applies knowledge) |
| Boundaries | None | Decoy testing prevents false triggers |
| Resource Cost | High indexing and database overhead | Lightweight directory of markdown files |
RAG tells you what is in the book; Distillation runs the playbook for the Agent.
Comparison with Karpathy LLM Wiki Approach
Andrej Karpathy proposed compiling raw files into a structured LLM Wiki, running Q&A, and feeding outputs back to enhance database utility. cangjie-skill incorporates this in Stage 0 and 1. The main differences:
- LLM Wiki: Structured entries for user searches (Knowledge Management).
- Knowledge Distillation: Executable units for Agent automation (Knowledge Execution).
Video Distillation Workflow (v2)
v2 supports video courses (using the video-downloader Skill) to transcribe audio files into texts before running the six-stage SOP.
- Retrieval: yt-dlp downloads videos from YouTube/Bilibili.
- Transcription: Whisper transcribes audio to txt. Using ASR APIs speeds up long videos.
- Merging: Automatically deduplicates and merges similar topics across multiple videos.
Suitable and Unsuitable Knowledge Inputs
| Input Type | Suitability | Notes |
|---|---|---|
| Methodology-dense books | ★★★★★ | Clear frameworks, easy to extract rules |
| Structured video courses | ★★★★☆ | Logical flow, high information density |
| General podcast conversations | ★★★☆☆ | Varies by speaker and topic structure |
| Creative writing and prose | ★★☆☆☆ | Low methodology density, few executable rules |
| Fiction and narratives | ★☆☆☆☆ | Not suitable; lacks programmatic guidelines |
Prerequisites: Reading or watching the source material beforehand helps verify validation boundaries. Distillation consolidates knowledge, it does not replace comprehension.
Continuous Optimization of Skills
Skill test cases are compatible with darwin-skill (an auto-evolution tool) which runs tests, evaluates performance, and updates expressions to ensure the Skill logic refines over time.
Token Consumption and Model Choices
Distillation is resource-intensive due to full text reads, multi-agent parallel runs, and stress testing.
- Book Distillation: tens of thousands of tokens, 30-90 minutes.
- 26-episode course (4h): high consumption, ~1 hour.
- 4 topic videos (80 min): moderate consumption, ~40 minutes. Recommendations: Use reasoning models for coordination, coding models for extraction runs, and long-context models to avoid text truncation.
Sharing and Reusing Distilled Skills
Distilled Skill repositories can be shared. Users clone the repository, feed the path to WorkBuddy, and load them instantly. Video course distillations can also be turned into interactive learning assistants for students.
Common Misunderstandings
- AI already read the book: Distillation creates trigger points, which pre-training does not.
- No need to read: Reading is necessary to guide the validation steps of the Agent.
- Execute directly: Decision-making remains the user's responsibility.
- More is better: Narrow triggers are preferred to prevent false activations.
Distillation Example
吴恩达 Andrew Ng's "AI for Everyone" course (2026 edition, 26 videos, 4h) distilled in ~1 hour, producing 25 Skills immediately ready for Agent execution.
Summary: Distillation's Role in Skill Architectures
Distillation is a method of Skill production. It operates in parallel with business SOP packaging:
- Business SOP: Internal operational manuals and routines.
- Distilled Knowledge: Methodologies, book guidelines, and academic courses.
Custom Skill Folder Structures and SOP Guidelines
Saves under ~/.workbuddy/skills/<SkillName>/:
SKILL.md(Mandatory): YAML header and instructions.references/(Optional): Templates.scripts/(Optional): Helper scripts.
YAML Frontmatter Header Examples
---
name: WeeklySummaryExpert
description: "Scan local Git commit logs and compile summaries. Trigger: git summary"
version: "1.0.0"
dependencies: "python>=3.8"
tools:
- file_system
- terminal
---Troubleshooting (FAQ)
- Skill Hidden in Menu: Check folder path or syntax in the YAML header.
- Unauthorized Tool Error: Verify that
terminalandfile_systempermissions are added totoolslist in the YAML header.
References
Part of this series
WorkBuddy In Action
View all guides in this series →