Compile

From freeman5860/KnowledgeBase · View interactive version

Compile is an AI agent skill from the GitHub repository freeman5860/KnowledgeBase. 将 raw/ 中的素材编译为 wiki 条目,更新索引和关系图谱。Use when the user wants to process pending raw materials into wiki entries.

How to use this skill

Skill file

/compile — 编译素材到 Wiki

将 raw/ 中状态为 pending 的素材编译为 wiki 条目。

工作流

  1. 读取 raw/_registry.md,找出所有 pending 状态的素材
  2. 如果用户指定了具体素材,只编译该素材;否则编译所有 pending 素材
  3. 对每个待编译素材:

a. 读取素材内容

b. 根据素材类型选择对应的 prompt 模板(templates/prompts/compile-article.md 或 compile-paper.md)

c. 提取核心概念列表

d. 匹配阶段:读取 wiki/_index.md 和 wiki/_graph.md,扫描已有 wiki 条目,为每个概念判定:

e. 执行创建新条目 / 更新已有条目

f. 扩散更新阶段:扫描 wiki 中所有已有条目,检查是否有条目应该补充本次新素材的信息(即使该条目不在步骤 c 的概念列表中)。一个素材可能触及 10-15 个已有条目。对这些条目:

g. 用 [[wikilinks]] 链接所有相关条目

  1. 更新全局文件:

Wiki 条目格式要求

注意事项

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.