Add single-line visual headers to 66 command files across 10 plugins: - clarity-assist (2 commands): 💬 - claude-config-maintainer (5 commands): ⚙️ - cmdb-assistant (11 commands): 🖥️ - code-sentinel (3 commands): 🔒 - contract-validator (5 commands): ✅ - data-platform (10 commands): 📊 - doc-guardian (5 commands): 📝 - git-flow (8 commands): 🔀 - pr-review (7 commands): 🔍 - viz-platform (10 commands): 🎨 Each command now displays a consistent header at execution start: ┌────────────────────────────────────────────────────────────────┐ │ [icon] PLUGIN-NAME · Command Description │ └────────────────────────────────────────────────────────────────┘ Addresses #275 (other plugin commands visual output) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5.3 KiB
description
| description |
|---|
| Generate infrastructure topology diagrams from NetBox data |
CMDB Topology Visualization
Visual Output
When executing this command, display the plugin header:
┌──────────────────────────────────────────────────────────────────┐
│ 🖥️ CMDB-ASSISTANT · Topology │
└──────────────────────────────────────────────────────────────────┘
Then proceed with the visualization.
Generate Mermaid diagrams showing infrastructure topology from NetBox.
Usage
/cmdb-topology <view> [scope]
Views:
rack <rack-name>- Rack elevation showing devices and positionsnetwork [site]- Network topology showing device connections via cablessite <site-name>- Site overview with racks and device countsfull- Full infrastructure overview
Instructions
You are a topology visualization assistant that queries NetBox and generates Mermaid diagrams.
View: Rack Elevation
Generate a rack view showing devices and their positions.
Data Collection:
- Use
dcim_list_racksto find the rack by name - Use
dcim_list_deviceswithrack_idfilter to get devices in rack - For each device, note:
position,u_height,face,name,role
Mermaid Output:
graph TB
subgraph rack["Rack: <rack-name> (U<height>)"]
direction TB
u42["U42: empty"]
u41["U41: empty"]
u40["U40: server-01 (Server)"]
u39["U39: server-01 (cont.)"]
u38["U38: switch-01 (Switch)"]
%% ... continue for all units
end
For devices spanning multiple U:
- Mark the top U with device name and role
- Mark subsequent Us as "(cont.)" for the same device
- Empty Us should show "empty"
View: Network Topology
Generate a network diagram showing device connections.
Data Collection:
- Use
dcim_list_sitesif no site specified (get all) - Use
dcim_list_deviceswith optionalsite_idfilter - Use
dcim_list_cablesto get all connections - Use
dcim_list_interfacesfor each device to understand port names
Mermaid Output:
graph TD
subgraph site1["Site: Home"]
router1[("core-router-01<br/>Router")]
switch1[["dist-switch-01<br/>Switch"]]
server1["web-server-01<br/>Server"]
server2["db-server-01<br/>Server"]
end
router1 -->|"eth0 - eth1"| switch1
switch1 -->|"gi0/1 - eth0"| server1
switch1 -->|"gi0/2 - eth0"| server2
Node shapes by role:
- Router:
[(" ")](cylinder/database shape) - Switch:
[[ ]](double brackets) - Server:
[ ](rectangle) - Firewall:
{{ }}(hexagon) - Other:
[ ](rectangle)
Edge labels: Show interface names on both ends (A-side - B-side)
View: Site Overview
Generate a site-level view showing racks and summary counts.
Data Collection:
- Use
dcim_get_siteto get site details - Use
dcim_list_rackswithsite_idfilter - Use
dcim_list_deviceswithsite_idfilter for counts per rack
Mermaid Output:
graph TB
subgraph site["Site: Headquarters"]
subgraph row1["Row 1"]
rack1["Rack A1<br/>12/42 U used<br/>5 devices"]
rack2["Rack A2<br/>20/42 U used<br/>8 devices"]
end
subgraph row2["Row 2"]
rack3["Rack B1<br/>8/42 U used<br/>3 devices"]
end
end
View: Full Infrastructure
Generate a high-level view of all sites and their relationships.
Data Collection:
- Use
dcim_list_regionsto get hierarchy - Use
dcim_list_sitesto get all sites - Use
dcim_list_deviceswith status filter for counts
Mermaid Output:
graph TB
subgraph region1["Region: Americas"]
site1["Headquarters<br/>3 racks, 25 devices"]
site2["Branch Office<br/>1 rack, 5 devices"]
end
subgraph region2["Region: Europe"]
site3["EU Datacenter<br/>10 racks, 100 devices"]
end
site1 -.->|"WAN Link"| site3
Output Format
Always provide:
- Summary - Brief description of what the diagram shows
- Mermaid Code Block - The diagram code in a fenced code block
- Legend - Explanation of shapes and colors used
- Data Notes - Any data quality issues (e.g., devices without position, missing cables)
Example Output:
## Network Topology: Home Site
This diagram shows the network connections between 4 devices at the Home site.
```mermaid
graph TD
router1[("core-router<br/>Router")]
switch1[["main-switch<br/>Switch"]]
server1["homelab-01<br/>Server"]
router1 -->|"eth0 - gi0/24"| switch1
switch1 -->|"gi0/1 - eth0"| server1
Legend:
- Cylinder shape: Routers
- Double brackets: Switches
- Rectangle: Servers
Data Notes:
- 1 device (nas-01) has no cable connections documented
## Examples
- `/cmdb-topology rack server-rack-01` - Show devices in server-rack-01
- `/cmdb-topology network` - Show all network connections
- `/cmdb-topology network Home` - Show network topology for Home site only
- `/cmdb-topology site Headquarters` - Show rack overview for Headquarters
- `/cmdb-topology full` - Show full infrastructure overview
## User Request
$ARGUMENTS