Skip to content

/wbVision — Exhaustive Simulation () ​

/wbVision is the systems cartographer. It transforms code structures (class hierarchies, component trees, API routes, dependency graphs) into visual architectural representations — primarily Mermaid.js diagrams. The hard constraint: structural accuracy. If two files don't explicitly import each other, no edge can be drawn between them. The agent traces real import/require statements, not inferred relationships.

Read this if you want to know which diagram types are supported, what --depth controls about the graph size, and why there's a 50-node hard limit.


1. Role & target ​

AspectBehavior
RoleThe Architect & Cartographer. Produces visual maps of code structure.
TargetSource directories, individual files, or ORM model files.
Cell scopeNone. /wbVision is read-only.
Side effects allowedWriting Mermaid markdown files.
Side effects forbiddenModifying code, editing plans, altering imports.

The "no inferred relationships" rule is what separates /wbVision from documentation tools that guess connections. If WBC.core.js doesn't explicitly import from tierEnforcement.js, no edge appears between them — even if they're in the same folder and logically related. The diagram shows what the code declares, not what a human might assume.


2. Argument resolution ​

FormExampleWhat /wbVision does
Specific fileCommand: /wbVision src/WBC.jsInternal flowchart: methods, control flow, branching within the monolith.
Directory pathCommand: /wbVision packages/wb-coreComponent tree: how files in wb-core relate to each other via imports.
Comma-separatedCommand: /wbVision apps/demo,packages/wb-coreCross-boundary diagram: visualizes the consumer → library interface.
Wildcard globCommand: /wbVision src/**/*.jsFull architectural map of the source directory.

The comma-separated form is the highest-value use case. Visualizing apps/demo,packages/wb-core shows exactly which exports from wb-core are consumed by the demo app — the boundary crossing is the diagram's subject.


3. Flag matrix ​

FlagShortcutPurpose
--type="<format>"-tForces diagram type: flowchart, er, sequence, class.
--depth="<N>"-dLimits recursive import tracing to N levels deep.

--type auto-detection. Without --type, the diagram format is inferred from the target:

  • Source directory → flowchart (dependency graph)
  • ORM models → er (entity-relationship)
  • API routes → sequence (request flow)
  • Single class file → class (UML class diagram)

--depth and the 50-node limit. The hard limit exists to prevent browser-crashing diagrams. A monorepo with 200+ files produces a graph that's unreadable even if it renders. --depth=2 is the sweet spot for most use cases — it shows the target and its immediate + second-degree dependencies without drowning in transitive imports.


4. Pipelines (the agent-native scenarios) ​

📋/wbVision Exhaustive Simulation
wb-core dependency graph after decomposition/wbVision core2/packages/wb-core/src/ -d="2" -o="arch_wb-core.md"
> /wbVision core2/packages/wb-core/src/ -d="2" -o="arch_wb-core.md"
[SYSTEM] Tracing imports (depth: 2)...
[AST] 18 files parsed. 14 import relationships found.
[GENERATE]
⚠️ Note: After the WBC.js decomposition, visualize how the new modules connect:

💠 Pipeline wb-core dependency graph after decomposition ​

After the WBC.js decomposition, visualize how the new modules connect:

💠 Pipeline Consumer-library boundary crossing ​

Visualize what demo.wbc-ui.com actually uses from wb-core:

💠 Pipeline API sequence diagram for the auth flow ​

Visualize the request lifecycle for authentication:


5. Edge cases & refusals ​

TriggerWhat /wbVision does
AST identifies >50 nodes❌ Graph too complex (N nodes). Use --depth to reduce. Recommended: -d="2".
Render fails (no headless browser)⚠️ SVG render failed. Outputting raw Mermaid markdown instead.
Files in scope don't import each other⚠️ Graph contains orphaned nodes. No import relationships found between these files.
Single file with no exportsProduces an internal flowchart of the file's control flow (if/else, loops, returns).
-t="er" on non-ORM files⚠️ No ORM models detected. ER diagram requires Prisma/Mongoose/Sequelize schemas. Falling back to flowchart.
Circular imports detectedRenders the cycle with a highlighted edge: `A -->

The unifying principle: /wbVision draws what the code declares. Every edge in the diagram traces to a real import/require statement or a real function call. No inferred, assumed, or hallucinated relationships. If the diagram looks sparse, it's because the code's coupling is actually sparse — and that's information worth having.