ascii-diagram

ascii-diagram is a skill for Claude Code from SethGammon/Citadel. It costs 43 tokens per session (2,931 once invoked), scanned A, original, MIT.

A tool for creating precisely aligned text diagrams, such as flowcharts, architecture diagrams, sequences, trees, and tables.

In plain words
What is it for?
It helps add readable ASCII diagrams to Markdown, code comments, or plain-text documents when alignment matters.
Why use it?
Hand-written text diagrams often become misaligned when labels have different lengths; this approach calculates the layout and checks the rendered result.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node .citadel/scripts/grid.cjs '{"direction":"horizontal","boxes":[{"id":"a","label":"Input"},{"id":"b","label":"Output"}],"arrows":[{"from":"a","to":"b","label.

Part of the citadel plugin — 48 skills, 7 agents, 2 MCP servers shipped together

Good fit It helps add readable ASCII diagrams to Markdown, code comments, or plain-text documents when alignment matters.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/SethGammon/Citadel
agentmods
npx agentmods add skills/sethgammon/citadel/ascii-diagram

Made for: Claude Code.

Or install citadel, the plugin that ships this one along with the rest of its 48 skills, 7 agents, 2 MCP servers.

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

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/sethgammon/citadel/ascii-diagram"><img src="https://agentmods.dev/badge/skills/sethgammon/citadel/ascii-diagram.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,931 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00043 $0.02931
Opus 5 $0.00022 $0.01465
Sonnet 5 $0.00009 $0.00586
Haiku 4.5 $0.00004 $0.00293

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

Security

Grade A, and why

ascii-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.

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.

skills/ascii-diagram/SKILL.md · 301 lines

How it starts

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

/ascii-diagram — Perfectly Aligned ASCII Diagrams

Orientation

Use when:

  • The user wants any kind of text/ASCII diagram: architecture, flow, sequence, box-and-arrow, tree, table, org chart, network topology
  • A diagram needs to be embedded in markdown, code comments, or plain text
  • Visual alignment matters

Do NOT use when:

  • The user wants an image (suggest Mermaid, PlantUML, or an image tool instead)
  • The diagram is trivial (a single box or a one-line arrow)

What this skill needs:

  • A description of what to diagram
  • Optional: preferred style (single-line +--+, double-line ╔══╗, rounded ╭──╮, heavy ┏━━┓)
  • Optional: target width constraint

Protocol

Step 1: PLAN THE LAYOUT

Before writing ANY characters, plan the diagram structurally:

  1. Identify elements: List every box/node and its label text
  2. Identify connections: List every arrow/line between elements, with optional labels
  3. Choose layout direction: left-to-right, top-to-bottom, or mixed
  4. Calculate dimensions:
    • Each box width = max label line length + 4 (2 padding + 2 border)
    • Each box height = label line count + 2 (top + bottom border)
    • Gutters between boxes: minimum 3 characters for arrows ()
    • For vertical arrows: minimum 1 row gap

Write this plan out explicitly before proceeding. Example:

Elements:
  A: "Client" → width=10, height=3
  B: "Server" → width=10, height=3
  C: "Database" → width=12, height=3
Layout: left-to-right
Connections: A→B (HTTP), B→C (SQL)
Total width: 10 + 6 + 10 + 6 + 12 = 44

Step 2: BUILD ON A CHARACTER GRID

Use this JavaScript approach mentally (or actually execute it via Bash if the diagram is complex):

// For complex diagrams, RUN this — don't try to hand-align
class Grid {
  constructor(w, h) {
    this.w = w; this.h = h;
    this.cells = Array.from({length: h}, () => Array(w).fill(' '));
  }
  put(x, y, char) {
    if (x >= 0 && x < this.w && y >= 0 && y < this.h) this.cells[y][x] = char;
  }
  text(x, y, str) {
    for (let i = 0; i < str.length; i++) this.put(x + i, y, str[i]);
  }
  box(x, y, w, h, label) {
    // Top border
    this.put(x, y, '+');
    for (let i = 1; i < w-1; i++) this.put(x+i, y, '-');
    this.put(x+w-1, y, '+');
    // Bottom border
    this.put(x, y+h-1, '+');
    for (let i = 1; i < w-1; i++) this.put(x+i, y+h-1, '-');
    this.put(x+w-1, y+h-1, '+');
    // Sides
    for (let j = 1; j < h-1; j++) {
      this.put(x, y+j, '|');
      this.put(x+w-1, y+j, '|');
    }
    // Label (centered)
    const lines = label.split('\n');
    const startY = y + Math.floor((h - lines.length) / 2);
    for (let li = 0; li < lines.length; li++) {
      const line = lines[li];
      const startX = x + Math.floor((w - line.length) / 2);
      this.text(startX, startY + li, line);
    }
  }
  hArrow(x1, x2, y, label) {
    // Horizontal arrow from x1 to x2 at row y
    const dir = x2 > x1 ? 1 : -1;
    for (let x = x1; x !== x2; x += dir) this.put(x, y, '-');
    this.put(x2, y, dir > 0 ? '>' : '<');
    if (label) {
      const lx = Math.min(x1, x2) + Math.floor((Math.abs(x2-x1) - label.length) / 2);
      this.text(lx, y - 1, label);
    }
  }
  vArrow(x, y1, y2, label) {
    // Vertical arrow from y1 to y2 at column x
    const dir = y2 > y1 ? 1 : -1;
    for (let y = y1; y !== y2; y += dir) this.put(x, y, '|');
    this.put(x, y2, dir > 0 ? 'v' : '^');
    if (label) this.text(x + 2, Math.min(y1, y2) + Math.floor(Math.abs(y2-y1) / 2), label);
  }
  render() {
    return this.cells.map(row => row.join('').trimEnd()).join('\n');
  }
}

Read the full file on GitHub · 301 lines

Files

What ships with it

2 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. 12d ago First seen · 301 lines · 43 tokens per session scan A 5f60084f1e0d

Subscribe to this mod's changes

ascii-diagram is a skill published in the GitHub repository SethGammon/Citadel (922 stars, last pushed today), licensed MIT. It adds 43 tokens to every session and 2,931 once invoked, about $0.0002 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

compose-org

Run a task as an evolved multi-agent ORG using the installed liquid-org framework — where YOU (the running Claude) embody the org: you ask liquid-org which proven team topology + specialist personas to use (retrieved from its evolved pool, or assembled fresh), then dispatch ONE SUBAGENT PER TALENT to play each role…

U0001F3A2/liquid-org · 226 tokens

liquid-rank

Rank the available skills by RELEVANCE to the current task, on demand, using liquid-org's read-only hermes skill ranker. This is an EXPLICIT, OPT-IN selector you invoke WHEN you want help choosing the most relevant skill for what you're doing — it is NOT default, automatic skill selection, and it does NOT decide for…

U0001F3A2/liquid-org · 198 tokens

present-gate

First-officer gate-presentation rendering — the captain-facing gate-review template and assembly rules, including workflow-owned finding labels. Invoke at the gate point after the FO has decided a stage must be presented.

spacedock-dev/spacedock · 44 tokens

audit-project

Run an iterative multi-agent code audit until critical and high findings are resolved. Use when the user says "audit my code", "find all the bugs", "deep code audit", "iterative review", or "review until clean".

OutlineDriven/odin-claude-plugin · 50 tokens

prototype

Use when asked to prototype one design question through a cheap logic or UI experiment, including button-driven state-model checks. Not for polished artifacts: use polished-web-prototype.

OutlineDriven/odin-claude-plugin · 36 tokens

contexts

Use when the user says "get context on X", "how does X work", or wants architectural orientation before coding.

OutlineDriven/odin-claude-plugin · 26 tokens