obsidian-canvas-architect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Dependencies

依赖项

This skill requires Python 3.8+ and standard library only. No external packages needed.
To install this skill's dependencies:
bash
pip-compile ./requirements.in
pip install -r ./requirements.txt
See
./requirements.txt
for the dependency lockfile (currently empty — standard library only).

本skill需要Python 3.8+,仅依赖标准库,无需外部包。
安装本skill的依赖项:
bash
pip-compile ./requirements.in
pip install -r ./requirements.txt
查看
./requirements.txt
获取依赖锁定文件(当前为空——仅使用标准库)。

Obsidian Canvas Architect

Obsidian Canvas Architect

Status: Active Author: Richard Fremmerlid Domain: Obsidian Integration Depends On:
obsidian-vault-crud
(WP06)
状态: 活跃 作者: Richard Fremmerlid 领域: Obsidian集成 依赖:
obsidian-vault-crud
(WP06)

Purpose

用途

Obsidian Canvas files (
.canvas
) use the JSON Canvas Spec 1.0 to define visual boards with nodes (text, file references, URLs) connected by directional edges. This skill lets agents programmatically generate visual planning boards, architecture diagrams, and execution flowcharts.
Obsidian Canvas文件(
.canvas
)采用JSON Canvas Spec 1.0定义包含节点(文本、文件引用、URL)和定向连接边的可视化看板。本skill允许Agent以编程方式生成可视化规划看板、架构图和执行流程图。

JSON Canvas Spec 1.0 Overview

JSON Canvas Spec 1.0 概述

A
.canvas
file is JSON with two top-level arrays:
json
{
  "nodes": [
    {"id": "1", "type": "text", "text": "Hello", "x": 0, "y": 0, "width": 250, "height": 60},
    {"id": "2", "type": "file", "file": "path/to/note.md", "x": 300, "y": 0, "width": 250, "height": 60}
  ],
  "edges": [
    {"id": "e1", "fromNode": "1", "toNode": "2", "fromSide": "right", "toSide": "left"}
  ]
}
.canvas
文件是包含两个顶级数组的JSON:
json
{
  "nodes": [
    {"id": "1", "type": "text", "text": "Hello", "x": 0, "y": 0, "width": 250, "height": 60},
    {"id": "2", "type": "file", "file": "path/to/note.md", "x": 300, "y": 0, "width": 250, "height": 60}
  ],
  "edges": [
    {"id": "e1", "fromNode": "1", "toNode": "2", "fromSide": "right", "toSide": "left"}
  ]
}

Node Types

节点类型

TypeRequired FieldsPurpose
text
text
,
x
,
y
,
width
,
height
Inline text content
file
file
,
x
,
y
,
width
,
height
Reference to a vault note
link
url
,
x
,
y
,
width
,
height
External URL
group
label
,
x
,
y
,
width
,
height
Visual grouping container
类型必填字段用途
text
text
,
x
,
y
,
width
,
height
内嵌文本内容
file
file
,
x
,
y
,
width
,
height
引用库中的笔记
link
url
,
x
,
y
,
width
,
height
外部URL
group
label
,
x
,
y
,
width
,
height
可视化分组容器

Edge Properties

边属性

FieldRequiredDescription
fromNode
YesSource node ID
toNode
YesTarget node ID
fromSide
No
top
,
right
,
bottom
,
left
toSide
No
top
,
right
,
bottom
,
left
label
NoEdge label text
字段是否必填描述
fromNode
源节点ID
toNode
目标节点ID
fromSide
top
,
right
,
bottom
,
left
toSide
top
,
right
,
bottom
,
left
label
边的标签文本

Available Commands

可用命令

Create a Canvas

创建画布

bash
python ./canvas_ops.py create --file <path.canvas>
bash
python ./canvas_ops.py create --file <path.canvas>

Add a Node

添加节点

bash
python ./canvas_ops.py add-node \
  --file <path.canvas> --type text --text "My Node" --x 100 --y 200
bash
python ./canvas_ops.py add-node \
  --file <path.canvas> --type text --text "My Node" --x 100 --y 200

Add an Edge

添加边

bash
python ./canvas_ops.py add-edge \
  --file <path.canvas> --from-node id1 --to-node id2
bash
python ./canvas_ops.py add-edge \
  --file <path.canvas> --from-node id1 --to-node id2

Read a Canvas

读取画布

bash
python ./canvas_ops.py read --file <path.canvas>
bash
python ./canvas_ops.py read --file <path.canvas>

Safety Guarantees

安全保障

  • All writes go through
    obsidian-vault-crud
    atomic write protocol
  • Malformed JSON triggers a clean error report, never a crash
  • Node IDs are auto-generated (UUID) to prevent collisions
  • Schema validation ensures all required fields are present before write
  • 所有写入操作均通过
    obsidian-vault-crud
    原子写入协议执行
  • 格式错误的JSON会触发清晰的错误报告,不会导致崩溃
  • 节点ID自动生成(UUID)以避免冲突
  • 在写入前会进行 Schema 验证,确保所有必填字段均已存在