temple-generator

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Temple Generator

Temple Generator

Generate a 3D interactive knowledge visualization from any Obsidian vault. The output is a single HTML file (Three.js) with concentric entity rings, audio, discovery mechanics, and multi-scale semantic zoom.
从任意Obsidian知识库生成3D交互式知识可视化内容。输出为单个HTML文件(基于Three.js),包含同心实体环、音频、探索机制以及多尺度语义缩放功能。

When to Use

适用场景

  • User wants to visualize any Obsidian vault as a 3D knowledge map
  • User wants to compare two vaults/document sets visually
  • User wants to regenerate the temple from scratch with fresh vault analysis
  • 用户希望将任意Obsidian知识库可视化为3D知识图谱
  • 用户希望直观对比两个知识库/文档集
  • 用户希望基于全新的知识库分析结果重新生成圣殿

Architecture

架构

Two-part system:
  1. Generation pipeline (this skill): discovers structure, names it, scores confidence, exports a scene package
  2. Runtime renderer (template): handles navigation, transitions, audio, discovery
Pre-generate meaning. Runtime-render experience.
分为两部分的系统:
  1. 生成流水线(本技能):发现结构、命名、置信度评分、导出场景包
  2. 运行时渲染器(模板):处理导航、过渡、音频、探索功能
预先生成语义信息,运行时渲染交互体验。

Workflow

工作流程

Step 1: Scan the Vault

步骤1:扫描知识库

Run
python3 ~/.claude/skills/temple-generator/scripts/extract_entities.py <vault_path>
.
This produces
vault-scan.json
with:
  • Files: path, title, tags, outgoing links, backlink counts, word count, folder, frontmatter
  • Graph: adjacency list with bidirectional link counts
  • Centrality: degree centrality per node
  • Clusters: detected groups of tightly linked notes
运行
python3 ~/.claude/skills/temple-generator/scripts/extract_entities.py <vault_path>
此命令会生成
vault-scan.json
,包含:
  • 文件:路径、标题、标签、出站链接、反向链接计数、字数、文件夹、前置元数据
  • 图谱:带双向链接计数的邻接表
  • 中心性:每个节点的度中心性
  • 集群:检测到的紧密关联笔记组

Step 2: Read the Scan + Sample Notes

步骤2:读取扫描结果与示例笔记

  1. Read
    vault-scan.json
  2. Read the top ~20 nodes by centrality (first 100 lines each)
  3. Read
    references/classification-guide.md
    for entity type heuristics
  4. Read 3-5 representative notes to calibrate the vault's "voice" (formal/informal, domain jargon, language)
  1. 读取
    vault-scan.json
  2. 读取按中心性排序的前约20个节点(每个节点读取前100行)
  3. 读取
    references/classification-guide.md
    获取实体类型启发规则
  4. 读取3-5篇代表性笔记,校准知识库的“语气”(正式/非正式、领域术语、语言风格)

Step 3: Classify Entities

步骤3:实体分类

Using
references/classification-guide.md
, assign each significant node to an entity type. Maintain two vocabularies:
  • canonical: neutral labels for portability (
    anxiety-management
    ,
    fermentation-process
    )
  • poetic: mythic/art labels for the installation (
    The Ferment Gate
    ,
    The Cortisol Throne
    )
Target counts per type (adjust for vault size):
TypeSmall vault (< 100)Medium (100-500)Large (500+)
Gods2-33-55-7
Demigods3-75-128-15
Tensions2-43-75-9
Narratives2-55-108-12
Blind spots1-33-54-7
Spirits1-33-53-5
Research5-1510-2515-30
Values2-53-85-10
Trails2-53-85-10
Questions3-65-108-12
Depths2-55-108-15
Crystals1-32-53-6
使用
references/classification-guide.md
,为每个重要节点分配实体类型。维护两种词汇体系:
  • 标准词汇:用于可移植性的中性标签(如
    anxiety-management
    fermentation-process
  • 诗意词汇:用于可视化场景的神话/艺术化标签(如
    The Ferment Gate
    The Cortisol Throne
各类型目标数量(根据知识库大小调整):
类型小型知识库(<100篇)中型知识库(100-500篇)大型知识库(500+篇)
神祇2-33-55-7
半神3-75-128-15
张力2-43-75-9
叙事2-55-108-12
盲区1-33-54-7
灵体1-33-53-5
研究5-1510-2515-30
价值观2-53-85-10
路径2-53-85-10
问题3-65-108-12
深渊2-55-108-15
晶体1-32-53-6

Step 4: Build Abstraction Levels

步骤4:构建抽象层级

Levels are confidence-gated — only include a level if the vault supports it.
Level 0 — Entities (always exists): individual nodes with positions, connections, descriptions.
Level 1 — Domains (requires >= 3 meaningful clusters): groups of related entities. Each domain has:
  • canonical
    +
    poetic
    name
  • member entity keys
  • centroid position (weighted average of member positions)
  • representative exemplar (most central member)
  • description (1-2 sentences in vault voice)
  • confidence score (0-1)
Level 2 — Axes (requires >= 2 interpretable opposing pairs): fundamental tensions. Each axis has:
  • two poles with names and descriptions
  • member domains per pole
  • axis description
  • confidence score
Level 3 — Comparison (requires two vaults + sufficient alignment): shared/unique analysis.
Read
references/merge-algorithm.md
for dual-graph logic.
层级采用置信度门控——仅当知识库支持时才包含对应层级。
层级0 — 实体(始终存在):包含位置、连接关系、描述的单个节点。
层级1 — 领域(需要≥3个有意义的集群):相关实体的分组。每个领域包含:
  • 标准名称 + 诗意名称
  • 成员实体键
  • 质心位置(成员位置的加权平均值)
  • 代表性范例(最核心的成员)
  • 描述(1-2句,匹配知识库语气)
  • 置信度评分(0-1)
层级2 — 轴(需要≥2个可解释的对立对):核心张力。每个轴包含:
  • 两个带有名称和描述的极点
  • 每个极点对应的领域成员
  • 轴描述
  • 置信度评分
层级3 — 对比(需要两个知识库 + 足够的匹配度):共享/独有分析结果。
阅读
references/merge-algorithm.md
获取双图逻辑。

Step 5: Generate Scene Package

步骤5:生成场景包

Follow the schema in
references/entity-schema.md
to produce
temple-data.json
.
Include:
  • entities
    : all classified nodes
  • levels
    : abstraction layers with zoom thresholds
  • mappings
    : entity → domain → axis crosswalks
  • comparison
    : (if dual-graph) shared/unique/alignment data
  • audio
    : motif hints per type and level
  • style
    : poetic vocabulary, intro text, color palette, layer definitions
  • confidence
    : per-abstraction and per-alignment scores
遵循
references/entity-schema.md
中的 schema 生成
temple-data.json
包含内容:
  • entities
    :所有已分类的节点
  • levels
    :带有缩放阈值的抽象层级
  • mappings
    :实体→领域→轴的交叉映射
  • comparison
    :(如果是双图模式)共享/独有/匹配度数据
  • audio
    :各类型和层级的音频主题提示
  • style
    :诗意词汇、介绍文本、调色板、层定义
  • confidence
    :各抽象层级和匹配度的评分

Step 6: Generate HTML

步骤6:生成HTML

  1. Copy
    ~/.claude/skills/temple-generator/assets/temple-template.html
    to the output location
  2. If
    --inline
    flag: embed the JSON data as
    const TEMPLE_DATA = {...};
    inside the HTML
  3. Otherwise: place
    temple-data.json
    alongside the HTML
  1. ~/.claude/skills/temple-generator/assets/temple-template.html
    复制到输出位置
  2. 如果使用
    --inline
    参数:将JSON数据以
    const TEMPLE_DATA = {...};
    的形式嵌入HTML中
  3. 否则:将
    temple-data.json
    放在HTML文件同一目录下

Step 7: Report

步骤7:生成报告

Show the user:
  • Entity counts by type
  • Abstraction levels generated (with confidence scores)
  • Top 5 gods/central entities
  • Detected tensions
  • If dual-graph: overlap percentage and shared domains
向用户展示:
  • 各类型实体的数量
  • 生成的抽象层级(含置信度评分)
  • 前5个核心实体(神祇)
  • 检测到的张力
  • 如果是双图模式:重叠百分比和共享领域

Dual-Graph Mode

双图模式

When
--compare vault_path_2
is provided:
  1. Scan both vaults independently (Step 1)
  2. Classify entities for each vault (Steps 2-3)
  3. Run merge algorithm from
    references/merge-algorithm.md
  4. Generate merged scene package with source attribution
  5. Template renders shared scaffold with divergence offsets
当提供
--compare vault_path_2
参数时:
  1. 独立扫描两个知识库(步骤1)
  2. 为每个知识库分类实体(步骤2-3)
  3. 运行
    references/merge-algorithm.md
    中的合并算法
  4. 生成带有来源标注的合并场景包
  5. 模板渲染共享框架并显示差异偏移

Quality Guidelines

质量指南

  • Skip trivial notes (daily todos, admin logs, empty stubs)
  • Prefer nodes that reveal the vault's actual concerns, not its filing system
  • Write in the vault's own voice, calibrated from sample notes
  • If a level lacks confidence, omit it rather than fabricating structure
  • Each abstraction level must be backed by membership weights, exemplars, and provenance
  • "The abstraction hierarchy should be semantic, not just geometric"
  • 跳过无关紧要的笔记(每日待办、管理日志、空草稿)
  • 优先选择能体现知识库核心关注点的节点,而非其文件系统结构
  • 使用与知识库一致的语气,基于示例笔记校准
  • 如果某层级置信度不足,应省略而非编造结构
  • 每个抽象层级必须有成员权重、范例和来源作为支撑
  • "抽象层级应基于语义,而非仅几何结构"

Audio Guidance for Template

模板音频指南

The template's audio system should respect hierarchical continuity across zoom levels:
  • L0 (close): localized, identity-rich — entity whispers and textures
  • L1 (medium): regional harmonic beds, cluster pulses
  • L2 (far): sparse drones, tension-based tonal movement
  • L3 (comparison): stereo/dialogic between two vault voices
Zoom should feel like changing resolution, not changing universes. Motifs relate across scales.
模板的音频系统应在缩放层级间保持层级连续性:
  • L0(近距离):本地化、富有辨识度的实体低语和纹理音效
  • L1(中距离):区域性和声背景、集群脉冲音效
  • L2(远距离):稀疏的低音 drone、基于张力的音调变化
  • L3(对比模式):两个知识库声音的立体声/对话式音效
缩放应像是改变分辨率,而非切换宇宙。主题在不同尺度间保持关联。