Install
openclaw skills install code-to-mindmapUse when (1) user pastes source code and wants to visualize it as a mind map, node graph, or tree diagram. (2) user says "show this as a mindmap", "draw the architecture", "make a flowchart of this code", or "visualize the structure". (3) user wants to understand an unfamiliar codebase by seeing its structure visually.
openclaw skills install code-to-mindmapUse when (1) user pastes source code and wants to visualize it as a mind map, node graph, or tree diagram. (2) user says "show this as a mindmap", "draw the architecture", "make a flowchart of this code", or "visualize the structure". (3) user wants to understand an unfamiliar codebase by seeing its structure visually.
This skill solves the specific problem of: code structure is hard to grasp from raw text — a visual map reveals relationships, hierarchy, and architecture at a glance.
This skill IS NOT:
This skill IS activated ONLY when: source code + visualization intent are both present.
/code-to-mindmapDefault mode. Parses source code and outputs a Mermaid-compatible mindmap or graph.
When to use: User provides code and wants a visual structure diagram.
/code-to-mindmap/hierarchyOutputs a tree showing file/folder hierarchy without analyzing imports.
When to use: User wants to see project structure, not code relationships.
def, class, import, async deffunction, const, class, import, exportfunc, type, struct, packagemain, app, index)| Code Shape | Diagram Type |
|---|---|
| Single file, class-heavy | Mindmap (center = class, branches = methods) |
| Multi-file, import dependencies | Graph (nodes = files, edges = imports) |
| Hierarchical directory | Tree / flowchart |
| State machine or flow | State diagram |
| Call graph (who calls whom) | Flowchart / directed graph |
Output as Mermaid mindmap or graph LR format:
mindmap
root((Code))
ClassName
method_one
method_two
nested_helper
another_class
handler
For large codebases (>20 nodes), summarize: show top-level structure only, note that deeper nodes exist.
calculate_sum(nums: list) -> int)A good output:
A bad output:
| Scenario | Bad Output | Good Output |
|---|---|---|
| Single Python class | All methods listed flat with no hierarchy | Center = class name, methods as child nodes |
| Multi-file project | One giant diagram with 50 nodes | Multiple sub-diagrams per module |
| Imported standard library | Treated as internal dependencies | Marked differently (dashed border) |
| Anonymous/lambda functions | Omitted | Listed as "anonymous / lambda" |
references/ — Mermaid mindmap syntax guide, language-specific parsing patterns, code architecture patternsscripts/render.py — Render Mermaid diagram to PNG/SVG