This Skill guides Agent to generate
standard Excalidraw diagram files (
JSON), which can be directly opened and further edited in environments integrated with
Excalidraw such as browsers, Obsidian, VSCode, etc.
Please guide users to provide information as much as possible according to the following structure (Chinese is acceptable):
[Diagram Type]: System Architecture Diagram / Flowchart / Data Structure Diagram / Free Sketch
[Content Source]: Free description / paper outline / code structure / interface list, etc.
[Core Elements]:
If the user only provides natural language description, the Agent needs to first sort out the "node list + relationship list" internally before drawing.
-
Parse input and build abstract model
- Extract all nodes: Assign unique id, name and type to each module/entity/step.
- Extract all relationships: source, target, optional label (call method, data flow direction, etc.).
- Determine layer information: According to the diagram type and user's layout preference, classify nodes into different layers (e.g. "user layer / frontend layer / service layer / data layer").
-
Simple layout strategy (coordinate allocation)
- Do not pursue complex automatic typesetting, only need to give a "reasonable and readable" initial position:
- System architecture diagram: Arranged in three or more layers from top to bottom, nodes of the same layer are on a horizontal line.
- Flowchart: Arranged vertically or horizontally in the order of steps, connected in series with arrows.
- Data structure diagram: Take the core entity as the center, related entities surround it, and keep the connections from obvious crossing.
- Roughly set coordinates, for example: y of the same layer is fixed, x increases according to the index; y of different layers increases according to the layer spacing.
-
Excalidraw element generation convention (including default arrows and color matching)
-
Node elements (default style):
- Use or to represent modules/entities/steps.
- Each node consists of a graphic element + a text element (the text is roughly centered and superimposed on the rectangle).
- Default color matching convention (if not specified by the user):
- Input / output: white background with black border (
backgroundColor: "transparent"
, ).
- Computing module / middle layer (such as Encoder / Decoder / FFN, etc.): light color background + black stroke (e.g.
backgroundColor: "#f5f5ff"
or similar), modules of the same type have the same color.
- Large grouping frame (such as "Encoder Stack", "Decoder Stack"): rounded rectangle, white background with black border, mark the title with text at the top of the frame.
- You can use to group nodes under the same subsystem into the same group, which is convenient for users to move as a whole later.
-
Connection elements (default arrows):
- Use to connect related nodes, are straight or slightly folded from the start point to the end point.
- Default direction: Point from the "data flow/call initiator" to the "receiver", for example Input → Embedding → Encoder → Decoder → Output.
- Core main processes use thicker black arrows (slightly larger ), and auxiliary relationships can use thin lines or light colors.
- If necessary, you can add short text elements to mark the meaning of the connection (such as "call", "write", "Attention", etc.).
-
Overall style:
- Rely on Excalidraw's hand-drawn rendering style, no need to manually simulate jitter.
- Control the number of elements, prioritize keeping the structure clear rather than filling with details; for structures like Transformer, it is recommended to only draw the main blocks and main arrows.
-
Excalidraw file structure requirements
- The top layer should conform to Excalidraw's official JSON structure, including at least:
- and (can be marked as
"cursor-skill-excalidraw-diagram"
)
- : diagram element array
- and (if there are no pictures, etc., a reasonable default empty structure can be given)
- All element ids must be unique, it is recommended to use a simple prefix + incrementing number or UUID style string.
-
Part 1 [Diagram Explanation]:
- Briefly explain the hierarchical structure of the diagram, the meaning of various nodes and the main connection relationships in Chinese (about 1-2 paragraphs).
- If there are reasonable supplements or abstractions to the user's input, also explain here to facilitate user proofreading.
-
Part 2 [Excalidraw JSON]:
- Output a complete JSON that can be directly saved as a file.
- Only output the JSON content itself, do not add comments, Markdown code block markers or additional explanatory text.
- Ensure that the JSON syntax is correct, there are no extra commas, and it can be parsed normally by Excalidraw.