block-diagram

block-diagram is a skill for Claude Code, Codex from jimezsa/opencolab. It costs 84 tokens per session (2,055 once invoked), scanned C, original, MIT.

A tool for turning a written description of a system, workflow, or architecture into an editable diagram. It creates D2 source code and can render SVG or PNG images.

In plain words
What is it for?
Use it to map software components, research models, services, pipelines, or workflows for technical and non-technical audiences.
Why use it?
It removes the need to draw system relationships by hand while keeping the diagram reproducible and changeable as the design evolves.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to map software components, research models, services, pipelines, or workflows for technical and non-technical audiences.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/jimezsa/opencolab/block-diagram
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.

Any agent
npx skills add jimezsa/opencolab --skill block-diagram
Clone the repo
git clone --depth 1 https://github.com/jimezsa/opencolab

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 block-diagram

README.md
[![agentmods](https://agentmods.dev/badge/skills/jimezsa/opencolab/block-diagram/github.svg)](https://agentmods.dev/skills/jimezsa/opencolab/block-diagram)
Your own site
<a href="https://agentmods.dev/skills/jimezsa/opencolab/block-diagram"><img src="https://agentmods.dev/badge/skills/jimezsa/opencolab/block-diagram/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for block-diagram

Your own site · 80×15
<a href="https://agentmods.dev/skills/jimezsa/opencolab/block-diagram"><img src="https://agentmods.dev/badge/skills/jimezsa/opencolab/block-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,055 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00084 $0.02055
Opus 5 $0.00042 $0.01027
Sonnet 5 $0.00017 $0.00411
Haiku 4.5 $0.00008 $0.00205

Measured 9d ago against content hash 2fd482bf4bed, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade C, and why

block-diagram scanned grade C with 2 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 9d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/render_d2_diagram.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

"script": "curl -fsSL https://d2lang.com/install.sh | sh -s --",

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

"script": "curl -fsSL https://d2lang.com/install.sh | sh -s --",
projects/SKILLS/block-diagram/SKILL.md · 197 lines

How it starts

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

Block Diagram Skill

Use this skill when the user wants a block diagram that explains a system, model, pipeline, service, architecture, or workflow.

This is the deterministic path for architecture visuals in OpenColab. The source of truth is a D2 file, not an image-generation prompt. The default rendered style is D2 sketch mode, which gives a hand-drawn look while keeping the diagram deterministic and editable. Diagrams should stay compact, and arrows should remain unlabeled unless the label carries specific technical meaning.

Mission

Given a textual architecture description:

  1. Normalize it into components, groups, and directed relationships.
  2. Write a canonical diagrams/<slug>.d2 source file.
  3. Render diagrams/<slug>.svg.
  4. Render diagrams/<slug>.png when the user wants a raster image or when the result should be sent back to Telegram.
  5. Return a short explanation of the diagram and any important assumptions.

Prerequisites

  • d2 is installed and available in PATH.
  • bash is available in PATH.
  • The working directory is writable.

Required Inputs

  • A system or architecture description.
  • Optional audience: beginner, engineer, executive, paper figure, infra team, and so on.
  • Optional must-include components, flows, or labels.
  • Optional must-include formulas or equations.
  • Optional preferred output name.
  • Optional render style: sketch or clean.

If the user does not provide an audience, assume engineer. If the user does not provide an output name, derive a short slug from the system name. If the user does not provide a render style, use sketch.

Hard Requirements

  • Use this skill for block diagrams instead of defaulting to a free-form image model.
  • Treat the .d2 file as the canonical artifact and the rendered image as a derived artifact.
  • Do not invent components, edges, protocols, or subsystems that were not implied by the request.
  • Support optional formula blocks with equation: |latex only when a mathematically important transformation, loss, or objective would be materially harder to understand without an explicit equation.
  • Do not generate a formula just because the request mentions math, a model, or an algorithm; include one only when the diagram would otherwise lose important meaning.
  • If one ambiguity blocks a faithful diagram, ask one targeted question. Otherwise proceed autonomously.
  • Keep the first diagram readable and compact. If the architecture is too dense, split it into an overview diagram plus one focused detail diagram.
  • Use references/style-guide.md for layout, color semantics, naming, and grouping rules.
  • Use references/patterns.md when selecting the diagram structure.
  • Use ml-llm-architecture-template.md as an optional template for detailed ML, LLM, neural-network, transformer, training, or quantization architecture diagrams.
  • Use references/validation.md before returning the final result.
  • Use scripts/render_d2_diagram.sh to format, validate, and render the final diagram.
  • Default to sketch-style rendering. Only switch to clean rendering when the user explicitly asks for a polished, paper-ready, or non-sketch output.
  • Default to unlabeled arrows. Add edge labels only when they convey specific information such as a protocol, artifact, or payload that the arrow alone would not communicate.
  • Never use generic edge labels such as input, output, data, result, something input, or something output.
  • OpenColab normally provides OPENCOLAB_PROGRESS_FILE during provider runs. When it is set and the task is long enough to justify updates, emit bounded JSON progress events for normalization, draft completion, render start, warnings, blockers, or final artifact creation when they help the user understand real progress.
  • If the rendered artifact should be sent to Telegram, emit a raw @telegram-file {"kind":"document","file":"diagrams/<slug>.svg","caption":"optional"} or @telegram-file {"kind":"photo","file":"diagrams/<slug>.png","caption":"optional"} line on its own line with no backticks or code fences. Keep the JSON on one line, use a valid kind (photo for images, never image/png/jpg), and on Windows write the path with forward slashes.
  • If PNG rendering is unavailable in the current environment, fall back to the SVG artifact and send it as a Telegram document instead of pretending the PNG exists.

Read the full file on GitHub · 197 lines

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 9d ago First seen · 197 lines · 84 tokens per session scan C 2fd482bf4bed

Subscribe to this mod's changes

block-diagram is a skill published in the GitHub repository jimezsa/opencolab (11 stars, last pushed 26d ago), licensed MIT. It adds 84 tokens to every session and 2,055 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it C with 2 findings (downloads and executes remote code, makes network calls). 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