arch-diagram

arch-diagram is a skill for Claude Code from braininahat/brains-in-a-hat. It costs 93 tokens per session (1,451 once invoked), scanned A, original, MIT.

A guide for drawing precise, publication-quality machine-learning architecture diagrams in Typst, a markup-based document system. The diagrams show data, model components, connections, and outputs as clean vector graphics.

In plain words
What is it for?
Use it to diagram neural networks, data-processing pipelines, model architectures, and scientific workflows in Typst documents.
Why use it?
It gives technical papers and reports a consistent way to explain how a model or processing pipeline is organized. Vector output stays sharp when resized or printed.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the archer plugin — 5 skills, 2 commands, 2 agents shipped together

Good fit Use it to diagram neural networks, data-processing pipelines, model architectures, and scientific workflows in Typst documents.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/braininahat/brains-in-a-hat/arch-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 braininahat/brains-in-a-hat --skill arch-diagram
Clone the repo
git clone --depth 1 https://github.com/braininahat/brains-in-a-hat

Made for: Claude Code.

Or install archer, the plugin that ships this one along with the rest of its 5 skills, 2 commands, 2 agents.

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

README.md
[![agentmods](https://agentmods.dev/badge/skills/braininahat/brains-in-a-hat/arch-diagram/github.svg)](https://agentmods.dev/skills/braininahat/brains-in-a-hat/arch-diagram)
Your own site
<a href="https://agentmods.dev/skills/braininahat/brains-in-a-hat/arch-diagram"><img src="https://agentmods.dev/badge/skills/braininahat/brains-in-a-hat/arch-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 arch-diagram

Your own site · 80×15
<a href="https://agentmods.dev/skills/braininahat/brains-in-a-hat/arch-diagram"><img src="https://agentmods.dev/badge/skills/braininahat/brains-in-a-hat/arch-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 93 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00093 $0.01451
Opus 5 $0.00046 $0.00726
Sonnet 5 $0.00019 $0.00290
Haiku 4.5 $0.00009 $0.00145

Measured 12d ago against content hash 31bb9ae33121, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

arch-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 12d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/compile-diagram.sh, scripts/render-tikz-for-typst.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.

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.

archer/skills/arch-diagram/SKILL.md · 147 lines

How it starts

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

Publication-Quality ML Architecture Diagrams

Generate vector architecture diagrams in Typst using the fletcher package (built on cetz). Follows the visual principles of Petar Velickovic and Janosh Riebesell: mathematical precision, semantic color, minimalist clarity.

Quick Start

Import the component library as a local Typst package. All colors, node types, edge helpers, and ml-diagram are available:

#import "@local/diagrams:0.1.0": *

For inline use in a full report (adds page/text settings):

#import "@local/diagrams:0.1.0": *
#set text(font: "New Computer Modern", size: 10pt)

// Inside the report body:
#figure(
  ml-diagram(
    data-in((0,0), [Poses\ #dim[(T, 22)]]),
    edge("-|>"),
    encoder((1,0), [BiGRU\ #dim[(T, 256)]]),
    edge("-|>"),
    ctc-head((2,0), [CTC\ #dim[46 classes]]),
    edge("-|>"),
    data-out((3,0), [Phonemes]),
  ),
  caption: [CTC pipeline],
)

For standalone diagram files (auto-sized page):

#import "@local/diagrams:0.1.0": *
#set page(width: auto, height: auto, margin: 5mm, fill: white)
#set text(font: "New Computer Modern", size: 10pt)

#ml-diagram(/* nodes and edges */)

Compile with: typst compile diagram.typ diagram.pdf

The package is installed at ~/.local/share/typst/packages/local/diagrams/0.1.0/ and symlinked to the skill's lib.typ so edits propagate automatically.

Component System

Read references/component-library.md for the full catalog of reusable ML components. Key components:

Component Tint Shape When to Use
data-in red house Raw input data
encoder blue rect Feature extraction layers
decoder teal rect Generation/reconstruction
attention orange hexagon Attention, gating, selection
norm yellow hexagon Normalization, regularization
ctc-head green rect CTC/classification output
embedding purple rect Latent spaces, projections
loss red diamond Loss computation
mask gray rect (dashed) Dropout, masking, optional

Read the full file on GitHub · 147 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. 12d ago First seen · 147 lines · 93 tokens per session scan A 31bb9ae33121

Subscribe to this mod's changes

arch-diagram is a skill published in the GitHub repository braininahat/brains-in-a-hat (4 stars, last pushed 2mo ago), licensed MIT. It adds 93 tokens to every session and 1,451 once invoked, about $0.0005 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-31.

Related

Other skills, from other repositories

scientific-schematics

Create publication-quality scientific diagrams using Nano Banana 2 AI with smart iterative refinement. Uses Gemini 3.6 Flash for quality review. Only regenerates if quality is below threshold for your document type. Specialized in neural network architectures, system diagrams, flowcharts, biological pathways, and…

K-Dense-AI/scientific-agent-skills · 67 tokens

paper-poster-html

A workflow for building an academic conference poster as one HTML/CSS file and printing it to a PDF at an exact page size. It uses the paper’s real figures and checks layout details before review.

wanshuiyin/Auto-claude-code-research-in-sleep · 107 tokens

paperFig

Design, implement, revise, and validate publication-quality scientific figures from references, existing plotting code, and real project data. Trace every figure to source code and inputs; deconstruct reference figures; plan the scientific story and multi-panel structure; build complex model architecture and…

WUBING2023/PaperSpine · 126 tokens

latex-posters

Use when creating or revising LaTeX research posters with beamerposter, tikzposter, or baposter, including poster layout, typography, color, print sizing, figure placement, QR codes, compilation, and print-ready PDF checks.

foryourhealth111-pixel/Vibe-Skills · 53 tokens

figure-composer

Compose a publication-grade multi-panel scientific figure from a claim, dataset, or draft result. Use when the task needs panel planning, consistent figure layout, figure review, or final figure assembly.

companion-inc/feynman · 42 tokens

ccf-visual-composer

A visual design assistant for research papers, presentations, posters, and README graphics. It can lay out figures, tables, diagrams, icons, colors, and other visual elements, including editable SVG, PDF, and PPTX outputs.

mikubaka88/CCFA-Skills · 86 tokens