Eriksen Labs Support
Documentation

Draft with AI

v2.10.02 min readUpdated

On this page
  1. Change a diagram you have
  2. See the prompt, or copy it by hand
  3. Fix an error with AI

If your organization lets you use an AI chat assistant, it can write a first draft of the Mermaid text. The editor writes the request for you.

  1. Above Diagram source, open Draft with AI.
  2. Under "What should the diagram show?", describe the diagram in your own words. For example:
    Example
    Our new-starter process, top to bottom. HR sends the contract. The
    new starter signs it. If it is not signed within a week, HR follows up.
    When it is signed, IT orders a laptop and the manager plans the first
    week.
  3. Optional: choose a Diagram type, such as Flowchart or Gantt. The list has all 32 kinds. Otherwise the AI chooses.
  4. Select Copy prompt. It turns on once the box has text.
    Draft with AI open on a new diagram: the request for a new-starter process typed under What should the diagram show?, Diagram type set to Flowchart, the Copy prompt button, and the hint to paste the prompt into your AI chat and its answer into the diagram source.
    Draft with AI with a request typed and Flowchart chosen. Copy prompt is on.
  5. Paste the prompt into the AI chat you use. Copy its whole answer with the chat's own copy button, or just the diagram with the button on its code block.
  6. Paste the answer into Diagram source. If the editor already has text, select all of it first (Ctrl+A, or Cmd+A on a Mac). The editor keeps just the diagram and says so.
  7. Check the preview, and every label, date and arrow.

Change a diagram you have

When the editor holds a diagram, choose Change my diagram or Start a new one. With Change my diagram, the box asks "What should change?", and the prompt carries your diagram. An example you have not changed starts a new one, unless you choose otherwise.

Draft with AI for a diagram already in the editor: What should change? with Add a review step before approval typed, Change my diagram chosen over Start a new one, and the Copy prompt button.
Change my diagram is chosen, so the prompt carries the diagram in the editor and the change typed above.

See the prompt, or copy it by hand

After a copy, Show prompt shows the exact text that was copied. If the browser blocks copying, the editor shows the prompt selected. Press Ctrl+C (Cmd+C on a Mac) to copy it.

Draft with AI after Copy prompt: the message Prompt copied. Paste it into your AI chat, then paste its answer into the diagram source, a Hide prompt button, and a read-only box showing the prompt, starting Write a Mermaid diagram that shows: and the request.
The prompt was copied, and Show prompt was selected. The box shows the exact text, and the button now reads Hide prompt.

Fix an error with AI

When the editor shows an error, Fix with AI appears under it. It copies your diagram and the error as one prompt. Paste it into your AI chat, then replace the diagram source with its answer.

An error on line 13 after Fix with AI was selected: the message Something looks wrong on line 13 with a caret under the problem, the Fix with AI button, and Fix prompt copied. Paste it into your AI chat, then replace the diagram source with its answer.
An error on line 13, after Fix with AI. The prompt is on the clipboard, ready to paste into the chat.

AI chats get things wrong. They can leave out a step, invent one, or write Mermaid this app cannot draw. The preview and the error message show you where.

The prompt holds what you typed. To change a diagram, it also holds the diagram's text, and to fix one, the text and the error. Nothing else from the page goes in: not the alt text, and not earlier versions. What you paste into an AI chat goes to the company that runs it, so follow your organization's rules. Mermaid & PlantUML Diagrams itself sends nothing to any AI.