Diagram
Use when the user asks to create, draw, or generate a diagram, flowchart, architecture diagram, system diagram, or any visual representation. Trigger on phrases like "draw a diagram", "create a flowchart", "visualize the architecture", "make a diagram of", "sketch this out". Also trigger when the user provides a description and wants it turned into a visual hand-drawn diagram.From its SKILL.md
npx -y skills add priyanshujain/skrawl --skill diagramAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.0 KB, as published. Nobody here has run it
Diagram Generation Skill
You generate Excalidraw-format JSON diagrams and render them to PNG using skrawl.
How to generate a diagram
- Analyze what the user wants to visualize
- Plan the layout: identify boxes, labels, connections, and their spatial arrangement
- Build valid Excalidraw JSON with these element types:
rectangle— for boxes/containers (usebackgroundColorfor color,roundness: { "type": 3 }for rounded corners)text— for labels (usecontainerIdto put text inside a shape, setverticalAlign: "middle",textAlign: "center")arrow— for connections (usepointsarray of[dx, dy]offsets,startArrowhead/endArrowhead: "arrow"for direction)ellipse— for circular nodesdiamond— for decision nodesline— for non-directional connections
- Render directly to PNG in a single Bash command by piping the JSON through stdin. NEVER create intermediate
.excalidrawfiles. The only file created should be the final output image.
npx skrawl --stdin -o <output>.png <<'EXCALIDRAW'
{ "type": "excalidraw", "version": 2, "elements": [...], "appState": { "viewBackgroundColor": "#ffffff" }, "files": {} }
EXCALIDRAW
Excalidraw JSON template
{
"type": "excalidraw",
"version": 2,
"elements": [],
"appState": { "viewBackgroundColor": "#ffffff" },
"files": {}
}
Element template — Rectangle with text inside
[
{
"id": "box-1",
"type": "rectangle",
"x": 100, "y": 100,
"width": 160, "height": 70,
"strokeColor": "#1e1e1e",
"backgroundColor": "#a5d8ff",
"fillStyle": "solid",
"strokeWidth": 2,
"roughness": 1,
"opacity": 100,
"roundness": { "type": 3 },
"seed": 42,
"version": 1,
"isDeleted": false,
"boundElements": [{ "id": "text-1", "type": "text" }]
},
{
"id": "text-1",
"type": "text",
"x": 130, "y": 120,
"width": 100, "height": 30,
"strokeColor": "#1e1e1e",
"text": "My Label",
"fontSize": 24,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "middle",
"containerId": "box-1",
"originalText": "My Label",
"roughness": 1,
"seed": 43,
"version": 1,
"isDeleted": false
}
]
Element template — Arrow
{
"id": "arrow-1",
"type": "arrow",
"x": 260, "y": 135,
"width": 100, "height": 0,
"strokeColor": "#1e1e1e",
"strokeWidth": 2,
"roughness": 1,
"seed": 44,
"version": 1,
"isDeleted": false,
"points": [[0, 0], [100, 0]],
"startArrowhead": null,
"endArrowhead": "arrow"
}
Color palette (Excalidraw defaults)
- Pink/rose:
#ffc9c9 - Light blue:
#a5d8ff - Light green:
#b2f2bb - Yellow:
#ffec99,#fff3bf - Orange:
#ffd8a8 - Lavender:
#d0bfff - Beige:
#f0e0e0 - Blue border:
#1971c2 - Default stroke:
#1e1e1e
Layout guidelines
- Standard box: 160x70 for short labels, wider for long text
- Spacing: ~100px between connected elements
- Use consistent Y coordinates for horizontal alignment
- Use consistent X coordinates for vertical alignment
- Arrows: set
pointsrelative to arrow'sx,yposition - For bidirectional: use
startArrowhead: "arrow"ANDendArrowhead: "arrow" - For two separate curved arrows (loop), offset Y positions slightly
Rendering
Render directly by piping JSON through stdin — never create intermediate .excalidraw files:
npx skrawl --stdin -o diagram.png <<'EXCALIDRAW'
{ "type": "excalidraw", "version": 2, "elements": [...], "appState": { "viewBackgroundColor": "#ffffff" }, "files": {} }
EXCALIDRAW
Options: --scale 3 for higher resolution, --dark for dark mode, -f svg for SVG output.