xmind

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

XMind 思维导图处理技能

XMind Mind Map Processing Skill

此技能提供 XMind 文件(
.xmind
)的完整处理能力:解析、创建和更新。通过配套的 Python 工具脚本实现文件操作,将思维导图内容转换为 Markdown 格式作为会话级记忆,便于用户与模型持续交流和编辑。
This skill provides complete processing capabilities for XMind files (
.xmind
): parsing, creation, and updating. File operations are implemented through the accompanying Python tool script, and mind map content is converted to Markdown format as session-level memory, facilitating continuous communication and editing between users and the model.

工具脚本

Tool Script

本技能依赖
scripts/xmind_tool.py
(相对于本技能目录),使用 Python 标准库(零第三方依赖)。执行方式:
bash
python skills/xmind/scripts/xmind_tool.py --session <session-id> <command> [args...]
This skill depends on
scripts/xmind_tool.py
(relative to this skill directory) and uses Python standard libraries (zero third-party dependencies). Execution method:
bash
python skills/xmind/scripts/xmind_tool.py --session <session-id> <command> [args...]

会话管理

Session Management

所有命令都需要
--session <id>
参数,用于隔离不同会话的记忆文件。
会话 ID 获取规则(按优先级):
  1. 从上下文中获取:如果当前对话上下文中已存在之前使用过的 session ID,直接复用
  2. 生成新 ID:如果上下文中没有可用的 session ID,在首次调用前生成一个 UUID v4 格式的字符串(例如
    f47ac10b-58cc-4372-a567-0e02b2c3d479
    ),并在后续调用中持续复用
  • 记忆文件存储路径:
    /tmp/skills-xmind-parsed/<session-id>/<filename>.md
All commands require the
--session <id>
parameter to isolate memory files for different sessions.
Session ID Acquisition Rules (by priority):
  1. Obtain from context: If a previously used session ID already exists in the current conversation context, reuse it directly
  2. Generate new ID: If no available session ID exists in the context, generate a UUID v4 format string (e.g.,
    f47ac10b-58cc-4372-a567-0e02b2c3d479
    ) before the first call, and continue to reuse it in subsequent calls
  • Memory file storage path:
    /tmp/skills-xmind-parsed/<session-id>/<filename>.md

支持的格式

Supported Formats

格式版本内部结构检测方式
ZenXMind Zen / 2020+ZIP 内含
content.json
自动检测
LegacyXMind 8ZIP 内含
content.xml
自动检测
创建新文件时默认使用 Zen 格式;更新已有文件时保留原格式。
FormatVersionInternal StructureDetection Method
ZenXMind Zen / 2020+ZIP containing
content.json
Automatic detection
LegacyXMind 8ZIP containing
content.xml
Automatic detection
New files are created in Zen format by default; when updating existing files, the original format is retained.

Markdown 表示规范

Markdown Representation Specification

解析后的 Markdown 使用缩进列表式结构,格式如下:
markdown
undefined
Parsed Markdown uses an indented list structure, formatted as follows:
markdown
undefined

Sheet: 工作表标题

Sheet: Worksheet Title

中心主题

Central Topic

Labels: 标签1, 标签2 Link: https://example.com Markers: priority-1 这里是中心主题的备注内容
  • 分支1 {labels: 重要} {link: https://example.com}
    这是分支1的备注 备注可以有多行
    • 子节点1.1 {markers: task-done, priority-1}
      • 子子节点1.1.1
    • 子节点1.2
  • 分支2
    • 子节点2.1
    • 子节点2.2

**格式说明:**
- `# Sheet: 标题` — 工作表标题(多工作表之间用 `---` 分隔)
- `## 标题` — 中心主题
- `- 内容` — 节点,使用 2 空格缩进表示层级
- `{labels: ...}` — 行内标签元数据
- `{link: ...}` — 行内超链接元数据
- `{markers: ...}` — 行内标记/图标元数据
- `> 内容` — 节点备注(blockquote 形式,紧跟在节点下方)
- 中心主题的元数据使用顶层 blockquote(`> Labels:`, `> Link:`, `> Markers:`)
Labels: Label1, Label2 Link: https://example.com Markers: priority-1 This is the note content of the central topic
  • Branch 1 {labels: important} {link: https://example.com}
    This is the note for Branch 1 Notes can have multiple lines
    • Sub-node 1.1 {markers: task-done, priority-1}
      • Sub-sub-node 1.1.1
    • Sub-node 1.2
  • Branch 2
    • Sub-node 2.1
    • Sub-node 2.2

**Format Explanation:**
- `# Sheet: Title` — Worksheet title (separate multiple worksheets with `---`)
- `## Title` — Central topic
- `- Content` — Node, use 2-space indentation to indicate hierarchy
- `{labels: ...}` — Inline label metadata
- `{link: ...}` — Inline hyperlink metadata
- `{markers: ...}` — Inline marker/icon metadata
- `> Content` — Node note (in blockquote format, immediately following the node)
- Metadata for the central topic uses top-level blockquotes (`> Labels:`, `> Link:`, `> Markers:`)

核心流程

Core Workflow

场景一:解析 XMind 文件

Scenario 1: Parse XMind File

触发词:"解析 xmind"、"打开思维导图"、"查看 xmind 内容"、"xmind 转 markdown"
步骤:
  1. 确认文件路径:确认用户提供的
    .xmind
    文件路径是否存在
  2. 执行解析:运行工具脚本
    bash
    python skills/xmind/scripts/xmind_tool.py --session <session-id> parse <file.xmind>
  3. 展示结果:将输出的 Markdown 内容展示给用户,包括:
    • 思维导图的整体结构概览
    • 各节点的层级关系
    • 附带的标签、备注、链接等元数据
  4. 记录记忆路径:输出末尾的
    <!-- memory_file: ... -->
    注释包含记忆文件路径,记住该路径以便后续操作使用
  5. 引导交互:提示用户可以继续对思维导图内容进行提问、修改或导出
Trigger Words: "parse xmind", "open mind map", "view xmind content", "xmind to markdown"
Steps:
  1. Confirm File Path: Verify whether the
    .xmind
    file path provided by the user exists
  2. Execute Parsing: Run the tool script
    bash
    python skills/xmind/scripts/xmind_tool.py --session <session-id> parse <file.xmind>
  3. Display Results: Show the output Markdown content to the user, including:
    • Overview of the overall structure of the mind map
    • Hierarchical relationships of each node
    • Attached metadata such as labels, notes, and links
  4. Record Memory Path: The
    <!-- memory_file: ... -->
    comment at the end of the output contains the memory file path; remember this path for subsequent operations
  5. Guide Interaction: Prompt the user that they can continue to ask questions, modify, or export the mind map content

场景二:创建 XMind 文件

Scenario 2: Create XMind File

触发词:"创建 xmind"、"新建思维导图"、"生成 xmind"
步骤:
  1. 收集需求:与用户交流,明确思维导图的结构:
    • 中心主题是什么?
    • 有哪些主要分支?
    • 各分支下有哪些子节点?
    • 是否需要添加标签、备注、链接等?
  2. 生成 Markdown:根据用户描述,按照上述 Markdown 规范生成内容
  3. 写入临时 Markdown 文件并执行创建
    bash
    # 将 markdown 内容写入临时文件,然后执行创建
    python skills/xmind/scripts/xmind_tool.py --session <session-id> create <output.xmind> <temp.md> [--format zen|legacy]
  4. 确认创建结果:向用户报告文件创建成功,展示文件路径
  5. 保持记忆:记忆文件已自动创建,后续可继续编辑
格式选择:
  • 默认创建 Zen 格式(现代格式,兼容性更好)
  • 如果用户明确要求 XMind 8 兼容格式,使用
    --format legacy
    参数
Trigger Words: "create xmind", "new mind map", "generate xmind"
Steps:
  1. Collect Requirements: Communicate with the user to clarify the structure of the mind map:
    • What is the central topic?
    • What are the main branches?
    • What sub-nodes are under each branch?
    • Do you need to add labels, notes, links, etc.?
  2. Generate Markdown: Generate content according to the above Markdown specification based on the user's description
  3. Write to Temporary Markdown File and Execute Creation:
    bash
    # Write markdown content to a temporary file, then execute creation
    python skills/xmind/scripts/xmind_tool.py --session <session-id> create <output.xmind> <temp.md> [--format zen|legacy]
  4. Confirm Creation Result: Report successful file creation to the user and display the file path
  5. Retain Memory: The memory file is automatically created, and can be edited subsequently
Format Selection:
  • Zen format is created by default (modern format with better compatibility)
  • If the user explicitly requires XMind 8 compatible format, use the
    --format legacy
    parameter

场景三:更新 XMind 文件

Scenario 3: Update XMind File

触发词:"更新 xmind"、"修改思维导图"、"编辑 xmind"
步骤:
  1. 加载当前内容
    • 首先尝试读取记忆文件(如果之前已解析过):
      bash
      python skills/xmind/scripts/xmind_tool.py --session <session-id> memory <file.xmind>
    • 如果没有记忆文件,先执行解析:
      bash
      python skills/xmind/scripts/xmind_tool.py --session <session-id> parse <file.xmind>
  2. 理解修改需求:与用户确认要进行的修改,例如:
    • 添加新分支或子节点
    • 删除某个节点
    • 修改节点内容、标签或备注
    • 调整节点层级关系
  3. 修改 Markdown:在记忆文件的基础上进行修改,确保格式符合规范
  4. 写入修改后的 Markdown:将修改后的内容写入临时文件
  5. 执行更新
    bash
    python skills/xmind/scripts/xmind_tool.py --session <session-id> update <file.xmind> <modified.md>
  6. 确认结果:向用户报告更新成功,展示变更摘要
Trigger Words: "update xmind", "modify mind map", "edit xmind"
Steps:
  1. Load Current Content:
    • First attempt to read the memory file (if parsed before):
      bash
      python skills/xmind/scripts/xmind_tool.py --session <session-id> memory <file.xmind>
    • If there is no memory file, perform parsing first:
      bash
      python skills/xmind/scripts/xmind_tool.py --session <session-id> parse <file.xmind>
  2. Understand Modification Requirements: Confirm the modifications to be made with the user, such as:
    • Add new branches or sub-nodes
    • Delete a node
    • Modify node content, labels, or notes
    • Adjust node hierarchical relationships
  3. Modify Markdown: Make modifications based on the memory file, ensuring the format complies with the specification
  4. Write Modified Markdown: Write the modified content to a temporary file
  5. Execute Update:
    bash
    python skills/xmind/scripts/xmind_tool.py --session <session-id> update <file.xmind> <modified.md>
  6. Confirm Result: Report successful update to the user and display the change summary

场景四:基于记忆继续交流

Scenario 4: Continue Communication Based on Memory

当用户在同一会话中再次提到已解析的 xmind 文件时:
  1. 读取记忆文件:使用
    memory
    命令获取之前解析的内容
  2. 基于内容回答:根据 Markdown 内容回答用户问题
  3. 支持操作
    • 总结思维导图要点
    • 搜索特定节点
    • 分析结构和层级关系
    • 提出改进建议
    • 将内容转换为其他格式(大纲、表格等)
When the user mentions a previously parsed xmind file again in the same session:
  1. Read Memory File: Use the
    memory
    command to retrieve the previously parsed content
  2. Answer Based on Content: Answer the user's question based on the Markdown content
  3. Supported Operations:
    • Summarize key points of the mind map
    • Search for specific nodes
    • Analyze structure and hierarchical relationships
    • Propose improvement suggestions
    • Convert content to other formats (outline, table, etc.)

注意事项

Notes

  • 解析和创建操作涉及文件 I/O,执行前确认路径有效
  • 更新操作会覆盖原文件,如用户未明确要求,建议先备份或另存为新文件
  • 记忆文件存储在
    /tmp/skills-xmind-parsed/<session-id>/
    ,会话结束后可能被系统清理
  • 如遇到损坏的 xmind 文件(非有效 ZIP 或缺少关键内容文件),向用户报告具体错误
  • XMind 文件中的图片附件不会包含在 Markdown 中,仅处理文本结构和元数据
  • 整个流程中使用中文与用户交互
  • Parsing and creation operations involve file I/O; verify the path is valid before execution
  • Update operations will overwrite the original file; if the user does not explicitly request it, it is recommended to back up or save as a new file first
  • Memory files are stored in
    /tmp/skills-xmind-parsed/<session-id>/
    and may be cleaned up by the system after the session ends
  • If a damaged xmind file is encountered (invalid ZIP or missing key content files), report the specific error to the user
  • Image attachments in XMind files will not be included in Markdown; only text structure and metadata are processed
  • Use Chinese to interact with users throughout the process