npx skills add ...
npx skills add eraserlabs/eraser-io --skill terraform-diagrams
Generates architecture diagrams from Terraform code. Use when user has .tf files or asks to visualize Terraform infrastructure.
npx skills add eraserlabs/eraser-io --skill terraform-diagrams
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:
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:
claudecursorchatgptgeminiTrack 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
Use the ACTUAL imageUrl from the API response.
Editor Link: Display with a header
Use the ACTUAL URL from the API response.
Sources section: Brief list of files/resources analyzed (if applicable)
Diagram Code section: The Eraser DSL in a code block with eraser language tag
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
Parses Terraform:
Generates DSL showing multi-provider and module structure:
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: