workspace/skills/pyats-topology/SKILL.md
Network topology discovery via CDP/LLDP neighbors, ARP tables, routing peers, and interface mapping to build complete network maps. Use when mapping the network, building a diagram, discovering what is connected to what, or documenting device neighbors and links.
npx skillsauth add automateyournetwork/netclaw pyats-topologyInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show cdp neighbors detail"}'
Extract per neighbor:
Build adjacency table:
Local Device | Local Interface | Remote Device | Remote Interface | Remote Platform
R1 | Gi0/0/0 | SW1 | Gi1/0/1 | WS-C3850-24T
R1 | Gi0/0/1 | R2 | Gi0/0/0 | ISR4431
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show lldp neighbors detail"}'
LLDP is IEEE 802.1AB — works with non-Cisco devices (Arista, Juniper, Linux hosts, IP phones, APs). Same adjacency table format as CDP but may include additional TLVs.
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show arp"}'
Analysis:
OSPF neighbors = L3 adjacent routers:
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show ip ospf neighbor"}'
BGP peers = logical connections (may be multi-hop):
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show ip bgp summary"}'
EIGRP neighbors:
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show ip eigrp neighbors"}'
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show ip interface brief"}'
Build subnet map:
Interface | IP Address | Subnet | Connected Subnet
Gi0/0/0 | 10.1.1.1/30 | 10.1.1.0/30 | R1 <-> SW1 transit
Gi0/0/1 | 10.1.2.1/30 | 10.1.2.0/30 | R1 <-> R2 transit
Loopback0 | 1.1.1.1/32 | 1.1.1.1/32 | Router ID
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show vrf"}'
For each VRF, identify:
PYATS_TESTBED_PATH=$PYATS_TESTBED_PATH python3 $MCP_CALL "python3 -u $PYATS_MCP_SCRIPT" pyats_run_show_command '{"device_name":"R1","command":"show standby brief"}'
Map virtual IPs, active/standby roles, group numbers, and tracking objects.
Combine all discovery data into a unified model:
Topology: NetClaw Discovery - YYYY-MM-DD
Devices:
R1 (C8000V, IOS-XE 17.x.x)
Loopback0: 1.1.1.1/32 (Router ID)
Gi1: 10.1.1.1/30 → R2:Gi1 (OSPF Area 0, cost 1)
Gi2: 10.1.2.1/24 → SW1:Gi0/1 (Access VLAN 10)
R2 (ISR4431, IOS-XE 17.x.x) [discovered via CDP]
Gi1: 10.1.1.2/30 → R1:Gi1
Gi2: 10.2.1.1/24 → SW2:Gi0/1
Subnets:
10.1.1.0/30 - R1-R2 transit (OSPF Area 0)
10.1.2.0/24 - R1 LAN segment (VLAN 10)
10.2.1.0/24 - R2 LAN segment (VLAN 20)
Routing Adjacencies:
R1 <-> R2: OSPF (Area 0, FULL)
R1 <-> ISP: BGP (AS 65001 <-> AS 65000, Established)
FHRP:
VLAN 10: HSRP Group 10, VIP 10.1.2.254, Active=R1, Standby=R3
After discovery, use this data to generate:
When NetBox is available ($NETBOX_MCP_SCRIPT is set), reconcile discovered topology against the source of truth:
python3 $MCP_CALL "python3 -u $NETBOX_MCP_SCRIPT" netbox_get_objects '{"object_type":"dcim.cables","filters":{},"limit":200}'
python3 $MCP_CALL "python3 -u $NETBOX_MCP_SCRIPT" netbox_get_objects '{"object_type":"dcim.devices","filters":{},"brief":true}'
python3 $MCP_CALL "python3 -u $NETBOX_MCP_SCRIPT" netbox_get_objects '{"object_type":"dcim.interfaces","filters":{"device":"R1"}}'
Compare CDP/LLDP discovered neighbors against NetBox cables:
| Category | Meaning | Action | |---|---|---| | DOCUMENTED | Link exists in both discovery and NetBox | No action | | UNDOCUMENTED | Link found by CDP/LLDP but not in NetBox | Open ServiceNow incident to update NetBox | | MISSING | Cable in NetBox but not seen by CDP/LLDP | Investigate — may be physical disconnect | | MISMATCH | Endpoints differ between discovery and NetBox | Investigate — possible re-patching |
Generate a Draw.io topology diagram with links color-coded by reconciliation status:
Run CDP/LLDP/ARP/routing peer collection across ALL devices simultaneously using multiple exec commands. Merge results to build the complete topology graph.
Record the topology discovery in GAIT:
python3 $MCP_CALL "python3 -u $GAIT_MCP_SCRIPT" gait_record_turn '{"input":{"role":"assistant","content":"Topology discovery completed: 5 devices, 12 links. NetBox reconciliation: 10 documented, 1 undocumented, 1 missing.","artifacts":[]}}'
testing
Human-in-the-loop escalation via HumanRail — route low-confidence agent decisions, pre-destructive operation approvals, and ambiguous incident tickets to real human engineers. Human answers are verified and returned as structured output. Workers are paid via Lightning Network. Use when the agent is uncertain, when a destructive change needs explicit human sign-off beyond a ServiceNow CR, or when an ambiguous ticket requires human triage before automated handling.
testing
Manage EVE-NG node lifecycle. Use when listing nodes, checking runtime state, creating or deleting nodes, starting or stopping nodes or whole labs, verifying node details, or wiping node NVRAM back to factory defaults.
development
Manage EVE-NG labs and platform inventory. Use when listing labs, checking lab metadata, creating or deleting labs, importing or exporting lab archives, checking EVE-NG health or auth, or verifying available node images before build work.
tools
Execute live CLI commands on running EVE-NG nodes over telnet console. Use when running show commands, making live config changes, verifying protocol state, testing connectivity, checking console readiness, or interacting with IOS, Junos, VPCS, EOS, or NX-OS nodes.