architecture-knowledge-graph

A guide to reading codebases with Excalidraw Architect MCP kg_* tools and building high-quality, persistent architecture knowledge graphs. Suitable for creating or updating .claude/architecture.md, mapping services and their dependencies, or analyzing one or more repositories to capture inter-service communication patterns.

Last repository push
GitHub Stars
164
Forks
10
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "architecture-knowledge-graph" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-64fc0864e7180edf4bb4066ef019a4ec22a8825fb67c36038c8b4333eeeaa690. Verify the upstream source and version against https://github.com/BV-Venky/excalidraw-architect-mcp before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

A guide to reading codebases with Excalidraw Architect MCP kg_* tools and building high-quality, persistent architecture knowledge graphs. Suitable for creating or updating .claude/architecture.md, mapping services and their dependencies, or analyzing one or more repositories to capture inter-service communication patterns.

0 Downloads

Introduction source: third_party · BV-Venky · 0.0.1 Reference

SkillPi interpretation

Tasks
Guide for reading a codebase and building a high-quality, persistent architecture knowledge graph via the Excalidraw Architect MCP kg_* tools. Use when creating or updating the knowledge graph (.claude/architecture.md), mapping services and their dependencies, or analyzing one or more repos to capture how services communicate.
Limits and differences
A dependency is keyed on `(from_id, to_id)`, so a second `kg_link` between the same pair **replaces** the first. If A talks to B two ways (REST *and* Kafka), combine them into one label — `"REST /orders · Kafka order.created"` — or link the primary transport. Don't issue two `kg_link` calls expecting two arrows.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: architecture-knowledge-graph
description: Guide for reading a codebase and building a high-quality, persistent architecture knowledge graph via the Excalidraw Architect MCP kg_* tools. Use when creating or updating the knowledge graph (.claude/architecture.md), mapping services and their dependencies, or analyzing one or more repos to capture how services communicate.

Architecture Knowledge Graph Guide

This skill teaches you how to turn a codebase into a clean, durable knowledge graph using the kg_* MCP tools. The graph (default .claude/architecture.md) is the single source of truth; diagrams are rendered views of it.

Graph quality depends almost entirely on how well you read the code. The MCP preserves, validates, and renders whatever you put in — it does not analyze the codebase. That analysis is your job.

Core Principle

Model services/components and how they communicate, not classes, functions, or every import. A "service" is a deployable unit / bounded context — one repo, one container, one logical responsibility.

Workflow (do the passes in order — don't interleave)

  1. kg_init once (or kg_import to bootstrap from an existing .excalidraw).
  2. Discovery pass — identify every service first. Add each with kg_add_service, setting component_type, domain, and owner while the info is in front of you (Dockerfiles, CODEOWNERS, READMEs, manifests).
  3. Linking pass — only after all services exist, add edges with kg_link. Linking before a target exists fails; that's why discovery comes first.
  4. kg_lint — catch dangling references, cycles, and single points of failure. Fix them before rendering.
  5. kg_render (whole graph) or kg_render_view / kg_render_around / kg_render_domain for focused diagrams.

How to find the edges (where services talk)

Look for these signals and translate each into a labelled kg_link:

Signal in code Link Label / style
HTTP client, base URL, OpenAPI/Swagger spec sync call "REST /orders", style: solid
gRPC stub / proto service sync call "gRPC GetOrder", style: solid
Kafka/SQS/RabbitMQ producer async event "Kafka order.created", style: dashed
Kafka/SQS/RabbitMQ consumer async event (incoming) label with the same topic
DB connection string / ORM config datastore "reads/writes", style: solid
Service-discovery / env var (PAYMENTS_URL) dependency name the protocol

Cross-repo detection (multiple repos)

To connect services across repos, match a producer in repo A to a consumer in repo B using the shared join key:

  • Async: topic / queue name (A publishes order.created, B subscribes order.created → kg_link order-svc -> fulfilment-svc "Kafka order.created" style=dashed).
  • Sync: the called service's route/host (A calls https://payments/charge → link A → payments).

Do a producer/consumer inventory across all repos before linking, so you don't miss an edge whose two ends live in different codebases.

Conventions (keep the graph consistent across sessions)

  • Stable kebab-case ids, reused everywhere: order-service — never OrderService one session and orders the next. Id drift silently corrupts a cumulative graph.
  • Every edge is labelled with the mechanism. No bare arrows between services.
  • Style encodes transport: solid = sync (REST/gRPC/DB), dashed = async (events/queues). Consistency makes diagrams instantly readable.
  • Set domain to group services (team / bounded context / tier) so you can render one domain at a time.

Granularity

The full graph may be large, but any single rendered view should stay readable (~6–15 services). If a domain has 20 services, render it per sub-domain with kg_render_domain / kg_render_view rather than one giant picture. Resist decomposing a service into its internal classes — that's a different diagram.

Known limitation: parallel edges

A dependency is keyed on (from_id, to_id), so a second kg_link between the same pair replaces the first. If A talks to B two ways (REST and Kafka), combine them into one label — "REST /orders · Kafka order.created" — or link the primary transport. Don't issue two kg_link calls expecting two arrows.

Verify

Unlike diagrams, the graph is deterministically checkable. After building, run whats_connected_to <service> and kg_lint to sanity-check the topology matches your understanding of the system before sharing rendered views.

Version history

  1. v2.0.0 GitHub ↗
    Original release notes

    ### Highlights - 25 diagram types (was 2): sequence, swimlane, ER, state machine, timeline, Gantt, quadrant, funnel, Venn, flywheel, and hand-drawn bar/line/scatter. - Exports now render through a Python port of roughjs, so SVG/PNG match the Excalidraw canvas instead of being clean-geometry approximations. - New tools: `list_diagram_types`, `get_diagram_schema`. ### Compatibility - `create_diagram` parameter order changed (`output_path` first). MCP clients call by keyword and are unaffected; positional Python callers need updating. - Export output changed — SVG snapshot tests will show diffs.

  2. v1.0.3 GitHub ↗
    Original release notes

    The big one: **your architecture is now a living knowledge graph**, not just a diagram. This release turns the project from a diagram generator into a persistent, queryable model of your system — diagrams become *views* of it. ### 🧠 Architecture Knowledge Graph Your services and dependencies now live in a single version-controlled markdown file (default `.claude/architecture.md`) that the AI builds once and reuses everywhere. It's human-readable, round-trips losslessly, and diffs cleanly in PRs. - **One source of truth, many views** — render the full system, a single domain, or everything within N hops of one service - **Queryable** — "what breaks if payments goes down?" returns the real upstream blast radius - **Self-checking** — lint for dependency cycles, single points of failure, orphans, and dangling references - **Bootstrap from what you have** — import existing `.excalidraw` diagrams into the graph - **Export anywhere** — Mermaid, Graphviz DOT, or JSON - **Git-aware** — diff how the architecture changed since any ref; generate onboarding docs; detect drift against actual Python imports ### 🔀 Parallel edges Two communication modes between the same services (e.g. a solid `REST /charge` call **and** a dashed `Kafka payment.requested` event) now render as two distinct, labelled arrows instead of collapsing into one. ### 🛠️ New MCP tools (`kg_*`) `kg_init` · `kg_add_service` · `kg_remove_service` · `kg_link` · `kg_unlink` · `kg_set_domain` · `kg_info` · `kg_render` · `kg_render_view` · `kg_render_around` · `kg_render_domain` · `kg_import` · `whats_connected_to` · `kg_path` · `kg_lint` · `kg_export` · `kg_diff` · `kg_onboarding_doc` · `kg_drift` ### 🐛 Fixes - **Edge labels no longer overlap arrows** in SVG/PNG export — the line is now masked behind bound labels, matching Excalidraw's native rendering (improves every exported diagram) - **Fixed an infinite loop** in edge routing when two arrows share an endpoint ### 📚 Docs - New README section for the knowledge graph, with a `kg_*` tool reference - New `architecture-knowledge-graph` skill that teaches the AI how to read a codebase and build a clean graph ### ✅ Compatibility Fully additive — the existing tools (`create_diagram`, `mermaid_to_excalidraw`, `modify_diagram`, `get_diagram_info`, `export_diagram`) are unchanged. No breaking changes. ### 📦 Install / upgrade ```bash pip install -U excalidraw-architect-mcp # or, no install: uvx excalidraw-architect-mcp Full changelog: https://github.com/BV-Venky/excalidraw-architect-mcp/compare/v0.3.0...v1.0.3

  3. v0.3.0 GitHub ↗
    Original release notes

    feat: add export_diagram tool for SVG and PNG export by @nandanadileep ## What's Changed * feat: add export_diagram tool for SVG and PNG export (#13) by @nandanadileep in https://github.com/BV-Venky/excalidraw-architect-mcp/pull/14 ## New Contributors * @nandanadileep made their first contribution in https://github.com/BV-Venky/excalidraw-architect-mcp/pull/14 **Full Changelog**: https://github.com/BV-Venky/excalidraw-architect-mcp/compare/v0.2.3...v0.3.0

  4. v0.2.3 GitHub ↗
    Original release notes

    Users on Python 3.10 were facing issues wrt Annotations as it is not Compatible. This version fixes the compatibility issues

  5. v0.2.2 GitHub ↗
    Original release notes

    MCP Registration

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供架构知识图谱构建的完整方法论,解决开发者实际痛点
  • 适用于多仓库服务依赖分析,具有广泛实用价值
Trigger Precision95/100

Highlights

  • 触发场景描述清晰完整,覆盖知识图谱创建、更新、服务映射等多种使用场景
  • 边界定义明确,不易与其他Skill混淆
Structure and Standards95/100

Highlights

  • 文档结构层次清晰,包含核心原则、工作流程、规范约定等完整章节
  • 提供详细表格说明代码信号与图谱元素的映射关系,便于执行
Execution Reliability90/100

Highlights

  • 工具调用顺序明确,参数说明详细,降低执行错误风险
  • 包含验证机制(kg_lint)和已知限制说明,提高执行成功率
Evidence Verifiability (mean of the first four)91/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • payments

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.