Generate an Excalidraw JSON diagram based on $ARGUMENTS.
Steps
- Read
$SKILL_DIR/references/EXCALIDRAW_GUIDE.mdfor component structures, layout rules, and patterns. - Analyze the arrow paths based on
$ARGUMENTSand 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
startBindingandendBindingon arrows, andboundElementson source/target rectangles. - Set
widthandheightfor 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.jsonin 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/endBindingandboundElementsare configured properly. - If text is missing or garbled, verify that
width,height, andfontFamily: 4are set. - If crossing logic fails, switch to a more spacious 2D layout rather than using complex crisscross connections.
