aws-diagrams by eraserlabs/eraser-io
npx skills add https://github.com/eraserlabs/eraser-io --skill aws-diagrams根据 CloudFormation 模板、AWS CLI 输出或自然语言描述,生成 AWS 基础设施的架构图。
在以下情况激活此技能:
aws ec2 describe-instances)此技能通过解析 AWS 资源并直接调用 Eraser API 来生成 AWS 专属的架构图:
/api/render/elements 并设置 diagramType: "cloud-architecture-diagram"当用户提供 AWS 基础设施信息时:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Resourcesaws 命令的 JSON 输出[label: "VPC 10.0.0.0/16"]示例:
main-vpc [label: "VPC 10.0.0.0/16"] {
public-subnet [label: "Public Subnet"] {
web-server [icon: aws-ec2, label: "Web Server"]
load-balancer [icon: aws-elb]
}
private-subnet [label: "Private Subnet"] {
database [icon: aws-rds]
cache [icon: aws-elasticache]
}
}
data-bucket [icon: aws-s3]
function [icon: aws-lambda]
load-balancer -> web-server
web-server -> 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.tf - VPC 和子网定义)关键:最小化输出格式
你的响应必须始终包含以下带有清晰标题的元素:
图表预览:使用标题显示
## 图表

使用 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:
MyVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
PublicSubnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref MyVPC
CidrBlock: 10.0.1.0/24
WebServer:
Type: AWS::EC2::Instance
Properties:
InstanceType: t3.micro
SubnetId: !Ref PublicSubnet
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-app-bucket
MyFunction:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.9
Handler: index.handler
MyDatabase:
Type: AWS::RDS::DBInstance
Properties:
Engine: postgres
DBInstanceClass: db.t3.micro
解析 CloudFormation:
生成显示 AWS 服务多样性的 DSL:
MyVPC [label: "VPC 10.0.0.0/16"] {
PublicSubnet [label: "Public Subnet 10.0.1.0/24"] {
WebServer [icon: aws-ec2, label: "EC2 t3.micro"]
}
}
MyBucket [icon: aws-s3, label: "S3 my-app-bucket"]
MyFunction [icon: aws-lambda, label: "Lambda python3.9"]
MyDatabase [icon: aws-rds, label: "RDS PostgreSQL db.t3.micro"]
WebServer -> MyBucket
MyFunction -> MyDatabase
WebServer -> MyDatabase
重要:所有标签文本必须位于引号内的一行中。AWS 专属:包含服务图标,显示服务间的数据流,在适用时按 VPC 分组。
diagramType: "cloud-architecture-diagram" 调用 /api/render/elementsUser runs: aws ec2 describe-instances
Provides JSON output
每周安装次数
567
代码仓库
GitHub 星标数
9
首次出现时间
Jan 27, 2026
安全审计
安装于
gemini-cli507
codex507
opencode503
github-copilot497
amp475
kimi-cli473
Generates architecture diagrams for AWS infrastructure from CloudFormation templates, AWS CLI output, or natural language descriptions.
Activate this skill when:
aws ec2 describe-instances)This skill generates AWS-specific diagrams by parsing AWS resources and calling the Eraser API directly:
/api/render/elements with diagramType: "cloud-architecture-diagram"When the user provides AWS infrastructure information:
Parse the Source
Resources section, identify types (AWS::EC2::Instance, etc.)aws commandsIdentify AWS Components
Map Relationships
Example:
main-vpc [label: "VPC 10.0.0.0/16"] {
public-subnet [label: "Public Subnet"] {
web-server [icon: aws-ec2, label: "Web Server"]
load-balancer [icon: aws-elb]
}
private-subnet [label: "Private Subnet"] {
database [icon: aws-rds]
cache [icon: aws-elasticache]
}
}
data-bucket [icon: aws-s3]
function [icon: aws-lambda]
load-balancer -> web-server
web-server -> 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.tf` \- VPC and subnet definitions)
* **External references** : Note any documentation, examples, or URLs consulted (e.g., AWS VPC 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:
MyVPC:
Type: AWS::EC2::VPC
Properties:
CidrBlock: 10.0.0.0/16
PublicSubnet:
Type: AWS::EC2::Subnet
Properties:
VpcId: !Ref MyVPC
CidrBlock: 10.0.1.0/24
WebServer:
Type: AWS::EC2::Instance
Properties:
InstanceType: t3.micro
SubnetId: !Ref PublicSubnet
MyBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: my-app-bucket
MyFunction:
Type: AWS::Lambda::Function
Properties:
Runtime: python3.9
Handler: index.handler
MyDatabase:
Type: AWS::RDS::DBInstance
Properties:
Engine: postgres
DBInstanceClass: db.t3.micro
Parses CloudFormation:
Generates DSL showing AWS service diversity:
MyVPC [label: "VPC 10.0.0.0/16"] {
PublicSubnet [label: "Public Subnet 10.0.1.0/24"] {
WebServer [icon: aws-ec2, label: "EC2 t3.micro"]
}
}
MyBucket [icon: aws-s3, label: "S3 my-app-bucket"]
MyFunction [icon: aws-lambda, label: "Lambda python3.9"]
MyDatabase [icon: aws-rds, label: "RDS PostgreSQL db.t3.micro"]
WebServer -> MyBucket
MyFunction -> MyDatabase
WebServer -> MyDatabase
Important : All label text must be on a single line within quotes. AWS-specific: Include service icons, show data flows between services, group by VPC when applicable.
/api/render/elements with diagramType: "cloud-architecture-diagram"User runs: aws ec2 describe-instances
Provides JSON output
Parses JSON to extract:
Formats and calls API
Weekly Installs
567
Repository
GitHub Stars
9
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
gemini-cli507
codex507
opencode503
github-copilot497
amp475
kimi-cli473
Azure 升级评估与自动化工具 - 轻松迁移 Functions 计划、托管层级和 SKU
64,099 周安装
Generate Eraser DSL Convert AWS resources to Eraser DSL:
[label: "VPC 10.0.0.0/16"]