# /json-canvas: Generate valid Obsidian canvases from mind maps to flowcharts

Source: https://trendhub.net/skills/obsidianmd-obsidian-skills/json-canvas
Skill folder: https://github.com/obsidianmd/obsidian-skills/tree/main/plugins/obsidian/skills/json-canvas
Pack: Obsidian Skills (https://trendhub.net/skills/obsidianmd-obsidian-skills)
Works with: Claude Code (terminal), Claude Code (in session), Codex, npx skills, npx skills (SSH), Gemini CLI, OpenCode

The JSON Canvas skill tells the agent how to create and edit .canvas files that follow the JSON Canvas 1.0 spec. It lists the attributes for text, file, link and group nodes and for edges, explains ID generation, colours and layout spacing, and ends with a checklist that catches duplicate IDs, dangling edges and broken escaping.

## When to use it

- You want a mind map, project board or flowchart built as an Obsidian canvas
- You need nodes added or connected on an existing canvas without breaking it
- A generated canvas fails to open and you need it repaired

## How it works

1. **Start the structure**: The agent creates a file with nodes and edges arrays and gives each node a unique 16-character hex ID plus position and size.
2. **Place nodes**: It positions new nodes to avoid overlaps with 50 to 100 pixels of space, widening boxes for CJK text.
3. **Connect them**: It adds edges with fromNode and toNode pointing at existing IDs, with optional sides, arrow ends and labels.
4. **Validate**: It parses the JSON and checks unique IDs, valid edge references, required fields, allowed values and escaped quotes.

## What it steers the agent away from

- Literal \\n sequences that Obsidian shows as text
- Unescaped quotes that make the canvas fail to load
- Creating canvases through obsidian create, which mangles newlines

## What it can touch

Reads and writes .canvas JSON files in your vault.

## Pairs well with

- `/obsidian-markdown`

## Questions

### Is JSON Canvas specific to Obsidian?

It is an open format with its own spec; Obsidian uses it for canvases, and the skill follows version 1.0.

### How are colours set?

Each node or edge takes a preset from 1 to 6 or a hex value; the presets' actual colours are left to the app.
