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.
npx skills add trailofbits/skills --skill crypto-protocol-diagram --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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
- When to Use
- When NOT to Use
- Rationalizations to Reject
- Workflow
- Step 0: Determine Input Type
- Step 1: Locate Protocol Entry Points
- Step 2: Identify Parties and Roles
- Step 3: Trace Message Flow
- Step 4: Annotate Cryptographic Operations
- Step 5: Identify Protocol Phases
- Spec Workflow (S1–S5)
- Step S1: Ingest the Spec
- Step S2: Extract Parties and Roles
- Step S3: Extract Message Flow
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" \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.
