Skip to content

Commit fe8e059

Browse files
committed
Add critical edge geometry requirements to documentation and code comments
1 parent 7df8fc7 commit fe8e059

File tree

5 files changed

+23
-0
lines changed

5 files changed

+23
-0
lines changed

CLAUDE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,13 @@ Opens the draw.io editor with a Mermaid.js diagram definition.
8585

8686
## Edge Routing Best Practices
8787

88+
**CRITICAL: Every edge `mxCell` must contain a `<mxGeometry relative="1" as="geometry" />` child element**, even when there are no waypoints. Self-closing edge cells (e.g. `<mxCell ... edge="1" ... />`) are invalid and will not render correctly. Always use the expanded form:
89+
```xml
90+
<mxCell id="e1" edge="1" parent="1" source="a" target="b" style="...">
91+
<mxGeometry relative="1" as="geometry" />
92+
</mxCell>
93+
```
94+
8895
draw.io does **not** have built-in collision detection for edges. You must plan layout and routing carefully:
8996

9097
- Use `edgeStyle=orthogonalEdgeStyle` for right-angle connectors (most common)

mcp-app-server/src/shared.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,7 @@ export function createServer(html, serverOptions = {})
324324
description:
325325
"Creates and displays an interactive draw.io diagram. Pass draw.io XML (mxGraphModel format) to render it inline. " +
326326
"IMPORTANT: The XML must be well-formed. Do NOT use double hyphens (--) inside XML comments, as this is invalid XML and will break the parser. Use single hyphens or rephrase instead (e.g. <!-- Order 1 to OrderItem --> not <!-- Order 1 --- OrderItem -->). " +
327+
"EDGE GEOMETRY: Every edge mxCell MUST contain a <mxGeometry relative=\"1\" as=\"geometry\" /> child element, even when there are no waypoints. Self-closing edge cells (<mxCell ... edge=\"1\" ... />) are invalid and will not render correctly. " +
327328
"EDGE ROUTING: Use edgeStyle=orthogonalEdgeStyle for right-angle connectors. " +
328329
"Space nodes at least 60px apart to avoid overlapping edges. " +
329330
"Use exitX/exitY/entryX/entryY (0-1) to control which side of a node an edge connects to, spreading connections across different sides. " +

mcp-tool-server/src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ const tools =
109109
"Use this to view, edit, or create diagrams in draw.io format. " +
110110
"The XML should be valid draw.io/mxGraph XML format. " +
111111
"IMPORTANT: Do NOT use double hyphens (--) inside XML comments, as this is invalid XML and will break the parser. Use single hyphens or rephrase instead. " +
112+
"EDGE GEOMETRY: Every edge mxCell MUST contain a <mxGeometry relative=\"1\" as=\"geometry\" /> child element, even when there are no waypoints. Self-closing edge cells (<mxCell ... edge=\"1\" ... />) are invalid and will not render correctly. " +
112113
"EDGE ROUTING: Use edgeStyle=orthogonalEdgeStyle for right-angle connectors. " +
113114
"Space nodes at least 60px apart to avoid overlapping edges. " +
114115
"Use exitX/exitY/entryX/entryY (0-1) to control which side of a node an edge connects to, spreading connections across different sides. " +

project-instructions/claude-project-instructions.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ print(f"""<!DOCTYPE html>
105105

106106
## Edge Routing (XML)
107107

108+
**CRITICAL: Every edge `mxCell` must contain a `<mxGeometry relative="1" as="geometry" />` child element**, even when there are no waypoints. Self-closing edge cells (e.g. `<mxCell ... edge="1" ... />`) are invalid and will not render correctly. Always use the expanded form:
109+
```xml
110+
<mxCell id="e1" edge="1" parent="1" source="a" target="b" style="...">
111+
<mxGeometry relative="1" as="geometry" />
112+
</mxCell>
113+
```
114+
108115
draw.io does **not** have built-in collision detection for edges. Plan layout carefully:
109116

110117
- Use `edgeStyle=orthogonalEdgeStyle` for right-angle connectors

skill-cli/SKILL.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ Every diagram must have this structure:
157157

158158
## Edge routing
159159

160+
**CRITICAL: Every edge `mxCell` must contain a `<mxGeometry relative="1" as="geometry" />` child element**, even when there are no waypoints. Self-closing edge cells (e.g. `<mxCell ... edge="1" ... />`) are invalid and will not render correctly. Always use the expanded form:
161+
```xml
162+
<mxCell id="e1" edge="1" parent="1" source="a" target="b" style="...">
163+
<mxGeometry relative="1" as="geometry" />
164+
</mxCell>
165+
```
166+
160167
draw.io does **not** have built-in collision detection for edges. Plan layout and routing carefully:
161168

162169
- Use `edgeStyle=orthogonalEdgeStyle` for right-angle connectors (most common)

0 commit comments

Comments
 (0)