claude-canvas 1.0.0 → 1.0.4

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.
package/README.md ADDED
@@ -0,0 +1,611 @@
1
+ <p align="center">
2
+ <img src="docs/assets/claude_canvas_art_2.png" alt="claude-canvas" width="600" />
3
+ </p>
4
+
5
+ <h1 align="center">claude-canvas</h1>
6
+
7
+ <p align="center">
8
+ <strong>A visual canvas for Claude Code — instead of asking questions in the terminal, Claude can draw diagrams, wireframes, and mockups on a shared canvas and collect visual feedback from the user.</strong>
9
+ </p>
10
+
11
+ <p align="center">
12
+ <a href="https://www.npmjs.com/package/claude-canvas"><img src="https://img.shields.io/npm/v/claude-canvas?style=for-the-badge&logo=npm&logoColor=white&color=CB3837" alt="npm version" /></a>
13
+ <a href="https://github.com/uditalias/claude-canvas/blob/main/LICENSE"><img src="https://img.shields.io/github/license/uditalias/claude-canvas?style=for-the-badge&color=blue" alt="License" /></a>
14
+ <a href="https://nodejs.org"><img src="https://img.shields.io/badge/node-%3E%3D18-339933?style=for-the-badge&logo=node.js&logoColor=white" alt="Node.js" /></a>
15
+ <a href="https://www.typescriptlang.org"><img src="https://img.shields.io/badge/typescript-5.4-3178C6?style=for-the-badge&logo=typescript&logoColor=white" alt="TypeScript" /></a>
16
+ <a href="https://github.com/uditalias/claude-canvas/issues"><img src="https://img.shields.io/github/issues/uditalias/claude-canvas?style=for-the-badge&logo=github&color=orange" alt="Issues" /></a>
17
+ </p>
18
+
19
+ <p align="center">
20
+ <a href="#installation">Installation</a> &bull;
21
+ <a href="#quick-start">Quick Start</a> &bull;
22
+ <a href="#cli-reference">CLI Reference</a> &bull;
23
+ <a href="#visual-qa">Visual Q&A</a> &bull;
24
+ <a href="#interactive-canvas">Interactive Canvas</a> &bull;
25
+ <a href="#claude-code-skill">Claude Code Skill</a> &bull;
26
+ <a href="#architecture">Architecture</a>
27
+ </p>
28
+
29
+ ---
30
+
31
+ ## What is claude-canvas?
32
+
33
+ **claude-canvas** gives [Claude Code](https://claude.ai/code) a visual canvas. It runs a local server that opens a browser-based drawing surface where Claude can send draw commands (shapes, arrows, text, freehand paths) via CLI or HTTP API, and users can draw interactively too. Communication happens in real-time over WebSocket.
34
+
35
+ It also serves as a **visual Q&A tool** — Claude can send structured questions alongside canvas drawings, and users answer by picking options, typing text, or drawing directly on the canvas.
36
+
37
+ <p align="center">
38
+ <img src="docs/screenshots/ui-drawing.png" alt="claude-canvas UI — architecture diagram with toolbar and canvas" width="700" />
39
+ </p>
40
+
41
+ ### Key Features
42
+
43
+ - **Sketchy hand-drawn aesthetic** — powered by [Rough.js](https://roughjs.com), all shapes render with a natural, whiteboard feel
44
+ - **Bidirectional drawing** — Claude draws via CLI/API, users draw interactively in the browser
45
+ - **Visual Q&A system** — ask structured questions with per-question canvas drawings, collect answers programmatically
46
+ - **Multiple fill styles** — hachure, solid, zigzag, cross-hatch, dots, dashed, and wireframe outlines
47
+ - **Session management** — run multiple isolated canvas sessions simultaneously
48
+ - **Real-time sync** — WebSocket-powered instant updates between CLI and browser
49
+ - **Export options** — save as PNG, SVG, or JSON
50
+ - **Claude Code skill** — install the skill so Claude automatically knows when and how to use the canvas
51
+
52
+ <p align="center">
53
+ <img src="docs/screenshots/fill-styles.png" alt="Fill styles gallery — hachure, solid, zigzag, cross-hatch, dots" width="700" />
54
+ </p>
55
+
56
+ ### How It Works
57
+
58
+ 1. **`claude-canvas start`** launches a local Express + WebSocket server and opens a browser tab
59
+ 2. **Claude Code** sends draw commands and questions via the CLI (which hits the HTTP API)
60
+ 3. The **server broadcasts** commands to the browser over WebSocket in real-time
61
+ 4. **Users interact** directly on the canvas — drawing, answering questions, or annotating Claude's work
62
+ 5. **`claude-canvas screenshot`** captures the canvas state and returns answers to any pending questions
63
+
64
+ ---
65
+
66
+ ## Installation
67
+
68
+ ### Via npm (recommended)
69
+
70
+ ```bash
71
+ npm install -g claude-canvas
72
+ claude-canvas setup
73
+ ```
74
+
75
+ The `setup` command installs the Claude Code skill, which lets Claude automatically use the canvas when it makes sense.
76
+
77
+ ### Updating
78
+
79
+ ```bash
80
+ claude-canvas update
81
+ ```
82
+
83
+ This checks for the latest version, installs it, and automatically updates the Claude Code skill if it has changed.
84
+
85
+ ### From source
86
+
87
+ ```bash
88
+ git clone https://github.com/uditalias/claude-canvas.git
89
+ cd claude-canvas
90
+ npm install
91
+ npm run build
92
+ npm link # makes `claude-canvas` available globally
93
+ claude-canvas setup
94
+ ```
95
+
96
+ ### Requirements
97
+
98
+ - **Node.js** >= 18
99
+ - A modern browser (Chrome, Firefox, Safari, Edge)
100
+
101
+ ---
102
+
103
+ ## Quick Start
104
+
105
+ **1. Start a canvas session:**
106
+
107
+ ```bash
108
+ claude-canvas start
109
+ ```
110
+
111
+ This opens a browser tab with a fresh canvas and returns session info:
112
+
113
+ ```json
114
+ {"sessionId": "a1b2c3d4", "port": 7890, "url": "http://127.0.0.1:7890", "pid": 1234}
115
+ ```
116
+
117
+ **2. Draw something:**
118
+
119
+ ```bash
120
+ claude-canvas draw '{"commands": [
121
+ {"type": "rect", "x": 50, "y": 50, "width": 200, "height": 100, "label": "Frontend"},
122
+ {"type": "rect", "x": 350, "y": 50, "width": 200, "height": 100, "label": "Backend"},
123
+ {"type": "arrow", "x1": 250, "y1": 100, "x2": 350, "y2": 100, "label": "API"}
124
+ ]}'
125
+ ```
126
+
127
+ **3. Take a screenshot:**
128
+
129
+ ```bash
130
+ claude-canvas screenshot
131
+ ```
132
+
133
+ ```json
134
+ {"ok": true, "path": "/tmp/claude-canvas/canvas-123.png", "answers": []}
135
+ ```
136
+
137
+ **4. Stop the session when done:**
138
+
139
+ ```bash
140
+ claude-canvas stop --all
141
+ ```
142
+
143
+ ---
144
+
145
+ ## CLI Reference
146
+
147
+ All commands accept `-s, --session <id>`. You can omit it when only one session is running.
148
+
149
+ ### Session Management
150
+
151
+ | Command | Description |
152
+ |---------|-------------|
153
+ | `claude-canvas start` | Start a new canvas session (opens browser) |
154
+ | `claude-canvas start -p 8080` | Start on a specific port |
155
+ | `claude-canvas stop -s <id>` | Stop a specific session |
156
+ | `claude-canvas stop --all` | Stop all running sessions |
157
+
158
+ ### Drawing
159
+
160
+ ```bash
161
+ # Send draw commands as JSON
162
+ claude-canvas draw '{"commands": [...]}'
163
+
164
+ # Read from stdin (useful for large payloads)
165
+ echo '{"commands": [...]}' | claude-canvas draw -
166
+
167
+ # Render instantly without animation
168
+ claude-canvas draw --no-animate '{"commands": [...]}'
169
+ ```
170
+
171
+ ### Canvas Operations
172
+
173
+ | Command | Description |
174
+ |---------|-------------|
175
+ | `claude-canvas clear` | Clear all objects from the canvas |
176
+ | `claude-canvas clear --layer claude` | Clear only Claude's objects (keep user drawings) |
177
+ | `claude-canvas screenshot` | Capture canvas as PNG and collect Q&A answers |
178
+ | `claude-canvas export -f png` | Export as PNG |
179
+ | `claude-canvas export -f svg` | Export as SVG |
180
+ | `claude-canvas export -f json` | Export as JSON |
181
+ | `claude-canvas export -f png --labels` | Export with shape labels included |
182
+
183
+ <details>
184
+ <summary><strong>DrawCommand Types</strong> (click to expand)</summary>
185
+
186
+ #### Shapes
187
+
188
+ All support optional `label`, `color`, `opacity`, and `fillStyle`:
189
+
190
+ ```jsonc
191
+ // Rectangle
192
+ {"type": "rect", "x": 50, "y": 50, "width": 200, "height": 120, "label": "Header"}
193
+
194
+ // Circle
195
+ {"type": "circle", "x": 200, "y": 200, "radius": 60, "label": "Node"}
196
+
197
+ // Ellipse
198
+ {"type": "ellipse", "x": 300, "y": 150, "width": 180, "height": 100}
199
+ ```
200
+
201
+ #### Lines and Arrows
202
+
203
+ ```jsonc
204
+ // Line
205
+ {"type": "line", "x1": 100, "y1": 100, "x2": 300, "y2": 100}
206
+
207
+ // Arrow (with directional head)
208
+ {"type": "arrow", "x1": 100, "y1": 200, "x2": 300, "y2": 200, "label": "flow"}
209
+ ```
210
+
211
+ #### Text
212
+
213
+ ```jsonc
214
+ // textAlign: "left" | "center" | "right"
215
+ {"type": "text", "x": 200, "y": 50, "content": "Title", "fontSize": 24, "textAlign": "center"}
216
+ ```
217
+
218
+ #### Freehand
219
+
220
+ ```jsonc
221
+ {"type": "freehand", "points": [[10, 10], [50, 30], [90, 10], [130, 30]]}
222
+ ```
223
+
224
+ #### Groups and Connectors
225
+
226
+ For structured flowcharts:
227
+
228
+ ```jsonc
229
+ // Group: bundle shapes under an ID for connectors
230
+ {"type": "group", "id": "box-a", "commands": [
231
+ {"type": "rect", "x": 200, "y": 30, "width": 140, "height": 60},
232
+ {"type": "text", "x": 270, "y": 50, "content": "Start", "textAlign": "center"}
233
+ ]}
234
+
235
+ // Connector: auto-routes between group edges
236
+ {"type": "connector", "from": "box-a", "to": "box-b", "label": "next"}
237
+ ```
238
+
239
+ </details>
240
+
241
+ ### Fill Styles
242
+
243
+ Shapes default to `"hachure"`. Set `fillStyle` on any shape:
244
+
245
+ | Style | Description |
246
+ |-------|-------------|
247
+ | `hachure` | Hand-drawn diagonal lines (default) |
248
+ | `solid` | Solid fill |
249
+ | `zigzag` | Zigzag pattern |
250
+ | `cross-hatch` | Cross-hatched lines |
251
+ | `dots` | Dotted pattern |
252
+ | `dashed` | Dashed lines |
253
+ | `zigzag-line` | Zigzag line pattern |
254
+ | `none` | No fill (wireframe outline only) |
255
+
256
+ ---
257
+
258
+ ## Visual Q&A
259
+
260
+ The Q&A system lets Claude send structured questions with visual context. A floating panel appears in the browser where users can answer by clicking options, typing text, or drawing.
261
+
262
+ <p align="center">
263
+ <img src="docs/screenshots/ui-ask.png" alt="Visual Q&A — question panel with layout options" width="700" />
264
+ </p>
265
+
266
+ Users select answers via interactive pill buttons. Selected answers are highlighted:
267
+
268
+ <p align="center">
269
+ <img src="docs/screenshots/ui-ask-answered.png" alt="Visual Q&A — answer selected" width="700" />
270
+ </p>
271
+
272
+ ### Sending Questions
273
+
274
+ ```bash
275
+ claude-canvas ask '{"questions": [
276
+ {
277
+ "id": "q1",
278
+ "text": "Which layout do you prefer?",
279
+ "type": "single",
280
+ "options": ["Layout A", "Layout B", "Layout C"],
281
+ "commands": [
282
+ {"type": "rect", "x": 80, "y": 80, "width": 200, "height": 150, "label": "Layout A"},
283
+ {"type": "rect", "x": 350, "y": 80, "width": 200, "height": 150, "label": "Layout B"}
284
+ ]
285
+ },
286
+ {
287
+ "id": "q2",
288
+ "text": "What should the title be?",
289
+ "type": "text"
290
+ }
291
+ ]}'
292
+ ```
293
+
294
+ ### Question Types
295
+
296
+ | Type | Description | User interaction | Answer format |
297
+ |------|------------|------------------|---------------|
298
+ | `single` | Pick one option | Radio-style pill buttons | `"value": "Option A"` |
299
+ | `multi` | Pick multiple options | Toggle pill buttons | `"value": ["Option A", "Option C"]` |
300
+ | `text` | Free text input | Text field | `"value": "user's text"` |
301
+ | `canvas` | Draw on canvas | Freeform drawing | `"value": "see canvas"` + snapshot PNG |
302
+
303
+ ### Collecting Answers
304
+
305
+ After sending questions, call `screenshot` to retrieve answers:
306
+
307
+ ```bash
308
+ claude-canvas screenshot
309
+ ```
310
+
311
+ ```json
312
+ {
313
+ "ok": true,
314
+ "path": "/tmp/claude-canvas/canvas-123.png",
315
+ "answers": [
316
+ {"questionId": "q1", "value": "Layout A"},
317
+ {"questionId": "q2", "value": "My Custom Title"}
318
+ ]
319
+ }
320
+ ```
321
+
322
+ For `canvas`-type questions, Claude draws a diagram and the user responds by drawing directly on the canvas. The answer includes a snapshot of what the user drew:
323
+
324
+ <p align="center">
325
+ <img src="docs/screenshots/ui-canvas-answer.png" alt="Canvas Q&A — Claude draws a wireframe, user annotates with freehand drawings" width="700" />
326
+ </p>
327
+
328
+ ```json
329
+ {"questionId": "q3", "value": "see canvas", "canvasSnapshot": "/tmp/claude-canvas/canvas-q3-456.png"}
330
+ ```
331
+
332
+ ---
333
+
334
+ ## Interactive Canvas
335
+
336
+ The browser canvas is a full interactive drawing surface, not just a display. Users can draw alongside Claude's shapes in real-time.
337
+
338
+ ### Drawing Tools
339
+
340
+ The toolbar provides these drawing tools:
341
+
342
+ | Tool | Description |
343
+ |------|-------------|
344
+ | Rectangle | Draw rectangles with optional fill |
345
+ | Circle | Draw circles |
346
+ | Line | Draw straight lines |
347
+ | Arrow | Draw directional arrows |
348
+ | Freehand | Freeform pencil drawing |
349
+ | Text | Click to place text |
350
+ | Paint | Brush painting with adjustable size |
351
+
352
+ ### Canvas Features
353
+
354
+ - **Zoom & Pan** — scroll to zoom, drag to pan the canvas
355
+ - **Undo/Redo** — full history support (up to 50 states)
356
+ - **Snap Guides** — alignment guides appear when moving objects near other objects
357
+ - **Context Menu** — right-click any shape to change color, fill, opacity, label, lock, or layer order
358
+ - **Color Palette** — soft muted color presets with custom color picker
359
+ - **Brush Size** — adjustable size for paint and freehand tools
360
+ - **Dark Mode** — respects system theme preference
361
+ - **Keyboard Shortcuts** — quick tool switching via keyboard
362
+
363
+ ### Layer System
364
+
365
+ Objects have a layer property:
366
+ - **`user`** — shapes drawn interactively in the browser
367
+ - **`claude`** — shapes drawn via the CLI/API
368
+
369
+ Use `claude-canvas clear --layer claude` to remove Claude's drawings without affecting user drawings.
370
+
371
+ ---
372
+
373
+ ## Claude Code Skill
374
+
375
+ Install the included skill so Claude Code automatically knows when and how to use the canvas.
376
+
377
+ ### Installation
378
+
379
+ ```bash
380
+ claude-canvas setup
381
+ ```
382
+
383
+ This interactively installs (or updates) the skill to `~/.claude/skills/claude-canvas/`. You can also install it manually:
384
+
385
+ ```bash
386
+ cp -r $(npm root -g)/claude-canvas/src/skill/claude-canvas ~/.claude/skills/
387
+ ```
388
+
389
+ ### What the Skill Does
390
+
391
+ Once installed, Claude Code will automatically use the canvas when it makes sense — for example:
392
+
393
+ - Drawing architecture diagrams during system design discussions
394
+ - Sketching UI wireframes when discussing layouts
395
+ - Creating flowcharts to explain processes
396
+ - Presenting visual options and asking for your preference via Q&A
397
+
398
+ You don't need to explicitly tell Claude to use the canvas. The skill teaches Claude when the canvas is the right tool for the job.
399
+
400
+ ---
401
+
402
+ ## Architecture
403
+
404
+ ```
405
+ ┌─────────────────┐
406
+ │ Claude Code │
407
+ │ (CLI / Skill) │
408
+ └────────┬────────┘
409
+ │ HTTP API
410
+ ┌────────▼────────┐
411
+ │ Express Server │
412
+ │ + WebSocket │
413
+ └────────┬────────┘
414
+ │ WebSocket
415
+ ┌────────▼────────┐
416
+ │ Browser Canvas │
417
+ │ React + Fabric │
418
+ └─────────────────┘
419
+ ```
420
+
421
+ <p align="center">
422
+ <img src="docs/screenshots/architecture-diagram.png" alt="Architecture diagram drawn on claude-canvas" width="700" />
423
+ </p>
424
+
425
+ <details>
426
+ <summary><strong>Project Structure</strong> (click to expand)</summary>
427
+
428
+ ```
429
+ src/
430
+ ├── bin/claude-canvas.ts # CLI entry point (Commander)
431
+ ├── server/
432
+ │ ├── router.ts # REST API endpoints
433
+ │ ├── websocket.ts # WebSocket server
434
+ │ ├── state.ts # In-memory state & broadcast
435
+ │ └── process.ts # Session management (PID/port)
436
+ ├── client/
437
+ │ ├── components/
438
+ │ │ ├── Canvas.tsx # Main canvas view
439
+ │ │ ├── Toolbox.tsx # Drawing toolbar
440
+ │ │ ├── QuestionPanel.tsx # Q&A floating panel
441
+ │ │ ├── Hud.tsx # Connection status & zoom
442
+ │ │ └── ContextMenu.tsx # Right-click context menu
443
+ │ ├── hooks/
444
+ │ │ ├── useCanvas.ts # Fabric.js canvas + rough.js rendering
445
+ │ │ ├── useDrawingTools.ts# Interactive drawing tools
446
+ │ │ ├── useWebSocket.ts # WS connection + auto-reconnect
447
+ │ │ ├── useToolState.ts # Tool selection + shortcuts
448
+ │ │ ├── useUndoRedo.ts # Canvas history (50 states)
449
+ │ │ ├── useSnapGuides.ts # Alignment snap guides
450
+ │ │ └── useQuestionPanel.ts# Q&A state management
451
+ │ └── lib/
452
+ │ └── rough-line.ts # Custom Fabric objects for rough.js
453
+ ├── protocol/
454
+ │ └── types.ts # Shared types (DrawCommand, WsMessage, etc.)
455
+ └── skill/
456
+ └── claude-canvas.md # Claude Code skill definition
457
+ ```
458
+
459
+ </details>
460
+
461
+ ---
462
+
463
+ ## Development
464
+
465
+ ```bash
466
+ # Clone the repository
467
+ git clone https://github.com/uditalias/claude-canvas.git
468
+ cd claude-canvas
469
+ npm install
470
+
471
+ # Run in development mode (server with hot reload)
472
+ npm run dev
473
+
474
+ # Run client only (Vite dev server on :5173, proxies to :7890)
475
+ npm run dev:client
476
+
477
+ # Build everything
478
+ npm run build
479
+
480
+ # Run unit tests
481
+ npm test
482
+
483
+ # Run E2E tests (requires build first)
484
+ npm run build && npx playwright test
485
+ ```
486
+
487
+ ---
488
+
489
+ ## Examples
490
+
491
+ <details>
492
+ <summary><strong>Architecture Diagram</strong></summary>
493
+
494
+ ```bash
495
+ claude-canvas draw '{"commands": [
496
+ {"type": "text", "x": 400, "y": 40, "content": "System Architecture", "fontSize": 28, "textAlign": "center"},
497
+ {"type": "rect", "x": 50, "y": 100, "width": 180, "height": 80, "label": "Client App", "fillStyle": "hachure"},
498
+ {"type": "rect", "x": 310, "y": 100, "width": 180, "height": 80, "label": "API Gateway", "fillStyle": "solid"},
499
+ {"type": "rect", "x": 570, "y": 100, "width": 180, "height": 80, "label": "Database", "fillStyle": "dots"},
500
+ {"type": "arrow", "x1": 230, "y1": 140, "x2": 310, "y2": 140, "label": "REST"},
501
+ {"type": "arrow", "x1": 490, "y1": 140, "x2": 570, "y2": 140, "label": "SQL"}
502
+ ]}'
503
+ ```
504
+
505
+ </details>
506
+
507
+ <details>
508
+ <summary><strong>Wireframe Layout</strong></summary>
509
+
510
+ ```bash
511
+ claude-canvas draw '{"commands": [
512
+ {"type": "rect", "x": 50, "y": 30, "width": 500, "height": 60, "label": "Navigation", "fillStyle": "none"},
513
+ {"type": "rect", "x": 50, "y": 110, "width": 150, "height": 300, "label": "Sidebar", "fillStyle": "none"},
514
+ {"type": "rect", "x": 220, "y": 110, "width": 330, "height": 300, "label": "Main Content", "fillStyle": "none"}
515
+ ]}'
516
+ ```
517
+
518
+ </details>
519
+
520
+ <details>
521
+ <summary><strong>Flowchart with Connectors</strong></summary>
522
+
523
+ ```bash
524
+ claude-canvas draw '{"commands": [
525
+ {"type": "group", "id": "start", "commands": [
526
+ {"type": "rect", "x": 200, "y": 30, "width": 140, "height": 60},
527
+ {"type": "text", "x": 270, "y": 50, "content": "Start", "textAlign": "center"}
528
+ ]},
529
+ {"type": "group", "id": "process", "commands": [
530
+ {"type": "rect", "x": 200, "y": 150, "width": 140, "height": 60},
531
+ {"type": "text", "x": 270, "y": 170, "content": "Process", "textAlign": "center"}
532
+ ]},
533
+ {"type": "group", "id": "end", "commands": [
534
+ {"type": "rect", "x": 200, "y": 270, "width": 140, "height": 60},
535
+ {"type": "text", "x": 270, "y": 290, "content": "End", "textAlign": "center"}
536
+ ]},
537
+ {"type": "connector", "from": "start", "to": "process"},
538
+ {"type": "connector", "from": "process", "to": "end"}
539
+ ]}'
540
+ ```
541
+
542
+ </details>
543
+
544
+ <details>
545
+ <summary><strong>Visual Decision Making (Q&A)</strong></summary>
546
+
547
+ ```bash
548
+ claude-canvas ask '{"questions": [
549
+ {
550
+ "id": "theme",
551
+ "text": "Which color theme should we use?",
552
+ "type": "single",
553
+ "options": ["Blue Ocean", "Forest Green", "Sunset Purple"],
554
+ "commands": [
555
+ {"type": "circle", "x": 150, "y": 150, "radius": 50, "label": "Blue", "fillStyle": "solid"},
556
+ {"type": "circle", "x": 350, "y": 150, "radius": 50, "label": "Green", "fillStyle": "solid"},
557
+ {"type": "circle", "x": 550, "y": 150, "radius": 50, "label": "Purple", "fillStyle": "solid"}
558
+ ]
559
+ },
560
+ {
561
+ "id": "name",
562
+ "text": "What should we name this feature?",
563
+ "type": "text"
564
+ },
565
+ {
566
+ "id": "features",
567
+ "text": "Which features should we include?",
568
+ "type": "multi",
569
+ "options": ["Dark mode", "Animations", "Keyboard shortcuts", "Mobile support"]
570
+ }
571
+ ]}'
572
+ ```
573
+
574
+ </details>
575
+
576
+ ---
577
+
578
+ ## Tips
579
+
580
+ - The visible canvas area is roughly **1200 x 800 pixels** — place shapes within this range
581
+ - Use `label` on shapes for clarity — labels float above shapes as text overlays
582
+ - Use `textAlign: "center"` with text inside groups to center text within boxes
583
+ - For groups, place the text `x` at the center of the rect (`rect.x + rect.width / 2`)
584
+ - After drawing, call `screenshot` to capture and verify what the user sees
585
+ - Use `clear --layer claude` to remove Claude's drawings without erasing user drawings
586
+ - Connectors automatically route between group edges — just specify `from` and `to` group IDs
587
+ - Pass `color` as a hex string for custom colors: `"color": "#D4726A"`
588
+
589
+ ---
590
+
591
+ ## Contributing
592
+
593
+ Contributions are welcome! Please feel free to submit a [Pull Request](https://github.com/uditalias/claude-canvas/pulls).
594
+
595
+ 1. Fork the repository
596
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
597
+ 3. Commit your changes (`git commit -m 'Add amazing feature'`)
598
+ 4. Push to the branch (`git push origin feature/amazing-feature`)
599
+ 5. Open a Pull Request
600
+
601
+ ---
602
+
603
+ ## License
604
+
605
+ This project is licensed under the MIT License — see the [LICENSE](LICENSE) file for details.
606
+
607
+ ---
608
+
609
+ <p align="center">
610
+ Built with &#10024; by <a href="https://github.com/uditalias">Udi Talias</a>
611
+ </p>