# Prompt Version 4: UML State Diagram Label Clearance Delta

Use this as a delta over `state-uml-recreated.prompt.md` after the third
rendered SVG/draw.io pass.

## Append Lines

- Validate label boundary clearance after rendering: every label needs a visible
  margin from container borders, connector lines, and arrowheads.
- Labels must not sit directly on a shape boundary unless the source diagram
  explicitly requires that overlap.
- Reposition transition labels that land on a container border after rendering.
- When edge labels cannot be positioned cleanly by the diagram tool, model them
  as independent text elements so their placement can be controlled precisely.
- After every visual correction, re-render the SVG and inspect the screenshot
  again before handoff.

## Modify Lines

- Change `connector label avoidance: route arrows so they do not cover state
labels or transition labels unless the source diagram explicitly does so` to
  `connector and label clearance: route arrows and labels so neither labels nor
connector lines sit on shape borders, arrowheads, or important text unless the
source diagram explicitly does so`.
- Change `final resizing and visual balance pass after the diagram is assembled
and rendered` to `final resizing, label clearance, and visual balance pass
after each render-correction cycle`.

## Validation Additions

- Inspect each label against its nearest container border after rendering.
- Re-render after moving labels and compare the screenshot before treating the
  diagram as ready.
- Record the correction if a label had to become an independent text element to
  avoid edge-label placement issues.
