Editing Diagrams (/drawio edit)
Use /drawio edit for incremental changes, theme switches, restructures, or imports from existing .drawio files.
Preferred Edit Modes
Existing offline bundle
This is the preferred path when the skill created the original diagram.
- read
.spec.yaml - update the spec
- re-render
.drawio - refresh
.arch.json
Existing .drawio file without sidecars
Import first:
bash
node skills/drawio/scripts/cli.js existing.drawio --input-format drawio --export-spec --write-sidecarsThen edit the generated spec and re-render.
Live browser session
Use this only when optional MCP is already configured and the user explicitly wants live refinement.
Critical rule:
- call
get_diagrambeforeedit_diagram
Common Edit Operations
Rename labels
text
/drawio edit rename User Service to Auth ServiceAdd elements
text
/drawio edit add a Redis Cache node between API Gateway and User Service, then connect it with data-flow arrowsChange semantic types
text
/drawio edit change the Event Store node from service to databaseSwitch theme
text
/drawio edit switch the diagram to high-contrast for accessibility reviewRestructure modules
text
/drawio edit restructure this into input, processing, and output modules using academic themeMajor structural edits should pause for confirmation after the logic draft when semantics may change.
Theme and Style Rules
- new nodes inherit the current theme
- new edges inherit the current connector style family
- type changes update shape semantics
- theme switches re-apply theme-token styling
- explicit color overrides stay explicit
Offline Edit Commands
Re-render a .drawio bundle:
bash
node skills/drawio/scripts/cli.js my-diagram.spec.yaml my-diagram.drawio --validate --write-sidecarsRe-render a strict SVG review artifact:
bash
node skills/drawio/scripts/cli.js my-diagram.spec.yaml my-diagram.svg --validate --write-sidecars --strict-warningsLive MCP Edit Flow
Use the live route only when needed:
start_sessioncreate_new_diagramor load the current diagramget_diagramedit_diagramexport_diagram
This route is optional. The offline sidecar path remains the default editing workflow.
Troubleshooting
Styles look inconsistent after edits
- check whether explicit style overrides were added
- re-apply the theme if you want token-based consistency
Labels or IDs no longer match
- inspect the current
.spec.yaml - if using live MCP, fetch the latest XML with
get_diagram
Edit scope is too large
- convert it into a restructure request
- confirm the new logic graph before rendering