eraser-diagrams

eraserlabs/eraser-io · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/eraserlabs/eraser-io --skill eraser-diagrams
0 commentsdiscussion
summary

Generate professional architecture diagrams from code, files, or natural language descriptions.

  • Supports five diagram types: flowcharts, entity-relationship diagrams, cloud architecture, sequence diagrams, and BPMN swimlane diagrams
  • Analyzes infrastructure files (Terraform, AWS, Azure) and code to extract architecture information and automatically generate Eraser DSL
  • Returns rendered diagram images with links to edit in the Eraser web editor
  • Requires ERASER_API_KEY environment var
skill.md

Eraser Diagram Generator

Generates professional architecture diagrams directly from code, infrastructure files, or natural language descriptions using the Eraser API.

When to Use

Activate this skill when:

  • User asks to create, generate, or visualize a diagram
  • User wants to document architecture from code
  • User has Terraform, AWS, Azure, or infrastructure files
  • User describes a system and wants it visualized
  • User mentions "diagram", "architecture", "visualize", or "draw"

How It Works

  1. Analyze the source: Extract architecture information from code, files, or descriptions
  2. Generate Eraser DSL: Create Eraser DSL code that describes the diagram
  3. Call the Eraser API: Make an HTTP POST request to render the diagram
  4. Return the result: Present the image URL and editor link to the user

Diagram Types and Syntax

Eraser supports five types of diagrams, each optimized for different use cases. For detailed DSL syntax and examples, refer to the appropriate reference file:

Flow Charts

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

Entity Relationship Diagrams (ERD)

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

Cloud Architecture Diagrams

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

Sequence Diagrams

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

BPMN Diagrams (Swimlane Diagrams)

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.

API Integration

Endpoint

POST https://app.eraser.io/api/render/elements
Content-Type: application/json
Authorization: Bearer ${ERASER_API_KEY}
X-Skill-Source: eraser-skill

Note: The X-Skill-Source header identifies the AI agent. You MUST replace eraser-skill with your actual 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

Response Format

{
  "imageUrl": "https://storage.googleapis.com/eraser-images/...",
  "createEraserFileUrl": "https://app.eraser.io/new?requestId=abc123&state=xyz789",
  "renderedElements": [...]
}

Error Responses

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:

  • Verify DSL syntax is correct before making the API call
  • Ensure diagramType matches the DSL content (e.g., sequence DSL with sequence-diagram)
  • For auth errors, verify the API key is set correctly as an environment variable

Instructions

When the user requests a diagram:

  1. Extract Information

    • If code/files are provided, analyze the structure, resources, and relationships
    • If description is provided, identify key components and connections
    • Determine the appropriate diagram type
  2. Generate Eraser DSL

    • Create Eraser DSL code that represents the architecture
    • CRITICAL: Label Formatting Rules
      • Labels MUST be on a single line - NEVER use newlines inside label attributes
      • Keep labels simple and readable - prefer separate labels over concatenating too much metadata
      • Format DSL with proper line breaks (one node/group per line, but labels stay on single lines)
    • For detailed DSL syntax and examples, see the Diagram Types and Syntax section above for links to reference files
  3. Create Element Definition

    • Create an element object with:
      • type: "diagram"
      • id: "diagram-1" (or generate a unique ID)
      • code: "<your generated DSL code>"
      • diagramType: "<appropriate type>"
  4. 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
      }'
    
  5. 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
  6. 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
      ![{Title}]({imageUrl})
      

      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.

  7. Error Handling

    • If API call fails, explain the error
    • Suggest checking API key if authentication fails
    • Offer to regenerate DSL code as fallback

Best Practices

  • Generate Valid DSL: Ensure the DSL syntax is correct before calling the API
  • Quote Labels Properly: Always quote labels that contain spaces, special characters, or numbers
  • Single-Line Labels: Labels MUST be on a single line - never use newlines inside label attributes
  • Format for Readability: Put each node, group, and connection on its own line (but keep labels single-line)
  • Include Metadata: If including CIDR blocks, instance types, etc., put them in the same quoted label string: [label: "VPC 10.0.0.0/16"]
  • Use Appropriate Diagram Type: Choose the right diagramType for the content
  • Group Related Items: Use containers (VPCs, modules) to group related components
  • Specify Connections: Show data flows, dependencies, and relationships
  • Handle Large Systems: Break down very large systems into focused diagrams
  • Include Source Header: Always include X-Skill-Source header with your AI agent name (claude, cursor, chatgpt, etc.)

Notes

  • Free tier diagrams include a watermark but are fully functional
  • The createEraserFileUrl is always returned (works for both free and paid tiers) and allows users to edit diagrams in the Eraser web editor
  • The DSL code can be used to regenerate or modify diagrams
  • API responses are cached, so identical requests return quickly
how to use eraser-diagrams

How to use eraser-diagrams on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add eraser-diagrams
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/eraserlabs/eraser-io --skill eraser-diagrams

The skills CLI fetches eraser-diagrams from GitHub repository eraserlabs/eraser-io and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/eraser-diagrams

Reload or restart Cursor to activate eraser-diagrams. Access the skill through slash commands (e.g., /eraser-diagrams) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.639 reviews
  • William Iyer· Dec 8, 2024

    Useful defaults in eraser-diagrams — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

  • Xiao Robinson· Nov 27, 2024

    eraser-diagrams is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Rahul Santra· Nov 19, 2024

    Solid pick for teams standardizing on skills: eraser-diagrams is focused, and the summary matches what you get after install.

  • Xiao Iyer· Oct 18, 2024

    eraser-diagrams reduced setup friction for our internal harness; good balance of opinion and flexibility.

  • Pratham Ware· Oct 10, 2024

    I recommend eraser-diagrams for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

  • Nia Dixit· Sep 21, 2024

    eraser-diagrams has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Arjun Liu· Sep 17, 2024

    Keeps context tight: eraser-diagrams is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Sakshi Patil· Sep 13, 2024

    eraser-diagrams fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Mia Iyer· Sep 13, 2024

    Solid pick for teams standardizing on skills: eraser-diagrams is focused, and the summary matches what you get after install.

  • Michael Kim· Sep 1, 2024

    I recommend eraser-diagrams for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.

showing 1-10 of 39

1 / 4