Generates architecture diagrams from code, infrastructure, or descriptions. Use when user asks to visualize, diagram, or document system architecture.
Install with Tessl CLI
npx tessl i github:eraserlabs/eraser-io --skill eraser-diagrams90
Does it follow best practices?
If you maintain this skill, you can automatically optimize it using the tessl CLI to improve its score:
npx tessl skill review --optimize ./path/to/skillValidation for skill structure
Generates professional architecture diagrams directly from code, infrastructure files, or natural language descriptions using the Eraser API.
Activate this skill when:
Eraser supports five types of diagrams, each optimized for different use cases. For detailed DSL syntax and examples, refer to the appropriate reference file:
Visualize process flows, user flows, and logic flows represented as nodes, groups, and relationships. Diagrams are created using simple syntax.
Use for: Process flows, user journeys, decision trees, business process documentation
diagramType: "flowchart-diagram"
Reference: Flowchart Syntax
Visualize data models represented as entities, attributes, and relationships. Diagrams are created using simple syntax.
Use for: Database schema design, data modeling, understanding entity relationships, documenting data structures
diagramType: "entity-relationship-diagram"
Reference: ERD Syntax
Visualize cloud infrastructure represented as nodes, groups, and connections. Diagrams are created using simple syntax.
Use for: Cloud infrastructure visualization, AWS/Azure/GCP architectures, system architecture documentation, data flow visualization
diagramType: "cloud-architecture-diagram"
Reference: Architecture Syntax
Visualize system flows using sequence diagrams. Each vertical column represents an entity (e.g. user, server, DB) and arrows between the columns represent the flow of information or requests. Diagrams are created using simple syntax.
Use for: API request/response flows, system interactions, user workflows, message passing between services, process flows over time
diagramType: "sequence-diagram"
Reference: Sequence Syntax
Visualize business processes represented as pools, lanes, and flow objects such as tasks, events, and gateways. Diagrams are created using simple syntax.
Use for: Business process documentation, workflow visualization, process improvement, cross-functional processes, swimlane diagrams showing roles/responsibilities
diagramType: "bpmn-diagram"
Reference: BPMN Syntax
Each reference file contains complete syntax documentation, property references, and practical examples.
POST https://app.eraser.io/api/render/elements
Content-Type: application/json
Authorization: Bearer ${ERASER_API_KEY}
X-Skill-Source: eraser-skillNote: The X-Skill-Source header identifies the AI agent. You MUST replace eraser-skill with your actual agent name:
claudecursorchatgptgemini{
"imageUrl": "https://storage.googleapis.com/eraser-images/...",
"createEraserFileUrl": "https://app.eraser.io/new?requestId=abc123&state=xyz789",
"renderedElements": [...]
}| Status | Error | Cause | Solution |
|---|---|---|---|
| 400 | Diagram element has no code | Missing code field in element | Ensure element has valid DSL code |
| 400 | Diagram element has no diagramType | Missing diagramType field | Add valid diagramType to element |
| 400 | Invalid diagramType | Unsupported diagram type | Use one of the supported types listed above |
| 401 | Unauthorized | Invalid or expired API key | Check ERASER_API_KEY is valid |
| 500 | Internal server error | Server-side issue | Retry the request; if persistent, contact support |
Error Response Format:
{
"error": {
"message": "Diagram element has no code",
"status": 400
}
}Troubleshooting Tips:
diagramType matches the DSL content (e.g., sequence DSL with sequence-diagram)When the user requests a diagram:
Extract Information
Generate Eraser DSL
Create Element Definition
type: "diagram"id: "diagram-1" (or generate a unique ID)code: "<your generated DSL code>"diagramType: "<appropriate type>"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: Replace eraser-skill in the X-Skill-Source header with your actual AI agent name (see API Integration section above for values).
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
}'Track Sources During Analysis
As you analyze files and resources to generate the diagram, track:
infra/main.tf - VPC and subnet definitions)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 extractedDiagram 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.
Error Handling
[label: "VPC 10.0.0.0/16"]diagramType for the contentX-Skill-Source header with your AI agent name (claude, cursor, chatgpt, etc.)createEraserFileUrl is always returned (works for both free and paid tiers) and allows users to edit diagrams in the Eraser web editorb116552
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.