I maintain several GCP infrastructure projects with Terraform. Every time I onboard someone or need to explain the architecture, I face the same problem: my diagrams are either outdated or does not even exist.
The Problem
If you use any coding agent you can generally ask Claude or Gemini to scan your codecase and generate architecture diagram anytime. I tried different approaches:
Mermaid diagrams - Great for code-based diagrams, but they get cluttered fast. A Terraform stack with 15+ resources becomes unreadable. And they don't support the freeform layout I need.
Manual Excalidraw - Beautiful, collaborative, easy to share. But I have to manually update it every time infrastructure changes. Which means it's always outdated.
What I wanted: Claude Code analyzes my codebase and generates an Excalidraw diagram automatically. High-level, clean, with proper arrows.
Most importantly, as I continue working on the project, Claude Code can update the diagram, by understanding the up-to-date codebase, comparing against the old diagram which give useful contexts sometimes.
Exploring Solutions
I considered different approaches to make this convenient:
Ad-hoc prompts — Just ask Claude Code when I need an update
Claude Code Skill — Teach Claude the Excalidraw format once, reuse everywhere
Plugin with slash command —
/excalidrawto trigger generationMCP server — More complex, but could watch for file changes
Hooks — Auto-trigger diagram updates after certain git operations
I started with Claude Code Skills — the simplest to implement. Skills are markdown files that teach Claude how to perform specific tasks. No scripts, no servers, just knowledge files. Perfect for experimenting with quality and feasibility before investing in more complex solutions.
The skill I built:
Analyzes any codebase (Terraform, Node.js, Python, etc.)
Identifies components, services, and their relationships
Generates valid
.excalidrawJSON files
Why and what are the use cases for this Skill ?
Excalidraw has become my go-to for architecture diagrams. A few use cases you can use this Claude Code Skills for:
Keep Architecture Diagram up-to-date — No more outdated diagrams. Claude reads your current code and regenerates with full context of what changed.
Version-controllable — Commit diagrams alongside code. Diff changes. Review in PRs.
Collaboration —
.excalidrawfiles are shared and maintained together with Git with your team, iterate together in real-time on excalidraw.com, or review changes in PRs like any other code artifact.
The .excalidraw format is just JSON — no libraries needed. Claude can generate it directly.
Enhancing the Skill’s features and capabilities:
Some gotchas and learnings:
Proper labels — Initially, I got the shape well but without key input and texts. After few debugging, the skill now teaches Claude to generate .excalidraw files with properly bound text labels. Without this, you get empty boxes. The JSON format requires a specific two-element pattern (shape + text) that isn’t obvious from Excalidraw’s JavaScript API docs.
Elbow arrows — By default LLM won’t really realize the overlapping of arrows and how best place and route them. Straight diagonal arrows look messy when connecting multiple components. The skill generates 90-degree elbow arrows that route cleanly around boxes — much more aesthetic and professional than overlapping straight lines.
Installation
The skill is open source at GitHub
Install in Claude Code:
# Add the marketplace
/plugin marketplace add ooiyeefei/ccc
# Install the skills collection
/plugin install ccc-skills@ccc
# Restart Claude Code
How to Use
After installation, try with preferred prompt or example below:
Use the ccc-skills:excalidraw skill to generate an architecture diagram for this project. Save to docs/architecture.excalidraw
Claude will:
Analyze your codebase
Identify components and relationships
Generate valid
.excalidrawJSONSave to the specified path
Open the file in Excalidraw or VS Code’s Excalidraw extension.
Example: EKS AI/ML Stack
I tested this on one of my sample repo that was built based on AWS AI on EKS blueprint for AI/ML workloads on EKS project (GitHub) — an EKS cluster with Rafay for GPU workload orchestration, Karpenter for autoscaling, and various AI/ML services. (Minor arrow adjustments may be needed occasionally, but the architecture logic and component relationships are accurate out of the box.)
Prompt used:
Use the ccc-skills:excalidraw skill to generate an architecture diagram for this project.
The skill identified the Terraform modules, understood the relationships between VPC → EKS → Node Groups → Karpenter, and generated a clean diagram with proper component grouping.
Try It Out
Got a Terraform stack, microservices repo, or monolith that needs documenting? Give it a shot and let me know what works and what breaks.
Links:
- GitHub (For the Skill)
- GitHub (For the Sample repo I used)
- Excalidraw
- Claude Code

Top comments (0)