edwingao28/excalidraw-toolkit/auto-diagram
Claude Code and agent skill by edwingao28/excalidraw-toolkit
- community
Checking that the SKILL.md file is still in the repository.
Analyze inspected source and generate a scoped architecture overview. Use when the user asks to "diagram this repo", "visualize the architecture", "auto diagram", or requests a codebase overview without specifying components. Do NOT use when the user provides a specific description, sample diagram, or component list — use the excalidraw skill instead.
Install
npx vskill@latest install edwingao28/excalidraw-toolkit/auto-diagramSKILL.md
Auto-Diagram: Codebase Overview
Read the requested source scope and draw its supported components and connections. State analysis limits and unknowns. For changes to an existing saved .excalidraw file, load the installed scoped-edit skill first; its file workflow does not need the live MCP canvas.
Prerequisite Check
Before starting analysis, verify the Excalidraw MCP server is available:
If the tool is unavailable, inspect the client configuration and report the concrete missing capability. For an installed toolkit, use its recorded absolute CLI path to run doctor; if the configured owned canvas is stopped and the user requested a live diagram, run start and recheck. Use the configured URL from the result. If installation is missing, point to the README's local archive setup; a registry npx invocation may fetch an older feature set. Source analysis can continue while live rendering is unavailable, but report that no rendered diagram was produced.
Context Budget
To prevent context window blowout on large codebases, follow these hard limits:
| Operation | Limit | |
|---|---|---|
| Grep results per pattern | 20 matches (use head_limit) | |
| Files read per component | 5 files | |
| Tool calls in Phase 2 | 15 | |
| Tool calls in Phase 3 | 10 |
If limits are exceeded, proceed with partial results and note gaps to the user.
Analysis Pipeline
Phase 1: Project Detection
Run these file checks to identify the project type and tech stack:
- Read root files -- check for
package.json,pyproject.toml,go.mod,Cargo.toml,pom.xml,Gemfile,composer.json,mix.exs,Makefile,Dockerfile,docker-compose.yml,*.tf - Scan directory structure --
lsthe root and first-level subdirectories to identify the layout pattern - Detect project type:
- Monorepo:
workspacesin package.json,lerna.json,pnpm-workspace.yaml, multiplego.modfiles,packages/orapps/directories - Microservices: Multiple
Dockerfilefiles,docker-compose.ymlwith 3+ services - Standard app: Single service with standard directory structure
- Check for frameworks -- look for markers:
- React/Next.js:
next.config.*,src/app/,src/pages/ - Express/Fastify/Hono:
routes/,controllers/,middleware/ - Nest.js:
@nestjs/corein package.json - Django/Flask/FastAPI:
manage.py,wsgi.py,app.py,main.pywithuvicorn - Spring:
src/main/java/,application.properties - Go services:
cmd/,internal/,pkg/ - Rust:
src/main.rs,src/lib.rs - Rails:
Gemfile+config/routes.rb - Laravel:
artisan,app/Http/ - Phoenix/Elixir:
mix.exs+lib/*_web/
Output: A mental model of the project type, primary language, and framework.
Monorepo handling: If monorepo detected, scope analysis to the top-level package structure first. Show one box per package/app. Offer to drill into specific packages on request.
Phase 2: Component Discovery
Based on project type, identify architectural components. Max 15 tool calls.
For Web Applications:
- Frontend -- Glob
*.tsx,*.jsx,*.vue,*.svelteinsrc/,app/,pages/(head_limit: 20) - API routes -- Grep route definitions:
router\.(get|post|put|delete),@(Get|Post|Put|Delete),@app\.route,HandleFunc(head_limit: 20) - Database -- Look for
prisma/schema.prisma,models.py,*.entity.ts,migrations/,@Entity,db.Model(head_limit: 20) - External services -- Grep for SDK/HTTP client imports:
axios,fetch(,requests\.,http\.NewRequest(head_limit: 20) - Message queues -- Grep:
amqp,kafka,bull,celery,SQS,pubsub(head_limit: 10) - Cache -- Grep:
redis,memcached,cachein imports (head_limit: 10) - Auth -- Grep:
passport,jwt,oauth,@Auth,middleware.*auth(head_limit: 10)
For Infrastructure:
- Services -- Read
docker-compose.ymlservice definitions - Cloud resources -- Grep
*.tfforresource "blocks (head_limit: 20) - K8s -- Glob
**/k8s/*.yamlor**/manifests/*.yaml(head_limit: 20)
For Libraries/CLIs:
- Entry points -- Find
main,bin,exportsin package config - Modules -- Map public API surface (read index/main files)
- Dependencies -- Read dependency list from package config
Output: A list of 4-12 components with names, types, and key file locations.
Phase 3: Connection Mapping
Determine how components connect. Max 10 tool calls. Focus on entry points and their immediate dependencies -- don't trace every import.
- Read entry point files -- For each major component, read the main/index file (max 5 files total). Look for:
- Import statements that reference OTHER components (not third-party packages)
- Function calls to other services (HTTP clients, RPC calls, queue publishers)
- Database connection/query code
- Event emitters/listeners
- Map connection types -- Categorize each connection:
REST/HTTP-- fetch/axios/requests callsSQL/ORM-- database queriesgRPC/RPC-- inter-service callsEvent/Queue-- pub/sub, message queuesImport-- direct module import (same codebase)
- Build edge list -- Record each directed edge with a source path and line range or symbol. Label its basis as an import, an observed call site, or an assumption. An SDK import does not establish a payment call; a connection string does not establish a successful database request. Use protocol labels only when the inspected code supports them. Source references support the explanation, not proof of runtime execution.
If you can't determine connections reliably: Show components without arrows and note "connections could not be auto-detected from entry point analysis. Try: 'add connections between X and Y'."
Output: A list of directed edges with labels.
Phase 4: State Scope and Proceed
Briefly state the inspected directories, components, supported connections, and unresolved questions. Continue with the user's requested diagram when the scope is clear. Ask a focused question only when a material ambiguity prevents choosing the target or content, or when the user explicitly requested a review before drawing. Incorporate any steering received during analysis.
Phase 5: Layout Selection
Choose layout based on the architecture pattern detected:
| Pattern | Layout | Trigger | |
|---|---|---|---|
| Request/response flow (most web apps) | Vertical flow (top→bottom) | Frontend + API + DB layers detected | |
| Data pipeline / ETL | Horizontal pipeline (left→right) | Linear chain of transforms detected | |
| Event-driven / microservices | Hub and spoke | Message broker/event bus detected | |
| Monolith with modules | Vertical flow with zones | Single service, multiple internal modules |
Tiebreaking: Prefer the pattern with more detected components. Default to vertical flow.
Hybrid: If both request/response and event-driven patterns exist, use vertical flow with the event bus in the middle layer (not hub-and-spoke).
Phase 6: Diagram Generation
Follow the excalidraw skill's new live-diagram workflow: inspect the current canvas, preserve unrelated content, create elements with fresh IDs, inspect geometry and a screenshot, and make at most two corrections. Clearing requires an explicit request to replace the current canvas. Query IDs before retrying a partial creation result. Keep source-derived content unchanged during visual corrections; list any unresolved content or rendering issue with the delivered artifacts.
Color by component role:
| Role | Background | Stroke | |
|---|---|---|---|
| Frontend | #a5d8ff | #1971c2 | |
| Backend/API | #d0bfff | #7048e8 | |
| Database | #b2f2bb | #2f9e44 | |
| External service | #ffc9c9 | #e03131 | |
| Queue/Event | #fff3bf | #fab005 | |
| Cache | #ffe8cc | #fd7e14 |
Label format: Each box should contain:
Example:
Grouping Heuristic (>12 components)
When more than 12 components are discovered:
- Group by top-level directory first (e.g., all files under
services/auth/→ "Auth Service") - If a directory contains >3 components, collapse into one zone named after the directory
- Show the zone as a dashed rectangle containing a single summary box
- Offer drill-down: "Want me to expand the [zone name] zone into its internal components?"
Constraints
- Max 12 components per diagram. If more found, apply grouping heuristic above.
- Max 20 arrows per diagram. Show primary data flow paths only. Use dashed lines for secondary connections.
- Always include a title with the project name and "Architecture Overview"
- Always include a legend if using more than 3 colors
Edge Cases
| Situation | How to Handle | |
|---|---|---|
| Empty or trivial repo (<5 files) | Generate a simple module diagram showing file relationships | |
| Monorepo with many packages | Show package-level view first, offer drill-down per package | |
| No clear architecture (scripts, notebooks) | Show file dependency graph instead | |
| Can't detect connections | Show components without arrows, note it to user | |
| User specifies a subdirectory | Scope analysis to that directory only | |
| Live MCP unavailable | Diagnose the installed integration; continue source analysis and state the rendering limitation | |
| Context budget exceeded | Proceed with partial results, tell user what was skipped |
Example: What Auto-Diagram Produces for a Next.js + Prisma App
Illustrative scope summary (actual source paths and connection evidence must come from the inspected repo):
I found 6 components and 5 connections in this codebase:Components:- Next.js Frontend (pages/, components/) — Frontend- API Routes (pages/api/) — Backend/API- Prisma ORM (prisma/schema.prisma) — Database- PostgreSQL (from DATABASE_URL in .env.example) — Database- NextAuth (from imports in [...nextauth].ts) — Auth- Stripe API (from stripe SDK imports) — External APIConnections:- Frontend → API Routes (REST API)- API Routes → Prisma ORM (Prisma queries)- Prisma ORM → PostgreSQL (SQL)- API Routes → NextAuth (auth middleware)- API Routes → Stripe SDK (import; payment call path not inspected)I will draw this inspected overview and mark the unverified payment path as an assumption.
Diagram layout: Vertical flow, 3 layers
After Diagram Delivery
Show this message once per conversation — only after the first successful diagram the user confirms they're happy with. Do not repeat on subsequent diagrams in the same session.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/excalidraw/skills/auto-diagram/SKILL.md
Popularity
- Repository stars
- 131
- Repository forks
- 9
- 7-day trend score
- 24
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 26 Apr 2026, 6 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/edwingao28/excalidraw-toolkit/auto-diagram)