Obsidian Canvas
This skill handles the creation and manipulation of .canvas files (JSON Canvas).
Core Workflow
- Library: Utilization of the provided
scripts/canvas_lib.py is MANDATORY. Do not write raw JSON.
- Execution: Construct a JSON payload and pipe it to the library script via stdin (CLI mode). Do not create temporary Python scripts.
- Layout: Focus on logical coordinates (x,y). The library handles ID generation, node height, and edge routing automatically.
Resources
- Library:
scripts/canvas_lib.py (Core logic for nodes, groups, and smart edges).
- CLI Spec: references/library_spec.md - Read strictly for JSON format.
- Specification: See references/spec.md for the detailed JSON schema.
- Example: See assets/flowchart.canvas.
Layout & Aesthetics (Senior Designer Standards)
- Whitespace: Use generous vertical gaps (120px-180px) between related nodes to provide "shelf space" for edge labels.
- Z-Indexing: The library handles z-indexing (groups render behind nodes). Always use groups to bound track-specific content.
- Hierarchy: Use H1 (#) for canvas titles, H2 (##) for major sections, and H3 (###) for individual node titles.
- Colors:
1 (Red): Friction, Error, Filing.
2 (Orange): Interaction, Support, Outreach.
3 (Yellow): Evidence, Documentation, Data.
4 (Green): Success, Resolution, Start.
5 (Blue/Cyan): Neutral, Operations.
6 (Purple): Titles, Meta-info, Outcome.
- Edges: Keep labels short. If multiple edges cross the same path, the library tries to route them, but manual
x adjustments help.
Output
To create a new canvas, construct a JSON payload and pipe it to the library script:
cat <<EOF | python3 /path/to/skills/obsidian-canvas/scripts/canvas_lib.py
{
"output": "Project_Flow.canvas",
"nodes": [
{"node_id": "start", "text": "Start", "x": 0, "y": 0, "color": "6"},
{"node_id": "end", "text": "End", "x": 0, "y": 200, "color": "1"}
],
"edges": [
{"from_node": "start", "to_node": "end"}
],
"groups": [
{"label": "Phase 1", "nodes_in_group": ["start", "end"], "color": "5"}
]
}
EOF
1---2name: obsidian-canvas3description: Create, edit, and manipulate Obsidian Canvas (.canvas) files. Use this skill when the user wants to visualize concepts, build flowcharts, or organize information spatially using the JSON Canvas format.4---56# Obsidian Canvas78This skill handles the creation and manipulation of `.canvas` files (JSON Canvas).910## Core Workflow11121. **Library**: Utilization of the provided `scripts/canvas_lib.py` is **MANDATORY**. Do not write raw JSON.132. **Execution**: Construct a JSON payload and pipe it to the library script via stdin (CLI mode). Do not create temporary Python scripts.143. **Layout**: Focus on logical coordinates (x,y). The library handles ID generation, node height, and edge routing automatically.1516## Resources1718- **Library**: `scripts/canvas_lib.py` (Core logic for nodes, groups, and smart edges).19- **CLI Spec**: [references/library_spec.md](references/library_spec.md) - **Read strictly for JSON format**.20- **Specification**: See [references/spec.md](references/spec.md) for the detailed JSON schema.21- **Example**: See [assets/flowchart.canvas](assets/flowchart.canvas).2223## Layout & Aesthetics (Senior Designer Standards)24- **Whitespace**: Use generous vertical gaps (120px-180px) between related nodes to provide "shelf space" for edge labels.25- **Z-Indexing**: The library handles z-indexing (groups render behind nodes). Always use groups to bound track-specific content.26- **Hierarchy**: Use H1 (#) for canvas titles, H2 (##) for major sections, and H3 (###) for individual node titles.27- **Colors**: 28 - `1` (Red): Friction, Error, Filing.29 - `2` (Orange): Interaction, Support, Outreach.30 - `3` (Yellow): Evidence, Documentation, Data.31 - `4` (Green): Success, Resolution, Start.32 - `5` (Blue/Cyan): Neutral, Operations.33 - `6` (Purple): Titles, Meta-info, Outcome.34- **Edges**: Keep labels short. If multiple edges cross the same path, the library tries to route them, but manual `x` adjustments help.3536## Output37To create a new canvas, construct a JSON payload and pipe it to the library script:3839```bash40cat <<EOF | python3 /path/to/skills/obsidian-canvas/scripts/canvas_lib.py41{42 "output": "Project_Flow.canvas",43 "nodes": [44 {"node_id": "start", "text": "Start", "x": 0, "y": 0, "color": "6"},45 {"node_id": "end", "text": "End", "x": 0, "y": 200, "color": "1"}46 ],47 "edges": [48 {"from_node": "start", "to_node": "end"}49 ],50 "groups": [51 {"label": "Phase 1", "nodes_in_group": ["start", "end"], "color": "5"}52 ]53}54EOF55```