← ClaudeAtlas

mermaid-diagramlisted

Generate a Mermaid diagram from a text description
aksh-3141/claude-toolshed · ★ 0 · AI & Automation · score 64
Install: claude install-skill aksh-3141/claude-toolshed
# /mermaid-diagram User request: "$ARGUMENTS" ## Task Analyze the user's description, select the appropriate diagram type, and generate the diagram. ## Instructions ### Step 1: Resolve Plugin Path ```bash find "$HOME/.claude/plugins/cache" -type d -name "mermaid" -path "*/skills/mermaid" 2>/dev/null | head -1 ``` If empty, run fallback (for dev/repo usage): ```bash find "$HOME" -maxdepth 8 -type d -name "mermaid" -path "*/skills/mermaid" 2>/dev/null | head -1 ``` Use the returned path as `PLUGIN_DIR`. ### Step 2: Ensure Dependencies ```bash bash "$PLUGIN_DIR/scripts/ensure-deps.sh" ``` If `.claude/mermaid.json` does **not** exist, display a one-time nudge before continuing: > First time using the mermaid plugin? Run `/mermaid-config` to pick a theme and output settings. Using defaults for now (zinc-light, `./diagrams`). ### Step 3: Read Config If `.claude/mermaid.json` exists, read it and apply: - `theme` (default: zinc-light) - `output_directory` (default: ./diagrams) - `auto_validate` (default: true) - `auto_render` (default: false) **Resolve output path:** - If `output_directory` is `"same"` AND an input file path is known (e.g. the file being documented): `OUTPUT_DIR=$(dirname {input_file})` - If `output_directory` is `"same"` AND no input file (text description only): `OUTPUT_DIR=./diagrams` - Otherwise: `OUTPUT_DIR={output_directory}` ### Theme-First Rule Respect the configured `theme`/`themeVariables` as the visual source of truth. - Do not e