xmind

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

XMind Mind Map Creator

XMind 思维导图生成工具

Create
.xmind
files by building a JSON structure and piping it to the bundled script.
通过构建JSON结构并将其传入捆绑脚本,创建
.xmind
文件。

How to create an XMind file

如何创建XMind文件

  1. Build a JSON object with
    path
    and
    sheets
    fields (see format below)
  2. Write it to a temp file, then run:
bash
node <skill-dir>/scripts/create_xmind.mjs < /tmp/xmind_input.json
Where
<skill-dir>
is the directory containing this SKILL.md file.
  1. 构建包含
    path
    sheets
    字段的JSON对象(格式见下文)
  2. 将其写入临时文件,然后运行:
bash
node <skill-dir>/scripts/create_xmind.mjs < /tmp/xmind_input.json
其中
<skill-dir>
是包含此SKILL.md文件的目录。

JSON Input Format

JSON输入格式

json
{
  "path": "/Users/user/Desktop/my_mindmap.xmind",
  "sheets": [
    {
      "title": "Sheet 1",
      "rootTopic": {
        "title": "Central Topic",
        "children": [
          {
            "title": "Branch 1",
            "notes": "Plain text note",
            "children": [
              { "title": "Sub-topic A" },
              { "title": "Sub-topic B" }
            ]
          }
        ]
      },
      "relationships": [
        { "sourceTitle": "Sub-topic A", "targetTitle": "Sub-topic B", "title": "related" }
      ]
    }
  ]
}
json
{
  "path": "/Users/user/Desktop/my_mindmap.xmind",
  "sheets": [
    {
      "title": "Sheet 1",
      "rootTopic": {
        "title": "Central Topic",
        "children": [
          {
            "title": "Branch 1",
            "notes": "Plain text note",
            "children": [
              { "title": "Sub-topic A" },
              { "title": "Sub-topic B" }
            ]
          }
        ]
      },
      "relationships": [
        { "sourceTitle": "Sub-topic A", "targetTitle": "Sub-topic B", "title": "related" }
      ]
    }
  ]
}

Topic Properties

主题属性

Each topic object supports:
FieldTypeDescription
title
string (required)Topic title
children
array of topicsChild topics
notes
string or
{plain?, html?}
Notes. HTML supports:
<strong>
,
<u>
,
<ul>
,
<ol>
,
<li>
,
<br>
. NOT
<code>
.
href
stringExternal URL link
attachment
stringAbsolute path to a file to attach (embedded in the .xmind). Mutually exclusive with
href
.
linkToTopic
stringTitle of another topic to link to (internal
xmind:#id
link, works across sheets)
labels
string[]Tags/labels
markers
string[]Marker IDs:
task-done
,
task-start
,
priority-1
to
priority-9
callouts
string[]Callout text bubbles
boundaries
{range, title?}[]
Visual grouping of children. Range:
"(start,end)"
summaryTopics
{range, title}[]
Summary topics spanning children ranges
structureClass
stringLayout (see below)
shape
stringTopic shape (see shapes below)
position
{x, y}
Absolute position (only for detached topics in free-positioning sheets)
每个主题对象支持以下属性:
字段类型说明
title
字符串(必填)主题标题
children
主题数组子主题
notes
字符串或
{plain?, html?}
备注。HTML支持:
<strong>
,
<u>
,
<ul>
,
<ol>
,
<li>
,
<br>
。不支持
<code>
href
字符串外部URL链接
attachment
字符串要附加的文件的绝对路径(嵌入到.xmind文件中)。与
href
互斥。
linkToTopic
字符串要链接到的另一个主题的标题(内部
xmind:#id
链接,跨工作表生效)
labels
字符串数组标签/标记
markers
字符串数组标记ID:
task-done
,
task-start
,
priority-1
priority-9
callouts
字符串数组标注文本气泡
boundaries
{range, title?}[]
子主题的可视化分组。范围格式:
"(start,end)"
summaryTopics
{range, title}[]
覆盖子主题范围的汇总主题
structureClass
字符串布局(见下文)
shape
字符串主题形状(见下文形状列表)
position
{x, y}
绝对位置(仅适用于自由定位工作表中的独立主题)

Topic shapes

主题形状

  • org.xmind.topicShape.roundedRect
    — rounded rectangle (default)
  • org.xmind.topicShape.diamond
    — diamond (use for conditions/decisions)
  • org.xmind.topicShape.ellipserect
    — ellipse (use for start/end)
  • org.xmind.topicShape.rect
    — rectangle
  • org.xmind.topicShape.underline
    — underline only
  • org.xmind.topicShape.circle
    — circle
  • org.xmind.topicShape.parallelogram
    — parallelogram (use for I/O)
  • org.xmind.topicShape.roundedRect
    — 圆角矩形(默认)
  • org.xmind.topicShape.diamond
    — 菱形(用于条件/决策)
  • org.xmind.topicShape.ellipserect
    — 椭圆形(用于开始/结束节点)
  • org.xmind.topicShape.rect
    — 矩形
  • org.xmind.topicShape.underline
    — 仅下划线
  • org.xmind.topicShape.circle
    — 圆形
  • org.xmind.topicShape.parallelogram
    — 平行四边形(用于输入/输出)

Layout structures

布局结构

  • org.xmind.ui.map.clockwise
    — balanced map
  • org.xmind.ui.map.unbalanced
    — unbalanced map
  • org.xmind.ui.logic.right
    — logic chart (right)
  • org.xmind.ui.org-chart.down
    — org chart (down)
  • org.xmind.ui.tree.right
    — tree (right)
  • org.xmind.ui.fishbone.leftHeaded
    — fishbone
  • org.xmind.ui.timeline.horizontal
    — timeline
  • org.xmind.ui.map.clockwise
    — 平衡思维导图
  • org.xmind.ui.map.unbalanced
    — 非平衡思维导图
  • org.xmind.ui.logic.right
    — 逻辑图(向右)
  • org.xmind.ui.org-chart.down
    — 组织结构图(向下)
  • org.xmind.ui.tree.right
    — 树形图(向右)
  • org.xmind.ui.fishbone.leftHeaded
    — 鱼骨图
  • org.xmind.ui.timeline.horizontal
    — 时间线

Task properties

任务属性

Simple checkbox (no dates needed):
  • taskStatus
    :
    "todo"
    or
    "done"
Planned tasks (for Gantt/timeline view in XMind):
FieldTypeDescription
progress
number 0.0-1.0Completion progress
priority
number 1-9Priority (1=highest)
startDate
ISO 8601 stringStart date, e.g.
"2026-02-01T00:00:00Z"
dueDate
ISO 8601 stringDue date
durationDays
numberDuration in days (preferred for relative planning)
dependencies
array
{targetTitle, type, lag?}
— type:
FS
,
FF
,
SS
,
SF
Two approaches for planned tasks:
  1. Relative (preferred): Use
    durationDays
    +
    dependencies
    . XMind auto-calculates dates.
  2. Absolute: Use
    startDate
    +
    dueDate
    for fixed dates.
When the user mentions "planning", "schedule", "timeline", "Gantt", "project", "phases", use RELATIVE planned tasks unless specific dates are given.
简单复选框(无需日期):
  • taskStatus
    :
    "todo"
    "done"
计划任务(用于XMind中的甘特图/时间线视图):
字段类型说明
progress
数字(0.0-1.0)完成进度
priority
数字(1-9)优先级(1=最高)
startDate
ISO 8601格式字符串开始日期,例如
"2026-02-01T00:00:00Z"
dueDate
ISO 8601格式字符串截止日期
durationDays
数字持续天数(相对规划首选)
dependencies
数组
{targetTitle, type, lag?}
— 类型:
FS
,
FF
,
SS
,
SF
计划任务的两种方式:
  1. 相对方式(首选):使用
    durationDays
    +
    dependencies
    。XMind会自动计算日期。
  2. 绝对方式:使用
    startDate
    +
    dueDate
    设置固定日期。
当用户提到“规划”、“日程”、“时间线”、“甘特图”、“项目”、“阶段”时,除非给出具体日期,否则使用相对方式的计划任务。

Sheet properties

工作表属性

FieldTypeDescription
title
string (required)Sheet title
rootTopic
topic (required)Root topic
relationships
array
{sourceTitle, targetTitle, title?, shape?}
— connects topics by title.
shape
:
"org.xmind.relationshipShape.curved"
(default) or
"org.xmind.relationshipShape.straight"
detachedTopics
array of topicsFree-floating topics (require
freePositioning: true
and
position
on each topic)
freePositioning
booleanEnable free topic positioning (for logic/flow diagrams)
字段类型说明
title
字符串(必填)工作表标题
rootTopic
主题(必填)根主题
relationships
数组
{sourceTitle, targetTitle, title?, shape?}
— 通过标题连接主题。
shape
"org.xmind.relationshipShape.curved"
(默认)或
"org.xmind.relationshipShape.straight"
detachedTopics
主题数组自由浮动主题(需要开启
freePositioning: true
,且每个主题需设置
position
freePositioning
布尔值启用主题自由定位(用于逻辑/流程图)

Logic / Flow diagrams

逻辑/流程图

For flowcharts, logic diagrams, or algorithmic diagrams, use free positioning with detached topics and straight relationships:
json
{
  "path": "/tmp/flowchart.xmind",
  "sheets": [{
    "title": "Algorithm",
    "freePositioning": true,
    "rootTopic": {
      "title": "START",
      "shape": "org.xmind.topicShape.ellipserect",
      "structureClass": "org.xmind.ui.map.clockwise"
    },
    "detachedTopics": [
      {"title": "IS X > 0?", "position": {"x": 0, "y": 130}, "shape": "org.xmind.topicShape.diamond"},
      {"title": "PRINT YES", "position": {"x": 200, "y": 130}},
      {"title": "PRINT NO", "position": {"x": -200, "y": 130}},
      {"title": "END", "position": {"x": 0, "y": 260}, "shape": "org.xmind.topicShape.ellipserect"}
    ],
    "relationships": [
      {"sourceTitle": "START", "targetTitle": "IS X > 0?", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "IS X > 0?", "targetTitle": "PRINT YES", "title": "YES", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "IS X > 0?", "targetTitle": "PRINT NO", "title": "NO", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "PRINT YES", "targetTitle": "END", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "PRINT NO", "targetTitle": "END", "shape": "org.xmind.relationshipShape.straight"}
    ]
  }]
}
Conventions: Use ellipse for start/end, diamond for conditions, rectangle (default) for actions, parallelogram for I/O. Use
"org.xmind.relationshipShape.straight"
for all connectors. Position topics on a grid (y increments of ~130px, x offsets of ~200px for branches).
When the user mentions "flowchart", "algorithm", "logic diagram", "organigramme de programmation", "diagramme logique", use this pattern.
对于流程图、逻辑图或算法图,请使用自由定位+独立主题+直线关系
json
{
  "path": "/tmp/flowchart.xmind",
  "sheets": [{
    "title": "Algorithm",
    "freePositioning": true,
    "rootTopic": {
      "title": "START",
      "shape": "org.xmind.topicShape.ellipserect",
      "structureClass": "org.xmind.ui.map.clockwise"
    },
    "detachedTopics": [
      {"title": "IS X > 0?", "position": {"x": 0, "y": 130}, "shape": "org.xmind.topicShape.diamond"},
      {"title": "PRINT YES", "position": {"x": 200, "y": 130}},
      {"title": "PRINT NO", "position": {"x": -200, "y": 130}},
      {"title": "END", "position": {"x": 0, "y": 260}, "shape": "org.xmind.topicShape.ellipserect"}
    ],
    "relationships": [
      {"sourceTitle": "START", "targetTitle": "IS X > 0?", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "IS X > 0?", "targetTitle": "PRINT YES", "title": "YES", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "IS X > 0?", "targetTitle": "PRINT NO", "title": "NO", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "PRINT YES", "targetTitle": "END", "shape": "org.xmind.relationshipShape.straight"},
      {"sourceTitle": "PRINT NO", "targetTitle": "END", "shape": "org.xmind.relationshipShape.straight"}
    ]
  }]
}
约定: 使用椭圆形表示开始/结束,菱形表示条件,矩形(默认)表示操作,平行四边形表示输入/输出。所有连接线使用
"org.xmind.relationshipShape.straight"
。将主题放置在网格上(y轴增量约130px,分支x轴偏移约200px)。
当用户提到“流程图”、“算法”、“逻辑图”、“organigramme de programmation”、“diagramme logique”时,使用此模式。

Working with large files

处理大文件

When reading a PDF or other large file fails (e.g. "PDF too large"), extract text using CLI tools before building the mind map:
bash
undefined
当读取PDF或其他大文件失败时(例如“PDF过大”),先使用CLI工具提取文本,再构建思维导图:
bash
undefined

Preferred: pdftotext (install: apt install poppler-utils)

首选:pdftotext(安装:apt install poppler-utils)

pdftotext input.pdf /tmp/extracted.txt
pdftotext input.pdf /tmp/extracted.txt

Fallback if pdftotext unavailable:

如果pdftotext不可用的备选方案:

python3 -c " import subprocess, pathlib, sys p = sys.argv[1] try: subprocess.run(['pdftotext', p, '/tmp/extracted.txt'], check=True) except FileNotFoundError: subprocess.run(['pip', 'install', 'pymupdf'], check=True, capture_output=True) import importlib; fitz = importlib.import_module('fitz') doc = fitz.open(p) pathlib.Path('/tmp/extracted.txt').write_text('\n'.join(page.get_text() for page in doc)) " input.pdf

Then read `/tmp/extracted.txt` to build the mind map.
python3 -c " import subprocess, pathlib, sys p = sys.argv[1] try: subprocess.run(['pdftotext', p, '/tmp/extracted.txt'], check=True) except FileNotFoundError: subprocess.run(['pip', 'install', 'pymupdf'], check=True, capture_output=True) import importlib; fitz = importlib.import_module('fitz') doc = fitz.open(p) pathlib.Path('/tmp/extracted.txt').write_text('\n'.join(page.get_text() for page in doc)) " input.pdf

然后读取`/tmp/extracted.txt`来构建思维导图。

Important rules

重要规则

  • The output path MUST end with
    .xmind
  • Always write the file where the user requests (e.g. ~/Downloads, ~/Desktop)
  • IDs are generated automatically
  • Topic references in relationships and dependencies are resolved by title
  • HTML notes: only
    <strong>
    ,
    <u>
    ,
    <ul>
    ,
    <ol>
    ,
    <li>
    ,
    <br>
    are supported.
    <code>
    is NOT supported by XMind.
  • Internal links (
    linkToTopic
    ) work across sheets
  • Notes should be substantial and detailed — don't just repeat the topic title. Use notes to add explanations, context, definitions, examples, key points, or reasoning. Aim for 2-5 sentences minimum per note. Use HTML notes with
    <strong>
    ,
    <ul>
    /
    <li>
    ,
    <br>
    for well-structured content. Most topics should have notes unless they are self-explanatory leaf nodes.
  • 输出路径必须以
    .xmind
    结尾
  • 始终将文件写入用户指定的位置(例如~/Downloads、~/Desktop)
  • ID会自动生成
  • 关系和依赖中的主题引用通过标题解析
  • HTML备注:仅支持
    <strong>
    ,
    <u>
    ,
    <ul>
    ,
    <ol>
    ,
    <li>
    ,
    <br>
    。XMind不支持
    <code>
  • 内部链接(
    linkToTopic
    )跨工作表生效
  • 备注应详实具体——不要仅重复主题标题。使用备注添加解释、上下文、定义、示例、关键点或推理。每个备注至少2-5句话。使用带有
    <strong>
    <ul>
    /
    <li>
    <br>
    的HTML备注来构建结构清晰的内容。除非是自解释的叶子节点,否则大多数主题都应有备注。