generate-diagram
Draw a network topology diagram from the device configs and saved show cdp/lldp neighbors detail output in configs/ — an SVG, a self-contained HTML preview, Mermaid and D2, and optionally an editable PowerPoint slide. Use when the user asks to draw, map, diagram or visualise the topology, the network, the links between devices, or wants a network diagram for a MOP, a change record, an incident report or a deck. Not for diagnosing a fault (use troubleshoot) or reviewing a config's security (use config-audit).
- License 许可
- MIT
- 最近更新
- 2026-11-02
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- generate-diagram
- description
- Draw a network topology diagram from the device configs and saved show cdp/lldp neighbors detail output in configs/ — an SVG, a self-contained HTML preview, Mermaid and D2, and optionally an editable PowerPoint slide. Use when the user asks to draw, map, diagram or visualise the topology, the network, the links between devices, or wants a network diagram for a MOP, a change record, an incident report or a deck. Not for diagnosing a fault (use troubleshoot) or reviewing a config's security (use config-audit).
02 资源文件 1
- 参考文档references/diagram-spec.md3.4 KB
03 SKILL.md 正文
Topology diagrams
The Damira scripts parse the configs into a spec (topology.json) and draw it. You
review the spec with the engineer, fix what the configs can't tell you, and present the
result. Everything runs locally and needs no install; no Damira API call is made.
Step 1: Choose the folder and check the inputs
Work in documents/<id>/, where <id> is short and kebab-case, such as
documents/chi-core-topology/. The inputs are the files in configs/: running-configs
(IOS, IOS-XE, NX-OS, Junos set form) and saved show cdp neighbors detail or
show lldp neighbors detail output, one file per device.
Configs alone give links only where two devices share a /29 to /31 subnet, plus BGP
sessions. If there is no CDP/LLDP output, say so and suggest the engineer saves
show cdp neighbors detail (or LLDP) from each device into configs/. Give the command;
don't run it on devices.
No configs at all, but the engineer describes the network or a source of truth such as
NetBox is connected? Write documents/<id>/topology.json yourself following
references/diagram-spec.md, and skip to Step 4.
Step 2: Build the spec
~/.damira/bin/damira diagram build configs/ -o documents/<id>/topology.json
It prints what it found, for example "7 nodes (3 external), 8 links: 6 from CDP/LLDP, 0 from shared subnets, 1 BGP-only (dashed)", plus a note for every device no CDP/LLDP output mentions.
Step 3: Review the links with the engineer
Read topology.json and summarise it in a short table: each link's two ends with their
interfaces, and how it was found. Point out what is inferred rather than seen:
- links with
sourcesubnetorbgp(no CDP/LLDP behind them) - dashed
bgpedges andexternalnodes - devices the notes say no neighbour output mentions
Ask whether anything is missing or wrong. Apply the answers by editing the spec (see
references/diagram-spec.md): set role, tier or zone, add links with
"source": "manual", delete links that aren't real. Never invent a link or an interface
the engineer or the evidence didn't give you.
Step 4: Render
~/.damira/bin/damira diagram render documents/<id>/topology.json
This writes topology.svg, index.html, topology.mmd and topology.d2 next to the
spec. The same spec always gives the same files.
Add --pptx if the engineer wants an editable slide (for a deck or a CAB). It uses
python-pptx if present, otherwise uv run --with python-pptx. Exit code 4 means no slide
was written because neither is available; everything else is. Suggest installing uv.
Step 5: Present
-
Give the paths:
topology.svgfor documents,index.htmlfor viewing (the diagram plus device and link tables; self-contained). Open it in Cursor's browser. -
Show the Mermaid inline in a ```mermaid block, so the engineer sees it in chat and can paste it into a wiki or a ticket.
-
If this Cursor build can show a canvas, build one from
topology.json, not from the SVG. Keep it local:- a stats row: devices, links, external nodes, inferred (subnet or bgp) links
- the diagram, nodes by tier top to bottom, dashed for
bgpedges and external nodes - a link table: both ends, interfaces, subnet, source
No canvas available? The preview covers it. Don't mention the canvas.
Need a copy to put in a ticket or send outside the team? Render a redacted one; never share the original preview:
~/.damira/bin/damira diagram render documents/<id>/topology.json \
--redact --out-dir documents/<id>/share
Hostnames, AS numbers, management IPs and subnets become tokens (HOST-1, IP-2, NET-1),
the same in every file. Show the user the redaction counts and ask them to check
documents/<id>/share/index.html for anything left.
When a MOP, change control or incident report in the same folder needs the diagram,
reference topology.svg or paste the Mermaid into it.
04 同仓库更多 Skills
upgrade-plan
Ask Damira to assess a version-to-version upgrade of a network platform and produce the MOP and change control. Use when the user names a product and a target release — "IOS-XE 17.6.5 to 17.9.5", "CUCM 12.5 SU7 to 15", "PAN-OS 10.2 to 11.1" — or asks what breaks, what the risk is, or how long a maintenance window needs to be. Covers CUCM, IOS-XE, IOS-XR, NX-OS, PAN-OS, FortiOS, Junos, ISE, ASA, WLC/Catalyst 9800. Not for platform-to-platform migration (CUCM to Webex Calling, on-prem to cloud) and not for diagnosing a fault after an upgrade — use troubleshoot for that.
troubleshoot
Ask Damira to diagnose an active, in-progress network fault. Use when the user reports something broken right now — an outage, a flapping interface, a BGP or OSPF adjacency down, dropped or blackholed traffic, failed calls, users unable to connect — or pastes show/log output for analysis. Also fires on direct questions like "why is BGP down" or "why is OSPF stuck in EXSTART". Returns vendor-specific diagnosis with exact CLI commands. Do NOT use for "how does X work" protocol questions, for reviewing a config that is not currently broken (use config-audit), or for planning an upgrade (use upgrade-plan).
source-of-truth-change
Turn intended state in the engineer's source of truth (NetBox or Nautobot) into a validated change, then hand it to the automation they already run — an Ansible Automation Platform job in check mode, a pyATS/Genie before-and-after diff, or a Terraform plan. Use when the user asks to make a change "from NetBox" or "from Nautobot", to push what the source of truth says, to bring devices in line with intended state, or to run a validated playbook through AAP or pyATS. Damira never applies the change; the engineer does. For a playbook with no source of truth use generate-playbook, for Terraform alone use generate-terraform, and for an active outage use troubleshoot.
lab-test-change
Test a network change in a throwaway ContainerLab lab before it goes near production — deploy the lab, apply the playbook or script, run show-command or pyATS/Genie checks, report pass/fail, and always destroy the lab. Use when the user says "test this in a lab first", "prove this change before the window", "dry-run this playbook against a lab", or wants evidence a change works before a CAB. Needs docker and containerlab on the engineer's machine; without them it validates only and says so. To only build a lab, use generate-lab; to write the change, use generate-playbook, generate-automation or generate-terraform.
generate-workbook
Build an Excel workbook (.xlsx) for a network procedure — a migration, platform migration, security audit, change control, or incident-response workbook — grounded in Damira evidence, with an HTML preview. Use when the user asks for a spreadsheet, workbook, tracker, or Excel version of a migration plan, cutover, audit findings, change record, or incident timeline. For a version-to-version upgrade, use upgrade-plan (it offers the workbook itself). Not for diagnosing an active fault — use troubleshoot.
generate-tests
Write network tests — pyATS/Genie learn, change, learn, diff jobs that prove a change did what it should and nothing else, and pytest tests for automation scripts — then validate them locally. Use when the user asks for pyATS, Genie, AEtest, a testbed file, pre/post change verification, state snapshots, or unit tests for a Nornir/Netmiko script. For the change itself use generate-playbook, generate-automation or generate-terraform.