drawio-impl-swimlanes
Installation
SKILL.md
Draw.io Swimlane Implementation
Purpose
This skill enables correct generation of swimlane diagrams, cross-functional flowcharts, and pool/lane layouts in Draw.io mxGraph XML. It enforces the container-relative coordinate system and prevents the most common AI mistake: placing child shapes at absolute page coordinates instead of container-relative coordinates.
Critical Rules (Memorize These)
- ALWAYS set
container=1in every swimlane and pool style — Without it, child shapes will NOT move with the lane when repositioned. - ALWAYS use container-relative coordinates for children — A child at
x="40" y="35"is 40px from the lane's left edge and 35px from the lane's top edge (below the header). NEVER use absolute page coordinates. - ALWAYS set
parentto the container ID for child shapes — A shape inside "lane1" MUST haveparent="lane1". NEVER setparent="1"for shapes that belong inside a container. - ALWAYS set cross-lane edge
parentto the common ancestor — When an edge connects shapes in different lanes, set the edge'sparentto the pool (the shared ancestor). NEVER set it to one of the individual lanes. - ALWAYS include
collapsible=0on lanes — Without it, users can accidentally collapse lanes in the editor, hiding all contents. - NEVER use absolute page coordinates for shapes inside a container — This is the #1 swimlane mistake. Shapes will render at the wrong position and will NOT move with their parent lane.
Container Hierarchy
Swimlane diagrams use a strict parent-child hierarchy: