architecture-diagram

architecture-diagram is a skill for Claude Code, Codex from OpenKnots/okcode. It costs 12 tokens per session (1,329 once invoked), scanned A, original, MIT.

A guide for generating architecture diagrams as PNG images with Python and matplotlib. Architecture diagrams show system components, layers, dependencies, or how data moves between parts.

In plain words
What is it for?
Use it for system overviews, request and event flows, package-dependency diagrams, data-flow illustrations, and comparisons of architectural options.
Why use it?
It provides a consistent way to turn a system design or package relationship into documentation that is easier to understand visually.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/openknots/okcode/architecture-diagram
Any agent
npx skills add OpenKnots/okcode --skill architecture-diagram
Clone the repo
git clone --depth 1 https://github.com/OpenKnots/okcode

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for architecture-diagram

README.md
[![agentmods](https://agentmods.dev/badge/skills/openknots/okcode/architecture-diagram.svg)](https://agentmods.dev/skills/openknots/okcode/architecture-diagram)
Your own site
<a href="https://agentmods.dev/skills/openknots/okcode/architecture-diagram"><img src="https://agentmods.dev/badge/skills/openknots/okcode/architecture-diagram.svg" alt="Measured on agentmods" height="20"></a>
Per session 12 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,329 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00012 $0.01329
Opus 5 $0.00006 $0.00665
Sonnet 5 $0.00002 $0.00266
Haiku 4.5 $0.00001 $0.00133

Measured 4d ago against content hash 69f5b653624c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

architecture-diagram scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/architecture-diagram/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Architecture Diagram Generator

When to use this skill

  • When the user asks for an architecture diagram, system diagram, or component visualization.
  • When updating READMEs that would benefit from visual architecture documentation.
  • When comparing architectural alternatives visually (like the telemetry-architecture-comparison pattern).
  • When the user wants to visualize data flow, package dependencies, or tech stack layers.

What this skill does

Generates publication-quality PNG architecture diagrams using Python + matplotlib. Diagrams use a consistent visual language: colored rounded boxes for components, styled arrows for data flow, dashed boundaries for service groups, and score badges for comparisons.

Implementation

Step 1: Identify the diagram type

Determine which diagram pattern fits the request:

Pattern When to use Example
High-level architecture Full system overview with all components high-level-architecture.png
Request/event flow Show how data moves through a pipeline server-request-flow.png
Package dependencies Show import/dependency relationships package-dependencies.png
Event flow Show event sourcing or pub/sub patterns orchestration-event-flow.png
Tech stack Layered technology overview tech-stack.png
Architecture comparison Compare N alternatives with scores telemetry-style comparison grid

Step 2: Use or extend the generator script

The diagram generator lives at scripts/generate-architecture-diagrams.py. It provides reusable primitives:

from generate_architecture_diagrams import (
    draw_box,      # Rounded colored rectangle with label + sublabel
    draw_arrow,    # Styled arrow with optional label and curve
    draw_boundary, # Dashed service/group boundary
    draw_badge,    # Colored score circle
    new_fig,       # Create a new figure with standard theme
    save,          # Save to assets/diagrams/
    THEME,         # Consistent color palette
    Box, Arrow,    # Dataclasses for components
)

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 130 lines · 12 tokens per session scan A 69f5b653624c

Subscribe to this mod's changes

architecture-diagram is a skill published in the GitHub repository OpenKnots/okcode (24 stars, last pushed 3mo ago), licensed MIT. It adds 12 tokens to every session and 1,329 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

diagramming-expert

Master of text-based visual communication using ASCII art, Unicode box-drawing, and structured diagram notation. Creates clear, maintainable diagrams for systems, processes, hierarchies, relationships, and psychological structures. Proactively generates diagrams to enhance understanding. Activate on visualization…

NeuroFusionAI/fibo-mcp · 92 tokens

architecture-diagram

Dark-themed SVG architecture/cloud/infra diagrams as HTML.

mateaix/mateclaw · 15 tokens

svg-press

Teaches agents how to hand-craft self-contained SVG diagrams that render correctly in browsers, tags, and Playwright PDF/PNG. Covers containment math, viewBox sizing, arrow construction, text hierarchy, KDCube brand color tokens, semantic zone fills, badges, the PNG inspection loop, writepng parameters, multi-diagram…

kdcube/kdcube · 87 tokens

mermaid-diagrams

Create software diagrams using Mermaid syntax. Use when users need to create, visualize, or document software through diagrams including class diagrams, sequence diagrams, flowcharts, ERDs, C4 architecture diagrams, state diagrams, git graphs, and other diagram types. Triggers include requests to diagram, visualize…

wpank/ai · 77 tokens

fin-arch-diagram

生成研究/项目架构图、流程图、层次图(swimlane / processflow / hierarchytree)。适合 PPT 汇报、技术文档、综述插图。输出风格接近 draw.io,可选 graphviz(高质量)/ matplotlib(零依赖)双后端。.

csmar432/finai-research · 72 tokens

visual-assets-generation

Generate visual assets (ASCII art, diagrams, banners) for repos and documentation.

kevinnft/ai-agent-skills · 19 tokens