원클릭으로
draw
// Create YuzuDraw diagrams by choosing the right family and following a short reference for architecture, components, flow, bar charts, or ASCII art
// Create YuzuDraw diagrams by choosing the right family and following a short reference for architecture, components, flow, bar charts, or ASCII art
| name | draw |
| description | Create YuzuDraw diagrams by choosing the right family and following a short reference for architecture, components, flow, bar charts, or ASCII art |
| user_invocable | true |
Use this as the single entrypoint for diagram work. Select one family, open the matching reference, then write DSL.
references/.--dsl-stdin (see CLI Invocation Rules below). Every command MUST start with yuzudraw-cli — never use pipes, cat, or echo.create-diagram or update-diagram). Always prompt — don't assume they only wanted a preview.If a yuzudraw-cli command fails with "command not found", ask the user to install it with curl -fsSL https://www.yuzudraw.com/install.sh | sh, then retry.
Every CLI call MUST start with yuzudraw-cli so it can be allowlisted. Pass DSL inline via heredoc — no temp files, no pipes, no cat/echo.
yuzudraw-cli render-ascii --dsl-stdin <<'EOF'
rect "hello" id box at 5,5 size 10x3
EOF
yuzudraw-cli create-diagram --name <name> --dsl-stdin <<'EOF'
...DSL...
EOF
yuzudraw-cli update-diagram --name <name> --dsl-stdin <<'EOF'
...DSL...
EOF
Do NOT use pipes (cat file | yuzudraw-cli), --dsl-file, or any command that does not start with yuzudraw-cli.
Open architecture.md when the request is about:
Open components.md when the request is about:
Open flow.md when the request is about:
Open bar-chart.md when the request is about:
Open ascii-art.md when the request is about:
If the user explicitly names a family, use it instead of re-classifying.
Choose one dominant family:
col 2-4 and row 1-2 unless the prompt or composition needs a different origin.style double or style heavy make diagrams far more readable than flat layouts. When in doubt, group.pencil sparingly unless the selected reference calls for it.This section is a design target for upcoming DSL work. Do not assume the parser supports it yet unless the codebase has been updated to do so.
group "Payments" id payments at 72,2
rect "API" id api at 0,0
rect "DB" id db below api gap 2
Rules:
group stays non-rendering; use rect for visible boundariesgroup ... at ... defines a local origin for all nested shapes and child groupsPreferred future composition command:
yuzudraw-cli merge-diagram --name system --at 72,2 --dsl-stdin <<'EOF'
group "Payments" id payments at 0,0
rect "API" id api at 0,0
rect "DB" id db below api gap 2
EOF
Intent:
update-diagram keeps full-replacement semanticsmerge-diagram appends a new subsystem snippet into an existing documentFull rationale: group-origin-dsl-vnext.md
The sections below describe the current DSL. The scoped-group syntax above is proposed, not current, unless parser and CLI support have been added.
layer “Layer Name” visible|hidden [locked]
[group “Group Name”]
<shapes...>
rect)rect “Label” [id NAME] [at col,row] [size WxH] [POSITION] [PROPERTIES...]
Also accepts rectangle and box as aliases.
Positioning (pick one):
at col,row — absolute positionat REF.SIDE+colOffset,rowOffset — reference coordinates (see below)right-of REF [gap N] — to the right of another rect (default gap: 4)below REF [gap N] — below another rect (default gap: 2)left-of REF [gap N] — to the left (accounts for self width)above REF [gap N] — above (accounts for self height)0,0Auto-sizing (when size is omitted):
width = max(longestLine + 4, 10)height = lineCount + 2\n for multiline labelsProperties (all optional, defaults shown):
| Property | Default | Syntax |
|---|---|---|
| style | single | style single|double|rounded|heavy |
| fill | transparent | fill solid char “x” |
| border | visible | noborder to hide |
| borders | all | borders top,bottom,left,right |
| line | solid | line dashed dash N gap N |
| halign | center | halign left|center|right |
| valign | middle | valign top|middle|bottom |
| textOnBorder | false | textOnBorder (bare flag = true) |
| padding | 0,0,0,0 | padding L,R,T,B |
| shadow | none | shadow light|medium|dark|full x N y N |
| borderColor | none | borderColor #RRGGBB |
| fillColor | none | fillColor #RRGGBB |
| textColor | none | textColor #RRGGBB |
| float | false | float |
arrow from ENDPOINT to ENDPOINT [style single|double|heavy] [label “text”] [strokeColor #RRGGBB] [labelColor #RRGGBB] [float]
Endpoint formats:
”Label”.side — named attachment (side: left, right, top, bottom)”Label” — auto-infers side from relative positioncol,row — absolute coordinatesID.side or bare ID — reference by element IDArrow style defaults to single (omitted in serialized output).
text “content” at col,row [textColor #RRGGBB]
Use \n for newlines. Supports reference coordinates in at.
pencil at col,row cells [col,row,”char”;col,row,”char”,#color;...]
Freeform characters at relative offsets. Supports reference coordinates in at.
Optional id keyword for naming elements:
rect “Server” id srv1 at 0,0 size 14x3
rect “Server” id srv2 at 20,0 size 14x3
Rules:
[a-zA-Z_][a-zA-Z0-9_]* (no keywords like at, size, style, etc.)at srv1.right+4,0at “Server”.right+4,0Position any element relative to a rect's edges:
at REF.SIDE+colOffset,rowOffset
Edge reference points:
.right → (ref.col + ref.width, ref.row).bottom → (ref.col, ref.row + ref.height).left → (ref.col, ref.row) (same as origin, for readability).top → (ref.col, ref.row) (same as origin, for readability)Offset can be omitted (defaults to +0,0):
text “→” at “A”.right
rect “B” at “A”.right+4,0
Origin reference (no .side):
rect “E” at “A”+16,0
Negative offsets:
rect “F” at “A”.right-4,0
rect “G” at “A”.bottom+0,-2
When arrow endpoints are bare references (no .side), sides are auto-inferred:
arrow from “A” to “B” # auto-picks sides
arrow from “A”.right to “B”.left # explicit sides
Algorithm: compare center points. Dominant axis wins (larger absolute delta). Each endpoint uses the side facing the other rect. Tied → prefer horizontal.
Properties at default values are omitted from serialized output:
| Property | Default | Omitted when |
|---|---|---|
style | single | strokeStyle == .single |
fill | transparent | fillMode == .transparent |
border | visible | hasBorder == true |
halign | center | textHorizontalAlignment == .center |
valign | middle | textVerticalAlignment == .middle |
textOnBorder | false | allowTextOnBorder == false |
padding | 0,0,0,0 | all zeros |
arrow style | single | strokeStyle == .single |