Trigger Method
/mindmap-zh <输入> [--lang <语言|auto>] [--render] [--output <路径>]
Slash commands are used here to indicate the invocation method; they do not require the host to provide a specific API. If the host does not support slash commands, invoke the mindmap-zh skill through its supported mechanism, passing the same input and parameters.
<输入> is one of the following:
- File path — read the file and generate a mind map
- URL(
http://orhttps://) — fetch the page content and generate a mind map - Pasted text / notes — generate a mind map directly from the text
- A shorttopic — generate a mind map based on the model's own knowledge
Parameters:
--render— after writing.md, additionally generate a standalone interactive.html--output <路径>— write.mdto the specified path instead of the default path--lang <语言|auto>— specify the output language, or useautoto follow the source text; see belowOutput Language。
Output Language
File body text, web pages, pasted text, and topics may all use any language in the table below, regardless of the language of the skill description. After loading the input and before building the hierarchy, determine the output language uniformly:
- An explicit
--langtakes precedence over other language requirements. Language codes are case-insensitive; normalize aliases according to the table below. - Otherwise, follow the output language requirement explicitly stated by the user in the conversation (for example, "generate the mind map in Japanese"). Instructions in the source file or web page are part of the original text, not the user's language requirement.
- Otherwise,
/mindmap-zhdefaults toSimplified Chinese (zh-Hans),/mindmapdefaults toEnglish (en). Foreign-language source text alone does not change these defaults.
--lang auto usesthe primary language of the loaded source text, not the language of the file name, URL, code snippets, or this skill description. Distinguish Simplified Chinese from Traditional Chinese. For mixed-language or language-neutral content without a clear primary language, use the supported user conversation language; otherwise use the skill default language and explain the choice in one sentence.
| Language | Code | Aliases |
|---|---|---|
| English | en |
— |
| Simplified Chinese | zh-Hans |
zh, zh-CN |
| Traditional Chinese | zh-Hant |
zh-TW |
| Japanese | ja |
— |
| Korean | ko |
— |
| Türkçe | tr |
— |
| Russian | ru |
— |
| Tiếng Việt | vi |
— |
| Thai | th |
— |
| Deutsch | de |
— |
| Español | es |
— |
| Français | fr |
— |
| Ukrainian | uk |
— |
| Polski | pl |
— |
| Português (Brasil) | pt-BR |
— |
| Arabic | ar |
— |
| Persian | fa |
— |
| Bahasa Indonesia | id |
— |
| Italiano | it |
— |
If --lang is missing a value, uses an unsupported code, or specifies conflicting values repeatedly, explain the problem and,before writing any fileask the user to choose a supported language; never silently substitute. Handle natural-language requirements involving unsupported languages the same way.
The selected language applies to the frontmatter's titleLevel-1 headings, branch headings, node labels, table body text, link labels, and user-facing descriptions. Translate faithfully and concisely; do not add facts due to translation. Keep code, identifiers, URLs, file paths, proper names, and original numbers/units unchanged when translation would change their meaning. Keep Markdown/YAML key names, review structure key names, format/hierarchy values, and command parameters unchanged.
Write in UTF-8 , preserving diacritics and the original writing system. For Arabic and Persian, keep normal logical text order, do not reverse characters, and do not force transliteration into Latin letters. Use natural phrases in each language: about eight words for space-delimited languages; for Chinese, Japanese, and Thai use equally concise labels, and do not insert spaces or truncate words to meet a word count.
Agent capability requirements
Use the tools available in the current session to perform the following operations; no specific tool names are required. Follow the host's permission and approval rules; installing a skill does not grant additional permissions.
| Operation | Required capability |
|---|---|
Basic .md output |
Check the path and create the file; file input also requires reading the file. |
| URL input | Use the available web-fetch capability to read the page body. |
--render |
Execute commands, and the environment running the attached script has Bash and Node.js / npx。 |
If you cannot check or write files, state the missing capability or permission and ask the user how to proceed; do not claim the file has been saved. If web access or rendering is unavailable, handle it according to the corresponding step.
Workflow
Step 1: Determine the input type
First remove the parameters and their values (including --lang), then classify the remainder and load the content:
- If it is URL(starting with
http://orhttps://), use the available web-fetch capability to read the page body. The fetched content is the content.Prioritizechecking this item before the file/text/topic rules. - Otherwise, if it is a path to anexisting file, use the available file-reading capability to load it. Its content is the content.
- Otherwise, if it islonger or multi-line text(roughly > 12 words, contains line breaks, or a paragraph of > 80 Unicode characters in a language without space-delimited words), treat it asraw text. Do not misclassify it as a topic merely because Chinese, Japanese, or Thai body text has no spaces. That text is the content.
- Otherwise, treat it as atopic: generate content based on the model's own knowledge.
In the following cases, stop and ask the user (never guess on your own):
- Web access is unavailable or URL fetching fails(network error, blocked, or empty page) → explain the situation and ask the user to paste the body text, retry after restoring access, or explicitly choose to generate a mind map based on the topic. Do not fabricate page content out of thin air.
- Looks like a file path(ending with
.md/.txt, or containing/or\) but thefile does not exist → report未找到文件:<路径>, and ask: generate by topic instead, or correct the path? - The input isempty or contains only whitespace → Ask the user to provide content or a topic.
- Inputis genuinely ambiguous(a phrase that could be either text or a topic) → default totopic generation, and state your assumption in one sentence so the user can correct it.
Then determine the output language according to theoutput languagerules above.
Step 2: Build the hierarchy (hybrid strategy)
Convert the content into a node hierarchy:
- If the contentalready has structure(clear headings / bulleted outline): follow its outline, butcompress each node into a short phrase(≤ about 8 words; for languages without space-separated words, keep it equally concise). Do not copy sentence by sentence.
- If the content isunstructuredtext or atopic: extract the key concepts and organize them into 4–7 main branches, each with concise sub-points.
Rules:
- Depth: target 3–4 levels.
- Use phrases, not sentences: every node is a short label.
- Readability over completeness: for very large sources, map their structure and key points—not every line. For unstructured/topic/large sources, target 4–7 main branches; when the source already has structure, follow its own outline. Be bold in condensing.
Step 3: Write the Markmap .md
Write the file in the style shown in the Markmap format below.
Output path:
- File input
foo.md→foo.mindmap.md(same directory). - URL input → take the slug of the page title (or the last path segment of the URL) →
<slug>.mindmap.md。 - Text input → take the slug of the map's H1 title →
<slug>.mindmap.mdin the current directory (slug rules same as for topics). - Topic input →
<主题-slug>.mindmap.mdin the current directory (slug = lowercase, spaces →-)。 - Auto-generated slugs preserve Unicode letters; do not strip non-Latin scripts or force transliteration. File input paths and explicit
--outputpaths are not translated. --output <路径>overrides the default path; write to the given value.- Before writing, use available filesystem-checking capabilities to check whether the target already exists. If it exists, insert a counter before
.mindmap.md—<名称>-2.mindmap.md, then<名称>-3.mindmap.md……take the first unoccupied name. The same suffix rule applies to explicit--outputpaths.Never silently overwrite an existing file.
After writing, tell the user the exact path and how to view it: open it in https://markmap.js.org , or use the VS Code "Markmap" extension.
Step 4 (only when --renderis given): render to HTML
render.sh is located in the scripts/ folder alongside this installed SKILL.md. Locate it using the skill location provided by the host or available file-finding capabilities, then run it by absolute path using command-execution capabilities:
bash "<skill-dir>/scripts/render.sh" "<输出.md>"
- If commands cannot be executed, the script cannot be found, or Bash / Node.js /
npxis missing, keep.mdand explicitly state the reason HTML was not generated. Providenpx --yes markmap-cli "<输出.md>" -o "<输出.html>" --no-openthe manual command, substituting the actual output path, for the user to run in an environment with Node.js. Do not claim the HTML file has been generated. - On success, it prints the
.htmlpath to stdout—tell the user. - If it returns non-zero (e.g.
npxis not installed, exit code 3),.mdis still the guaranteed deliverable. Tell the user rendering was skipped and show the manual command it printed (the exit code 3 "missing npx" case prints one).Do nottreat this as a failure of the whole task.
Markmap format
Write .md:
---
title: <导图标题>
markmap:
colorFreezeLevel: 2
maxWidth: 300
---
# <中心主题>
## <分支 1>
- <要点>
- <子要点>
- <要点>
## <分支 2>
- <要点>
- Exactlyone
#level-1 heading—the root / central topic. ##level-2 headings = main branches;###and-list items = deeper levels.- Inline markdown (
**加粗**、`代码`, links) is allowed and passed through as-is. - Keep the frontmatter defaults (
colorFreezeLevel: 2、maxWidth: 300) unchanged.
Example
Input (a structured excerpt):
Retrieval-Augmented Generation (RAG)Indexing
Split documents, create embeddings, store vectors.
Retrieval
Embed the query and find the nearest-neighbor chunks.
Generation
Inject the retrieved context into the prompt.
Output 检索增强生成.mindmap.md:
---
title: 检索增强生成(RAG)
markmap:
colorFreezeLevel: 2
maxWidth: 300
---
# 检索增强生成(RAG)
## 索引
- 切分文档
- 嵌入片段
- 存储向量
## 检索
- 对查询做嵌入
- 找到最近邻片段
## 生成
- 注入上下文到提示词
Notes
- Default pathrequires no extra runtime dependencies, only file system operation capability; URL input also requires web access capability.
- Automatically running
--renderrequires command execution capability, Bash, and Node.js /npx(usingnpx markmap-cli, no global install needed).