|
1 | 1 | # GNS3-Skills |
2 | 2 |
|
3 | | -Network troubleshooting skills repository for GNS3 Copilot. |
| 3 | +Domain knowledge repository for [GNS3 Copilot](https://github.com/yueguobin/gns3-copilot) — an AI-powered network lab assistant built on LangGraph. |
4 | 4 |
|
5 | | -This repository contains **50 YAML-formatted skill definitions** with **815 fault injection scenarios** covering 60+ networking protocols and technologies — from PPP serial links to SRv6 and EVPN. |
| 5 | +> ⚠️ **What are "skills" here?** This repository is **not** a collection of Claude Code Skills (i.e., `SKILL.md` files auto-triggered by description matching). Instead, it is the **knowledge layer** of GNS3 Copilot. The YAML and Markdown files in this repo define structured domain knowledge — fault injection catalogs, protocol analysis schemas, device command references, and agent prompts — which are loaded into the Copilot's memory registries and served to the LLM via dedicated LangChain tools (`injection_skills`, `packet_analysis_skills`, `device_skills`). The actual executable tools (device configuration, packet capture, topology management) live in the [gns3-server](https://github.com/yueguobin/gns3-server) repository under `gns3server/agent/gns3_copilot/tools_v2/`. |
| 6 | +> |
| 7 | +> For the full architecture: [Architecture Overview](#architecture) |
| 8 | +
|
| 9 | +This repository currently contains **50 YAML-formatted skill definitions** with **815 fault injection scenarios** covering 60+ networking protocols and technologies — from PPP serial links to SRv6 and EVPN. |
6 | 10 |
|
7 | 11 | > 📊 See [SKILLS_SUMMARY.md](SKILLS_SUMMARY.md) for full statistics. |
8 | 12 |
|
9 | 13 | ## Table of Contents |
10 | 14 |
|
11 | 15 | - [Directory Structure](#directory-structure) |
| 16 | +- [Architecture](#architecture) |
12 | 17 | - [Skill Format](#skill-format) |
13 | 18 | - [Injection Skills](#injection-skills) |
14 | 19 | - [Device Skills](#device-skills) |
@@ -55,6 +60,54 @@ GNS3-Skills/ |
55 | 60 | └── SKILLS_SUMMARY.md # Full statistics and breakdown |
56 | 61 | ``` |
57 | 62 |
|
| 63 | +## Architecture |
| 64 | + |
| 65 | +This repository forms the **knowledge layer** of GNS3 Copilot. The skills defined here are not standalone executable units — they are structured domain knowledge consumed by LangChain tools registered in the `gns3_copilot` agent module. |
| 66 | + |
| 67 | +``` |
| 68 | +┌─────────────────────────────────────────────────────────────────┐ |
| 69 | +│ GNS3 Copilot (LangGraph Agent) │ |
| 70 | +│ │ |
| 71 | +│ ┌──────────────────────────────────────────────────────────┐ │ |
| 72 | +│ │ LLM (with System Prompt) │ │ |
| 73 | +│ │ prompts/troubleshooting_injection.md ← loaded via │ │ |
| 74 | +│ │ prompts/lab_automation_assistant.md prompt_loader │ │ |
| 75 | +│ └───────────────┬──────────────────────────────────────────┘ │ |
| 76 | +│ │ │ |
| 77 | +│ ┌─────────────┼──────────────┬──────────────────┐ │ |
| 78 | +│ ▼ ▼ ▼ ▼ │ |
| 79 | +│ ┌─────────┐ ┌──────────┐ ┌──────────────┐ ┌──────────────────┐ │ |
| 80 | +│ │injection│ │device │ │packet_ │ │GNS3 operation │ │ |
| 81 | +│ │_skills │ │_skills │ │analysis_ │ │tools │ │ |
| 82 | +│ │(Tool) │ │(Tool) │ │skills (Tool) │ │(tp. GNS3Create- │ │ |
| 83 | +│ │ │ │ │ │ │ │ NodeTool, etc.) │ │ |
| 84 | +│ └────┬────┘ └────┬─────┘ └──────┬───────┘ └──────────────────┘ │ |
| 85 | +│ │ │ │ │ |
| 86 | +└──────┼───────────┼──────────────┼───────────────────────────────┘ |
| 87 | + │ │ │ |
| 88 | + ▼ ▼ ▼ |
| 89 | +┌────────────┐ ┌────────┐ ┌──────────────┐ |
| 90 | +│ injection/ │ │device/ │ │packet_ │ |
| 91 | +│ ospf_ │ │vpcs │ │analysis/ │ |
| 92 | +│ issues.yaml│ │.yaml │ │ospf.yaml │ |
| 93 | +│ bgp_ │ │ │ │bgp.yaml │ |
| 94 | +│ issues.yaml│ │feature/│ │arp.yaml │ |
| 95 | +│ ... (50) │ │topology│ │... (60) │ |
| 96 | +└────────────┘ │_planner│ └──────────────┘ |
| 97 | + │.yaml │ |
| 98 | + └────────┘ |
| 99 | +``` |
| 100 | + |
| 101 | +**Data flow:** |
| 102 | + |
| 103 | +1. GNS3 Copilot starts → `SkillsManager` clones/pulls this repo → `SkillsLoader` parses YAML files |
| 104 | +2. Parsed data populates three in-memory registries: `INJECTION_SKILLS_REGISTRY`, `SKILLS_REGISTRY`, `PACKET_ANALYSIS_REGISTRY` |
| 105 | +3. Three LangChain tools (`InjectionSkillsTool`, `DeviceSkillsTool`, `PacketAnalysisSkillsTool`) expose these registries to the LLM via tool calls |
| 106 | +4. Separate executable tools (e.g., `PacketAnalysisTool` → tshark, `ExecuteMultipleDeviceConfigCommands` → network devices) perform the actual actions |
| 107 | +5. Agent prompts (`prompts/*.md`) are loaded directly into the LLM's system message to define role and workflow |
| 108 | + |
| 109 | +In Claude Code terms, this architecture is analogous to having **references/** data and **scripts/** executables in separate repositories, wired together by a custom agent framework rather than by the Claude Code runtime. |
| 110 | + |
58 | 111 | ## Skill Format |
59 | 112 |
|
60 | 113 | Skills are defined in two formats depending on their type: |
@@ -139,7 +192,15 @@ command_aliases: # LLM command mapping |
139 | 192 |
|
140 | 193 | ## Usage with GNS3 Copilot |
141 | 194 |
|
142 | | -Skills are automatically loaded from this repository by the GNS3 Copilot agent. |
| 195 | +Skills are automatically loaded from this repository by the GNS3 Copilot agent into three in-memory registries: |
| 196 | + |
| 197 | +| Registry | Source Directory | Exposed Via | Purpose | |
| 198 | +|---|---|---|---| |
| 199 | +| `INJECTION_SKILLS_REGISTRY` | `injection/` | `injection_skills` tool | Fault injection scenarios | |
| 200 | +| `SKILLS_REGISTRY` | `device/`, `feature/` | `device_skills` tool | Device commands, topology planning | |
| 201 | +| `PACKET_ANALYSIS_REGISTRY` | `packet_analysis/` | `packet_analysis_skills` tool | Protocol tshark field definitions | |
| 202 | + |
| 203 | +The LLM queries these registries at runtime via tool calls, then acts on the returned knowledge using separate executable tools (e.g., `PacketAnalysisTool` for running tshark, `ExecuteMultipleDeviceConfigCommands` for configuring devices). |
143 | 204 |
|
144 | 205 | ### Configuration |
145 | 206 |
|
@@ -168,9 +229,15 @@ curl -X POST http://localhost:3080/api/skills/update |
168 | 229 |
|
169 | 230 | ### Loading Behavior |
170 | 231 |
|
171 | | -Skills are loaded from the `injection/` and `device/` directories at startup. The loader (in `gns3server/agent/gns3_copilot/skills/loader.py`) maps filenames to skill keys: |
172 | | -- `injection/ospf_issues.yaml` → key: `injection_ospf` |
173 | | -- `device/vpcs.yaml` → key: value of `device_type` field |
| 232 | +At startup, `SkillsManager` clones or pulls this repository, then `SkillsLoader` parses YAML files into the registries: |
| 233 | + |
| 234 | +- `injection/ospf_issues.yaml` → `INJECTION_SKILLS_REGISTRY["injection_ospf"]` |
| 235 | +- `device/vpcs.yaml` → `SKILLS_REGISTRY["gns3_vpcs_telnet"]` (key from `device_type` field) |
| 236 | +- `packet_analysis/ospf.yaml` → `PACKET_ANALYSIS_REGISTRY["ospf"]` (key from `protocol_key` field) |
| 237 | + |
| 238 | +Prompts in `prompts/` are loaded separately into the agent's system message via `prompt_loader.py`. |
| 239 | + |
| 240 | +The registries support hot reload (`POST /api/skills/update`) without restarting the server. |
174 | 241 |
|
175 | 242 | ## CI/CD Validation |
176 | 243 |
|
|
0 commit comments