Agent skill

diagram-excalidraw

Generate Excalidraw architecture diagrams from codebase analysis. Use when user says "create an architecture diagram", "visualize the system design", "generate an excalidraw diagram", "draw the component structure", "create a visual representation of the codebase", or "diagram the data flow".

Stars 30
Forks 9

Install this agent skill to your Project

npx add-skill https://github.com/Uniswap/ai-toolkit/tree/next/packages/plugins/development-codebase-tools/skills/diagram-excalidraw

SKILL.md

Excalidraw Diagram Generator

Generate valid .excalidraw JSON files representing system architecture from codebase analysis.

When to Activate

  • User asks to create an architecture diagram
  • User wants to visualize system design
  • User asks for a flowchart or data flow diagram
  • User wants to document system structure visually
  • User mentions Excalidraw or diagram generation

Quick Start

Works without existing diagrams, Terraform, or specific file types. Analyzes any codebase structure.

Critical Implementation Rules

Four non-negotiable constraints:

  1. No Diamond Shapes: Diamond arrow connections are broken in raw Excalidraw JSON. Use styled rectangles instead:

    • Orchestrators: coral background with thick stroke
    • Decision points: orange background with dashed stroke
  2. Label Architecture: The label property does NOT work in raw JSON. Every labeled element requires:

    • A shape with boundElements referencing the text element
    • A separate text element with containerId pointing to the shape
  3. Arrow Formatting: Multi-point arrows need:

    • "elbowed": true
    • "roundness": null
    • "roughness": 0
  4. Edge Positioning: Arrows must start/end at shape edges, not centers:

    • Top: (x + width/2, y)
    • Bottom: (x + width/2, y + height)
    • Left: (x, y + height/2)
    • Right: (x + width, y + height/2)

Generation Workflow

  1. Analyze codebase structure - Identify components, services, and relationships
  2. Plan layout grid - Determine rows, columns, and spacing
  3. Generate shape elements - Create rectangles, ellipses, text labels
  4. Add connection arrows - Connect components with proper edge positioning
  5. Apply grouping - Group related elements (namespaces, services, etc.)
  6. Validate and write output - Check all constraints before writing file

Input Parsing

Extract from user's request:

  • scope: What part of codebase to diagram (full, specific module, etc.)
  • type: Type of diagram (architecture, data flow, deployment, etc.)
  • depth: Level of detail (high-level overview vs detailed)
  • output: Output file path (defaults to ./architecture.excalidraw)

Output Format

Generate a valid .excalidraw JSON file with:

  • Proper file structure (type, version, elements, appState)
  • All shapes with unique IDs
  • Proper text bindings for labels
  • Correct arrow connections at shape edges
  • Logical groupings with dashed rectangles

Validation Checklist

Before writing output, verify:

  • No duplicate element IDs
  • All labels have proper shape-text bindings
  • No diamond shapes used
  • All arrows positioned at shape edges
  • JSON is valid and properly formatted

Reference Documentation

For detailed implementation guidance, see:

  • JSON Format Reference - Complete element structure
  • Arrow Routing Guide - Arrow positioning and patterns
  • Color Palettes - Component type color schemes
  • Examples - Layout patterns and templates
  • Validation Rules - Pre-output verification

Expand your agent's capabilities with these related and highly-rated skills.

Uniswap/ai-toolkit

review-plan

Review implementation plans for completeness and feasibility. Use when user says "review this plan before I start", "is this implementation plan complete", "check if this plan aligns with our patterns", "give me feedback on my implementation strategy", or "validate this plan before we execute it".

30 9
Explore
Uniswap/ai-toolkit

plan-implementation

Create implementation plans for features and changes. Use when user says "plan how to implement user authentication", "how should I add dark mode to the app", "what's the best way to refactor the database layer", "create a plan for migrating to the new API", or "I need to implement [feature] - help me plan it out".

30 9
Explore
Uniswap/ai-toolkit

execute-plan

Execute implementation plans step-by-step. Use when user says "execute the plan", "implement the plan we created", "start building based on the plan", "go ahead and implement it", "proceed with the implementation", "execute as a stack", "create a PR stack while implementing", "implement with one PR per step", or references a plan file and wants to begin coding.

30 9
Explore
Uniswap/ai-toolkit

generate-commit-message

Generate well-structured git commit messages. Use when user says "generate commit message", "write a commit", "what should my commit message be", "create commit message for these changes", or needs help crafting conventional commit messages.

30 9
Explore
Uniswap/ai-toolkit

plan-swarm

Refine plans through multi-agent expert discussion. Use when user says "get multiple expert opinions on this plan", "I want different perspectives on this approach", "have the agents discuss this strategy", "refine the plan through collaborative review", or "what would different specialists think about this design".

30 9
Explore
Uniswap/ai-toolkit

create-pr

Create or update pull requests with conventional commits. Use when user says "create a PR for these changes", "submit this for review", "open a pull request", "push these changes and create a PR", "I'm ready to submit this work", or "create PR and link to issue

30 9
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results