Generate an Excalidraw JSON diagram based on $ARGUMENTS .
Steps
-
Read $SKILL_DIR/references/EXCALIDRAW_GUIDE.md for component structures, layout rules, and patterns.
-
Analyze the arrow paths based on $ARGUMENTS and identify crossing risks (e.g., return arrows).
-
Choose an appropriate layout strategy based on crossings: horizontal/vertical for none, bypass paths for 1-2, 2D layout (grid, diamond) for 3+.
-
Generate the JSON diagram following the required structural templates.
-
Enforce arrow binding bidirectionally by ensuring startBinding and endBinding on arrows, and boundElements on source/target rectangles.
-
Set width and height for all text elements to ensure rendering.
-
Ensure background regions fully cover all contained elements with 40px padding.
-
Enforce proper sibling layout horizontally; use fork arrows for child elements to reflect parallel paths.
-
Verify no arrow passes through unrelated components and no label overlaps. Adjust spacing or routing if violations occur.
-
Save the JSON file as <descriptive-name>.excalidraw.json in the active directory.
-
Instruct the user to drag the file into https://excalidraw.com/ or open with the VS Code Excalidraw extension.
Output
A valid .excalidraw.json file.
Error Handling & Troubleshooting
-
If arrows fail to snap to components, check that BOTH startBinding /endBinding and boundElements are configured properly.
-
If text is missing or garbled, verify that width , height , and fontFamily: 4 are set.
-
If crossing logic fails, switch to a more spacious 2D layout rather than using complex crisscross connections.