Skip to main content
skill CX Codex

crypto-protocol-diagram — Claude Code skill: protocol diagrams

Reads protocol code or a spec and writes a Mermaid sequenceDiagram with crypto annotations, plus an ASCII diagram in the reply.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add trailofbits/skills --skill crypto-protocol-diagram -a claude-code
Open on GitHub

What crypto-protocol-diagram does

Point it at a crypto protocol and it maps the message flow: who sends what, which operation runs at each step, what phases the handshake has. The Mermaid sequenceDiagram is written to a file, and an ASCII version lands inline in the answer.

Input can be implementation code (.py, .rs, .go, .ts, .js, .cpp, .c) or a specification: an RFC, a paper, pseudocode, plain prose, a ProVerif .pv model, a Tamarin .spthy one. The work follows a checklist — classify the input, find protocol entry points with rg searches over names like handshake and keygen, list the parties, then annotate each cryptographic step and show error paths as alt blocks. Specs behind a URL arrive through WebFetch; Read, Write, Grep, Glob and Bash handle local files.

When both code and a spec exist, it starts from the spec and then checks the implementation against it, flagging divergences. That is why it does not sketch from memory. Call graphs and class hierarchies are the job of the neighbouring diagramming-code skill, since this one extracts protocol semantics rather than code structure.

What it helps with

  • trace a TLS handshake through library source
  • pull message flow out of an RFC and draw it
  • see where the code drifted from the spec
  • visualise a ProVerif model before checking it
  • sketch the X3DH key exchange phases

Example prompts for the agent

  • Diagram the handshake in src/handshake.rs as a Mermaid sequenceDiagram
  • Extract the message flow from this RFC and annotate the crypto steps
  • Compare noise/ against the noise.spthy model and mark the differences

How to install crypto-protocol-diagram

1Skills CLI (Vercel)

npx skills add trailofbits/skills --skill crypto-protocol-diagram -a claude-code

2Manually: put the files in place

~/.claude/skills/crypto-protocol-diagram/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/crypto-protocol-diagram/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about crypto-protocol-diagram

How do I install crypto-protocol-diagram in Claude Code?

Run npx skills add trailofbits/skills --skill crypto-protocol-diagram -a claude-code. The skill file ends up at ~/.claude/skills/crypto-protocol-diagram/SKILL.md.

What does crypto-protocol-diagram do?

It builds a sequence diagram of a crypto protocol from code or a specification. You get a Mermaid sequenceDiagram in a file and an ASCII diagram in the reply, with each cryptographic operation labelled.

How is it different from diagramming-code?

diagramming-code draws code structure: call graphs, classes, module dependencies. This skill pulls out protocol semantics — parties, messages, crypto transformations.

Similar skills

Everything for Security →

From the same set77

graph-evolution Compares Trailmark code graphs across two code snapshots to spot structural security changes. It catches attack path expansion and privilege shifts that text diffs overlook. CX Codex +1 3,900installs trailmark-structural Builds a Trailmark graph for a target directory and reports complexity, taint, blast radius, privilege boundaries, and attack surface data. CX Codex +1 3,900installs trailmark-summary This skill runs trailmark analyze --summary against a target directory and reports detected languages, entry point count and dependencies. CX Codex +1 3,900installs audit-augmentation Projects SARIF static analysis reports, weAudit notes, and binary graphs onto Trailmark code graphs. Useful when mapping vulnerabilities to call graphs and data taint paths. CX Codex +1 3,900installs vector-forge This skill uses mutation testing to find gaps in tests for cryptographic implementations and propose vectors for uncovered cases. Use it to assess an existing test suite. CX Codex +1 3,800installs genotoxic Sorts survived mutants into false positives, missing unit tests and fuzzing targets, using a code graph built with Trailmark. CX Codex +1 3,800installs c-review Reviews native C/C++ code for memory bugs, integer overflows and races. Use it when auditing userspace applications, daemons or services. CX Codex +1 3,700installs chrome-mcp-troubleshooting Troubleshoots native host clashes between Claude Code and Chrome on macOS. Fixes broken bridge connections when browser tools refuse to run. CX Codex +1 2,400installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor