Draw.io Delegation Skill
Delegate diagram creation to a separate GitHub Copilot CLI session that has the draw.io MCP server enabled.
Prerequisites
- •
Start the draw.io container (if not already running):
bashcd ~/dotfiles/ai && docker compose up -d
- •
Verify container is ready:
bashcurl -sf http://localhost:8098/ > /dev/null && echo "ready" || echo "not ready"
Usage
To create a diagram, use the bash tool to call drawio-copilot-task with a detailed prompt:
bash
drawio-copilot-task "Your detailed diagram description here"
How It Works
- •
drawio-copilot-taskis a shell function in~/dotfiles/zsh/.zshrc(stowed to~/.zshrc) - •It starts GitHub Copilot CLI with:
- •
--additional-mcp-config @~/.copilot/drawio-only.json(enables drawio MCP) - •
--disable-builtin-mcps(disables github-mcp-server) - •
--allow-all-tools --no-ask-user --silent(non-interactive mode)
- •
- •Copilot receives your prompt, uses drawio MCP tools to create the diagram
- •The diagram appears in the user's browser (via draw.io container at localhost:8098)
- •Copilot exits after completing the task
Prompt Guidelines
Be specific - include components, connections, and layout hints:
bash
# Good: specific components and relationships drawio-copilot-task "Create an AWS architecture diagram showing: - VPC with public and private subnets - ALB in public subnet - EKS cluster with 3 pods in private subnet - RDS PostgreSQL in private subnet - Show arrows: ALB -> EKS -> RDS" # Good: Kubernetes with specific resources drawio-copilot-task "Create a Kubernetes diagram with: - Ingress controller - Service (ClusterIP) - Deployment with 3 replicas - ConfigMap and Secret - PersistentVolumeClaim Show the namespace boundary" # Bad: too vague drawio-copilot-task "make a diagram"
Troubleshooting
Function not found
The drawio-copilot-task function is defined in ~/dotfiles/zsh/.zshrc.
- •The function should be available in any interactive zsh session
Container not running
bash
cd ~/dotfiles/ai && docker compose up -d docker ps | grep drawio
MCP server can't connect
- •Verify
http://localhost:8098/is accessible in browser - •Check container logs:
docker logs drawio
Diagram not appearing
- •The browser should open automatically via
start_session - •If not, open
http://localhost:8098/manually
Limitations
- •Runs as separate process - no context from current session
- •Non-interactive (auto-approves all tools)
- •For iterative work, user should run
drawio-copilotalias directly
Interactive Mode
For interactive diagram work (user-facing), use the shell alias directly:
bash
drawio-copilot
This opens an interactive Copilot session with drawio MCP enabled.