LogoAwesome Skills
  • Search
  • Category
  • Tag
  • Blog
LogoAwesome Skills
LogoAwesome Skills

Discover Open-Source Agent Skills for AI Coding Assistants

Product

  • Search
  • Category
  • Tag
  • Blog

Resources

  • Claude Skill Docs
  • Antigravity Skills Docs

Tools

  • Claude Code
  • OpenCode
  • Cursor
  • Codex
  • Antigravity

Company

  • Privacy Policy
  • Terms of Service
  • Sitemap

©2026 Awesome Skills. All rights reserved.

Privacy PolicyTerms
Back to Skills

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.

5,841stars513forksUpdated 6/24/2026
Security#security#protocol-analysis#mermaid#diagramming#cryptography

Security Assessment

Low Risk(85/100)

Detected risks:

Secret Exposure([references/mermaid-sequence-syntax.md] secret =)
Security Score85/100

About crypto-protocol-diagram

Crypto Protocol Diagram extracts the message flow of a cryptographic protocol and produces a Mermaid sequenceDiagram (written to a file) plus an ASCII sequence diagram (printed inline). It accepts two kinds of input: source code implementing a protocol, or a specification such as an RFC, academic paper, pseudocode, informal prose, a ProVerif (.pv) model, or a Tamarin (.spthy) model. 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. It is suited to diagramming handshakes and key exchanges and to named protocols like TLS, Noise, Signal, X3DH, Double Ratchet, FROST, DH, and ECDH.

Use it when asked to diagram, visualize, or extract a cryptographic protocol from code, a spec, or a formal model. It should not be used for call graphs, class hierarchies, or module dependency maps (use diagramming-code), for formal verification (use mermaid-to-proverif after generating the diagram), or for input that has no protocol semantics. The skill enforces discipline against shortcuts: it rejects diagramming from memory, requires annotating every cryptographic operation, requires showing every abort and error path with alt blocks, and treats ProVerif and Tamarin models as specifications rather than code.

The workflow starts at Step 0 by classifying the input as code, spec, or both using a signal table (file extensions and imports indicate code; RFC headers, algorithm labels, ProVerif process/let/in/out, or Tamarin rule/--[...]-> indicate spec). Code input proceeds through locating protocol entry points with ripgrep, identifying parties and roles, tracing message flow (including treating in-process function-call boundaries as logical sends), annotating cryptographic operations such as keygen, DH/ECDH, KDF/HKDF, signing, verification, encryption, decryption, commitment, hashing, and secret sharing, and grouping steps into named phases like setup, handshake, authentication, key derivation, data transfer, and finalization. Specification input follows a parallel S1–S5 path; when both code and a spec exist, the spec workflow runs first and code is used to verify and annotate divergences. Both paths converge on generating the sequenceDiagram and verifying and delivering it.

FAQ

What input formats does this skill accept?

It accepts source code implementing a protocol, and specifications including RFCs, academic papers, pseudocode, informal prose, ProVerif (.pv) models, and Tamarin (.spthy) models.

What output does it produce?

It produces a Mermaid sequenceDiagram written to a file and an ASCII sequence diagram printed inline, capturing who sends what to whom and the cryptographic operations at each step.

How is this different from the diagramming-code skill?

diagramming-code visualizes code structure such as call graphs, class hierarchies, and module dependencies. This skill instead extracts protocol semantics — parties, message exchanges, cryptographic transformations, and protocol phases.

Does it handle both a spec and an implementation at the same time?

Yes. When both exist, the spec workflow (S1–S5) runs first to build the diagram, then the code-reading steps verify the implementation against it and annotate any divergences with a warning marker.

What should I use after generating the diagram if I want formal verification?

Use the mermaid-to-proverif skill after generating the diagram. This skill itself does not perform formal verification.

All Files

11 files
agents/openai.yaml0.1 KB
View
examples/simple-handshake/protocol.py5.7 KB
View
references/ascii-sequence-diagram.md2.3 KB
View
references/spec-parsing-patterns.md11.4 KB
View
assets/trail-of-bits-mark.svg3.0 KB
View
examples/simple-proverif/expected-output.md3.9 KB
View
references/mermaid-sequence-syntax.md7.5 KB
View
SKILL.md18.1 KB
View
examples/simple-handshake/expected-output.md4.8 KB
View
examples/simple-proverif/model.pv1.8 KB
View
references/protocol-patterns.md10.7 KB
View

Install crypto-protocol-diagram

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill

Repository

trailofbits/skills

Related Skills

short-form-video

14

multi-asset-morning-briefing

7,907

content-strategy

2,901

doherty-threshold

2,901