Commit Graph

13 Commits

Author SHA1 Message Date
Gaudenz Alder 3b6df74994 Preview for mermaid and ELK support 2026-04-17 18:26:47 +02:00
Gaudenz Alder 61762b47a1 fix: document line break encoding in xml-reference.md
Prevent LLMs from using literal \n in value attributes, which renders
as backslash-n text instead of a newline. Recommend 
 (universal)
or <br> (html=1 only).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 14:32:00 +02:00
Gaudenz Alder 9e4d11ae4a fix: add html=1 to edge examples and document fontStyle usage
Edge examples lacked html=1, causing LLMs to generate edges without
it. When edge labels contain HTML tags, they render as literal text
without this flag. Also add guidance on fontStyle vs HTML tags: use
fontStyle for whole-label formatting, HTML tags for partial formatting,
never both.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 06:10:37 +02:00
Gaudenz Alder 875b75fe67 fix: add html=1 to all XML examples to prevent raw HTML tag display
Without html=1 in the style, draw.io renders HTML tags (<b>, <br>,
<font>, etc.) as literal text instead of formatting them. Added html=1
to all code examples and a new "HTML labels" section documenting the
requirement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-11 16:03:15 +02:00
Gaudenz Alder eececbee95 feat: add edge routing guidance and style selection to xml-reference.md
- Edge style selection table (orthogonal, elbow, entity relation, straight, curved)
- Priority-based orthogonal routing rules (P1: layout, P2: no crossings, P3: clean routes)
- Fan-out/fan-in bus bundling for cleaner multi-edge routing
- Scoping: detailed routing rules apply only to orthogonal/elbow edges
- Consistency rule: one primary edge style per diagram type
- Container edge guidance for swimlanes and VPCs
- UML lifeline shape in style properties table

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 10:36:14 +02:00
Gaudenz Alder 079768d7a0 rename drawio-style-reference.md to style-reference.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 08:06:48 +02:00
Gaudenz Alder a8941a7d69 docs: skip search_shapes when user asks for basic/simple shapes
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:40:33 +02:00
Gaudenz Alder 6ade58cd4a docs: guide LLMs to skip search_shapes for standard diagram types
Add explicit decision step: skip search_shapes for flowcharts, UML, ERD,
org charts, mind maps etc. that use basic geometric shapes. Only use it
for industry-specific icons (cloud, P&ID, network, electrical, Cisco, K8s).

Updated in xml-reference.md (single source of truth), search_shapes tool
description, and CLAUDE.md.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 21:36:10 +02:00
Gaudenz Alder d026f26c39 feat: add search_shapes tool with 10,400+ shape index
Add a shape search system that lets LLMs discover correct draw.io style
strings for domain-specific shapes (AWS, Azure, GCP, P&ID, electrical,
Cisco, Kubernetes, UML, BPMN, etc.) before generating XML.

- shape-search/generate-index.js: loads app.min.js via jsdom, runs all
  sidebar palette initializations, intercepts createVertexTemplateEntry
  and createEdgeTemplateEntry to capture {style, w, h, title, tags}
  for every shape. Produces search-index.json (10,440 shapes).

- mcp-app-server/src/shared.js: adds soundex(), buildTagMap(), and
  searchShapes() implementing the same search algorithm as draw.io's
  Sidebar (exact + phonetic matching, AND across terms). Registers
  search_shapes tool in createServer() when shapeIndex is provided.

- Build pipeline: build-html.js embeds the index in generated-html.js,
  worker.js and index.js pass it through to createServer().

- xml-reference.md: guides LLMs to use search_shapes for domain shapes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 20:53:41 +02:00
Gaudenz Alder 3e9f667bb1 docs: add general principles to xml-reference (shapes, language)
Nudge LLMs to use semantically correct draw.io shapes and to match
the user's language in diagram labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 19:34:20 +02:00
Gaudenz Alder cdf3578ae1 feat: add mxfile.xsd schema to shared/, update XSD links
Move mxfile.xsd from www.diagrams.net-source to the public repo so
all references can point here. Update XSD links in xml-reference.md
and drawio-style-reference.md to use the GitHub URL.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 19:24:43 +02:00
Gaudenz Alder 3c0e40acaa feat: add style reference and update xml-reference link
Move drawio-style-reference.md from drawusaurus to shared/ (public
repo so it can be referenced from the docs site). Update the style
reference link in xml-reference.md to point to the new location.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 19:17:40 +02:00
Gaudenz Alder 3366c8e7b3 feat: single source of truth for XML generation prompt
Move the draw.io XML generation reference to shared/xml-reference.md
and wire all four consumers to use it instead of duplicating the
content. Add layers, tags, and metadata/placeholders documentation.

- MCP app server: reads at startup (Node.js) or pre-builds into
  generated-html.js (Workers) via build-html.js
- MCP tool server: reads at startup with fallback to local copy;
  prepack script bundles the file before npm publish
- Skill: references the GitHub raw URL so it works after install
- Project instructions: tells users to copy from GitHub

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 18:59:19 +02:00