Skip to content
Back to skills

Coding

ASecurity

Turn a hand-drawn sketch or whiteboard photo into an editable diagram (Excalidraw, Mermaid or Draw.io) after the human approves the recognised elements. Use when the user supplies an image of a diagram, wireframe or event-storming board.

  • 24 stars
  • 0 votes
  • 0 copies
  • 6 views
  • Added October 14, 2026
ai-agentsgonodegitapidocumentation

Works with

  • api
  • mcp

Security analysis

A100/100

Pro scans all 21 files and shows the line behind each finding

Scanned November 22, 2026

npx -y skills add andreibesleaga/GABBE --skill coding --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Coding?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Coding
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/andreibesleaga-coding-111e905b/badge)](https://www.skillsdirectory.com/skills/andreibesleaga-coding-111e905b)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: sketch-to-diagram
description: "Turn a hand-drawn sketch or whiteboard photo into an editable diagram (Excalidraw, Mermaid or Draw.io) after the human approves the recognised elements. Use when the user supplies an image of a diagram, wireframe or event-storming board."
triggers: [sketch, hand-drawn, whiteboard photo, napkin, wireframe scan, recognize diagram]
tags: [coding, architecture, visual, recognition, AI]
context_cost: high
---
# Sketch-to-Diagram Skill

## Goal
Transform hand-drawn sketches (whiteboard photos, napkin drawings, paper wireframes) into formal, editable digital diagrams using the **Sketch → Recognize → Redraw** pipeline:
1. **Recognize**: Image recognition MCP describes elements, connections, and labels from the sketch
2. **Structure**: Agent organizes recognized elements into a structured diagram description
3. **Redraw**: Agent generates formal diagram via Excalidraw MCP, Mermaid code, or Draw.io XML

## Prerequisites
- **Image Recognition MCP**: `image-recognition` must be configured (requires `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`)
- **Output MCP** (at least one):
  - `excalidraw` — for `.excalidraw` output
  - `drawio` — for Draw.io XML output
  - Or none — for Mermaid text output (no MCP needed)
- **Optional**: Tesseract OCR installed for text extraction from noisy images

## Supported Input Types
| Input | Examples |
|---|---|
| **Whiteboard photos** | Architecture sketches, event storming boards, sprint planning |
| **Napkin drawings** | Quick flowcharts, ER diagrams, state machines |
| **Paper wireframes** | UI layouts, page flows, component hierarchies |
| **Screenshot mockups** | Existing diagram screenshots to recreate as editable |
| **Hand-drawn charts** | Bar charts, timelines, Gantt outlines |
| **Annotated screenshots** | Marked-up UIs with arrows and notes |

## Steps

### Phase 1: Capture & Recognize
1. **Receive the image** — user provides a file path or base64-encoded image
2. **Call image-recognition MCP** — send image for analysis:
   - Describe all shapes (rectangles, circles, diamonds, arrows)
   - Identify text labels on each shape
   - Map connections (which arrows connect which shapes)
   - Note colors, groupings, and spatial layout
3. **Extract text** (optional) — if handwriting is unclear, use Tesseract OCR

### Phase 2: Structure
4. **Build element list** — organize recognized elements into:
   - Nodes: `{id, label, shape, position, color, group}`
   - Edges: `{source, target, label, direction}`
   - Frames/Groups: `{name, children[]}`
5. **Validate** — check for unconnected nodes, duplicate labels, missing edges
6. **Present to user** — show structured description for approval before redrawing

### Phase 3: Redraw
7. **Choose output format** based on user preference or diagram complexity:
   - **Excalidraw** (visual, hand-drawn style): Use `excalidraw` MCP tools
   - **Mermaid** (text-based, version-controllable): Generate Mermaid syntax
   - **Draw.io** (enterprise, XML): Use `drawio` MCP tools
8. **Create diagram** — generate the formal diagram using chosen tool
9. **Document** — fill `SKETCH_TO_DIAGRAM_TEMPLATE.md` with results

## Output Formats

| Format | When to Use | MCP Required |
|---|---|---|
| Excalidraw (`.excalidraw`) | Visual collaboration, hand-drawn aesthetic | `excalidraw` |
| Mermaid (`.md`) | Version-controlled docs, PRDs, READMEs | None |
| Draw.io (`.drawio`) | Enterprise docs, Confluence, detailed layouts | `drawio` |
| PNG/SVG export | Static documentation, presentations | Depends on source |

## Usage Examples

### Whiteboard photo to architecture diagram
```
> "Here's a photo of our whiteboard architecture sketch. Convert it to an Excalidraw diagram."
```

### Napkin flowchart to Mermaid
```
> "I drew this flowchart on paper [image]. Convert it to Mermaid syntax for our README."
```

### UI wireframe to diagram
```
> "Recognize this hand-drawn wireframe and create a component hierarchy diagram."
```

### Event storming board to formal diagram
```
> "Here's a photo of our event storming session. Extract all events, commands, and aggregates into a structured diagram."
```

## Deliverables
- `SKETCH_TO_DIAGRAM_TEMPLATE.md`: Structured report with original image description, recognized elements, and generated diagram
- Generated diagram file (`.excalidraw`, `.md` with Mermaid, or `.drawio`)

## Constraints
- Do not redraw before the human has approved the element list.
- Every node and edge comes from the image or the human's description.

## Limits and safety
- If the sketch may show credentials, internal addresses or personal data, ask the human before sending it to an external vision service; the local option is Tesseract OCR for text plus a description of the shapes.
- Show the structured element list and get the human's approval before redrawing; after the first redraw ask for corrections.
- Mark low-confidence elements in the list; do not invent nodes or edges the image does not show.
- If recognition is poor (blurry, overlapping), ask the human to describe the diagram instead of guessing.

Files in this skill

  • agent-trajectory-eval.skill.md5.7 KB
  • artisan-commands.skill.md3.7 KB
  • browser-tdd.skill.md7 KB
  • chaos-fault-injection.skill.md8.1 KB
  • ci-autofix.skill.md4.2 KB
  • clean-coder.skill.md4.5 KB
  • code-review.skill.md6.1 KB
  • debug.skill.md6.5 KB
  • documentation.skill.md7.3 KB
  • eval-driven-development.skill.md6.9 KB
  • evals/code-review.eval.yaml1 KB
  • excalidraw.skill.md3.7 KB
  • file-processing.skill.md4.3 KB
  • git-workflow.skill.md7.2 KB
  • metamorphic-testing.skill.md7.8 KB
  • mobile-dev.skill.md4.2 KB
  • nodejs-expert.skill.md1.6 KB
  • output-validation.skill.md5.4 KB
  • pbt-strategy.skill.md8 KB
  • performant-ai.skill.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.