Skill 详情

obsidian-canvas-architect

Directly creates and manipulates Obsidian Canvas files.

匹配类型直接匹配已针对 obsidian 审核
来源richfrem/agent-plugins-skills外部来源
报告安装量28仅表示受欢迎程度

使用前先检查

自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。

已保存的来源预览

SKILL.md

这段内容是审核时保存的快照。外部来源才是完整且最新的版本。

---
name: obsidian-canvas-architect
plugin: obsidian-wiki-engine
description: "Programmatically create and manipulate Obsidian Canvas (.canvas) files using JSON Canvas Spec 1.0. Enables agents to generate visual flowcharts, architecture diagrams, and planning boards. Use when creating or editing visual canvas files."
allowed-tools: Bash, Read, Write
---

## 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).

---
# Obsidian Canvas Architect

**Status:** Active
**Author:** Richard Fremmerlid
**Domain:** Obsidian Integration
**Depends On:** `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.

## JSON Canvas Spec 1.0 Overview

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"}
  ]
}
```

### Node Types
| Type | Required Fields | Purpose |
|:-----|:---------------|:--------|
| `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 |

### Edge Properties
| Field | Required | Description |
|:------|:---------|:------------|
| `fromNode` | Yes | Source node ID |
| `toNode` | Yes | Target node ID |
| `fromSide` | No | `top`, `right`, `bottom`, `left` |
| `toSide` | No | `top`, `right`, `bottom`, `left` |
| `label` | No | Edge label text |

## Available Commands

### Create a 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
```

### Add an Edge
```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>
```

## 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
在 GitHub 阅读完整来源 (打开外部页面)
相关上下文

相关工作