OpenParable
Skip to content
← Back to skills

Generate Diagram

Design
generate-diagram

Generate Diagram is an Agent Skill for design published in the TentacleOpera/switchboard repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.

Generate architectural diagrams via LocalApiServer

View on GitHub ↗
QUICK START

How to use this skill

Bring this guide into your coding agent with a prompt tailored to the tool you use.

  1. Open your project in Codex.
  2. Copy and paste the prompt below.
  3. Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/TentacleOpera/switchboard/blob/HEAD/.claude/skills/generate-diagram/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/generate-diagram, but wait for my approval before writing files or running scripts.

Copying this prompt does not install or run the skill. Review third-party files before use.

Generate Architectural Diagram

When to Use

  • User asks for an architecture diagram
  • Need to visualize code structure or relationships

Prerequisites

  • Optional: mermaid-cli installed (npm install -g @mermaid-js/mermaid-cli)
  • Without mermaid-cli: Returns Mermaid syntax text instead of image

Usage

CUR="$PWD"
while [ "$CUR" != "/" ] && [ ! -d "$CUR/.agents/skills" ]; do CUR=$(dirname "$CUR"); done
source "$CUR/.agents/skills/_lib/sb_api_call.sh"

# Generate and upload to ClickUp task
sb_api_call POST /diagram/generate \
  -H "Content-Type: application/json" \
  -d '{
    "diagramType": "flowchart",
    "maxNodes": 30,
    "focusPath": "src/services/",
    "detailLevel": "summary",
    "targetId": "task123456",
    "platform": "clickup"
  }'

Parameters

  • diagramType (required): "flowchart", "sequence", or "component"
  • maxNodes (optional): Maximum nodes to include (default: 50)
  • focusPath (optional): Relative path to focus analysis on
  • detailLevel (optional): "summary" (grouped) or "detailed" (expanded)
  • targetId (optional): Task/issue ID to upload to
  • platform (optional): "clickup" or "linear" (required if targetId provided)

Response

With mermaid-cli installed:

{
  "success": true,
  "rendered": true,
  "url": "https://..."
}

Without mermaid-cli:

{
  "success": true,
  "rendered": false,
  "warning": "mermaid-cli not installed...",
  "mermaidSyntax": "graph TD\nA --> B",
  "installCommand": "npm install -g @mermaid-js/mermaid-cli"
}

Error Handling

  • 400: Missing diagramType
  • 401: Unauthorized
  • 500: Generation failed
  • 503: Service unavailable