Skill: suka233/kmind-markdown-to-mindmap (version 0.1.1)

--- name: kmind-markdown-to-mindmap description: Convert Markdown heading outlines into themed KMind mind maps. Export PNG or SVG images with theme presets, layouts, edge routes, dark mode, and rainbow branches. version: 0.1.1 user-invocable: true metadata: {"openclaw":{"skillKey":"kmind-markdown-to-mindmap","emoji":"🧠","requires":{"bins":["node"],"config":["browser.enabled"]}}} --- KMind Zen is a professional mind mapping product with a desktop app, web app, SiYuan plugin, and Obsidian plugin. The official website is `https://kmind.app`. This skill converts Markdown heading outlines into KMind mind map images. It is a fully offline skill and does not require any network connection for local conversion. The best input is a hierarchy built with Markdown headings such as `#`, `##`, and `###`. Headings become mind map nodes. Non-heading body text under a heading becomes notes on that node. During image export, notes are shown as note-entry icons by default instead of expanded note text. To view or continue editing those notes, export `.kmindz.svg` and open it in a KMind Zen client. Its main advantage is that it can generate polished, visually consistent mind maps locally and offline. It exports PNG or SVG images and supports theme presets, root layouts, branch edge routes, light/dark appearance, and rainbow branches. When the user simply asks for a mind map image, default to PNG. Use SVG only when the user explicitly asks for vector output. When the user wants an editable KMind package, prefer exporting `.kmindz.svg`. A `.kmindz.svg` package can be imported into any KMind Zen client for seamless editing. Even when no client is installed, the map content can still be opened and viewed quickly as an SVG file first, then imported into a client later for continued editing. Useful for meeting outlines, reading notes, brainstorming lists, project proposals, and Markdown heading outline-to-mindmap workflows. This is a publishable, self-contained skill. Always invoke the bundled entrypoint from `{baseDir}`: `node {baseDir}/scripts/kmind-render.mjs ...` Workflow: 1. If the user wants a specific theme, layout, or edge-route style, inspect the available options first: `node {baseDir}/scripts/kmind-render.mjs themes --format json` 2. If the user provides raw Markdown text instead of a file path, pass it through stdin. 3. Start the export with `render-markdown`. 4. By default, the command tries to auto-launch the user's local Chromium browser in headless mode. 5. The first stdout line is a JSON object with `status: "ready"`. 6. When the command finishes, the last stdout line is a JSON object with `status: "done"` and the final `outputPath`. 7. Only use `--browser manual` when automatic browser launch is unavailable and you need to open the printed local URL yourself. If the user's machine has no usable Chromium browser, automatic SVG / PNG export is unavailable. In that case, either use `--browser manual` to open the local page and complete the export, or clearly report that automatic export is unavailable in this environment. Do not fake success. Useful command template (default recommendation: PNG): `node {baseDir}/scripts/kmind-render.mjs render-markdown INPUT_OR_DASH --output OUTPUT.png --theme-preset PRESET_ID --layout LAYOUT_ID --edge-route EDGE_ROUTE_ID --appearance light|dark --rainbow auto|on|off --png-scale 1 --browser auto` Parameter guidance: - `--output` decides the output format when `--image-format` is omitted: `.png` means bitmap output and `.svg` means vector output. When the user simply asks for a mind map image, prefer `.png` by default. - `--theme-preset` should be chosen from the `themes` output. Recommended candidates: `kmind-material-3-slate` `kmind-rainbow-breeze` `kmind-midnight-neon` [REDACTED_SECRET] [REDACTED_SECRET] - `--layout` should be chosen from the `themes` output. Common choices: `logical-right` `logical-left` `mindmap-both-auto` - `--edge-route` should be chosen from the `themes` output. Common choices: `cubic` `edge-lead-quadratic` `center-quadratic` `orthogonal` - `--appearance dark` forces dark mode. - `--rainbow on` forcibly enables rainbow branches even if the current theme does not enable them by default. - `--png-scale 1` matches the current webapp default export. Only raise it when the user explicitly asks for a higher-resolution PNG. - `--browser auto` is the default and tries to auto-launch the local browser. - `--browser manual` is the manual fallback mode. - Do not proactively surface `--svg-mode` or `--png-mode`. Internally, the current defaults already use the combination closest to the webapp's actual export behavior: `SVG=fidelity`, `PNG=accurate`. Only mention those advanced flags when the user explicitly asks for low-level export tuning. - Image export uses the card-style node body layout close to KMind Zen webapp behavior. Notes converted from non-heading body text are not expanded in the image and are shown as note-entry icons. Defaults when the user does not specify: - `theme-preset`: `kmind-material-3-slate` - recommended image output suffix: `.png` - `image-format`: inferred from `--output` first; fall back to `svg` if it cannot be inferred - `layout`: by default, do not explicitly override it; keep KMind's default root layout - `edge-route`: by default, do not explicitly override it; keep the preset theme's edge style - `appearance`: `light` - `rainbow`: `auto` - `svg-mode`: internal default `fidelity` - `png-mode`: internal default `accurate` - `png-scale`: `1` - `viewport-width`: `1600` - `viewport-height`: `900` Current publish-safe allowlist for this skill: - `layouts`: `logical-right`, `logical-left`, `mindmap-both-auto` - `edge-routes`: `cubic`, `edge-lead-quadratic`, `center-quadratic`, `orthogonal` If the user wants a KMind project file instead of an image, do not use this image export flow. Use: `node {baseDir}/scripts/kmind-render.mjs import-markdown INPUT_OR_DASH --output OUTPUT.kmindz.svg`

path: CHANGELOG.md
content: # Changelog

All notable changes to this skill will be documented in this file.

## 0.1.1 - 2026-05-18

### Changed

- Clarified that the recommended input is a Markdown heading outline.
- Documented that non-heading body text is converted to node notes.
- Recommended PNG as the default image output format.
- Aligned image export guidance with the card-style node body layout where notes are shown as note icons.

## 0.1.0 - 2026-04-04

### Added

- Initial public release of the `kmind-markdown-to-mindmap` skill bundle.
- Offline conversion from Markdown outlines or plain text to KMind mind maps.
- Export support for `SVG`, `PNG`, and editable `.kmindz.svg`.
- Publish-safe theme, layout, and edge-route options for agent-facing usage.
- Bundled vendor CLI runtime under `scripts/vendor/`.
- Agent metadata under `agents/openai.yaml`.

### Notes

- Automatic `SVG` / `PNG` export requires a usable local Chromium browser.
- `.kmindz.svg` export does not depend on browser rendering.


path: README.md
content: # KMind Markdown To Mind Map

[中文说明](./README_zh_CN.md)

Convert Markdown heading outlines into polished KMind mind maps offline.

This skill exports:

- `PNG` for bitmap images
- `SVG` for vector images
- `.kmindz.svg` for editable KMind project files

It supports theme presets, root layouts, edge routes, light or dark appearance, and rainbow branches.

Recommended input is a hierarchy built with Markdown headings such as `#`, `##`, and `###`. Headings become mind map nodes. Non-heading body text under a heading becomes notes on that node. Image export shows notes as note-entry icons by default instead of expanding the note text. To view or continue editing those notes, export `.kmindz.svg` and open it in a KMind Zen client.

When the user simply asks for a mind map image, prefer PNG by default. Use SVG only when vector output is explicitly requested.

## What This Repo Contains

This repository is the publishable skill bundle for `kmind-markdown-to-mindmap`.

Main files:

- `SKILL.md`: skill instructions for agent runtimes
- `scripts/kmind-render.mjs`: local entrypoint
- `scripts/vendor/*`: bundled KMind CLI runtime
- `agents/openai.yaml`: agent metadata

## Requirements

- Node.js installed locally
- For automatic `SVG` or `PNG` image export: a usable local Chromium browser
- No network connection is required for local conversion itself

Notes:

- `.kmindz.svg` export does not depend on browser rendering
- `SVG` / `PNG` export uses a local browser render flow

## Quick Start

List available themes, layouts, and edge routes:

```bash
node ./scripts/kmind-render.mjs themes --format json
```

Create an editable KMind project file:

```bash
node ./scripts/kmind-render.mjs import-markdown ./outline.md \
  --output ./outline.kmindz.svg
```

Create a PNG mind map (recommended default image format):

```bash
node ./scripts/kmind-render.mjs render-markdown ./outline.md \
  --output ./outline.png \
  --theme-preset kmind-material-3-slate \
  --layout mindmap-both-auto \
  --edge-route orthogonal \
  --appearance dark \
  --rainbow on
```

Create an SVG mind map:

```bash
node ./scripts/kmind-render.mjs render-markdown ./outline.md \
  --output ./outline.svg \
  --theme-preset kmind-rainbow-breeze \
  --layout logical-left \
  --edge-route edge-lead-quadratic \
  --appearance dark \
  --rainbow auto
```

Use stdin instead of a file:

```bash
node ./scripts/kmind-render.mjs render-markdown - \
  --output ./stdin-demo.png <<'EOF'
# Terminal Demo
## Branch A
### Item 1
## Branch B
### Item 2
EOF
```

## Common Parameters

- `--output`: target file path; format is inferred from suffix when possible. Prefer `.png` for normal image requests and `.svg` only for vector output.
- `--theme-preset`: theme preset id from `themes --format json`
- `--layout`: root layout id
- `--edge-route`: branch edge style id
- `--appearance`: `light` or `dark`
- `--rainbow`: `auto`, `on`, or `off`
- `--png-scale`: PNG export scale; default is `1`
- `--browser`: `auto` or `manual`

Current publish-safe layout set:

- `logical-right`
- `logical-left`
- `mindmap-both-auto`

Current publish-safe edge-route set:

- `cubic`
- `edge-lead-quadratic`
- `center-quadratic`
- `orthogonal`

## Recommended Defaults

- `theme-preset`: `kmind-material-3-slate`
- Image output suffix: `.png`
- `appearance`: `light`
- `rainbow`: `auto`
- `png-scale`: `1`

If the user wants an editable KMind package instead of an image, prefer:

```bash
node ./scripts/kmind-render.mjs import-markdown INPUT_OR_DASH \
  --output OUTPUT.kmindz.svg
```

## Typical Use Cases

- Meeting outlines
- Reading notes
- Brainstorming lists
- Project proposals
- Markdown heading outline-to-mindmap workflows

## Limitations

- Automatic image export requires a usable local Chromium browser
- This skill does not bundle a browser
- If automatic browser launch is unavailable, use `--browser manual`
- Long non-heading body text is stored as node notes. In exported images, those notes are represented by note icons instead of expanded text.

## Related

- KMind Zen: `https://kmind.app`
- Skill id: `kmind-markdown-to-mindmap`


path: README_zh_CN.md
content: # KMind Markdown To Mind Map

[English](./README.md)

将 Markdown 标题大纲离线转换为高质量的 KMind 导图。

这个 skill 支持导出：

- `PNG` 位图
- `SVG` 矢量图
- 可继续在 KMind 中编辑的 `.kmindz.svg`

它支持主题预设、根布局、连线样式、明暗模式和彩虹分支。

推荐输入是以 `#`、`##`、`###` 等 Markdown 标题组织的层级大纲。标题会转换为导图节点；标题下方的非标题正文会转换为该节点的备注。图片导出时备注默认只显示为备注入口图标，不展开正文；如需查看或继续编辑这些备注内容，请导出 `.kmindz.svg` 并在 KMind Zen 客户端中打开。

如果用户只是要求导图图片，推荐默认导出 `PNG`；只有在明确需要矢量图时再导出 `SVG`。

## 仓库内容

这个仓库是 `kmind-markdown-to-mindmap` 的可发布 skill bundle。

主要文件：

- `SKILL.md`：给 agent runtime 使用的 skill 说明
- `scripts/kmind-render.mjs`：本地命令入口
- `scripts/vendor/*`：打包后的 KMind CLI 运行时
- `agents/openai.yaml`：agent 元数据

## 环境要求

- 本机已安装 Node.js
- 若要自动导出 `SVG` / `PNG`，本机需要有可用的 Chromium 浏览器
- 本地转换本身不依赖网络连接

说明：

- `.kmindz.svg` 导出不依赖浏览器渲染
- `SVG` / `PNG` 导出会走本地浏览器渲染流程

## 快速开始

查看可用主题、布局和连线：

```bash
node ./scripts/kmind-render.mjs themes --format json
```

导出可编辑的 KMind 项目文件：

```bash
node ./scripts/kmind-render.mjs import-markdown ./outline.md \
  --output ./outline.kmindz.svg
```

导出 PNG 导图（推荐默认图片格式）：

```bash
node ./scripts/kmind-render.mjs render-markdown ./outline.md \
  --output ./outline.png \
  --theme-preset kmind-material-3-slate \
  --layout mindmap-both-auto \
  --edge-route orthogonal \
  --appearance dark \
  --rainbow on
```

导出 SVG 导图：

```bash
node ./scripts/kmind-render.mjs render-markdown ./outline.md \
  --output ./outline.svg \
  --theme-preset kmind-rainbow-breeze \
  --layout logical-left \
  --edge-route edge-lead-quadratic \
  --appearance dark \
  --rainbow auto
```

通过 stdin 输入 Markdown：

```bash
node ./scripts/kmind-render.mjs render-markdown - \
  --output ./stdin-demo.png <<'EOF'
# 终端输入示例
## 分支 A
### 条目 1
## 分支 B
### 条目 2
EOF
```

## 常用参数

- `--output`：输出路径；通常会按文件后缀推断格式。普通图片需求推荐 `.png`，明确需要矢量图时再使用 `.svg`
- `--theme-preset`：主题预设 id
- `--layout`：根布局 id
- `--edge-route`：连线样式 id
- `--appearance`：`light` 或 `dark`
- `--rainbow`：`auto`、`on`、`off`
- `--png-scale`：PNG 导出倍率，默认 `1`
- `--browser`：`auto` 或 `manual`

当前对外开放的布局：

- `logical-right`
- `logical-left`
- `mindmap-both-auto`

当前对外开放的连线：

- `cubic`
- `edge-lead-quadratic`
- `center-quadratic`
- `orthogonal`

## 推荐默认值

- `theme-preset`：`kmind-material-3-slate`
- 图片输出后缀：`.png`
- `appearance`：`light`
- `rainbow`：`auto`
- `png-scale`：`1`

如果你想要的是可继续编辑的 KMind 文件，而不是图片，优先使用：

```bash
node ./scripts/kmind-render.mjs import-markdown INPUT_OR_DASH \
  --output OUTPUT.kmindz.svg
```

## 典型场景

- 会议纪要
- 读书笔记
- 头脑风暴清单
- 项目提案
- Markdown 标题大纲转导图工作流

## 限制说明

- 自动图片导出依赖本机可用的 Chromium 浏览器
- skill 本身不会内置浏览器
- 如果自动浏览器拉起不可用，请使用 `--browser manual`
- 长段落等非标题正文会保存为节点备注。导出图片时，这些备注以备注图标表示，不展开为正文。

## 相关信息

- KMind Zen：`https://kmind.app`
- skill id：`kmind-markdown-to-mindmap`


path: agents/openai.yaml
content: interface:
  display_name: "KMind Markdown To Mind Map"
  short_description: "Turn Markdown heading outlines into KMind PNG/SVG mind maps with theme, layout, edge route, dark mode, and rainbow options."
  default_prompt: "Use $kmind-markdown-to-mindmap to turn this Markdown heading outline into a KMind mind map image, prefer PNG by default, and choose an appropriate theme, layout, edge route, appearance, and rainbow style."

policy:
  allow_implicit_invocation: true


path: package.json
content: name: kmind-markdown-to-mindmap
private: yes
version: 0.1.1

path: scripts/kmind-render.mjs
content: #!/usr/bin/env node

import { spawn } from "node:child_process";
import path from "node:path";
import { fileURLToPath } from "node:url";

const scriptDir = path.dirname(fileURLToPath(import.meta.url));
const vendorCliPath = path.join(scriptDir, "vendor", "cli.mjs");

const child = spawn(process.execPath, [vendorCliPath, ...process.argv.slice(2)], {
  stdio: "inherit",
});

child.on("close", (code, signal) => {
  if (typeof code === "number") {
    process.exit(code);
    return;
  }
  if (signal) {
    process.kill(process.pid, signal);
    return;
  }
  process.exit(1);
});

child.on("error", (error) => {
  console.error(error instanceof Error ? error.message : "Failed to launch bundled KMind CLI.");
  process.exit(1);
});


Security scan verdicts — ClawScan: clean | static analysis: suspicious | VirusTotal: clean | SkillSpector: clean (LOW)