跳到正文
Skillpedia
任务与项目16k · #10805

canvas

它能做什么

这个技能让你的智能体构建和修改 Obsidian 画布。适合喜欢在同一页面上用笔记和链接以可视化方式规划想法的人。

适用场景

  • ✓当你想在 Obsidian 画布上制作笔记或想法的可视化图时。
  • ✓当你想把笔记、文件或链接添加到现有的画布中时。
  • ✓当你想查看你的知识库中已经存在哪些画布时。

技能链接

https://github.com/AgriciDaniel/claude-obsidian/blob/main/skills/canvas/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/AgriciDaniel/claude-obsidian/blob/main/skills/canvas/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请把我的项目笔记放到一个新的画布上,按主题分组,让我看清它们之间的联系。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会以安全的方式读取或编辑画布文件,添加节点、分组和连接线。每次修改都会保存为一个步骤,如果出现问题可以恢复。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Canvas

Treat a canvas as a vault-scoped JSON Canvas document. Keep reads read-only and route every requested mutation through one recoverable transaction.

Resolve the installed product root from this skill's own location, not from the vault or current working directory:

PRODUCT_ROOT=/absolute/path/to/installed/claude-obsidian
CORE="$PRODUCT_ROOT/scripts/claude-obsidian.py"
test -f "$CORE"

Every ../wiki/references/ link in this file resolves the same way, relative to this skill's own directory under $PRODUCT_ROOT, never relative to the selected vault's wiki/ directory.

Choose the syntax source

Prefer a separately installed kepano/obsidian-skills json-canvas skill for format details. Otherwise read references/canvas-spec.md. The open standard is JSON Canvas 1.0.

Use this skill for vault workflow and transaction safety even when an upstream syntax skill is available.

Scope

  • Resolve the user vault before reading. Never derive it from plugin files.
  • Store boards under wiki/canvases/; use wiki/canvases/main.canvas only as the default when the user did not name a board.
  • Treat wiki/canvases/_index.md as an optional catalog. Add a new board to it in the same transaction when a catalog exists. Node or edge edits inside an existing board do not require a catalog change.
  • The transaction engine supports file creation and replacement only. A board file cannot be deleted or renamed through this skill. Explain that boundary for a file-removal or file-rename request and return a separate cleanup plan; do not substitute host file tools or silently turn a rename into a copy.
  • Use vault-relative paths in file and background; reject absolute paths, .. traversal, home shortcuts, and paths that escape through symlinks.
  • Reference only files already inside the vault or created in the same reviewed transaction. If an optional capture or media capability is detected, compose with it and consume its returned vault-relative path. Do not assume a particular plugin, command, or session log, and do not download or copy assets in this skill.
  • Use link nodes for URLs. Accept HTTPS URLs only; a link node does not grant permission to fetch the page. Creating its JSON makes no request, but opening it in Obsidian may fetch Open Graph metadata from that URL's host. Disclose that render-time egress and confirm it is acceptable; otherwise use a text node containing the URL.

Read-only operations

For status or list requests, parse the selected .canvas files and report node counts, group labels, broken edge endpoints, and missing vault-relative file targets. If the default canvas is absent, report that fact and offer a creation preview; do not create it during a status request.

Draft a mutation

  1. Read the entire canvas and any catalog target. Record each expected SHA-256, or null for a file that must be absent.
  2. Preserve unknown JSON fields and existing array order. The node array is bottom-to-top z-order.
  3. Draft the requested nodes or edges:
    • Give every node and edge a unique ID. Prefer a random 16-character lowercase hexadecimal ID and verify it is unused.
    • Require integer x, y, width, and height values for every node.
    • Use text, file, link, or group exactly as defined by JSON Canvas.
    • Require every fromNode and toNode to reference an existing or newly drafted node.
  4. Position new content deliberately. A group is a visual container, not a parent. Use 20 px inner padding and 40 px gaps, wrap to a new row when needed, and preview any group expansion.
  5. Serialize valid UTF-8 JSON with top-level nodes and edges arrays.

Minimal node examples:

{
  "nodes": [
    {
      "id": "6f0ad84f44ce9c17",
      "type": "text",
      "text": "# Research map\n\nA concise orientation card.",
      "x": 0,
      "y": 0,
      "width": 400,
      "height": 180
    },
    {
      "id": "a1b2c3d4e5f67890",
      "type": "file",
      "file": "wiki/concepts/Contextual Retrieval.md",
      "x": 460,
      "y": 0,
      "width": 400,
      "height": 240
    }
  ],
  "edges": []
}

Use file plus optional subpath: "#Heading" for notes, images, PDFs, and other vault files. Use url only on a link node. Escape line breaks in JSON strings as \n, not as literal backslash-plus-n text.

Preview and apply

Validate before showin

常见问题

画布保存在哪里?

它们保存在你的 wiki 的 canvases 文件夹中,如果你没有指定名称,则默认使用主画布。

它能只告诉我有哪些画布吗?

可以。读取画布是只读操作,因此智能体可以列出它们而不做任何更改。

它需要其他技能吗?

如果安装了单独的画布格式语法技能,它可以使用,但没有该技能也能运行。

详情

作者的原始描述

Create, inspect, and update Obsidian JSON Canvas boards with text, file, link, group, and edge nodes. Use for canvas status, canvas lists, visual maps, zones, spatial layouts, adding vault notes or media to a .canvas file, and requests such as create canvas, add to canvas, or put this on the canvas.

repo: AgriciDaniel/claude-obsidian

热度

GitHub 星标
16k
排名
#10805
许可证
MIT
更新时间
2026/10/25

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能