diagram

diagram is a command for Claude Code from nWave-ai/nWave. It costs 29 tokens per session (507 once invoked), scanned A, original, MIT.

Generates C4 architecture diagrams (context, container, component) in Mermaid or PlantUML. Use when creating or updating architecture visualizations.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter.

Part of the nw plugin — 12 commands shipped together

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 commands/nwave-ai/nwave/diagram
Clone the repo
git clone --depth 1 https://github.com/nWave-ai/nWave

Made for: Claude Code.

Or install nw, the plugin that ships this one along with the rest of its 12 commands.

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 diagram

README.md
[![agentmods](https://agentmods.dev/badge/commands/nwave-ai/nwave/diagram.svg)](https://agentmods.dev/commands/nwave-ai/nwave/diagram)
Your own site
<a href="https://agentmods.dev/commands/nwave-ai/nwave/diagram"><img src="https://agentmods.dev/badge/commands/nwave-ai/nwave/diagram.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 507 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin unknown 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.00029 $0.00507
Opus 5 $0.00015 $0.00253
Sonnet 5 $0.00006 $0.00101
Haiku 4.5 $0.00003 $0.00051

Measured today against content hash 7c462483af41, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

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

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.

plugins/nw/commands/diagram.md · 64 lines

How it starts

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

NW-DIAGRAM: Architecture Diagram Generation

Wave: CROSS_WAVE | Agent: Morgan (nw-solution-architect) | Command: *create-diagrams

Overview

Generate architecture diagrams from design documents. Supports C4 model levels (context|container|component) in Mermaid|PlantUML|C4 format. Audience-appropriate: high-level context for stakeholders|component details for developers|deployment topology for operations.

Context Files Required

  • docs/product/architecture/brief.md (SSOT — component boundaries, technology stack, design decisions)

Agent Invocation

@nw-solution-architect

Execute *create-diagrams for {architecture-component}.

Context Files: docs/product/architecture/brief.md

Configuration:

  • diagram_type: component (component|deployment|sequence|data|context)
  • format: mermaid (mermaid|plantuml|c4)
  • level: container (context|container|component)
  • output_directory: docs/product/architecture/

Progress Tracking

The invoked agent MUST create a task list from its workflow phases at the start of execution using TaskCreate. Each phase becomes a task with the gate condition as completion criterion. Mark tasks in_progress when starting each phase and completed when the gate passes. This gives the user real-time visibility into progress.

Success Criteria

  • Diagrams accurately represent current architecture
  • Audience-appropriate detail level applied
  • Diagrams render without syntax errors
  • Output files created in configured directory

Next Wave

Handoff To: {invoking-agent-returns-to-workflow} Deliverables: Architecture diagrams in configured format

Examples

Example 1: Generate C4 container diagram

/nw-diagram payment-service --diagram_type=component --format=mermaid --level=container

Morgan reads architecture docs and produces a Mermaid container diagram showing service boundaries, data stores, and external integrations.

Expected Outputs

docs/product/architecture/
  system-context.{ext}
  component-architecture.{ext}
  deployment-architecture.{ext}

Read the full file on GitHub · 64 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. today First seen · 64 lines · 29 tokens per session scan A 7c462483af41

Subscribe to this mod's changes

diagram is a command published in the GitHub repository nWave-ai/nWave (605 stars, last pushed today), licensed MIT. It adds 29 tokens to every session and 507 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-09-06.