From eraserlabs-eraser-io
Generates architecture diagrams from Terraform code by parsing .tf files and visualizing resources, modules, and dependencies via Eraser API.
How this skill is triggered — by the user, by Claude, or both
Slash command
/eraserlabs-eraser-io:terraform-diagramsThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generates architecture diagrams directly from Terraform `.tf` files. Specializes in parsing Terraform code and visualizing infrastructure resources, modules, and their relationships.
Generates architecture diagrams directly from Terraform .tf files. Specializes in parsing Terraform code and visualizing infrastructure resources, modules, and their relationships.
Activate this skill when:
.tf, .tfvars) and wants to visualize the infrastructureThis skill generates Terraform-specific diagrams by parsing Terraform code and calling the Eraser API directly:
/api/render/elements with diagramType: "cloud-architecture-diagram"When the user provides Terraform code:
Parse the Terraform
resource blocks (AWS, Azure, GCP, etc.)module blocks and their configurationsdata sources and their dependenciesvariable and output definitionsMap Relationships
subnet_id = aws_subnet.public.id)Generate Eraser DSL Convert Terraform resources to Eraser DSL:
[label: "VPC 10.0.0.0/16"]Example:
main-vpc [label: "VPC 10.0.0.0/16"] {
public-subnet [label: "Public Subnet 10.0.1.0/24"] {
web-server [icon: aws-ec2, label: "Web Server t3.micro"]
load-balancer [icon: aws-elb]
}
private-subnet [label: "Private Subnet"] {
database [icon: aws-rds]
}
}
load-balancer -> web-server
web-server -> database
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:
claudecursorchatgptgeminicurl -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
}'
Track Sources During Analysis
As you analyze Terraform files and resources to generate the diagram, track:
infra/main.tf - VPC and subnet definitions, infra/rds.tf - Database configuration)Handle the Response
CRITICAL: Minimal Output Format
Your response MUST always include these elements with clear headers:
Diagram Preview: Display with a header
## Diagram

Use the ACTUAL imageUrl from the API response.
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.
Sources section: Brief list of files/resources analyzed (if applicable)
## Sources
- `path/to/file` - What was extracted
Diagram Code section: The Eraser DSL in a code block with eraser language tag
## Diagram Code
```eraser
{DSL code here}
Learn More link: You can learn more about Eraser at https://docs.eraser.io/docs/using-ai-agent-integrations
Additional content rules:
The default output should be SHORT. The diagram image speaks for itself.
Handle Multiple Providers
# AWS Resources
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
}
resource "aws_subnet" "public" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.1.0/24"
}
resource "aws_instance" "web" {
subnet_id = aws_subnet.public.id
instance_type = "t3.micro"
}
# Azure Resources (multi-provider)
resource "azurerm_resource_group" "main" {
name = "rg-main"
location = "East US"
}
resource "azurerm_virtual_network" "main" {
name = "vnet-main"
resource_group_name = azurerm_resource_group.main.name
address_space = ["10.1.0.0/16"]
}
# Module usage
module "database" {
source = "./modules/rds"
vpc_id = aws_vpc.main.id
}
Parses Terraform:
Generates DSL showing multi-provider and module structure:
# AWS Resources
aws-vpc [label: "AWS VPC 10.0.0.0/16"] {
aws-subnet [label: "Public Subnet 10.0.1.0/24"] {
web-server [icon: aws-ec2, label: "Web Server t3.micro"]
}
}
# Azure Resources
resource-group [label: "Resource Group rg-main"] {
azure-vnet [label: "Azure VNet 10.1.0.0/16"]
}
# Module
database-module [label: "Database Module"] {
rds-instance [icon: aws-rds]
}
aws-vpc -> database-module
Important: All label text must be on a single line within quotes. Terraform-specific: Show modules as containers, group by provider, include resource dependencies.
Calls /api/render/elements with diagramType: "cloud-architecture-diagram"
User receives a diagram showing:
npx claudepluginhub eraserlabs/eraser-ioGenerates architecture diagrams from code, infrastructure, or descriptions. Supports flowcharts, ERDs, cloud architecture, and sequence diagrams using Eraser API.
Generates AWS architecture diagrams in Mermaid or ASCII from descriptions, conversation context, or existing IaC files (CDK, Terraform, CloudFormation, SAM).
Generates validated AWS architecture diagrams as draw.io XML using official AWS icons. Analyzes CloudFormation, CDK, Terraform codebases or brainstorms designs interactively. Exports .drawio with PNG/SVG/PDF options.