Skip to content

A self-organizing Obsidian vault that gives AI coding agents persistent memory.

feat: mermaid-visualizer and excalidraw-diagram skills (#119)

Brenno Ferrari2ec6104ef48b
diff --git a/.claude/skills/excalidraw-diagram/SKILL.md b/.claude/skills/excalidraw-diagram/SKILL.md
new file mode 100644
index 0000000..907384e
--- /dev/null
+++ b/.claude/skills/excalidraw-diagram/SKILL.md
@@ -0,0 +1,474 @@
+---
+name: excalidraw-diagram
+description: Generate Excalidraw diagrams from text content. Supports three output modes - Obsidian (.md), Standard (.excalidraw), and Animated (.excalidraw with animation order). Triggers on "Excalidraw", "diagram", "standard excalidraw", "animate".
+metadata:
+ version: 1.2.1
+---
+
+# Excalidraw Diagram Generator
+
+Create Excalidraw diagrams from text content with multiple output formats.
+
+## Output Modes
+
+Select output mode based on the user's trigger words:
+
+| Trigger Words | Output Mode | File Format | Use Case |
+|---------------|-------------|-------------|----------|
+| `Excalidraw`, `diagram`, `flowchart`, `mind map` | **Obsidian** (default) | `.md` | Open directly in Obsidian |
+| `standard excalidraw` | **Standard** | `.excalidraw` | Open/edit/share on excalidraw.com |
+| `animate`, `animated excalidraw` | **Animated** | `.excalidraw` | Drag to excalidraw-animate to generate animation |
+
+## Workflow
+
+1. **Detect output mode** from trigger words (see Output Modes table above)
+2. Analyze content - identify concepts, relationships, hierarchy
+3. Choose diagram type (see Diagram Types below)
+4. Generate Excalidraw JSON (add animation order if Animated mode)
+5. Output in correct format based on mode
+6. **Automatically save to current working directory**
+7. Notify user with file path and usage instructions
+
+## Output Formats
+
+### Mode 1: Obsidian Format (Default)
+
+**Output strictly in the following structure, with no modifications:**
+
+```markdown
+---
+excalidraw-plugin: parsed
+tags: [excalidraw]
+---
+==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'
+
+# Excalidraw Data
+
+## Text Elements
+%%
+## Drawing
+\`\`\`json
+{complete JSON data}
+\`\`\`
+%%
+```
+
+**Key points:**
+- Frontmatter must include `tags: [excalidraw]`
+- Warning message must be included in full
+- JSON must be wrapped in `%%` markers
+- Do not use any frontmatter settings other than `excalidraw-plugin: parsed`
+- **File extension**: `.md`
+
+### Mode 2: Standard Excalidraw Format
+
+Output pure JSON file, openable on excalidraw.com:
+
+```json
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://excalidraw.com",
+ "elements": [...],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#ffffff"
+ },
+ "files": {}
+}
+```
+
+**Key points:**
+- `source` uses `https://excalidraw.com` (not the Obsidian plugin)
+- Pure JSON, no Markdown wrapping
+- **File extension**: `.excalidraw`
+
+### Mode 3: Animated Excalidraw Format
+
+Same as Standard format, but each element adds a `customData.animate` field to control animation order:
+
+```json
+{
+ "id": "element-1",
+ "type": "rectangle",
+ "customData": {
+ "animate": {
+ "order": 1,
+ "duration": 500
+ }
+ },
+ ...other standard fields
+}
+```
+
+**Animation order rules:**
+- `order`: Playback order (1, 2, 3...) — lower numbers appear first
+- `duration`: Drawing duration for the element (milliseconds), default 500
+- Elements with the same `order` appear simultaneously
+- Recommended order: title → main framework → connection lines → detail text
+
+**Usage:**
+1. Generate the `.excalidraw` file
+2. Drag to https://dai-shi.github.io/excalidraw-animate/
+3. Click Animate to preview, then export as SVG or WebM
+
+**File extension**: `.excalidraw`
+
+---
+
+## Diagram Types & Selection Guide
+
+Choose the appropriate diagram type to maximize clarity and visual impact.
+
+| Type | Use Case | Approach |
+|------|----------|----------|
+| **Flowchart** | Step-by-step processes, workflows, task sequences | Connect steps with arrows, clearly show process flow |
+| **Mind Map** | Concept expansion, topic categorization, brainstorming | Radiate outward from a central core |
+| **Hierarchy** | Org charts, content levels, system decomposition | Build level nodes top-down or left-to-right |
+| **Relationship** | Dependencies, influences, interactions between elements | Use lines between shapes to show relationships, with arrows and labels |
+| **Comparison** | Side-by-side analysis of two or more approaches | Two columns or table format, with comparison dimensions labeled |
+| **Timeline** | Event progression, project milestones, evolution | Use time as axis, mark key dates and events |
+| **Matrix** | Two-dimensional categorization, priority grids, positioning | Establish X and Y dimensions, place items on coordinate plane |
+| **Freeform** | Scattered content, brainstorming, initial information gathering | No structural constraints, freely place blocks and arrows |
+
+## Design Rules
+
+### Text & Format
+- **All text elements must use** `fontFamily: 5` (Excalifont handwriting font)
+- **Double quote replacement**: replace `"` with `『』`
+- **Parentheses replacement**: replace `()` with `「」`
+- **Font size rules** (hard minimums — below these values, text is unreadable at normal zoom):
+ - Title: 20-28px (minimum 20px)
+ - Subtitle: 18-20px
+ - Body/labels: 16-18px (minimum 16px)
+ - Minor annotations: 14px (only for unimportant auxiliary notes, use sparingly)
+ - **Never go below 14px**
+- **Line height**: all text uses `lineHeight: 1.25`
+- **Text centering**: standalone text elements have no auto-centering — manually calculate x coordinate:
+ - Estimate text width: `estimatedWidth = text.length * fontSize * 0.5`
+ - Centering formula: `x = centerX - estimatedWidth / 2`
+ - Example: text "Hello" (5 chars, fontSize 20) centered at x=300 → `estimatedWidth = 5 * 20 * 0.5 = 50` → `x = 300 - 25 = 275`
+
+### Layout & Design
+- **Canvas range**: keep all elements within 0-1200 x 0-800 area
+- **Minimum shape size**: rectangles/ellipses with text must be at least 120x60px
+- **Element spacing**: minimum 20-30px gap to prevent overlap
+- **Clear hierarchy**: use different colors and shapes to distinguish information levels
+- **Graphic elements**: use rectangles, circles, arrows etc. to organize information
+- **No Emoji**: do not use any Emoji symbols in diagram text — use simple shapes (circles, squares, arrows) or color coding instead
+
+### Color Palette
+
+**Text colors (strokeColor for text):**
+
+| Purpose | Hex | Description |
+|---------|-----|-------------|
+| Title | `#1e40af` | Deep blue |
+| Subtitle/connectors | `#3b82f6` | Bright blue |
+| Body text | `#374151` | Dark gray (minimum `#757575` on white background) |
+| Emphasis/highlight | `#f59e0b` | Gold |
+
+**Shape fill colors (backgroundColor, fillStyle: "solid"):**
+
+| Hex | Semantic | Use Case |
+|-----|----------|----------|
+| `#a5d8ff` | Light blue | Input, data source, primary nodes |
+| `#b2f2bb` | Light green | Success, output, completed |
+| `#ffd8a8` | Light orange | Warning, pending, external dependency |
+| `#d0bfff` | Light purple | Processing, middleware, special items |
+| `#ffc9c9` | Light red | Error, critical, alert |
+| `#fff3bf` | Light yellow | Notes, decisions, planning |
+| `#c3fae8` | Light teal | Storage, data, cache |
+| `#eebefa` | Light pink | Analysis, metrics, statistics |
+
+**Region background colors (large rectangle + opacity: 30, for layered diagrams):**
+
+| Hex | Semantic |
+|-----|----------|
+| `#dbe4ff` | Frontend/UI layer |
+| `#e5dbff` | Logic/processing layer |
+| `#d3f9d8` | Data/tools layer |
+
+**Contrast rules:**
+- Text on white background must be no lighter than `#757575`
+- On light fills, use dark color variants (e.g., on light green use `#15803d`, not `#22c55e`)
+- Avoid light gray text (`#b0b0b0`, `#999`) on white backgrounds
+
+See [references/excalidraw-schema.md](references/excalidraw-schema.md) for full reference.
+
+## JSON Structure
+
+**Obsidian mode:**
+```json
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://github.com/zsviczian/obsidian-excalidraw-plugin",
+ "elements": [...],
+ "appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" },
+ "files": {}
+}
+```
+
+**Standard / Animated mode:**
+```json
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://excalidraw.com",
+ "elements": [...],
+ "appState": { "gridSize": null, "viewBackgroundColor": "#ffffff" },
+ "files": {}
+}
+```
+
+## Element Template
+
+Each element requires these fields (do NOT add extra fields like `frameId`, `index`, `versionNonce`, `rawText` -- they may cause issues on excalidraw.com. `boundElements` must be `null` not `[]`, `updated` must be `1` not timestamps):
+
+```json
+{
+ "id": "unique-id",
+ "type": "rectangle",
+ "x": 100, "y": 100,
+ "width": 200, "height": 50,
+ "angle": 0,
+ "strokeColor": "#1e1e1e",
+ "backgroundColor": "transparent",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid",
+ "roughness": 1,
+ "opacity": 100,
+ "groupIds": [],
+ "roundness": {"type": 3},
+ "seed": 123456789,
+ "version": 1,
+ "isDeleted": false,
+ "boundElements": null,
+ "updated": 1,
+ "link": null,
+ "locked": false
+}
+```
+
+`strokeStyle` values: `"solid"` (default) | `"dashed"` | `"dotted"`. Dashed lines are suitable for optional paths, async flows, weak associations, etc.
+
+Text elements add:
+```json
+{
+ "text": "Display text",
+ "fontSize": 20,
+ "fontFamily": 5,
+ "textAlign": "center",
+ "verticalAlign": "middle",
+ "containerId": null,
+ "originalText": "Display text",
+ "autoResize": true,
+ "lineHeight": 1.25
+}
+```
+
+**Animated mode additionally adds** a `customData` field:
+```json
+{
+ "id": "title-1",
+ "type": "text",
+ "customData": {
+ "animate": {
+ "order": 1,
+ "duration": 500
+ }
+ },
+ ...other fields
+}
+```
+
+See [references/excalidraw-schema.md](references/excalidraw-schema.md) for all element types.
+
+---
+
+## Additional Technical Requirements
+
+### Text Elements Handling
+- The `## Text Elements` section in Markdown **must be left empty**, using only `%%` as delimiters
+- The Obsidian Excalidraw plugin will **automatically populate text elements** from the JSON data
+- No need to manually list all text content
+
+### Coordinates & Layout
+- **Coordinate system**: origin (0,0) is at the top-left
+- **Recommended range**: all elements within 0-1200 x 0-800 pixels
+- **Element IDs**: each element needs a unique `id` (can be strings like "title", "box1", etc.)
+
+### Required Fields for All Elements
+
+**IMPORTANT**: Do NOT include `frameId`, `index`, `versionNonce`, or `rawText` fields. Use `boundElements: null` (not `[]`), and `updated: 1` (not timestamps).
+
+```json
+{
+ "id": "unique-identifier",
+ "type": "rectangle|text|arrow|ellipse|diamond",
+ "x": 100, "y": 100,
+ "width": 200, "height": 50,
+ "angle": 0,
+ "strokeColor": "#color-hex",
+ "backgroundColor": "transparent|#color-hex",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "strokeStyle": "solid|dashed|dotted",
+ "roughness": 1,
+ "opacity": 100,
+ "groupIds": [],
+ "roundness": {"type": 3},
+ "seed": 123456789,
+ "version": 1,
+ "isDeleted": false,
+ "boundElements": null,
+ "updated": 1,
+ "link": null,
+ "locked": false
+}
+```
+
+### Text-Specific Properties
+Text elements (type: "text") require additional properties (do NOT include `rawText`):
+```json
+{
+ "text": "Display text",
+ "fontSize": 20,
+ "fontFamily": 5,
+ "textAlign": "center",
+ "verticalAlign": "middle",
+ "containerId": null,
+ "originalText": "Display text",
+ "autoResize": true,
+ "lineHeight": 1.25
+}
+```
+
+### appState Configuration
+```json
+"appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#ffffff"
+}
+```
+
+### files Field
+```json
+"files": {}
+```
+
+## Common Mistakes to Avoid
+
+- **Text offset** — standalone text element `x` is the left edge, not center. Must use the centering formula to manually calculate, or text will be off to one side
+- **Element overlap** — elements with similar y coordinates easily stack. Check for at least 20px spacing before placing new elements
+- **Insufficient canvas padding** — don't place content flush with canvas edges. Leave 50-80px padding on all sides
+- **Title not centered over diagram** — title should be centered over the overall width of the diagram below it, not fixed at x=0
+- **Arrow label overflow** — long text labels (e.g., "ATP + NADPH") will exceed short arrows. Keep labels short or increase arrow length
+- **Insufficient contrast** — light text on white background is nearly invisible. Text color must be no lighter than `#757575`; colored text should use dark variants
+- **Font size too small** — below 14px is unreadable at normal zoom; body text minimum is 16px
+
+## Implementation Notes
+
+### Auto-save & File Generation Workflow
+
+When generating an Excalidraw diagram, **automatically execute these steps:**
+
+#### 1. Choose the appropriate diagram type
+- Based on the content provided by the user, refer to the "Diagram Types & Selection Guide" table above
+- Analyze the core requirements of the content and select the most suitable visualization
+
+#### 2. Generate a meaningful filename
+
+Select file extension based on output mode:
+
+| Mode | Filename Format | Example |
+|------|----------------|---------|
+| Obsidian | `[topic].[type].md` | `business-model.relationship.md` |
+| Standard | `[topic].[type].excalidraw` | `business-model.relationship.excalidraw` |
+| Animated | `[topic].[type].animate.excalidraw` | `business-model.relationship.animate.excalidraw` |
+
+#### 3. Auto-save using the Write tool
+- **Save location**: current working directory (auto-detect from environment)
+- **Full path**: `{current_directory}/[filename].md`
+- This enables flexible migration without hardcoded paths
+
+#### 4. Ensure Markdown structure is completely correct
+**Must generate in the following format** (no modifications allowed):
+
+```markdown
+---
+excalidraw-plugin: parsed
+tags: [excalidraw]
+---
+==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'
+
+# Excalidraw Data
+
+## Text Elements
+%%
+## Drawing
+\`\`\`json
+{complete JSON data}
+\`\`\`
+%%
+```
+
+#### 5. JSON data requirements
+- Include complete Excalidraw JSON structure
+- All text elements use `fontFamily: 5`
+- Replace `"` with `『』` in text
+- Replace `()` with `「」` in text
+- JSON format must be valid and pass syntax checking
+- All elements have unique `id` values
+- Include `appState` and `files: {}` fields
+
+#### 6. User feedback and confirmation
+Report to the user:
+- Diagram has been generated
+- Exact save location
+- How to view it in Obsidian
+- Design choices made (what diagram type was chosen and why)
+- Whether adjustments or modifications are needed
+
+### Example Output Messages
+
+**Obsidian mode:**
+```
+Excalidraw diagram generated!
+
+Saved to: business-model.relationship.md
+
+Usage:
+1. Open this file in Obsidian
+2. Click the MORE OPTIONS menu (top right)
+3. Select "Switch to EXCALIDRAW VIEW"
+```
+
+**Standard mode:**
+```
+Excalidraw diagram generated!
+
+Saved to: business-model.relationship.excalidraw
+
+Usage:
+1. Open https://excalidraw.com
+2. Click top-left menu → Open → select this file
+3. Or drag and drop the file onto the excalidraw.com page
+```
+
+**Animated mode:**
+```
+Animated Excalidraw diagram generated!
+
+Saved to: business-model.relationship.animate.excalidraw
+
+Animation order: Title(1) → Main framework(2-4) → Connectors(5-7) → Detail text(8-10)
+
+To generate animation:
+1. Open https://dai-shi.github.io/excalidraw-animate/
+2. Click Load File and select this file
+3. Preview the animation
+4. Click Export to save as SVG or WebM
+```
diff --git a/.claude/skills/excalidraw-diagram/references/excalidraw-schema.md b/.claude/skills/excalidraw-diagram/references/excalidraw-schema.md
new file mode 100644
index 0000000..c890d82
--- /dev/null
+++ b/.claude/skills/excalidraw-diagram/references/excalidraw-schema.md
@@ -0,0 +1,201 @@
+# Excalidraw JSON Schema Reference
+
+## Color Palette
+
+### Primary Colors
+| Purpose | Color | Hex |
+|---------|-------|-----|
+| Main Title | Deep Blue | `#1e40af` |
+| Subtitle | Medium Blue | `#3b82f6` |
+| Body Text | Dark Gray | `#374151` |
+| Emphasis | Orange | `#f59e0b` |
+| Success | Green | `#10b981` |
+| Warning | Red | `#ef4444` |
+
+### Background Colors
+| Purpose | Color | Hex |
+|---------|-------|-----|
+| Light Blue | Background | `#dbeafe` |
+| Light Gray | Neutral | `#f3f4f6` |
+| Light Orange | Highlight | `#fef3c7` |
+| Light Green | Success | `#d1fae5` |
+| Light Purple | Accent | `#ede9fe` |
+
+## Element Types
+
+### Rectangle
+```json
+{
+ "type": "rectangle",
+ "id": "unique-id",
+ "x": 100,
+ "y": 100,
+ "width": 200,
+ "height": 80,
+ "strokeColor": "#1e40af",
+ "backgroundColor": "#dbeafe",
+ "fillStyle": "solid",
+ "strokeWidth": 2,
+ "roughness": 1,
+ "opacity": 100,
+ "roundness": { "type": 3 }
+}
+```
+
+### Text
+```json
+{
+ "type": "text",
+ "id": "unique-id",
+ "x": 150,
+ "y": 130,
+ "text": "Content here",
+ "fontSize": 20,
+ "fontFamily": 5,
+ "textAlign": "center",
+ "verticalAlign": "middle",
+ "strokeColor": "#1e40af",
+ "backgroundColor": "transparent"
+}
+```
+
+### Arrow
+```json
+{
+ "type": "arrow",
+ "id": "unique-id",
+ "x": 300,
+ "y": 140,
+ "width": 100,
+ "height": 0,
+ "points": [[0, 0], [100, 0]],
+ "strokeColor": "#374151",
+ "strokeWidth": 2,
+ "startArrowhead": null,
+ "endArrowhead": "arrow"
+}
+```
+
+### Ellipse
+```json
+{
+ "type": "ellipse",
+ "id": "unique-id",
+ "x": 100,
+ "y": 100,
+ "width": 120,
+ "height": 120,
+ "strokeColor": "#10b981",
+ "backgroundColor": "#d1fae5",
+ "fillStyle": "solid"
+}
+```
+
+### Diamond
+```json
+{
+ "type": "diamond",
+ "id": "unique-id",
+ "x": 100,
+ "y": 100,
+ "width": 150,
+ "height": 100,
+ "strokeColor": "#f59e0b",
+ "backgroundColor": "#fef3c7",
+ "fillStyle": "solid"
+}
+```
+
+### Line
+```json
+{
+ "type": "line",
+ "id": "unique-id",
+ "x": 100,
+ "y": 100,
+ "points": [[0, 0], [200, 100]],
+ "strokeColor": "#374151",
+ "strokeWidth": 2
+}
+```
+
+## Full JSON Structure
+
+```json
+{
+ "type": "excalidraw",
+ "version": 2,
+ "source": "https://excalidraw.com",
+ "elements": [
+ // Array of elements
+ ],
+ "appState": {
+ "gridSize": null,
+ "viewBackgroundColor": "#ffffff"
+ },
+ "files": {}
+}
+```
+
+## Font Family Values
+
+| Value | Font Name |
+|-------|-----------|
+| 1 | Virgil (hand-drawn) |
+| 2 | Helvetica |
+| 3 | Cascadia |
+| 4 | Assistant |
+| 5 | Excalifont (recommended) |
+
+## Fill Styles
+
+- `solid` - Solid fill
+- `hachure` - Hatched lines
+- `cross-hatch` - Cross-hatched
+- `dots` - Dotted pattern
+
+## Roundness Types
+
+- `{ "type": 1 }` - Sharp corners
+- `{ "type": 2 }` - Slight rounding
+- `{ "type": 3 }` - Full rounding (recommended)
+
+## Element Binding
+
+To connect text to a container:
+
+```json
+{
+ "type": "rectangle",
+ "id": "container-id",
+ "boundElements": [{ "id": "text-id", "type": "text" }]
+}
+```
+
+```json
+{
+ "type": "text",
+ "id": "text-id",
+ "containerId": "container-id"
+}
+```
+
+## Arrow Binding
+
+To connect arrows to shapes:
+
+```json
+{
+ "type": "arrow",
+ "startBinding": {
+ "elementId": "source-shape-id",
+ "focus": 0,
+ "gap": 5
+ },
+ "endBinding": {
+ "elementId": "target-shape-id",
+ "focus": 0,
+ "gap": 5
+ }
+}
+```
diff --git a/.claude/skills/mermaid-visualizer/SKILL.md b/.claude/skills/mermaid-visualizer/SKILL.md
new file mode 100644
index 0000000..d9ed66c
--- /dev/null
+++ b/.claude/skills/mermaid-visualizer/SKILL.md
@@ -0,0 +1,276 @@
+---
+name: mermaid-visualizer
+description: Transform text content into professional Mermaid diagrams for presentations and documentation. Use when users ask to visualize concepts, create flowcharts, or make diagrams from text. Supports process flows, system architectures, comparisons, mindmaps, and more with built-in syntax error prevention.
+---
+
+# Mermaid Visualizer
+
+## Overview
+
+Convert text content into clean, professional Mermaid diagrams optimized for presentations and documentation. Automatically handles common syntax pitfalls (list syntax conflicts, subgraph naming, spacing issues) to ensure diagrams render correctly in Obsidian, GitHub, and other Mermaid-compatible platforms.
+
+## Quick Start
+
+When creating a Mermaid diagram:
+
+1. **Analyze the content** - Identify key concepts, relationships, and flow
+2. **Choose diagram type** - Select the most appropriate visualization (see Diagram Types below)
+3. **Select configuration** - Determine layout, detail level, and styling
+4. **Generate diagram** - Create syntactically correct Mermaid code
+5. **Output in markdown** - Wrap in proper code fence with optional explanation
+
+**Default assumptions:**
+- Vertical layout (TB) unless horizontal requested
+- Medium detail level (balanced between simplicity and information)
+- Professional color scheme with semantic colors
+- Obsidian/GitHub compatible syntax
+
+## Diagram Types
+
+### 1. Process Flow (graph TB/LR)
+**Best for:** Workflows, decision trees, sequential processes, AI agent architectures
+
+**Use when:** Content describes steps, stages, or a sequence of actions
+
+**Key features:**
+- Swimlanes via subgraph for grouping related steps
+- Arrow labels for transitions
+- Feedback loops and branches
+- Color-coded stages
+
+**Configuration options:**
+- `layout`: "vertical" (TB), "horizontal" (LR)
+- `detail`: "simple" (core steps only), "standard" (with descriptions), "detailed" (with annotations)
+- `style`: "minimal", "professional", "colorful"
+
+### 2. Circular Flow (graph TD with circular layout)
+**Best for:** Cyclic processes, continuous improvement loops, agent feedback systems
+
+**Use when:** Content emphasizes iteration, feedback, or circular relationships
+
+**Key features:**
+- Central hub with radiating elements
+- Curved feedback arrows
+- Clear cycle indicators
+
+### 3. Comparison Diagram (graph TB with parallel paths)
+**Best for:** Before/after comparisons, A vs B analysis, traditional vs modern systems
+
+**Use when:** Content contrasts two or more approaches or systems
+
+**Key features:**
+- Side-by-side layout
+- Central comparison node
+- Clear differentiation via color/style
+
+### 4. Mindmap
+**Best for:** Hierarchical concepts, knowledge organization, topic breakdowns
+
+**Use when:** Content is hierarchical with clear parent-child relationships
+
+**Key features:**
+- Radial tree structure
+- Multiple levels of nesting
+- Clean visual hierarchy
+
+### 5. Sequence Diagram
+**Best for:** Interactions between components, API calls, message flows
+
+**Use when:** Content involves communication between actors/systems over time
+
+**Key features:**
+- Timeline-based layout
+- Clear actor separation
+- Activation boxes for processes
+
+### 6. State Diagram
+**Best for:** System states, status transitions, lifecycle stages
+
+**Use when:** Content describes states and transitions between them
+
+**Key features:**
+- Clear state nodes
+- Labeled transitions
+- Start and end states
+
+## Critical Syntax Rules
+
+**Always follow these rules to prevent parsing errors:**
+
+### Rule 1: Avoid List Syntax Conflicts
+```
+❌ WRONG: [1. Perception] → Triggers "Unsupported markdown: list"
+✅ RIGHT: [1.Perception] → Remove space after period
+✅ RIGHT: [① Perception] → Use circled numbers (①②③④⑤⑥⑦⑧⑨⑩)
+✅ RIGHT: [(1) Perception] → Use parentheses
+✅ RIGHT: [Step 1: Perception] → Use "Step" prefix
+```
+
+### Rule 2: Subgraph Naming
+```
+❌ WRONG: subgraph AI Agent Core → Space in name without quotes
+✅ RIGHT: subgraph agent["AI Agent Core"] → Use ID with display name
+✅ RIGHT: subgraph agent → Use simple ID only
+```
+
+### Rule 3: Node References
+```
+❌ WRONG: Title --> AI Agent Core → Reference display name directly
+✅ RIGHT: Title --> agent → Reference subgraph ID
+```
+
+### Rule 4: Special Characters in Node Text
+```
+✅ Use quotes for text with spaces: ["Text with spaces"]
+✅ Escape or avoid: quotation marks → use 『』instead
+✅ Escape or avoid: parentheses → use 「」instead
+✅ Line breaks in circle nodes only: ((Text<br/>Break))
+```
+
+### Rule 5: Arrow Types
+- `-->` solid arrow
+- `-.->` dashed arrow (for supporting systems, optional paths)
+- `==>` thick arrow (for emphasis)
+- `~~~` invisible link (for layout only)
+
+For complete syntax reference and edge cases, see [references/syntax-rules.md](references/syntax-rules.md)
+
+## Configuration Options
+
+All diagrams accept these parameters:
+
+**Layout:**
+- `direction`: "vertical" (TB), "horizontal" (LR), "right-to-left" (RL), "bottom-to-top" (BT)
+- `aspect`: "portrait" (default), "landscape" (wide), "square"
+
+**Detail Level:**
+- `simple`: Core elements only, minimal labels
+- `standard`: Balanced detail with key descriptions (default)
+- `detailed`: Full annotations, explanations, and metadata
+- `presentation`: Optimized for slides (larger text, fewer details)
+
+**Style:**
+- `minimal`: Monochrome, clean lines
+- `professional`: Semantic colors, clear hierarchy (default)
+- `colorful`: Vibrant colors, high contrast
+- `academic`: Formal styling for papers/documentation
+
+**Additional Options:**
+- `show_legend`: true/false - Include color/symbol legend
+- `numbered`: true/false - Add sequence numbers to steps
+- `title`: string - Add diagram title
+
+## Example Usage Patterns
+
+**Pattern 1: Basic request**
+```
+User: "Visualize the software development lifecycle"
+Response: [Analyze → Choose graph TB → Generate with standard detail]
+```
+
+**Pattern 2: With configuration**
+```
+User: "Create a horizontal flowchart of our sales process with lots of detail"
+Response: [Analyze → Choose graph LR → Generate with detailed level]
+```
+
+**Pattern 3: Comparison**
+```
+User: "Compare traditional AI vs AI agents"
+Response: [Analyze → Choose comparison layout → Generate with contrasting styles]
+```
+
+## Workflow
+
+1. **Understand the content**
+ - Identify main concepts, entities, and relationships
+ - Determine hierarchy or sequence
+ - Note any comparisons or contrasts
+
+2. **Select diagram type**
+ - Match content structure to diagram type
+ - Consider user's presentation context
+ - Default to process flow if ambiguous
+
+3. **Choose configuration**
+ - Apply user-specified options
+ - Use sensible defaults for unspecified options
+ - Optimize for readability
+
+4. **Generate Mermaid code**
+ - Follow all syntax rules strictly
+ - Use semantic naming (descriptive IDs)
+ - Apply consistent styling
+ - Test for common errors:
+ * No "number. space" patterns in node text
+ * All subgraphs use ID["display name"] format
+ * All node references use IDs not display names
+
+5. **Output with context**
+ - Wrap in ```mermaid code fence
+ - Add brief explanation of diagram structure
+ - Mention rendering compatibility (Obsidian, GitHub, etc.)
+ - Offer to adjust or create variations
+
+## Color Scheme Defaults
+
+Standard professional palette:
+- Green (#d3f9d8/#2f9e44): Input, perception, start states
+- Red (#ffe3e3/#c92a2a): Planning, decision points
+- Purple (#e5dbff/#5f3dc4): Processing, reasoning
+- Orange (#ffe8cc/#d9480f): Actions, tool usage
+- Cyan (#c5f6fa/#0c8599): Output, execution, results
+- Yellow (#fff4e6/#e67700): Storage, memory, data
+- Pink (#f3d9fa/#862e9c): Learning, optimization
+- Blue (#e7f5ff/#1971c2): Metadata, definitions, titles
+- Gray (#f8f9fa/#868e96): Neutral elements, traditional systems
+
+## Common Patterns
+
+### Swimlane Pattern (Grouping)
+```mermaid
+graph TB
+ subgraph core["Core Process"]
+ A --> B --> C
+ end
+ subgraph support["Supporting Systems"]
+ D
+ E
+ end
+ core -.-> support
+```
+
+### Feedback Loop Pattern
+```mermaid
+graph TB
+ A[Start] --> B[Process]
+ B --> C[End]
+ C -.->|Feedback| A
+```
+
+### Hub and Spoke Pattern
+```mermaid
+graph TB
+ Central[Hub]
+ A[Spoke 1] --> Central
+ B[Spoke 2] --> Central
+ C[Spoke 3] --> Central
+```
+
+## Quality Checklist
+
+Before outputting, verify:
+- [ ] No "number. space" patterns in any node text
+- [ ] All subgraphs use proper ID syntax
+- [ ] All arrows use correct syntax (-->, -.->)
+- [ ] Colors applied consistently
+- [ ] Layout direction specified
+- [ ] Style declarations present
+- [ ] No ambiguous node references
+- [ ] Compatible with Obsidian/GitHub renderers
+- [ ] **No Emoji** in any node text - use text labels or color coding instead
+
+## References
+
+For detailed syntax rules and troubleshooting, see:
+- [references/syntax-rules.md](references/syntax-rules.md) - Complete syntax reference and error prevention
diff --git a/.claude/skills/mermaid-visualizer/references/syntax-rules.md b/.claude/skills/mermaid-visualizer/references/syntax-rules.md
new file mode 100644
index 0000000..75a319a
--- /dev/null
+++ b/.claude/skills/mermaid-visualizer/references/syntax-rules.md
@@ -0,0 +1,484 @@
+# Mermaid Syntax Rules Reference
+
+This reference provides comprehensive syntax rules and error prevention strategies for Mermaid diagrams. Load this when encountering syntax errors or needing detailed syntax information.
+
+## Table of Contents
+
+1. [Critical Error Prevention](#critical-error-prevention)
+2. [Node Syntax](#node-syntax)
+3. [Subgraph Syntax](#subgraph-syntax)
+4. [Arrow and Connection Types](#arrow-and-connection-types)
+5. [Styling and Colors](#styling-and-colors)
+6. [Layout and Direction](#layout-and-direction)
+7. [Advanced Patterns](#advanced-patterns)
+8. [Troubleshooting](#troubleshooting)
+
+## Critical Error Prevention
+
+### List Syntax Conflict (Most Common Error)
+
+**Problem:** Mermaid parser interprets `number. space` as Markdown ordered list syntax.
+
+**Error Message:** `Parse error: Unsupported markdown: list`
+
+**Solutions:**
+
+```mermaid
+❌ [1. Perception]
+❌ [2. Planning]
+❌ [3. Reasoning]
+
+✅ [1.Perception] # Remove space
+✅ [① Perception] # Use circled numbers
+✅ [(1) Perception] # Use parentheses
+✅ [Step 1: Perception] # Use prefix
+✅ [Step 1 - Perception] # Use dash
+✅ [Perception] # Remove numbering
+```
+
+**Circled number reference:**
+```
+① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⑪ ⑫ ⑬ ⑭ ⑮ ⑯ ⑰ ⑱ ⑲ ⑳
+```
+
+### Subgraph Naming Rules
+
+**Rule:** Subgraphs with spaces must use ID + display name format.
+
+```mermaid
+❌ subgraph Core Process
+ A --> B
+ end
+
+✅ subgraph core["Core Process"]
+ A --> B
+ end
+
+✅ subgraph core_process
+ A --> B
+ end
+```
+
+**Referencing subgraphs:**
+```mermaid
+❌ Title --> Core Process # Cannot reference display name
+✅ Title --> core # Must reference ID
+```
+
+### Node Reference Rules
+
+**Rule:** Always reference nodes by ID, never by display text.
+
+```mermaid
+# Define nodes
+A[Display Text A]
+B["Display Text B"]
+
+# Reference nodes
+A --> B ✅ Use node IDs
+Display Text A --> Display Text B ❌ Cannot use display text
+```
+
+## Node Syntax
+
+### Basic Node Types
+
+```mermaid
+# Rectangle (default)
+A[Rectangle Text]
+
+# Rectangle with rounded corners
+B(Rounded Text)
+
+# Stadium shape
+C([Stadium Text])
+
+# Circle
+D((Circle<br/>Text))
+
+# Asymmetric shape
+E>Right Arrow]
+
+# Rhombus (decision)
+F{Decision?}
+
+# Hexagon
+G{{Hexagon}}
+
+# Parallelogram
+H[/Parallelogram/]
+
+# Database
+I[(Database)]
+
+# Trapezoid
+J[/Trapezoid\]
+```
+
+### Node Text Rules
+
+**Line breaks:**
+- `<br/>` only works in circle nodes: `((Text<br/>Break))`
+- For other nodes, use separate annotation nodes or keep text concise
+
+**Special characters:**
+- Spaces: Use quotes if needed: `["Text with spaces"]`
+- Quotes: Replace with 『』or avoid
+- Parentheses: Replace with 「」or avoid
+- Colons: Generally safe but avoid if causing issues
+- Hyphens/dashes: Safe to use
+
+**Length guidelines:**
+- Keep node text under 50 characters
+- Use multiple lines (circle nodes) or separate annotation nodes for longer content
+- Consider splitting into multiple nodes if text is too long
+
+## Subgraph Syntax
+
+### Basic Structure
+
+```mermaid
+graph TB
+ # Correct format with ID and display name
+ subgraph id["Display Name"]
+ direction TB
+ A --> B
+ end
+
+ # Simple ID only (no spaces)
+ subgraph simple
+ C --> D
+ end
+
+ # Can set direction inside subgraph
+ subgraph horiz["Horizontal"]
+ direction LR
+ E --> F
+ end
+```
+
+### Nested Subgraphs
+
+```mermaid
+graph TB
+ subgraph outer["Outer Group"]
+ direction TB
+
+ subgraph inner1["Inner 1"]
+ A --> B
+ end
+
+ subgraph inner2["Inner 2"]
+ C --> D
+ end
+
+ inner1 -.-> inner2
+ end
+```
+
+**Limitation:** Keep nesting to 2 levels maximum for readability.
+
+### Connecting Subgraphs
+
+```mermaid
+graph TB
+ subgraph g1["Group 1"]
+ A[Node A]
+ end
+
+ subgraph g2["Group 2"]
+ B[Node B]
+ end
+
+ # Connect individual nodes (recommended)
+ A --> B
+
+ # Connect subgraphs (creates invisible link for layout)
+ g1 -.-> g2
+```
+
+## Arrow and Connection Types
+
+### Basic Arrows
+
+```mermaid
+A --> B # Solid arrow
+A -.-> B # Dashed arrow
+A ==> B # Thick arrow
+A ~~~> B # Invisible link (layout only, not rendered)
+```
+
+### Arrow Labels
+
+```mermaid
+A -->|Label Text| B
+A -.->|Optional| B
+A ==>|Important| B
+```
+
+### Multi-target Connections
+
+```mermaid
+# One to many
+A --> B & C & D
+
+# Many to one
+A & B & C --> D
+
+# Chaining
+A --> B --> C --> D
+```
+
+### Bidirectional
+
+```mermaid
+A <--> B # Bidirectional solid
+A <-.-> B # Bidirectional dashed
+```
+
+## Styling and Colors
+
+### Inline Styling
+
+```mermaid
+style NodeID fill:#color,stroke:#color,stroke-width:2px
+```
+
+### Color Format
+
+- Hex colors: `#ff0000` or `#f00`
+- RGB: `rgb(255,0,0)`
+- Color names: `red`, `blue`, etc. (limited support)
+
+### Common Style Patterns
+
+```mermaid
+# Professional look
+style A fill:#d3f9d8,stroke:#2f9e44,stroke-width:2px
+
+# Emphasis
+style B fill:#ffe3e3,stroke:#c92a2a,stroke-width:3px
+
+# Muted/secondary
+style C fill:#f8f9fa,stroke:#dee2e6,stroke-width:1px
+
+# Title/header
+style D fill:#1971c2,stroke:#1971c2,stroke-width:3px,color:#ffffff
+```
+
+### Styling Multiple Nodes
+
+```mermaid
+# Apply same style to multiple nodes
+style A,B,C fill:#d3f9d8,stroke:#2f9e44,stroke-width:2px
+```
+
+## Layout and Direction
+
+### Direction Codes
+
+```mermaid
+graph TB # Top to Bottom (vertical)
+graph BT # Bottom to Top
+graph LR # Left to Right (horizontal)
+graph RL # Right to Left
+graph TD # Top Down (same as TB)
+```
+
+### Layout Control Tips
+
+1. **Vertical layouts (TB/BT):** Best for sequential processes, hierarchies
+2. **Horizontal layouts (LR/RL):** Best for timelines, wide displays
+3. **Mixed directions:** Set different directions in subgraphs
+
+```mermaid
+graph TB
+ subgraph vertical["Vertical Flow"]
+ direction TB
+ A --> B --> C
+ end
+
+ subgraph horizontal["Horizontal Flow"]
+ direction LR
+ D --> E --> F
+ end
+```
+
+## Advanced Patterns
+
+### Feedback Loop Pattern
+
+```mermaid
+graph TB
+ A[Start] --> B[Process]
+ B --> C[Output]
+ C -.->|Feedback| A
+
+ style A fill:#d3f9d8,stroke:#2f9e44,stroke-width:2px
+ style B fill:#e5dbff,stroke:#5f3dc4,stroke-width:2px
+ style C fill:#c5f6fa,stroke:#0c8599,stroke-width:2px
+```
+
+### Swimlane Pattern
+
+```mermaid
+graph TB
+ subgraph lane1["Lane 1"]
+ A[Step 1] --> B[Step 2]
+ end
+
+ subgraph lane2["Lane 2"]
+ C[Step 3] --> D[Step 4]
+ end
+
+ B --> C
+```
+
+### Hub and Spoke
+
+```mermaid
+graph TB
+ Hub[Central Hub]
+
+ A[Spoke 1] --> Hub
+ B[Spoke 2] --> Hub
+ C[Spoke 3] --> Hub
+ Hub --> D[Output]
+```
+
+### Decision Tree
+
+```mermaid
+graph TB
+ Start[Start] --> Decision{Decision Point?}
+ Decision -->|Option A| PathA[Path A]
+ Decision -->|Option B| PathB[Path B]
+ Decision -->|Option C| PathC[Path C]
+
+ PathA --> End[End]
+ PathB --> End
+ PathC --> End
+```
+
+### Comparison Layout
+
+```mermaid
+graph TB
+ Title[Comparison]
+
+ subgraph left["System A"]
+ A1[Feature 1]
+ A2[Feature 2]
+ A3[Feature 3]
+ end
+
+ subgraph right["System B"]
+ B1[Feature 1]
+ B2[Feature 2]
+ B3[Feature 3]
+ end
+
+ Title --> left
+ Title --> right
+
+ subgraph compare["Key Differences"]
+ Diff[Difference Summary]
+ end
+
+ left --> compare
+ right --> compare
+```
+
+## Troubleshooting
+
+### Common Errors and Solutions
+
+#### Error: "Parse error on line X: Expecting 'SEMI', 'NEWLINE', 'EOF'"
+
+**Causes:**
+1. Subgraph name with spaces not using ID format
+2. Node reference using display text instead of ID
+3. Invalid special characters in node text
+
+**Solutions:**
+- Use `subgraph id["Display Name"]` format
+- Reference nodes by ID only
+- Quote node text with special characters
+
+#### Error: "Unsupported markdown: list"
+
+**Cause:** Using `number. space` pattern in node text
+
+**Solution:** Remove space or use alternatives (①, (1), Step 1:)
+
+#### Error: "Parse error: unexpected character"
+
+**Causes:**
+1. Unescaped special characters
+2. Improper quotes
+3. Invalid Mermaid syntax
+
+**Solutions:**
+- Replace problematic characters (quotes → 『』, parens → 「」)
+- Use proper node definition syntax
+- Check arrow syntax
+
+#### Diagram doesn't render correctly
+
+**Causes:**
+1. Missing style declarations
+2. Incorrect direction specification
+3. Invalid connections
+
+**Solutions:**
+- Verify all style declarations use valid syntax
+- Check direction is set in graph declaration or subgraph
+- Ensure all node IDs are defined before referencing
+
+### Validation Checklist
+
+Before finalizing any diagram:
+
+- [ ] No `number. space` patterns in node text
+- [ ] All subgraphs use proper ID syntax if they contain spaces
+- [ ] All node references use IDs not display text
+- [ ] All arrows use valid syntax (-->, -.->)
+- [ ] All style declarations are syntactically correct
+- [ ] Direction is explicitly set
+- [ ] No unescaped special characters in node text
+- [ ] All connections reference defined nodes
+
+### Platform-Specific Notes
+
+**Obsidian:**
+- Older Mermaid version, more strict parsing
+- Limited support for `<br/>` (only in circle nodes)
+- Test diagrams before finalizing
+
+**GitHub:**
+- Good Mermaid support
+- Renders most modern syntax
+- May differ slightly from Obsidian rendering
+
+**Mermaid Live Editor:**
+- Most up-to-date parser
+- Best for testing new syntax
+- May support features not available in Obsidian/GitHub
+
+## Quick Reference
+
+### Safe Numbering Methods
+✅ `1.Text` `①Text` `(1)Text` `Step 1:Text`
+❌ `1. Text`
+
+### Safe Subgraph Syntax
+✅ `subgraph id["Name"]` `subgraph simple_name`
+❌ `subgraph Name With Spaces`
+
+### Safe Node References
+✅ `NodeID --> AnotherID`
+❌ `"Display Text" --> "Other Text"`
+
+### Safe Special Characters
+✅ `『』` for quotes, `「」` for parentheses
+❌ `"` unescaped quotes, `()` in problematic contexts
\ No newline at end of file