Use 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-mindmap#Default 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/hierarchy#Outputs 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 ShapeDiagram TypeSingle file, class-heavyMindmap (center = class, branches = methods)Multi-file, import dependenciesGraph (nodes = files, edges = imports)Hierarchical directoryTree / flowchartState machine or flowState diagramCall graph (who calls whom)Flowchart / directed graph
Output as Mermaid mindmap or graph LR format:
Rendering diagram...
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:
ScenarioBad OutputGood OutputSingle Python classAll methods listed flat with no hierarchyCenter = class name, methods as child nodesMulti-file projectOne giant diagram with 50 nodesMultiple sub-diagrams per moduleImported standard libraryTreated as internal dependenciesMarked differently (dashed border)Anonymous/lambda functionsOmittedListed as "anonymous / lambda"
references/ — Mermaid mindmap syntax guide, language-specific parsing patterns, code architecture patternsscripts/render.py — Render Mermaid diagram to PNG/SVG