Agent skill · Documentation

crypto-protocol-diagram

Extracts protocol message flow from source code, RFCs, academic papers, pseudocode, informal prose, ProVerif (.pv), or Tamarin (.spthy) models and generates Mermaid sequenceDiagrams with cryptographic annotations. Use when diagramming a crypto protocol, visualizing a handshake or key exchange flow, extracting message flow from a spec or RFC, diagramming a ProVerif or Tamarin model, or drawing sequence diagrams for TLS, Noise, Signal, X3DH, Double Ratchet, FROST, DH, or ECDH protocols.

trailofbitsgithub.com/trailofbitsGitHub ↗
claude-codeships scriptsCC-BY-SA-4.0
Install
npx skills add trailofbits/skills --skill crypto-protocol-diagram --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 11
SKILL.md size: 18 KB
Bundled scripts: yes
Path: plugins/trailmark/skills/crypto-protocol-diagram/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 6,426
Language: Python
Read our review of the source →

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Crypto Protocol Diagram Produces a Mermaid `sequenceDiagram` (written to file) and an ASCII sequence diagram (printed inline) from either: - **Source code** implementing a cryptographic protocol, or - **A specification** — RFC, academic paper, pseudocode, informal prose, ProVerif (`.pv`), or Tamarin (`.spthy`) model. **Tools used:** Read, Write, Grep, Glob, Bash, WebFetch (for URL specs). Unlike the `diagramming-code` skill (which visualizes code structure), this skill extracts **protocol semantics**: who sends what to whom, what cryptographic transformations occur at each step, and what protocol phases exist. For call graphs, class hierarchies, or module dependency maps, use the `diagramming-code` skill instead. ## When to Use - User asks to diagram, visualize, or extract a cryptographic protocol - Input is source code implementing a handshake, key exchange, or multi-party protocol - Input is an RFC, academic paper, pseudocode, or formal model (ProVerif/Tamarin) - User names a specific protocol (TLS, Noise, Signal, X3DH, FROST) ## When NOT to Use - User wants a call graph, class hierarchy, or module dependency map — use `diagramming-code` - User wants to formally verify a protoc

What's inside
Steps it walks through
  1. When to Use
  2. When NOT to Use
  3. Rationalizations to Reject
  4. Workflow
  5. Step 0: Determine Input Type
  6. Step 1: Locate Protocol Entry Points
  7. Step 2: Identify Parties and Roles
  8. Step 3: Trace Message Flow
  9. Step 4: Annotate Cryptographic Operations
  10. Step 5: Identify Protocol Phases
  11. Spec Workflow (S1–S5)
  12. Step S1: Ingest the Spec
  13. Step S2: Extract Parties and Roles
  14. Step S3: Extract Message Flow
Ships with 10 files
  • agents/openai.yaml
  • assets/trail-of-bits-mark.svg
  • examples/simple-handshake/expected-output.md
  • examples/simple-handshake/protocol.py
  • examples/simple-proverif/expected-output.md
  • examples/simple-proverif/model.pv
  • references/ascii-sequence-diagram.md
  • references/mermaid-sequence-syntax.md
  • references/protocol-patterns.md
  • references/spec-parsing-patterns.md
Commands it runs
Find handshake, session, round, phase entry points
rg -l "handshake|session_init|round[_0-9]|setup|keygen|send_msg|recv_msg" {targetDir}
Find crypto primitives in use
rg "sign|verify|encrypt|decrypt|dh|ecdh|kdf|hkdf|hmac|hash|commit|reveal|share" \
More from skills
All skills →
About this skill
What does the crypto-protocol-diagram skill do?

Extracts protocol message flow from source code, RFCs, academic papers, pseudocode, informal prose, ProVerif (.pv), or Tamarin (.spthy) models and generates Mermaid sequenceDiagrams with cryptographic annotations. Use when diagramming a crypto protocol, visualizing a handshake or key exchange flow, extracting message flow from a spec or RFC, diagramming a ProVerif or Tamarin model, or drawing sequence diagrams for TLS, Noise, Signal, X3DH, Double Ratchet, FROST, DH, or ECDH protocols.

How do I install it?

Run `npx skills add trailofbits/skills --skill crypto-protocol-diagram --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From trailofbits/skills, a repository with 6,426 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going