bobo-ai-cli 3.0.4 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +259 -259
  3. package/bundled-skills/CORE_SKILLS.txt +18 -18
  4. package/bundled-skills/backend-expert/SKILL.md +97 -97
  5. package/bundled-skills/code-review/SKILL.md +280 -280
  6. package/bundled-skills/code-review-expert/SKILL.md +85 -85
  7. package/bundled-skills/context-budget-analyzer/SKILL.md +76 -76
  8. package/bundled-skills/context-compressor/SKILL.md +75 -75
  9. package/bundled-skills/context-optimization-suite/SKILL.md +162 -162
  10. package/bundled-skills/frontend-expert/SKILL.md +93 -93
  11. package/bundled-skills/github/SKILL.md +12 -12
  12. package/bundled-skills/high-agency/SKILL.md +473 -473
  13. package/bundled-skills/high-agency/references/builder-patterns.md +126 -126
  14. package/bundled-skills/high-agency/references/recovery-playbook.md +298 -298
  15. package/bundled-skills/memory-manager/SKILL.md +214 -214
  16. package/bundled-skills/memory-manager/references/advanced-config.md +65 -65
  17. package/bundled-skills/orchestrator/SKILL.md +681 -681
  18. package/bundled-skills/planning-with-files/SKILL.md +193 -193
  19. package/bundled-skills/skill-creator/SKILL.md +220 -220
  20. package/bundled-skills/testing-expert/SKILL.md +99 -99
  21. package/bundled-skills/verify/SKILL.md +15 -15
  22. package/dist/agent.d.ts +5 -0
  23. package/dist/agent.js +11 -1
  24. package/dist/agent.js.map +1 -1
  25. package/dist/agents/catalog.d.ts +47 -0
  26. package/dist/agents/catalog.js +63 -5
  27. package/dist/agents/catalog.js.map +1 -1
  28. package/dist/agents/router.d.ts +12 -1
  29. package/dist/agents/router.js +43 -3
  30. package/dist/agents/router.js.map +1 -1
  31. package/dist/agents/spawn.js +36 -18
  32. package/dist/agents/spawn.js.map +1 -1
  33. package/dist/autonomous.js +5 -5
  34. package/dist/cli.js +23 -21
  35. package/dist/cli.js.map +1 -1
  36. package/dist/compactor.js +39 -39
  37. package/dist/dream.js +29 -29
  38. package/dist/image-input.d.ts +44 -0
  39. package/dist/image-input.js +161 -0
  40. package/dist/image-input.js.map +1 -0
  41. package/dist/memory.js +13 -13
  42. package/dist/project.js +15 -15
  43. package/dist/repl.js +88 -0
  44. package/dist/repl.js.map +1 -1
  45. package/dist/skills.js +54 -54
  46. package/dist/sub-agents.js +65 -65
  47. package/dist/tools/browser.js +21 -21
  48. package/dist/tools/claude-code.js +10 -10
  49. package/dist/web.js +7 -7
  50. package/dist/wiki-commands.d.ts +2 -0
  51. package/dist/wiki-commands.js +249 -0
  52. package/dist/wiki-commands.js.map +1 -0
  53. package/dist/wiki.d.ts +90 -0
  54. package/dist/wiki.js +614 -0
  55. package/dist/wiki.js.map +1 -0
  56. package/knowledge/advanced-patterns.md +70 -70
  57. package/knowledge/agent-directives.md +74 -74
  58. package/knowledge/api-integration-patterns.md +102 -0
  59. package/knowledge/code-review-protocol.md +69 -0
  60. package/knowledge/dream.md +36 -36
  61. package/knowledge/engineering.md +52 -46
  62. package/knowledge/error-catalog.md +38 -33
  63. package/knowledge/event-driven-architecture.md +43 -0
  64. package/knowledge/external-alignment.md +47 -0
  65. package/knowledge/high-agency.md +73 -0
  66. package/knowledge/image-generation.md +48 -0
  67. package/knowledge/index.json +194 -169
  68. package/knowledge/llm-wiki-pattern.md +71 -0
  69. package/knowledge/long-task-management.md +79 -0
  70. package/knowledge/memory/cache-optimization-and-skill-integration.md +102 -102
  71. package/knowledge/memory/engineering-patterns.md +134 -134
  72. package/knowledge/memory/feedback_root_structure.md +15 -15
  73. package/knowledge/memory/project-contexts.md +69 -69
  74. package/knowledge/memory/tools-and-services.md +85 -85
  75. package/knowledge/memory-management.md +72 -0
  76. package/knowledge/rules/advisor-strategy.md +204 -0
  77. package/knowledge/rules/agents.md +62 -62
  78. package/knowledge/rules/blocking-rules.md +323 -323
  79. package/knowledge/rules/cache-management.md +379 -379
  80. package/knowledge/rules/capability-evolution.md +132 -132
  81. package/knowledge/rules/coding.md +126 -126
  82. package/knowledge/rules/engineering-workflows.md +225 -225
  83. package/knowledge/rules/evomap-content-guidelines.md +354 -354
  84. package/knowledge/rules/evomap-guide.md +224 -224
  85. package/knowledge/rules/external-alignment.md +22 -0
  86. package/knowledge/rules/git.md +31 -31
  87. package/knowledge/rules/hooks.md +106 -106
  88. package/knowledge/rules/performance.md +101 -101
  89. package/knowledge/rules/remotion-auto-production.md +1120 -1120
  90. package/knowledge/rules/security.md +46 -46
  91. package/knowledge/rules/testing.md +32 -32
  92. package/knowledge/rules/work-mode.md +208 -208
  93. package/knowledge/rules.md +62 -62
  94. package/knowledge/self-evolution.md +78 -0
  95. package/knowledge/self-rationalization-guard.md +52 -0
  96. package/knowledge/skills/Skill_Seekers.md +1722 -1722
  97. package/knowledge/skills/ab-test-setup.md +557 -557
  98. package/knowledge/skills/agent-sdk-dev.md +238 -238
  99. package/knowledge/skills/agent-tools.md +136 -136
  100. package/knowledge/skills/analytics-tracking.md +597 -597
  101. package/knowledge/skills/artifacts-builder.md +89 -89
  102. package/knowledge/skills/asana.md +12 -12
  103. package/knowledge/skills/backend-expert.md +97 -97
  104. package/knowledge/skills/brand-voice.md +481 -481
  105. package/knowledge/skills/browser-use.md +419 -419
  106. package/knowledge/skills/cache-optimization-skill.md +179 -179
  107. package/knowledge/skills/canvas-design.md +147 -147
  108. package/knowledge/skills/citation-validator.md +203 -203
  109. package/knowledge/skills/clangd-lsp.md +52 -52
  110. package/knowledge/skills/code-review-expert.md +85 -85
  111. package/knowledge/skills/code-review.md +280 -280
  112. package/knowledge/skills/code-simplifier.md +12 -12
  113. package/knowledge/skills/commit-commands.md +258 -258
  114. package/knowledge/skills/competitor-alternatives.md +795 -795
  115. package/knowledge/skills/content-atomizer.md +910 -910
  116. package/knowledge/skills/content-research-writer.md +605 -605
  117. package/knowledge/skills/context-optimization-suite.md +162 -162
  118. package/knowledge/skills/context7.md +12 -12
  119. package/knowledge/skills/copy-editing.md +494 -494
  120. package/knowledge/skills/copywriting.md +510 -510
  121. package/knowledge/skills/csharp-lsp.md +40 -40
  122. package/knowledge/skills/decision-making-framework.md +154 -154
  123. package/knowledge/skills/developer-growth-analysis.md +335 -335
  124. package/knowledge/skills/direct-response-copy.md +2336 -2336
  125. package/knowledge/skills/docker-expert.md +229 -229
  126. package/knowledge/skills/document-skills.md +12 -12
  127. package/knowledge/skills/documentation-expert.md +126 -126
  128. package/knowledge/skills/email-sequence.md +1061 -1061
  129. package/knowledge/skills/email-sequences.md +910 -910
  130. package/knowledge/skills/example-plugin.md +72 -72
  131. package/knowledge/skills/explanatory-output-style.md +82 -82
  132. package/knowledge/skills/feature-dev.md +458 -458
  133. package/knowledge/skills/file-organizer.md +466 -466
  134. package/knowledge/skills/firebase.disabled.md +12 -12
  135. package/knowledge/skills/form-cro.md +488 -488
  136. package/knowledge/skills/free-tool-strategy.md +636 -636
  137. package/knowledge/skills/frontend-design-offical.md +55 -55
  138. package/knowledge/skills/frontend-design.md +41 -41
  139. package/knowledge/skills/frontend-expert.md +93 -93
  140. package/knowledge/skills/github.md +12 -12
  141. package/knowledge/skills/gitlab.md +12 -12
  142. package/knowledge/skills/gopls-lsp.md +32 -32
  143. package/knowledge/skills/got-controller.md +218 -218
  144. package/knowledge/skills/greptile.md +72 -72
  145. package/knowledge/skills/hookify.md +376 -376
  146. package/knowledge/skills/image-editor.md +189 -189
  147. package/knowledge/skills/image-enhancer.md +109 -109
  148. package/knowledge/skills/jdtls-lsp.md +49 -49
  149. package/knowledge/skills/json-canvas.md +654 -654
  150. package/knowledge/skills/keyword-research.md +559 -559
  151. package/knowledge/skills/kotlin-lsp.md +28 -28
  152. package/knowledge/skills/laravel-boost.md +12 -12
  153. package/knowledge/skills/launch-strategy.md +394 -394
  154. package/knowledge/skills/lead-magnet.md +393 -393
  155. package/knowledge/skills/learning-output-style.md +106 -106
  156. package/knowledge/skills/linear.md +12 -12
  157. package/knowledge/skills/lua-lsp.md +47 -47
  158. package/knowledge/skills/marketing-ideas.md +720 -720
  159. package/knowledge/skills/marketing-psychology.md +534 -534
  160. package/knowledge/skills/mcp-builder.md +369 -369
  161. package/knowledge/skills/meeting-insights-analyzer.md +347 -347
  162. package/knowledge/skills/memory-evolution-system.md +172 -172
  163. package/knowledge/skills/multi-lens-thinking.md +407 -407
  164. package/knowledge/skills/nano-banana-pro.md +116 -116
  165. package/knowledge/skills/newsletter.md +736 -736
  166. package/knowledge/skills/notebooklm.md +296 -296
  167. package/knowledge/skills/obsidian-bases.md +634 -634
  168. package/knowledge/skills/obsidian-markdown.md +651 -651
  169. package/knowledge/skills/onboarding-cro.md +494 -494
  170. package/knowledge/skills/orchestrator.md +681 -681
  171. package/knowledge/skills/page-cro.md +379 -379
  172. package/knowledge/skills/paid-ads.md +624 -624
  173. package/knowledge/skills/paywall-upgrade-cro.md +651 -651
  174. package/knowledge/skills/php-lsp.md +36 -36
  175. package/knowledge/skills/planning-with-files.md +193 -193
  176. package/knowledge/skills/playwright.md +12 -12
  177. package/knowledge/skills/plugin-dev.md +434 -434
  178. package/knowledge/skills/popup-cro.md +520 -520
  179. package/knowledge/skills/positioning-angles.md +330 -330
  180. package/knowledge/skills/pr-review-toolkit.md +359 -359
  181. package/knowledge/skills/pricing-strategy.md +777 -777
  182. package/knowledge/skills/programmatic-seo.md +714 -714
  183. package/knowledge/skills/pyright-lsp.md +43 -43
  184. package/knowledge/skills/quality-assurance-framework.md +168 -168
  185. package/knowledge/skills/question-refiner.md +160 -160
  186. package/knowledge/skills/ralph-loop.md +205 -205
  187. package/knowledge/skills/refactoring-expert.md +103 -103
  188. package/knowledge/skills/referral-program.md +668 -668
  189. package/knowledge/skills/research-executor.md +164 -164
  190. package/knowledge/skills/review-with-security.md +12 -12
  191. package/knowledge/skills/rust-analyzer-lsp.md +50 -50
  192. package/knowledge/skills/schema-markup.md +647 -647
  193. package/knowledge/skills/security-audit-expert.md +124 -124
  194. package/knowledge/skills/security-expert.md +140 -140
  195. package/knowledge/skills/security-guidance.md +12 -12
  196. package/knowledge/skills/seedance-prompt.md +139 -139
  197. package/knowledge/skills/self-evolution.md +1160 -1160
  198. package/knowledge/skills/seo-audit.md +432 -432
  199. package/knowledge/skills/seo-content.md +787 -787
  200. package/knowledge/skills/serena.md +12 -12
  201. package/knowledge/skills/signup-flow-cro.md +409 -409
  202. package/knowledge/skills/skill-creator.md +220 -220
  203. package/knowledge/skills/skill-manager.md +226 -226
  204. package/knowledge/skills/skill-share.md +98 -98
  205. package/knowledge/skills/slack.md +12 -12
  206. package/knowledge/skills/social-content.md +878 -878
  207. package/knowledge/skills/spec-flow-skill.md +124 -124
  208. package/knowledge/skills/stripe.md +12 -12
  209. package/knowledge/skills/supabase.md +12 -12
  210. package/knowledge/skills/swift-lsp.md +40 -40
  211. package/knowledge/skills/synthesizer.md +236 -236
  212. package/knowledge/skills/template-skill.md +16 -16
  213. package/knowledge/skills/testing-expert.md +99 -99
  214. package/knowledge/skills/theme-factory.md +72 -72
  215. package/knowledge/skills/tiktok-research.md +208 -208
  216. package/knowledge/skills/typescript-lsp.md +36 -36
  217. package/knowledge/skills/ui-ux-pro-max.md +247 -247
  218. package/knowledge/skills/verify.md +15 -15
  219. package/knowledge/skills/visual-prompt-engineer.md +102 -102
  220. package/knowledge/skills/webapp-testing.md +111 -111
  221. package/knowledge/skills/wide-research.md +191 -191
  222. package/knowledge/system.md +93 -93
  223. package/knowledge/task-router.md +46 -37
  224. package/knowledge/verification.md +38 -38
  225. package/knowledge/worker-prompt-craft.md +66 -0
  226. package/knowledge/workflows/3d-viz.md +47 -47
  227. package/knowledge/workflows/data-pipeline.md +47 -47
  228. package/knowledge/workflows/db-migration.md +51 -51
  229. package/knowledge/workflows/feature-dev.md +41 -41
  230. package/knowledge/workflows/tdd-flow.md +52 -52
  231. package/knowledge/workflows/ui-verify.md +51 -51
  232. package/package.json +74 -74
  233. package/dist/claude-bridge.d.ts +0 -18
  234. package/dist/claude-bridge.js +0 -91
  235. package/dist/claude-bridge.js.map +0 -1
  236. package/dist/tools/claude-bridge-tool.d.ts +0 -4
  237. package/dist/tools/claude-bridge-tool.js +0 -44
  238. package/dist/tools/claude-bridge-tool.js.map +0 -1
@@ -1,654 +1,654 @@
1
- ---
2
- id: "json-canvas"
3
- title: "JSON Canvas Skill"
4
- category: "knowledge"
5
- tags: ["json canvas skill", "overview", "file structure", "nodes", "edges", "colors", "complete examples", "id generation", "layout guidelines", "validation rules"]
6
- triggers: []
7
- dependencies: []
8
- source: "E:/Bobo's Coding cache/.claude/skills/json-canvas"
9
- ---
10
-
11
- ---
12
- name: json-canvas
13
- description: Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.
14
- ---
15
-
16
- # JSON Canvas Skill
17
-
18
- This skill enables Claude Code to create and edit valid JSON Canvas files (`.canvas`) used in Obsidian and other applications.
19
-
20
- ## Overview
21
-
22
- JSON Canvas is an open file format for infinite canvas data. Canvas files use the `.canvas` extension and contain valid JSON following the [JSON Canvas Spec 1.0](https://jsoncanvas.org/spec/1.0/).
23
-
24
- ## File Structure
25
-
26
- A canvas file contains two top-level arrays:
27
-
28
- ```json
29
- {
30
- "nodes": [],
31
- "edges": []
32
- }
33
- ```
34
-
35
- - `nodes` (optional): Array of node objects
36
- - `edges` (optional): Array of edge objects connecting nodes
37
-
38
- ## Nodes
39
-
40
- Nodes are objects placed on the canvas. There are four node types:
41
-
42
- - `text` - Text content with Markdown
43
- - `file` - Reference to files/attachments
44
- - `link` - External URL
45
- - `group` - Visual container for other nodes
46
-
47
- ### Z-Index Ordering
48
-
49
- Nodes are ordered by z-index in the array:
50
-
51
- - First node = bottom layer (displayed below others)
52
- - Last node = top layer (displayed above others)
53
-
54
- ### Generic Node Attributes
55
-
56
- All nodes share these attributes:
57
-
58
- | Attribute | Required | Type | Description |
59
- | --------- | -------- | ----------- | --------------------------------------------- |
60
- | `id` | Yes | string | Unique identifier for the node |
61
- | `type` | Yes | string | Node type: `text`, `file`, `link`, or `group` |
62
- | `x` | Yes | integer | X position in pixels |
63
- | `y` | Yes | integer | Y position in pixels |
64
- | `width` | Yes | integer | Width in pixels |
65
- | `height` | Yes | integer | Height in pixels |
66
- | `color` | No | canvasColor | Node color (see Color section) |
67
-
68
- ### Text Nodes
69
-
70
- Text nodes contain Markdown content.
71
-
72
- ```json
73
- {
74
- "id": "6f0ad84f44ce9c17",
75
- "type": "text",
76
- "x": 0,
77
- "y": 0,
78
- "width": 400,
79
- "height": 200,
80
- "text": "# Hello World\n\nThis is **Markdown** content."
81
- }
82
- ```
83
-
84
- | Attribute | Required | Type | Description |
85
- | --------- | -------- | ------ | ------------------------------- |
86
- | `text` | Yes | string | Plain text with Markdown syntax |
87
-
88
- ### File Nodes
89
-
90
- File nodes reference files or attachments (images, videos, PDFs, notes, etc.).
91
-
92
- ```json
93
- {
94
- "id": "a1b2c3d4e5f67890",
95
- "type": "file",
96
- "x": 500,
97
- "y": 0,
98
- "width": 400,
99
- "height": 300,
100
- "file": "Attachments/diagram.png"
101
- }
102
- ```
103
-
104
- ```json
105
- {
106
- "id": "b2c3d4e5f6789012",
107
- "type": "file",
108
- "x": 500,
109
- "y": 400,
110
- "width": 400,
111
- "height": 300,
112
- "file": "Notes/Project Overview.md",
113
- "subpath": "#Implementation"
114
- }
115
- ```
116
-
117
- | Attribute | Required | Type | Description |
118
- | --------- | -------- | ------ | ------------------------------------------ |
119
- | `file` | Yes | string | Path to file within the system |
120
- | `subpath` | No | string | Link to heading or block (starts with `#`) |
121
-
122
- ### Link Nodes
123
-
124
- Link nodes display external URLs.
125
-
126
- ```json
127
- {
128
- "id": "c3d4e5f678901234",
129
- "type": "link",
130
- "x": 1000,
131
- "y": 0,
132
- "width": 400,
133
- "height": 200,
134
- "url": "https://obsidian.md"
135
- }
136
- ```
137
-
138
- | Attribute | Required | Type | Description |
139
- | --------- | -------- | ------ | ------------ |
140
- | `url` | Yes | string | External URL |
141
-
142
- ### Group Nodes
143
-
144
- Group nodes are visual containers for organizing other nodes.
145
-
146
- ```json
147
- {
148
- "id": "d4e5f6789012345a",
149
- "type": "group",
150
- "x": -50,
151
- "y": -50,
152
- "width": 1000,
153
- "height": 600,
154
- "label": "Project Overview",
155
- "color": "4"
156
- }
157
- ```
158
-
159
- ```json
160
- {
161
- "id": "e5f67890123456ab",
162
- "type": "group",
163
- "x": 0,
164
- "y": 700,
165
- "width": 800,
166
- "height": 500,
167
- "label": "Resources",
168
- "background": "Attachments/background.png",
169
- "backgroundStyle": "cover"
170
- }
171
- ```
172
-
173
- | Attribute | Required | Type | Description |
174
- | ----------------- | -------- | ------ | -------------------------- |
175
- | `label` | No | string | Text label for the group |
176
- | `background` | No | string | Path to background image |
177
- | `backgroundStyle` | No | string | Background rendering style |
178
-
179
- #### Background Styles
180
-
181
- | Value | Description |
182
- | -------- | ------------------------------------------- |
183
- | `cover` | Fills entire width and height of node |
184
- | `ratio` | Maintains aspect ratio of background image |
185
- | `repeat` | Repeats image as pattern in both directions |
186
-
187
- ## Edges
188
-
189
- Edges are lines connecting nodes.
190
-
191
- ```json
192
- {
193
- "id": "f67890123456789a",
194
- "fromNode": "6f0ad84f44ce9c17",
195
- "toNode": "a1b2c3d4e5f67890"
196
- }
197
- ```
198
-
199
- ```json
200
- {
201
- "id": "0123456789abcdef",
202
- "fromNode": "6f0ad84f44ce9c17",
203
- "fromSide": "right",
204
- "fromEnd": "none",
205
- "toNode": "b2c3d4e5f6789012",
206
- "toSide": "left",
207
- "toEnd": "arrow",
208
- "color": "1",
209
- "label": "leads to"
210
- }
211
- ```
212
-
213
- | Attribute | Required | Type | Default | Description |
214
- | ---------- | -------- | ----------- | ------- | ------------------------------- |
215
- | `id` | Yes | string | - | Unique identifier for the edge |
216
- | `fromNode` | Yes | string | - | Node ID where connection starts |
217
- | `fromSide` | No | string | - | Side where edge starts |
218
- | `fromEnd` | No | string | `none` | Shape at edge start |
219
- | `toNode` | Yes | string | - | Node ID where connection ends |
220
- | `toSide` | No | string | - | Side where edge ends |
221
- | `toEnd` | No | string | `arrow` | Shape at edge end |
222
- | `color` | No | canvasColor | - | Line color |
223
- | `label` | No | string | - | Text label for the edge |
224
-
225
- ### Side Values
226
-
227
- | Value | Description |
228
- | -------- | ------------------- |
229
- | `top` | Top edge of node |
230
- | `right` | Right edge of node |
231
- | `bottom` | Bottom edge of node |
232
- | `left` | Left edge of node |
233
-
234
- ### End Shapes
235
-
236
- | Value | Description |
237
- | ------- | ----------------- |
238
- | `none` | No endpoint shape |
239
- | `arrow` | Arrow endpoint |
240
-
241
- ## Colors
242
-
243
- The `canvasColor` type can be specified in two ways:
244
-
245
- ### Hex Colors
246
-
247
- ```json
248
- {
249
- "color": "#FF0000"
250
- }
251
- ```
252
-
253
- ### Preset Colors
254
-
255
- ```json
256
- {
257
- "color": "1"
258
- }
259
- ```
260
-
261
- | Preset | Color |
262
- | ------ | ------ |
263
- | `"1"` | Red |
264
- | `"2"` | Orange |
265
- | `"3"` | Yellow |
266
- | `"4"` | Green |
267
- | `"5"` | Cyan |
268
- | `"6"` | Purple |
269
-
270
- Note: Specific color values for presets are intentionally undefined, allowing applications to use their own brand colors.
271
-
272
- ## Complete Examples
273
-
274
- ### Simple Canvas with Text and Connections
275
-
276
- ```json
277
- {
278
- "nodes": [
279
- {
280
- "id": "8a9b0c1d2e3f4a5b",
281
- "type": "text",
282
- "x": 0,
283
- "y": 0,
284
- "width": 300,
285
- "height": 150,
286
- "text": "# Main Idea\n\nThis is the central concept."
287
- },
288
- {
289
- "id": "1a2b3c4d5e6f7a8b",
290
- "type": "text",
291
- "x": 400,
292
- "y": -100,
293
- "width": 250,
294
- "height": 100,
295
- "text": "## Supporting Point A\n\nDetails here."
296
- },
297
- {
298
- "id": "2b3c4d5e6f7a8b9c",
299
- "type": "text",
300
- "x": 400,
301
- "y": 100,
302
- "width": 250,
303
- "height": 100,
304
- "text": "## Supporting Point B\n\nMore details."
305
- }
306
- ],
307
- "edges": [
308
- {
309
- "id": "3c4d5e6f7a8b9c0d",
310
- "fromNode": "8a9b0c1d2e3f4a5b",
311
- "fromSide": "right",
312
- "toNode": "1a2b3c4d5e6f7a8b",
313
- "toSide": "left"
314
- },
315
- {
316
- "id": "4d5e6f7a8b9c0d1e",
317
- "fromNode": "8a9b0c1d2e3f4a5b",
318
- "fromSide": "right",
319
- "toNode": "2b3c4d5e6f7a8b9c",
320
- "toSide": "left"
321
- }
322
- ]
323
- }
324
- ```
325
-
326
- ### Project Board with Groups
327
-
328
- ```json
329
- {
330
- "nodes": [
331
- {
332
- "id": "5e6f7a8b9c0d1e2f",
333
- "type": "group",
334
- "x": 0,
335
- "y": 0,
336
- "width": 300,
337
- "height": 500,
338
- "label": "To Do",
339
- "color": "1"
340
- },
341
- {
342
- "id": "6f7a8b9c0d1e2f3a",
343
- "type": "group",
344
- "x": 350,
345
- "y": 0,
346
- "width": 300,
347
- "height": 500,
348
- "label": "In Progress",
349
- "color": "3"
350
- },
351
- {
352
- "id": "7a8b9c0d1e2f3a4b",
353
- "type": "group",
354
- "x": 700,
355
- "y": 0,
356
- "width": 300,
357
- "height": 500,
358
- "label": "Done",
359
- "color": "4"
360
- },
361
- {
362
- "id": "8b9c0d1e2f3a4b5c",
363
- "type": "text",
364
- "x": 20,
365
- "y": 50,
366
- "width": 260,
367
- "height": 80,
368
- "text": "## Task 1\n\nImplement feature X"
369
- },
370
- {
371
- "id": "9c0d1e2f3a4b5c6d",
372
- "type": "text",
373
- "x": 370,
374
- "y": 50,
375
- "width": 260,
376
- "height": 80,
377
- "text": "## Task 2\n\nReview PR #123",
378
- "color": "2"
379
- },
380
- {
381
- "id": "0d1e2f3a4b5c6d7e",
382
- "type": "text",
383
- "x": 720,
384
- "y": 50,
385
- "width": 260,
386
- "height": 80,
387
- "text": "## Task 3\n\n~~Setup CI/CD~~"
388
- }
389
- ],
390
- "edges": []
391
- }
392
- ```
393
-
394
- ### Research Canvas with Files and Links
395
-
396
- ```json
397
- {
398
- "nodes": [
399
- {
400
- "id": "1e2f3a4b5c6d7e8f",
401
- "type": "text",
402
- "x": 300,
403
- "y": 200,
404
- "width": 400,
405
- "height": 200,
406
- "text": "# Research Topic\n\n## Key Questions\n\n- How does X affect Y?\n- What are the implications?",
407
- "color": "5"
408
- },
409
- {
410
- "id": "2f3a4b5c6d7e8f9a",
411
- "type": "file",
412
- "x": 0,
413
- "y": 0,
414
- "width": 250,
415
- "height": 150,
416
- "file": "Literature/Paper A.pdf"
417
- },
418
- {
419
- "id": "3a4b5c6d7e8f9a0b",
420
- "type": "file",
421
- "x": 0,
422
- "y": 200,
423
- "width": 250,
424
- "height": 150,
425
- "file": "Notes/Meeting Notes.md",
426
- "subpath": "#Key Insights"
427
- },
428
- {
429
- "id": "4b5c6d7e8f9a0b1c",
430
- "type": "link",
431
- "x": 0,
432
- "y": 400,
433
- "width": 250,
434
- "height": 100,
435
- "url": "https://example.com/research"
436
- },
437
- {
438
- "id": "5c6d7e8f9a0b1c2d",
439
- "type": "file",
440
- "x": 750,
441
- "y": 150,
442
- "width": 300,
443
- "height": 250,
444
- "file": "Attachments/diagram.png"
445
- }
446
- ],
447
- "edges": [
448
- {
449
- "id": "6d7e8f9a0b1c2d3e",
450
- "fromNode": "2f3a4b5c6d7e8f9a",
451
- "fromSide": "right",
452
- "toNode": "1e2f3a4b5c6d7e8f",
453
- "toSide": "left",
454
- "label": "supports"
455
- },
456
- {
457
- "id": "7e8f9a0b1c2d3e4f",
458
- "fromNode": "3a4b5c6d7e8f9a0b",
459
- "fromSide": "right",
460
- "toNode": "1e2f3a4b5c6d7e8f",
461
- "toSide": "left",
462
- "label": "informs"
463
- },
464
- {
465
- "id": "8f9a0b1c2d3e4f5a",
466
- "fromNode": "4b5c6d7e8f9a0b1c",
467
- "fromSide": "right",
468
- "toNode": "1e2f3a4b5c6d7e8f",
469
- "toSide": "left",
470
- "toEnd": "arrow",
471
- "color": "6"
472
- },
473
- {
474
- "id": "9a0b1c2d3e4f5a6b",
475
- "fromNode": "1e2f3a4b5c6d7e8f",
476
- "fromSide": "right",
477
- "toNode": "5c6d7e8f9a0b1c2d",
478
- "toSide": "left",
479
- "label": "visualized by"
480
- }
481
- ]
482
- }
483
- ```
484
-
485
- ### Flowchart
486
-
487
- ```json
488
- {
489
- "nodes": [
490
- {
491
- "id": "a0b1c2d3e4f5a6b7",
492
- "type": "text",
493
- "x": 200,
494
- "y": 0,
495
- "width": 150,
496
- "height": 60,
497
- "text": "**Start**",
498
- "color": "4"
499
- },
500
- {
501
- "id": "b1c2d3e4f5a6b7c8",
502
- "type": "text",
503
- "x": 200,
504
- "y": 100,
505
- "width": 150,
506
- "height": 60,
507
- "text": "Step 1:\nGather data"
508
- },
509
- {
510
- "id": "c2d3e4f5a6b7c8d9",
511
- "type": "text",
512
- "x": 200,
513
- "y": 200,
514
- "width": 150,
515
- "height": 80,
516
- "text": "**Decision**\n\nIs data valid?",
517
- "color": "3"
518
- },
519
- {
520
- "id": "d3e4f5a6b7c8d9e0",
521
- "type": "text",
522
- "x": 400,
523
- "y": 200,
524
- "width": 150,
525
- "height": 60,
526
- "text": "Process data"
527
- },
528
- {
529
- "id": "e4f5a6b7c8d9e0f1",
530
- "type": "text",
531
- "x": 0,
532
- "y": 200,
533
- "width": 150,
534
- "height": 60,
535
- "text": "Request new data",
536
- "color": "1"
537
- },
538
- {
539
- "id": "f5a6b7c8d9e0f1a2",
540
- "type": "text",
541
- "x": 400,
542
- "y": 320,
543
- "width": 150,
544
- "height": 60,
545
- "text": "**End**",
546
- "color": "4"
547
- }
548
- ],
549
- "edges": [
550
- {
551
- "id": "a6b7c8d9e0f1a2b3",
552
- "fromNode": "a0b1c2d3e4f5a6b7",
553
- "fromSide": "bottom",
554
- "toNode": "b1c2d3e4f5a6b7c8",
555
- "toSide": "top"
556
- },
557
- {
558
- "id": "b7c8d9e0f1a2b3c4",
559
- "fromNode": "b1c2d3e4f5a6b7c8",
560
- "fromSide": "bottom",
561
- "toNode": "c2d3e4f5a6b7c8d9",
562
- "toSide": "top"
563
- },
564
- {
565
- "id": "c8d9e0f1a2b3c4d5",
566
- "fromNode": "c2d3e4f5a6b7c8d9",
567
- "fromSide": "right",
568
- "toNode": "d3e4f5a6b7c8d9e0",
569
- "toSide": "left",
570
- "label": "Yes",
571
- "color": "4"
572
- },
573
- {
574
- "id": "d9e0f1a2b3c4d5e6",
575
- "fromNode": "c2d3e4f5a6b7c8d9",
576
- "fromSide": "left",
577
- "toNode": "e4f5a6b7c8d9e0f1",
578
- "toSide": "right",
579
- "label": "No",
580
- "color": "1"
581
- },
582
- {
583
- "id": "e0f1a2b3c4d5e6f7",
584
- "fromNode": "e4f5a6b7c8d9e0f1",
585
- "fromSide": "top",
586
- "fromEnd": "none",
587
- "toNode": "b1c2d3e4f5a6b7c8",
588
- "toSide": "left",
589
- "toEnd": "arrow"
590
- },
591
- {
592
- "id": "f1a2b3c4d5e6f7a8",
593
- "fromNode": "d3e4f5a6b7c8d9e0",
594
- "fromSide": "bottom",
595
- "toNode": "f5a6b7c8d9e0f1a2",
596
- "toSide": "top"
597
- }
598
- ]
599
- }
600
- ```
601
-
602
- ## ID Generation
603
-
604
- Node and edge IDs must be unique strings. Obsidian generates 16-character hexadecimal IDs:
605
-
606
- ```json
607
- "id": "6f0ad84f44ce9c17"
608
- "id": "a3b2c1d0e9f8g7h6"
609
- "id": "1234567890abcdef"
610
- ```
611
-
612
- This format is a 16-character lowercase hex string (64-bit random value).
613
-
614
- ## Layout Guidelines
615
-
616
- ### Positioning
617
-
618
- - Coordinates can be negative (canvas extends infinitely)
619
- - `x` increases to the right
620
- - `y` increases downward
621
- - Position refers to top-left corner of node
622
-
623
- ### Recommended Sizes
624
-
625
- | Node Type | Suggested Width | Suggested Height |
626
- | ------------ | --------------- | ---------------- |
627
- | Small text | 200-300 | 80-150 |
628
- | Medium text | 300-450 | 150-300 |
629
- | Large text | 400-600 | 300-500 |
630
- | File preview | 300-500 | 200-400 |
631
- | Link preview | 250-400 | 100-200 |
632
- | Group | Varies | Varies |
633
-
634
- ### Spacing
635
-
636
- - Leave 20-50px padding inside groups
637
- - Space nodes 50-100px apart for readability
638
- - Align nodes to grid (multiples of 10 or 20) for cleaner layouts
639
-
640
- ## Validation Rules
641
-
642
- 1. All `id` values must be unique across nodes and edges
643
- 2. `fromNode` and `toNode` must reference existing node IDs
644
- 3. Required fields must be present for each node type
645
- 4. `type` must be one of: `text`, `file`, `link`, `group`
646
- 5. `backgroundStyle` must be one of: `cover`, `ratio`, `repeat`
647
- 6. `fromSide`, `toSide` must be one of: `top`, `right`, `bottom`, `left`
648
- 7. `fromEnd`, `toEnd` must be one of: `none`, `arrow`
649
- 8. Color presets must be `"1"` through `"6"` or valid hex color
650
-
651
- ## References
652
-
653
- - [JSON Canvas Spec 1.0](https://jsoncanvas.org/spec/1.0/)
654
- - [JSON Canvas GitHub](https://github.com/obsidianmd/jsoncanvas)
1
+ ---
2
+ id: "json-canvas"
3
+ title: "JSON Canvas Skill"
4
+ category: "knowledge"
5
+ tags: ["json canvas skill", "overview", "file structure", "nodes", "edges", "colors", "complete examples", "id generation", "layout guidelines", "validation rules"]
6
+ triggers: []
7
+ dependencies: []
8
+ source: "E:/Bobo's Coding cache/.claude/skills/json-canvas"
9
+ ---
10
+
11
+ ---
12
+ name: json-canvas
13
+ description: Create and edit JSON Canvas files (.canvas) with nodes, edges, groups, and connections. Use when working with .canvas files, creating visual canvases, mind maps, flowcharts, or when the user mentions Canvas files in Obsidian.
14
+ ---
15
+
16
+ # JSON Canvas Skill
17
+
18
+ This skill enables Claude Code to create and edit valid JSON Canvas files (`.canvas`) used in Obsidian and other applications.
19
+
20
+ ## Overview
21
+
22
+ JSON Canvas is an open file format for infinite canvas data. Canvas files use the `.canvas` extension and contain valid JSON following the [JSON Canvas Spec 1.0](https://jsoncanvas.org/spec/1.0/).
23
+
24
+ ## File Structure
25
+
26
+ A canvas file contains two top-level arrays:
27
+
28
+ ```json
29
+ {
30
+ "nodes": [],
31
+ "edges": []
32
+ }
33
+ ```
34
+
35
+ - `nodes` (optional): Array of node objects
36
+ - `edges` (optional): Array of edge objects connecting nodes
37
+
38
+ ## Nodes
39
+
40
+ Nodes are objects placed on the canvas. There are four node types:
41
+
42
+ - `text` - Text content with Markdown
43
+ - `file` - Reference to files/attachments
44
+ - `link` - External URL
45
+ - `group` - Visual container for other nodes
46
+
47
+ ### Z-Index Ordering
48
+
49
+ Nodes are ordered by z-index in the array:
50
+
51
+ - First node = bottom layer (displayed below others)
52
+ - Last node = top layer (displayed above others)
53
+
54
+ ### Generic Node Attributes
55
+
56
+ All nodes share these attributes:
57
+
58
+ | Attribute | Required | Type | Description |
59
+ | --------- | -------- | ----------- | --------------------------------------------- |
60
+ | `id` | Yes | string | Unique identifier for the node |
61
+ | `type` | Yes | string | Node type: `text`, `file`, `link`, or `group` |
62
+ | `x` | Yes | integer | X position in pixels |
63
+ | `y` | Yes | integer | Y position in pixels |
64
+ | `width` | Yes | integer | Width in pixels |
65
+ | `height` | Yes | integer | Height in pixels |
66
+ | `color` | No | canvasColor | Node color (see Color section) |
67
+
68
+ ### Text Nodes
69
+
70
+ Text nodes contain Markdown content.
71
+
72
+ ```json
73
+ {
74
+ "id": "6f0ad84f44ce9c17",
75
+ "type": "text",
76
+ "x": 0,
77
+ "y": 0,
78
+ "width": 400,
79
+ "height": 200,
80
+ "text": "# Hello World\n\nThis is **Markdown** content."
81
+ }
82
+ ```
83
+
84
+ | Attribute | Required | Type | Description |
85
+ | --------- | -------- | ------ | ------------------------------- |
86
+ | `text` | Yes | string | Plain text with Markdown syntax |
87
+
88
+ ### File Nodes
89
+
90
+ File nodes reference files or attachments (images, videos, PDFs, notes, etc.).
91
+
92
+ ```json
93
+ {
94
+ "id": "a1b2c3d4e5f67890",
95
+ "type": "file",
96
+ "x": 500,
97
+ "y": 0,
98
+ "width": 400,
99
+ "height": 300,
100
+ "file": "Attachments/diagram.png"
101
+ }
102
+ ```
103
+
104
+ ```json
105
+ {
106
+ "id": "b2c3d4e5f6789012",
107
+ "type": "file",
108
+ "x": 500,
109
+ "y": 400,
110
+ "width": 400,
111
+ "height": 300,
112
+ "file": "Notes/Project Overview.md",
113
+ "subpath": "#Implementation"
114
+ }
115
+ ```
116
+
117
+ | Attribute | Required | Type | Description |
118
+ | --------- | -------- | ------ | ------------------------------------------ |
119
+ | `file` | Yes | string | Path to file within the system |
120
+ | `subpath` | No | string | Link to heading or block (starts with `#`) |
121
+
122
+ ### Link Nodes
123
+
124
+ Link nodes display external URLs.
125
+
126
+ ```json
127
+ {
128
+ "id": "c3d4e5f678901234",
129
+ "type": "link",
130
+ "x": 1000,
131
+ "y": 0,
132
+ "width": 400,
133
+ "height": 200,
134
+ "url": "https://obsidian.md"
135
+ }
136
+ ```
137
+
138
+ | Attribute | Required | Type | Description |
139
+ | --------- | -------- | ------ | ------------ |
140
+ | `url` | Yes | string | External URL |
141
+
142
+ ### Group Nodes
143
+
144
+ Group nodes are visual containers for organizing other nodes.
145
+
146
+ ```json
147
+ {
148
+ "id": "d4e5f6789012345a",
149
+ "type": "group",
150
+ "x": -50,
151
+ "y": -50,
152
+ "width": 1000,
153
+ "height": 600,
154
+ "label": "Project Overview",
155
+ "color": "4"
156
+ }
157
+ ```
158
+
159
+ ```json
160
+ {
161
+ "id": "e5f67890123456ab",
162
+ "type": "group",
163
+ "x": 0,
164
+ "y": 700,
165
+ "width": 800,
166
+ "height": 500,
167
+ "label": "Resources",
168
+ "background": "Attachments/background.png",
169
+ "backgroundStyle": "cover"
170
+ }
171
+ ```
172
+
173
+ | Attribute | Required | Type | Description |
174
+ | ----------------- | -------- | ------ | -------------------------- |
175
+ | `label` | No | string | Text label for the group |
176
+ | `background` | No | string | Path to background image |
177
+ | `backgroundStyle` | No | string | Background rendering style |
178
+
179
+ #### Background Styles
180
+
181
+ | Value | Description |
182
+ | -------- | ------------------------------------------- |
183
+ | `cover` | Fills entire width and height of node |
184
+ | `ratio` | Maintains aspect ratio of background image |
185
+ | `repeat` | Repeats image as pattern in both directions |
186
+
187
+ ## Edges
188
+
189
+ Edges are lines connecting nodes.
190
+
191
+ ```json
192
+ {
193
+ "id": "f67890123456789a",
194
+ "fromNode": "6f0ad84f44ce9c17",
195
+ "toNode": "a1b2c3d4e5f67890"
196
+ }
197
+ ```
198
+
199
+ ```json
200
+ {
201
+ "id": "0123456789abcdef",
202
+ "fromNode": "6f0ad84f44ce9c17",
203
+ "fromSide": "right",
204
+ "fromEnd": "none",
205
+ "toNode": "b2c3d4e5f6789012",
206
+ "toSide": "left",
207
+ "toEnd": "arrow",
208
+ "color": "1",
209
+ "label": "leads to"
210
+ }
211
+ ```
212
+
213
+ | Attribute | Required | Type | Default | Description |
214
+ | ---------- | -------- | ----------- | ------- | ------------------------------- |
215
+ | `id` | Yes | string | - | Unique identifier for the edge |
216
+ | `fromNode` | Yes | string | - | Node ID where connection starts |
217
+ | `fromSide` | No | string | - | Side where edge starts |
218
+ | `fromEnd` | No | string | `none` | Shape at edge start |
219
+ | `toNode` | Yes | string | - | Node ID where connection ends |
220
+ | `toSide` | No | string | - | Side where edge ends |
221
+ | `toEnd` | No | string | `arrow` | Shape at edge end |
222
+ | `color` | No | canvasColor | - | Line color |
223
+ | `label` | No | string | - | Text label for the edge |
224
+
225
+ ### Side Values
226
+
227
+ | Value | Description |
228
+ | -------- | ------------------- |
229
+ | `top` | Top edge of node |
230
+ | `right` | Right edge of node |
231
+ | `bottom` | Bottom edge of node |
232
+ | `left` | Left edge of node |
233
+
234
+ ### End Shapes
235
+
236
+ | Value | Description |
237
+ | ------- | ----------------- |
238
+ | `none` | No endpoint shape |
239
+ | `arrow` | Arrow endpoint |
240
+
241
+ ## Colors
242
+
243
+ The `canvasColor` type can be specified in two ways:
244
+
245
+ ### Hex Colors
246
+
247
+ ```json
248
+ {
249
+ "color": "#FF0000"
250
+ }
251
+ ```
252
+
253
+ ### Preset Colors
254
+
255
+ ```json
256
+ {
257
+ "color": "1"
258
+ }
259
+ ```
260
+
261
+ | Preset | Color |
262
+ | ------ | ------ |
263
+ | `"1"` | Red |
264
+ | `"2"` | Orange |
265
+ | `"3"` | Yellow |
266
+ | `"4"` | Green |
267
+ | `"5"` | Cyan |
268
+ | `"6"` | Purple |
269
+
270
+ Note: Specific color values for presets are intentionally undefined, allowing applications to use their own brand colors.
271
+
272
+ ## Complete Examples
273
+
274
+ ### Simple Canvas with Text and Connections
275
+
276
+ ```json
277
+ {
278
+ "nodes": [
279
+ {
280
+ "id": "8a9b0c1d2e3f4a5b",
281
+ "type": "text",
282
+ "x": 0,
283
+ "y": 0,
284
+ "width": 300,
285
+ "height": 150,
286
+ "text": "# Main Idea\n\nThis is the central concept."
287
+ },
288
+ {
289
+ "id": "1a2b3c4d5e6f7a8b",
290
+ "type": "text",
291
+ "x": 400,
292
+ "y": -100,
293
+ "width": 250,
294
+ "height": 100,
295
+ "text": "## Supporting Point A\n\nDetails here."
296
+ },
297
+ {
298
+ "id": "2b3c4d5e6f7a8b9c",
299
+ "type": "text",
300
+ "x": 400,
301
+ "y": 100,
302
+ "width": 250,
303
+ "height": 100,
304
+ "text": "## Supporting Point B\n\nMore details."
305
+ }
306
+ ],
307
+ "edges": [
308
+ {
309
+ "id": "3c4d5e6f7a8b9c0d",
310
+ "fromNode": "8a9b0c1d2e3f4a5b",
311
+ "fromSide": "right",
312
+ "toNode": "1a2b3c4d5e6f7a8b",
313
+ "toSide": "left"
314
+ },
315
+ {
316
+ "id": "4d5e6f7a8b9c0d1e",
317
+ "fromNode": "8a9b0c1d2e3f4a5b",
318
+ "fromSide": "right",
319
+ "toNode": "2b3c4d5e6f7a8b9c",
320
+ "toSide": "left"
321
+ }
322
+ ]
323
+ }
324
+ ```
325
+
326
+ ### Project Board with Groups
327
+
328
+ ```json
329
+ {
330
+ "nodes": [
331
+ {
332
+ "id": "5e6f7a8b9c0d1e2f",
333
+ "type": "group",
334
+ "x": 0,
335
+ "y": 0,
336
+ "width": 300,
337
+ "height": 500,
338
+ "label": "To Do",
339
+ "color": "1"
340
+ },
341
+ {
342
+ "id": "6f7a8b9c0d1e2f3a",
343
+ "type": "group",
344
+ "x": 350,
345
+ "y": 0,
346
+ "width": 300,
347
+ "height": 500,
348
+ "label": "In Progress",
349
+ "color": "3"
350
+ },
351
+ {
352
+ "id": "7a8b9c0d1e2f3a4b",
353
+ "type": "group",
354
+ "x": 700,
355
+ "y": 0,
356
+ "width": 300,
357
+ "height": 500,
358
+ "label": "Done",
359
+ "color": "4"
360
+ },
361
+ {
362
+ "id": "8b9c0d1e2f3a4b5c",
363
+ "type": "text",
364
+ "x": 20,
365
+ "y": 50,
366
+ "width": 260,
367
+ "height": 80,
368
+ "text": "## Task 1\n\nImplement feature X"
369
+ },
370
+ {
371
+ "id": "9c0d1e2f3a4b5c6d",
372
+ "type": "text",
373
+ "x": 370,
374
+ "y": 50,
375
+ "width": 260,
376
+ "height": 80,
377
+ "text": "## Task 2\n\nReview PR #123",
378
+ "color": "2"
379
+ },
380
+ {
381
+ "id": "0d1e2f3a4b5c6d7e",
382
+ "type": "text",
383
+ "x": 720,
384
+ "y": 50,
385
+ "width": 260,
386
+ "height": 80,
387
+ "text": "## Task 3\n\n~~Setup CI/CD~~"
388
+ }
389
+ ],
390
+ "edges": []
391
+ }
392
+ ```
393
+
394
+ ### Research Canvas with Files and Links
395
+
396
+ ```json
397
+ {
398
+ "nodes": [
399
+ {
400
+ "id": "1e2f3a4b5c6d7e8f",
401
+ "type": "text",
402
+ "x": 300,
403
+ "y": 200,
404
+ "width": 400,
405
+ "height": 200,
406
+ "text": "# Research Topic\n\n## Key Questions\n\n- How does X affect Y?\n- What are the implications?",
407
+ "color": "5"
408
+ },
409
+ {
410
+ "id": "2f3a4b5c6d7e8f9a",
411
+ "type": "file",
412
+ "x": 0,
413
+ "y": 0,
414
+ "width": 250,
415
+ "height": 150,
416
+ "file": "Literature/Paper A.pdf"
417
+ },
418
+ {
419
+ "id": "3a4b5c6d7e8f9a0b",
420
+ "type": "file",
421
+ "x": 0,
422
+ "y": 200,
423
+ "width": 250,
424
+ "height": 150,
425
+ "file": "Notes/Meeting Notes.md",
426
+ "subpath": "#Key Insights"
427
+ },
428
+ {
429
+ "id": "4b5c6d7e8f9a0b1c",
430
+ "type": "link",
431
+ "x": 0,
432
+ "y": 400,
433
+ "width": 250,
434
+ "height": 100,
435
+ "url": "https://example.com/research"
436
+ },
437
+ {
438
+ "id": "5c6d7e8f9a0b1c2d",
439
+ "type": "file",
440
+ "x": 750,
441
+ "y": 150,
442
+ "width": 300,
443
+ "height": 250,
444
+ "file": "Attachments/diagram.png"
445
+ }
446
+ ],
447
+ "edges": [
448
+ {
449
+ "id": "6d7e8f9a0b1c2d3e",
450
+ "fromNode": "2f3a4b5c6d7e8f9a",
451
+ "fromSide": "right",
452
+ "toNode": "1e2f3a4b5c6d7e8f",
453
+ "toSide": "left",
454
+ "label": "supports"
455
+ },
456
+ {
457
+ "id": "7e8f9a0b1c2d3e4f",
458
+ "fromNode": "3a4b5c6d7e8f9a0b",
459
+ "fromSide": "right",
460
+ "toNode": "1e2f3a4b5c6d7e8f",
461
+ "toSide": "left",
462
+ "label": "informs"
463
+ },
464
+ {
465
+ "id": "8f9a0b1c2d3e4f5a",
466
+ "fromNode": "4b5c6d7e8f9a0b1c",
467
+ "fromSide": "right",
468
+ "toNode": "1e2f3a4b5c6d7e8f",
469
+ "toSide": "left",
470
+ "toEnd": "arrow",
471
+ "color": "6"
472
+ },
473
+ {
474
+ "id": "9a0b1c2d3e4f5a6b",
475
+ "fromNode": "1e2f3a4b5c6d7e8f",
476
+ "fromSide": "right",
477
+ "toNode": "5c6d7e8f9a0b1c2d",
478
+ "toSide": "left",
479
+ "label": "visualized by"
480
+ }
481
+ ]
482
+ }
483
+ ```
484
+
485
+ ### Flowchart
486
+
487
+ ```json
488
+ {
489
+ "nodes": [
490
+ {
491
+ "id": "a0b1c2d3e4f5a6b7",
492
+ "type": "text",
493
+ "x": 200,
494
+ "y": 0,
495
+ "width": 150,
496
+ "height": 60,
497
+ "text": "**Start**",
498
+ "color": "4"
499
+ },
500
+ {
501
+ "id": "b1c2d3e4f5a6b7c8",
502
+ "type": "text",
503
+ "x": 200,
504
+ "y": 100,
505
+ "width": 150,
506
+ "height": 60,
507
+ "text": "Step 1:\nGather data"
508
+ },
509
+ {
510
+ "id": "c2d3e4f5a6b7c8d9",
511
+ "type": "text",
512
+ "x": 200,
513
+ "y": 200,
514
+ "width": 150,
515
+ "height": 80,
516
+ "text": "**Decision**\n\nIs data valid?",
517
+ "color": "3"
518
+ },
519
+ {
520
+ "id": "d3e4f5a6b7c8d9e0",
521
+ "type": "text",
522
+ "x": 400,
523
+ "y": 200,
524
+ "width": 150,
525
+ "height": 60,
526
+ "text": "Process data"
527
+ },
528
+ {
529
+ "id": "e4f5a6b7c8d9e0f1",
530
+ "type": "text",
531
+ "x": 0,
532
+ "y": 200,
533
+ "width": 150,
534
+ "height": 60,
535
+ "text": "Request new data",
536
+ "color": "1"
537
+ },
538
+ {
539
+ "id": "f5a6b7c8d9e0f1a2",
540
+ "type": "text",
541
+ "x": 400,
542
+ "y": 320,
543
+ "width": 150,
544
+ "height": 60,
545
+ "text": "**End**",
546
+ "color": "4"
547
+ }
548
+ ],
549
+ "edges": [
550
+ {
551
+ "id": "a6b7c8d9e0f1a2b3",
552
+ "fromNode": "a0b1c2d3e4f5a6b7",
553
+ "fromSide": "bottom",
554
+ "toNode": "b1c2d3e4f5a6b7c8",
555
+ "toSide": "top"
556
+ },
557
+ {
558
+ "id": "b7c8d9e0f1a2b3c4",
559
+ "fromNode": "b1c2d3e4f5a6b7c8",
560
+ "fromSide": "bottom",
561
+ "toNode": "c2d3e4f5a6b7c8d9",
562
+ "toSide": "top"
563
+ },
564
+ {
565
+ "id": "c8d9e0f1a2b3c4d5",
566
+ "fromNode": "c2d3e4f5a6b7c8d9",
567
+ "fromSide": "right",
568
+ "toNode": "d3e4f5a6b7c8d9e0",
569
+ "toSide": "left",
570
+ "label": "Yes",
571
+ "color": "4"
572
+ },
573
+ {
574
+ "id": "d9e0f1a2b3c4d5e6",
575
+ "fromNode": "c2d3e4f5a6b7c8d9",
576
+ "fromSide": "left",
577
+ "toNode": "e4f5a6b7c8d9e0f1",
578
+ "toSide": "right",
579
+ "label": "No",
580
+ "color": "1"
581
+ },
582
+ {
583
+ "id": "e0f1a2b3c4d5e6f7",
584
+ "fromNode": "e4f5a6b7c8d9e0f1",
585
+ "fromSide": "top",
586
+ "fromEnd": "none",
587
+ "toNode": "b1c2d3e4f5a6b7c8",
588
+ "toSide": "left",
589
+ "toEnd": "arrow"
590
+ },
591
+ {
592
+ "id": "f1a2b3c4d5e6f7a8",
593
+ "fromNode": "d3e4f5a6b7c8d9e0",
594
+ "fromSide": "bottom",
595
+ "toNode": "f5a6b7c8d9e0f1a2",
596
+ "toSide": "top"
597
+ }
598
+ ]
599
+ }
600
+ ```
601
+
602
+ ## ID Generation
603
+
604
+ Node and edge IDs must be unique strings. Obsidian generates 16-character hexadecimal IDs:
605
+
606
+ ```json
607
+ "id": "6f0ad84f44ce9c17"
608
+ "id": "a3b2c1d0e9f8g7h6"
609
+ "id": "1234567890abcdef"
610
+ ```
611
+
612
+ This format is a 16-character lowercase hex string (64-bit random value).
613
+
614
+ ## Layout Guidelines
615
+
616
+ ### Positioning
617
+
618
+ - Coordinates can be negative (canvas extends infinitely)
619
+ - `x` increases to the right
620
+ - `y` increases downward
621
+ - Position refers to top-left corner of node
622
+
623
+ ### Recommended Sizes
624
+
625
+ | Node Type | Suggested Width | Suggested Height |
626
+ | ------------ | --------------- | ---------------- |
627
+ | Small text | 200-300 | 80-150 |
628
+ | Medium text | 300-450 | 150-300 |
629
+ | Large text | 400-600 | 300-500 |
630
+ | File preview | 300-500 | 200-400 |
631
+ | Link preview | 250-400 | 100-200 |
632
+ | Group | Varies | Varies |
633
+
634
+ ### Spacing
635
+
636
+ - Leave 20-50px padding inside groups
637
+ - Space nodes 50-100px apart for readability
638
+ - Align nodes to grid (multiples of 10 or 20) for cleaner layouts
639
+
640
+ ## Validation Rules
641
+
642
+ 1. All `id` values must be unique across nodes and edges
643
+ 2. `fromNode` and `toNode` must reference existing node IDs
644
+ 3. Required fields must be present for each node type
645
+ 4. `type` must be one of: `text`, `file`, `link`, `group`
646
+ 5. `backgroundStyle` must be one of: `cover`, `ratio`, `repeat`
647
+ 6. `fromSide`, `toSide` must be one of: `top`, `right`, `bottom`, `left`
648
+ 7. `fromEnd`, `toEnd` must be one of: `none`, `arrow`
649
+ 8. Color presets must be `"1"` through `"6"` or valid hex color
650
+
651
+ ## References
652
+
653
+ - [JSON Canvas Spec 1.0](https://jsoncanvas.org/spec/1.0/)
654
+ - [JSON Canvas GitHub](https://github.com/obsidianmd/jsoncanvas)