본문으로 건너뛰기
cccskills
무료GitHub에 공개

draw-io

Create, read, edit, and open draw.io (.drawio) files. Supports architecture diagrams, ER diagrams, flowcharts, domain model diagrams, and more. Use when requests include "create a diagram", "make a flowchart", "draw an architecture diagram", "create an ER diagram", "open a .drawio file", "what's in this diagram?", etc. Do NOT use for Mermaid or PlantUML generation.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(5)

  • SKILL.md6.1 KB
  • references/layout-guide.md5.6 KB
  • references/xml-reference.md11.2 KB
  • test/test-cases-jp.md8.1 KB
  • test/test-cases.md6.7 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

draw.io Diagram Skill

Create, read, and edit diagrams in draw.io format (.drawio).

Supported Diagram Types (Examples)

  • Architecture diagrams
  • Domain model diagrams
  • Object diagrams
  • ER diagrams
  • Flowcharts
  • Wireframes
  • Sequence diagrams
  • Class diagrams

Any other diagram type that can be expressed in draw.io is also supported.

Workflow

1. Read (Reference during development)

Read domain model or architecture diagrams and use them as development context.

Trigger examples: "Check the domain model", "Read the design diagram", "Reference the architecture", "What's in this diagram?"

Steps:

  1. Load reference files: Read the following
  2. Use Glob to search for .drawio files
  3. Use Read to load the XML
  4. Extract information from mxCell attributes:
    • value attribute: labels (entity names, method names, etc.)
    • parent attribute: parent-child relationships (group membership)
    • source/target attributes: edge connections
    • fillColor in style attribute: element classification (color-based)
  5. Output a structured summary

2. Create / Edit

Create new diagrams or update existing .drawio files.

Trigger examples: "Create a diagram", "Make a flowchart", "Draw an architecture diagram", "Create an ER diagram", "Update the diagram", "Add an entity", "Change a relationship"

Steps:

  1. Clarify requirements: Confirm the diagram type and elements to include with the user
  2. Load reference files: Always load the following before starting work
  3. Check existing files: Use Glob to search for the target .drawio file
    • File exists → Use Read to get the XML and check existing IDs
    • No file → Proceed as a new creation
  4. List elements: Enumerate boxes, relationships, and groups
  5. Generate / Edit XML:
    • New creation: Combine the base structure template with mxCells, and save as .drawio using Write
    • Editing existing: Assign new IDs that don't conflict with existing ones, and update the XML using Edit
  6. Show path: Display the file path to the user (do not open automatically)

3. Open in Desktop App

Trigger examples: "Open this file", "Open the .drawio file", "Open the diagram"

Steps:

  1. Identify the file path (if not specified, use Glob to search for .drawio files)
  2. Run open -a "draw.io" <file-path> using Bash

Prerequisite: draw.io must be installed via brew install --cask drawio

XML Base Structure

Important: Always specify darkMode="0". This disables Adaptive Colors, preventing color inversion when opened in a dark-mode editor, and maintains light-mode colors during SVG/PNG export.

<mxfile host="app.diagrams.net" agent="Claude" version="21.0.0">
  <diagram name="Diagram Name" id="unique-id">
    <mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0" darkMode="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <!-- Add elements here -->
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>

For multiple pages, add multiple <diagram> elements. Specify darkMode="0" in each <mxGraphModel>.

Important Constraints

  • Always specify darkMode="0" — omitting it causes color inversion in dark mode
  • Keep IDs unique — manage with prefixes like box1, edge1
  • Use &#xa; for line breaks — for text line breaks within XML
  • Specify parent-child relationships with the parent attribute — coordinates of child elements within a group are relative to the parent
  • vertex="1" for shapes, edge="1" for edges
  • Do not open after editing — only display the file path; open only when the user explicitly asks
  • Do not include -- in XML comments — <!-- Order ---> Customer --> causes an XML error; write as <!-- Order to Customer -->

Troubleshooting

XML Parse Error

Cause: -- is included in a comment Fix: Avoid -- as in <!-- Order to Customer -->. See the beginning of references/xml-reference.md for details

Colors Inverted in Dark Mode

Cause: Missing darkMode="0" specification Fix: Add darkMode="0" to <mxGraphModel>. For multiple pages, specify it on all pages

Shapes Overlapping / Edges Crossing

Cause: Layout calculation issues Fix: Check layout principles in references/layout-guide.md. Distribute edge connection points using exitX/exitY/entryX/entryY

Rendering Broken Due to Duplicate IDs

Cause: Multiple mxCells with the same ID exist Fix: Check existing IDs before editing and assign unique IDs

draw.io App Won't Open

Cause: draw.io desktop app is not installed Fix: Install with brew install --cask drawio

Reference Files

  • XML Patterns & Styles → references/xml-reference.md Contents: mxCell patterns (rectangle, text, edge, group, DB, stack layout), style attributes, color palette, edge styles, custom properties, connection points, parsing examples for reading Load for reading, creating, and editing

  • Layout Guide → references/layout-guide.md Contents: Layout principles, coordinate calculations, placement patterns, boundary coordinate calculations Load for creating and editing

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

이 스킬의 문제 신고