Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add skills/johnnywuj81/tokenknows/distillnpx skills add johnnywuj81/tokenknows --skill distillgit clone --depth 1 https://github.com/johnnywuj81/tokenknowsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/johnnywuj81/tokenknows/distill)<a href="https://agentmods.dev/skills/johnnywuj81/tokenknows/distill"><img src="https://agentmods.dev/badge/skills/johnnywuj81/tokenknows/distill.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00085 | $0.01463 |
| Opus 5 | $0.00043 | $0.00732 |
| Sonnet 5 | $0.00017 | $0.00293 |
| Haiku 4.5 | $0.00009 | $0.00146 |
Grade A, and why
distill scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Distill Session
把当前 Claude session 蒸馏成 TokenKnows 后端的结构化文档之一。
用户意图判断
用户说下列任一表达,即应调用此 skill:
| 用户说 | 推断文档类型 |
|---|---|
| "蒸馏 / 总结 / 整理" 这次对话 | 让用户选, 默认 weekly_report |
| "出周报" / "生成周报" / "weekly" | weekly_report |
| "技术方案" / "设计文档" / "tech design" | tech_design |
| "ADR" / "架构决策" / "决策记录" | adr |
| "复盘" / "故障复盘" / "postmortem" | incident |
| "技术书籍" / "教程" / "long-form" | book |
| "蒸馏 skill" / "提炼专家技能" | agent_skill |
| "知识图谱" / "KG" / "实体关系" | knowledge_graph |
如果用户没明示,优先问一句 "你想蒸馏成哪种类型?周报 / 技术方案 / ADR / 复盘 / 书籍 / Skill / 知识图谱?",然后再走流程。
标准流程 (5 步)
Step 1 · 整理本次 session 的关键事件
把对话拆成 3-10 条 event (每条聚焦一个语义单元):
- 用户提的需求 / 问题 / 决策点
- Claude 给出的方案 / 关键代码 / 取舍说明
- 重要工具调用 (e.g. Edit/Bash 执行的 PR 合并、测试结果)
每条 event 形如:
{
"external_id": "<session_uuid>-<msg_index>",
"source_ref": "<session_uuid>",
"event_type": "ai_conversation_turn", // 或 tool_call/code_change
"content": "<对话片段或代码变更摘要>",
"title": "<一句话标题>",
"author_name": "user" 或 "Claude",
"tags": ["关键词1", "关键词2"]
}
关键: external_id 务必唯一 (同 session_uuid + msg_index)避免后端 dedup 时丢失。
Step 2 · 批量提交 events
调 MCP tool: submit_session_events
events: [...上面整理的 3-10 条...]
返回 {ingested, skipped, project_id}。如果 skipped > 0,说明部分 event 被 backend 去重 (content_hash 已存在),正常不用担心。
Step 3 · 触发蒸馏 pipeline
调 MCP tool: distill_document
document_type: "<step 1 用户选的类型>"
time_window: "this_week" // 默认; 用户明说 "上周/最近 7 天" 时改
返回 {asset_id, status: "generating", view_url, estimated_seconds: 60}。view_url 是完整可点击的绝对 URL (前缀由 TOKENKNOWS_WEB_BASE 决定,默认 http://127.0.0.1:5173)。
告诉用户:"已触发蒸馏,大约 60 秒。我会轮询完成状态。"
Step 4 · 轮询完成
每 5-10 秒调一次 get_asset(asset_id),直到 status == "draft" (或 failed)。
- 如果 60 秒还在 generating,告诉用户后端 LLM 还在跑,继续等
- 如果超 3 分钟 → 后端可能挂,提示用户查 backend log
- 如果 status=
draft→ 进入 Step 5
Step 5 · 展示蒸馏结果
调 get_asset_chapters(asset_id),拿到完整 markdown。
展示方式按类型分:
- weekly_report / tech_design / adr / incident: 把每个 chapter 的
title+content用 markdown headings 直接输出给用户 - book: 章节多,先列大纲 (chapter titles) 给用户,再问要看哪几章
- agent_skill: 输出 SKILL.md 风格 markdown, 让用户决定是否落地到
~/.claude/skills/ - knowledge_graph: layout 含 nodes/edges; 用 ASCII art 简述 (e.g.
Alice --authored_by--> PR#127),指引用户开浏览器看可视化 (URL 在 view_url 里,绝对 URL 可直接点)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 6d ago First seen · 118 lines · 85 tokens per session scan A 95509a3d3bfb
distill is a skill published in the GitHub repository johnnywuj81/tokenknows (4 stars, last pushed 2d ago), licensed MIT. It adds 85 tokens to every session and 1,463 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
honey-px
Read huge read-only text as PNG pages; big input cut.
lov-document-illustrator
为文档原地插入 AI 配图。读取文档后全局规划插入点,并行生成所有图片, 异步插回原文。支持封面图、自定义比例和三种风格。 Use when: 用户要求为文档/文章/笔记生成配图、插图。 Also trigger when user mentions: 配图、插图、illustration、 generate images、document images、为文章加图。.
lov-fill-form
Fill in Word document form templates (.docx) with user-provided data. Reads a template containing tables with label→value cell pairs, detects all fillable fields, and outputs a completed document. Handles CJK/Latin mixed text with proper font switching. Use this skill when the user wants to fill in a form template…
lov-pdf2png
Convert PDF files to a single vertically concatenated PNG image using macOS native CoreGraphics. Each page is rendered at 2x scale and stitched top-to-bottom. 20x faster than pdftoppm+ImageMagick, zero external dependencies on macOS. Trigger when the user mentions "pdf to png", "pdf转png", "PDF转图片", "pdf拼接", "pdf截图"…
doc-drift
Use this skill when the user wants to audit the memory and documents Claude Code loads into context — CLAUDE.md (user global + project + nested), MEMORY.md, @imports, .claude/skills, .claude/agents, .claude/commands, installed plugins — and detect three kinds of issues: outdated claims, mutually contradictory…
lov-academic-translator
将英文论文、arXiv、期刊/会议文章及技术 PDF 翻译为中文 PDF 或可发布的中文 Markdown。用户提出“翻译英文 PDF”“翻译论文”“论文超级翻译官”“保留图片、公式和原版式”“原文译文对照”“页数对应”或“PDF 图文排版不要乱”时使用。.