azure-diagrams by eraserlabs/eraser-io
npx skills add https://github.com/eraserlabs/eraser-io --skill azure-diagrams根据 ARM 模板、Azure CLI 输出或自然语言描述,生成 Azure 基础设施的架构图。
在以下情况激活此技能:
az vm list)此技能通过解析 Azure 资源并直接调用 Eraser API 来生成 Azure 专用图表:
/api/render/elements 并指定 diagramType: "cloud-architecture-diagram"当用户提供 Azure 基础设施信息时:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
resourcesaz 命令的 JSON 输出[label: "VNet 10.0.0.0/16"]示例:
myVNet [label: "VNet 10.0.0.0/16"] {
subnet1 [label: "Subnet 1"] {
myVM [icon: azure-vm, label: "Virtual Machine"]
gateway [icon: azure-app-gateway]
}
subnet2 [label: "Subnet 2"] {
database [icon: azure-sql]
}
}
storage [icon: azure-storage]
myVNet -> myVM
myVM -> database
5. 发起 HTTP 请求
重要:生成 DSL 后,你必须执行此 curl 命令。切勿在生成 DSL 后不进行 API 调用就停止。
关键:在下面的 X-Skill-Source 请求头中,你必须将值替换为你的 AI 代理名称:
如果你是 Claude (Anthropic),使用:claude
如果你在 Cursor 中运行,使用:cursor
如果你是 ChatGPT (OpenAI),使用:chatgpt
如果你是 Gemini (Google),使用:gemini
否则,使用你的模型/代理名称(小写)
curl -X POST https://app.eraser.io/api/render/elements
-H "Content-Type: application/json"
-H "X-Skill-Source: eraser-skill"
-H "Authorization: Bearer ${ERASER_API_KEY}"
-d '{
"elements": [{
"type": "diagram",
"id": "diagram-1",
"code": "<your generated DSL>",
"diagramType": "cloud-architecture-diagram"
}],
"scale": 2,
"theme": "${ERASER_THEME:-dark}",
"background": true
}'
在分析文件和资源以生成图表时,跟踪:
infra/main.bicep - 虚拟网络和子网定义)关键:最小输出格式
你的响应必须始终包含以下元素,并带有清晰的标题:
图表预览:使用标题显示
## 图表

使用 API 响应中的实际 imageUrl。
编辑器链接:使用标题显示
## 在 Eraser 中打开
[在 Eraser 编辑器中编辑此图表]({createEraserFileUrl})
使用 API 响应中的实际 URL。
来源部分:简要列出分析的文件/资源(如果适用)
## 来源
- `path/to/file` - 提取的内容
图表代码部分:Eraser DSL 代码,放在带有 eraser 语言标签的代码块中
## 图表代码
```eraser
{DSL code here}
了解更多链接:您可以在 https://docs.eraser.io/docs/using-ai-agent-integrations 了解更多关于 Eraser 的信息
附加内容规则:
默认输出应该简短。图表图像本身就能说明问题。
{
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"name": "rg-main"
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "myVNet",
"properties": {
"addressSpace": {
"addressPrefixes": ["10.0.0.0/16"]
},
"subnets": [
{
"name": "subnet1",
"properties": {
"addressPrefix": "10.0.1.0/24"
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "myVM",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_B1s"
}
}
},
{
"type": "Microsoft.Web/sites",
"name": "myAppService",
"properties": {
"serverFarmId": "/subscriptions/.../serverfarms/myPlan"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "mystorageaccount"
},
{
"type": "Microsoft.Sql/servers",
"name": "mysqlserver",
"properties": {
"administratorLogin": "admin"
}
}
]
}
解析 ARM 模板:
生成显示 Azure 服务多样性的 DSL:
resource-group [label: "Resource Group rg-main"] {
myVNet [label: "VNet 10.0.0.0/16"] {
subnet1 [label: "Subnet 1 10.0.1.0/24"] {
myVM [icon: azure-vm, label: "VM Standard_B1s"]
}
}
myAppService [icon: azure-app-service, label: "App Service"]
mystorageaccount [icon: azure-storage, label: "Storage Account"]
mysqlserver [icon: azure-sql, label: "SQL Server"]
}
myAppService -> mystorageaccount
myVM -> mysqlserver
重要:所有标签文本必须位于引号内的单行上。Azure 专用:将资源组显示为容器,包含应用服务、存储账户和 SQL 数据库,并带有适当的 Azure 图标。
diagramType: "cloud-architecture-diagram" 调用 /api/render/elementsUser runs: az vm list --output json
Provides JSON output
296
9
2026年1月27日
gemini-cli258
codex257
opencode254
github-copilot254
amp236
kimi-cli235
Generates architecture diagrams for Azure infrastructure from ARM templates, Azure CLI output, or natural language descriptions.
Activate this skill when:
az vm list)This skill generates Azure-specific diagrams by parsing Azure resources and calling the Eraser API directly:
/api/render/elements with diagramType: "cloud-architecture-diagram"When the user provides Azure infrastructure information:
Parse the Source
resources array, identify types (Microsoft.Compute/virtualMachines, etc.)az commandsIdentify Azure Components
Map Relationships
Example:
myVNet [label: "VNet 10.0.0.0/16"] {
subnet1 [label: "Subnet 1"] {
myVM [icon: azure-vm, label: "Virtual Machine"]
gateway [icon: azure-app-gateway]
}
subnet2 [label: "Subnet 2"] {
database [icon: azure-sql]
}
}
storage [icon: azure-storage]
myVNet -> myVM
myVM -> database
5. Make the HTTP Request
IMPORTANT : You MUST execute this curl command after generating the DSL. Never stop after generating DSL without making the API call.
CRITICAL : In the X-Skill-Source header below, you MUST replace the value with your AI agent name:
* If you are Claude (Anthropic), use: `claude`
* If you are running in Cursor, use: `cursor`
* If you are ChatGPT (OpenAI), use: `chatgpt`
* If you are Gemini (Google), use: `gemini`
* Otherwise, use your model/agent name in lowercase
curl -X POST https://app.eraser.io/api/render/elements \
-H "Content-Type: application/json" \
-H "X-Skill-Source: eraser-skill" \
-H "Authorization: Bearer ${ERASER_API_KEY}" \
-d '{
"elements": [{
"type": "diagram",
"id": "diagram-1",
"code": "<your generated DSL>",
"diagramType": "cloud-architecture-diagram"
}],
"scale": 2,
"theme": "${ERASER_THEME:-dark}",
"background": true
}'
6. Track Sources During Analysis
As you analyze files and resources to generate the diagram, track:
* **Internal files** : Record each file path you read and what information was extracted (e.g., `infra/main.bicep` \- VNet and subnet definitions)
* **External references** : Note any documentation, examples, or URLs consulted (e.g., Azure architecture best practices documentation)
* **Annotations** : For each source, note what it contributed to the diagram
7. Handle the Response
CRITICAL: Minimal Output Format
Your response MUST always include these elements with clear headers:
1. **Diagram Preview** : Display with a header
## Diagram

Use the ACTUAL imageUrl from the API response.
2. **Editor Link** : Display with a header
## Open in Eraser
[Edit this diagram in the Eraser editor]({createEraserFileUrl})
Use the ACTUAL URL from the API response.
3. **Sources section** : Brief list of files/resources analyzed (if applicable)
## Sources
- `path/to/file` - What was extracted
4. **Diagram Code section** : The Eraser DSL in a code block with `eraser` language tag
## Diagram Code
```eraser
{DSL code here}
5. **Learn More link** : `You can learn more about Eraser at https://docs.eraser.io/docs/using-ai-agent-integrations`
Additional content rules:
* If the user ONLY asked for a diagram, include NOTHING beyond the 5 elements above
* If the user explicitly asked for more (e.g., "explain the architecture", "suggest improvements"), you may include that additional content
* Never add unrequested sections like Overview, Security Considerations, Testing, etc.
The default output should be SHORT. The diagram image speaks for itself.
{
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"name": "rg-main"
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "myVNet",
"properties": {
"addressSpace": {
"addressPrefixes": ["10.0.0.0/16"]
},
"subnets": [
{
"name": "subnet1",
"properties": {
"addressPrefix": "10.0.1.0/24"
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "myVM",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_B1s"
}
}
},
{
"type": "Microsoft.Web/sites",
"name": "myAppService",
"properties": {
"serverFarmId": "/subscriptions/.../serverfarms/myPlan"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "mystorageaccount"
},
{
"type": "Microsoft.Sql/servers",
"name": "mysqlserver",
"properties": {
"administratorLogin": "admin"
}
}
]
}
Parses ARM template:
Generates DSL showing Azure service diversity:
resource-group [label: "Resource Group rg-main"] {
myVNet [label: "VNet 10.0.0.0/16"] {
subnet1 [label: "Subnet 1 10.0.1.0/24"] {
myVM [icon: azure-vm, label: "VM Standard_B1s"]
}
}
myAppService [icon: azure-app-service, label: "App Service"]
mystorageaccount [icon: azure-storage, label: "Storage Account"]
mysqlserver [icon: azure-sql, label: "SQL Server"]
}
myAppService -> mystorageaccount
myVM -> mysqlserver
Important : All label text must be on a single line within quotes. Azure-specific: Show Resource Groups as containers, include App Services, Storage Accounts, and SQL databases with proper Azure icons.
/api/render/elements with diagramType: "cloud-architecture-diagram"User runs: az vm list --output json
Provides JSON output
Parses JSON to extract:
Formats and calls API
Weekly Installs
296
Repository
GitHub Stars
9
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykFail
Installed on
gemini-cli258
codex257
opencode254
github-copilot254
amp236
kimi-cli235
Generate Eraser DSL Convert Azure resources to Eraser DSL:
[label: "VNet 10.0.0.0/16"]