[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHG40SJWW84H6VBWFEPJ3N":3,"skill-same:01M7CHG40SJWW84H6VBWFEPJ3N":78},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M7CHG40SJWW84H6VBWFEPJ3N","mermaid-to-proverif",null,"Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files). Use when generating a ProVerif model, formally verifying a protocol, converting a Mermaid diagram to ProVerif, verifying protocol security properties (secrecy, authentication, forward secrecy), checking for replay attacks, or producing a .pv file from a sequence diagram.","bongkage\u002Ftrailofbits-skills","bongkage","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F101378796?v=4","01M7CH419QTJ16DNJ33P0WCWBE","01M7CH41A9NWK8D2JBRK9F0M2C",1,"CC-BY-SA-4.0","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: mermaid-to-proverif\ndescription: \"Translates Mermaid sequenceDiagrams describing cryptographic protocols into ProVerif formal verification models (.pv files). Use when generating a ProVerif model, formally verifying a protocol, converting a Mermaid diagram to ProVerif, verifying protocol security properties (secrecy, authentication, forward secrecy), checking for replay attacks, or producing a .pv file from a sequence diagram.\"\n---\n\n# Mermaid to ProVerif\n\nReads a Mermaid `sequenceDiagram` describing a cryptographic protocol and\nproduces a ProVerif model (`.pv` file) that can be passed directly to the\nProVerif verifier.\n\n**Tools used:** Read, Write, Grep, Glob.\n\nThe typical input is the output of the `crypto-protocol-diagram` skill — a\nMermaid `sequenceDiagram` annotated with cryptographic operations (`Sign`,\n`Verify`, `DH`, `HKDF`, `Enc`, `Dec`, etc.) and message arrows.\n\n## When to Use\n\n- User asks to formally verify a cryptographic protocol described as a Mermaid sequenceDiagram\n- User wants to generate a ProVerif model (.pv file) from a protocol diagram\n- User wants to prove secrecy, authentication, or forward secrecy properties\n- Input is the output of the `crypto-protocol-diagram` skill\n\n## When NOT to Use\n\n- No Mermaid sequenceDiagram exists yet — use `crypto-protocol-diagram` first to generate one\n- User wants to verify properties of non-cryptographic systems (state machines, access control)\n- User wants to run ProVerif on an existing .pv file — just run `proverif model.pv` directly\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"Reachability queries are just busywork\" | If events aren't reachable, all other query results are meaningless | Always add reachability queries first as a sanity check |\n| \"Public channels are fine for all messages\" | Private channels for internal state prevent false attacks | Use private channels for intra-process state threading |\n| \"I'll skip the forward secrecy test\" | Ephemeral keys demand forward secrecy verification | Add the ForwardSecrecyTest process whenever the diagram shows ephemeral keys |\n| \"Unused declarations are harmless\" | ProVerif may report spurious results from orphan declarations | Clean up all unused types, functions, and events |\n| \"The model compiles, so it's correct\" | A compiling model can have dead receives, type mismatches, or impossible guards that make queries vacuously true | Validate reachability before trusting any security query |\n| \"I don't need to check the example first\" | The example defines the expected output quality bar | Study `examples\u002Fsimple-handshake\u002F` before working on unfamiliar protocols |\n\n---\n\n## Workflow\n\n```\nProVerif Model Progress:\n- [ ] Step 1: Parse participants and channels\n- [ ] Step 2: Inventory cryptographic operations\n- [ ] Step 3: Declare types, functions, and equations\n- [ ] Step 4: Identify and declare events\n- [ ] Step 5: Formulate security queries\n- [ ] Step 6: Write participant processes\n- [ ] Step 7: Write main process and finalize\n- [ ] Step 8: Verify and deliver\n```\n\n### Step 1: Parse Participants and Channels\n\nFrom the Mermaid diagram:\n\n1. Extract every `participant` or `actor` declaration. Each becomes a\n   ProVerif process.\n2. Count message arrows (`->>`, `-->>`, `-x`, `--x`). Each distinct\n   `A ->> B: label` creates a communication step on a channel.\n3. Decide channel model:\n   - **Public channel** for any message sent over the network before a\n     secure channel is established (e.g., ClientHello, ephemeral keys,\n     ciphertext to be decrypted by the peer).\n   - **Private channel** only for internal state threading within a single\n     party process (not for cross-party messages).\n   - Default: declare one shared public channel `c` for all cross-party\n     messages. Add per-flow channels only when two distinct parallel sessions\n     must be independent.\n\n```proverif\nfree c: channel.\n```\n\n### Step 2: Inventory Cryptographic Operations\n\nWalk through every `Note over` annotation and message label. Build a list of\nall distinct operations used. Map each to a ProVerif declaration category:\n\n| Mermaid annotation | ProVerif category |\n|--------------------|-------------------|\n| `keygen() → sk, pk` | New name (`new sk`), public key derived via function |\n| `DH(sk_A, pk_B)` | DH function or `exp` with group |\n| `Sign(sk, msg) → σ` | Signature function |\n| `Verify(pk, msg, σ)` | Equation or destructor |\n| `Enc(key, msg) → ct` | Symmetric or asymmetric encryption function |\n| `Dec(key, ct) → msg` | Destructor (equation) |\n| `HKDF(ikm, info) → k` | PRF\u002FKDF function |\n| `HMAC(key, msg) → tag` | MAC function |\n| `H(msg) → digest` | Hash function |\n| `Commit(v, r) → C` | Commitment function |\n| `Open(C, v, r)` | Commitment equation |\n\nConsult [references\u002Fcrypto-to-proverif-mapping.md](references\u002Fcrypto-to-proverif-mapping.md)\nfor exact ProVerif syntax for each.\n\n### Step 3: Declare Types, Functions, and Equations\n\nBuild the cryptographic preamble in this order:\n\n1. **Types** — declare custom types used to distinguish key material:\n\n```proverif\ntype key.\ntype pkey.   (* public key *)\ntype skey.   (* secret key *)\ntype nonce.\n```\n\n2. **Constants** — for fixed strings used as domain separators or labels:\n\n```proverif\nconst msg1_label: bitstring.\nconst msg2_label: bitstring.\nconst info_session_key: bitstring.\n```\n\n3. **Functions** — constructors and destructors. Destructors use inline `reduc`\n   so that the process aborts on verification or decryption failure:\n\n```proverif\n(* Asymmetric encryption *)\nfun aenc(bitstring, pkey): bitstring.\nfun adec(bitstring, skey): bitstring\n    reduc forall m: bitstring, k: skey;\n        adec(aenc(m, pk(k)), k) = m.\nfun pk(skey): pkey.\n\n(* Symmetric encryption \u002F AEAD *)\nfun aead_enc(bitstring, key): bitstring.\nfun aead_dec(bitstring, key): bitstring\n    reduc forall m: bitstring, k: key;\n        aead_dec(aead_enc(m, k), k) = m.\n\n(* Digital signatures — verify returns the message on success, aborts on failure *)\nfun sign(bitstring, skey): bitstring.\nfun verify(bitstring, bitstring, pkey): bitstring\n    reduc forall m: bitstring, k: skey;\n        verify(sign(m, k), m, pk(k)) = m.\n\n(* KDF — first arg is key (from DH), second is bitstring (info\u002Fcontext) *)\nfun hkdf(key, bitstring): key.\n\n(* MAC *)\nfun mac(bitstring, key): bitstring.\n\n(* Hash *)\nfun hash(bitstring): bitstring.\n\n(* DH *)\nfun dh(skey, pkey): key.\nfun dhpk(skey): pkey.\n\n(* Serialization — ProVerif is strongly typed: pkey cannot appear\n * where bitstring is expected. Use these to build signed payloads. *)\nfun pkey2bs(pkey): bitstring.\nfun concat(bitstring, bitstring): bitstring.\n```\n\n4. **Equations** — algebraic identities on constructors only (not on destructors,\n   which already have their rewrite rules inline):\n\n```proverif\nequation forall sk_a: skey, sk_b: skey;\n    dh(sk_a, dhpk(sk_b)) = dh(sk_b, dhpk(sk_a)).\n```\n\nOnly declare what the diagram actually uses. Do not add functions for\noperations not present.\n\n### Step 4: Identify and Declare Events\n\nEvents mark security-relevant moments in the protocol execution. Extract them\nby identifying:\n\n- **Begin events** (`event beginRole(params)`): triggered immediately before a\n  party sends a message that depends on a long-term identity commitment (e.g.,\n  right before sending a signed message or a MAC'd message).\n- **End events** (`event endRole(params)`): triggered immediately after a party\n  successfully verifies the peer's identity (e.g., after `Verify(...)` or MAC\n  check passes, session key confirmed).\n- **Secrecy markers**: any key or nonce that should remain unknown to the\n  attacker after the handshake.\n\n```proverif\nevent beginI(pkey, pkey).     (* pk_I, pk_R — fired before sending the signed message *)\nevent endI(pkey, pkey, key).  (* pk_I, pk_R, session_key — fired after accepting *)\nevent beginR(pkey, pkey).\nevent endR(pkey, pkey, key).\n```\n\nParameters should uniquely identify the session: the parties' public keys,\nplus the session key or a transcript hash.\n\n### Step 5: Formulate Security Queries\n\nWrite one query per security property. Choose from:\n\n**Reachability (always add first — structural sanity check):**\n\nVerify that the success events are actually reachable. If ProVerif reports any\nof these as `false`, the model has a structural bug (dead receive, type mismatch,\nimpossible guard) and no other query result should be trusted. Once the model\nis validated, comment them out if they slow down the main property checks:\n\n```proverif\n(* Sanity: both endpoints must be reachable — comment out once validated. *)\n(*\nquery pk_i: pkey, pk_r: pkey, k: key; event(endI(pk_i, pk_r, k)).\nquery pk_i: pkey, pk_r: pkey, k: key; event(endR(pk_i, pk_r, k)).\n*)\n```\n\n**Secrecy** (key not derivable by attacker):\n\nDeclare a private free name and encrypt it under the session key. The attacker\nknowing `private_I` is equivalent to breaking the session key:\n\n```proverif\nfree private_I: bitstring [private].\n\n(* In process, after deriving sk_session: *)\nout(c, aead_enc(private_I, sk_session));\n\n(* Query: *)\nquery attacker(private_I).\n```\n\n**Weak authentication** (if B accepted, A ran at some point with matching\nparams — does not prevent replay):\n\n```proverif\nquery pk_i: pkey, pk_r: pkey, k: key;\n    event(endR(pk_i, pk_r, k)) ==> event(beginI(pk_i, pk_r)).\n```\n\n**Injective authentication** (prevents replay — each B-accept corresponds to\na distinct A-run):\n\n```proverif\nquery pk_i: pkey, pk_r: pkey, k: key;\n    inj-event(endR(pk_i, pk_r, k)) ==>\n    inj-event(beginI(pk_i, pk_r)).\n```\n\n**Forward secrecy**: add a `ForwardSecrecyTest` process to the main process\nthat leaks both long-term secret keys to the attacker, then check that a past\nsession key remains secret. Pair it with a `free fs_witness: key [private]`\ndeclaration and `query attacker(fs_witness)`. See\n[references\u002Fsecurity-properties.md](references\u002Fsecurity-properties.md) →\nForward Secrecy, and the worked example in\n`examples\u002Fsimple-handshake\u002Fsample-output.pv`.\n\nChoose the strongest applicable query for each property. See\n[references\u002Fsecurity-properties.md](references\u002Fsecurity-properties.md) for\nthe full decision tree.\n\n### Step 6: Write Participant Processes\n\nWrite one `let` process per participant. Structure each process to mirror the\nMermaid diagram step-by-step, in order.\n\n**Template for a two-party protocol:**\n\n```proverif\nlet Initiator(sk_I: skey, pk_R: pkey) =\n    (* Step: generate ephemeral key *)\n    new ek_I: skey;\n    let epk_I = dhpk(ek_I) in\n    (* Step: sign and send msg1 — pkey2bs casts pkey to bitstring *)\n    let sig_I = sign(concat(msg1_label, pkey2bs(epk_I)), sk_I) in\n    event beginI(pk(sk_I), pk_R);\n    out(c, (epk_I, sig_I));\n    (* Step: receive msg2 *)\n    in(c, (epk_R: pkey, sig_R: bitstring));\n    (* Step: verify responder signature — destructor aborts on failure *)\n    let transcript = concat(pkey2bs(epk_I), pkey2bs(epk_R)) in\n    let _ = verify(sig_R, concat(msg2_label, transcript), pk_R) in\n    (* Step: derive session key *)\n    let dh_val = dh(ek_I, epk_R) in\n    let sk_session = hkdf(dh_val, concat(info_session_key, transcript)) in\n    event endI(pk(sk_I), pk_R, sk_session);\n    (* Secrecy witness: encrypt private_I under the session key.\n     * Declared as: free private_I: bitstring [private].\n     * The query attacker(private_I) checks the attacker cannot derive it. *)\n    out(c, aead_enc(private_I, sk_session)).\n```\n\n**Rules for writing processes:**\n\n- Each `A ->> B: msg_contents` in the diagram becomes:\n  - `out(c, msg_contents)` in A's process\n  - `in(c, x)` (with matching destructuring) in B's process\n- Each `Note over A: op → result` becomes a `let result = op in` binding\n- Each `Note over A: Verify(...)` becomes a `let _ = verify(...) in`\n  binding (the destructor aborts on failure — no explicit else needed,\n  modeling abort)\n- Use `alt` blocks in the diagram as `if\u002Fthen\u002Felse` in the process\n- Long-term keys are process parameters; ephemeral values use `new`\n\n**N-party or MPC protocols:** write one process per distinct role. For\nthreshold protocols, write a single role process and replicate it `!N` times\nin the main process.\n\n### Step 7: Write Main Process and Finalize\n\nThe main process:\n\n1. Generates long-term keys with `new`\n2. Publishes public keys to the attacker via `out(c, pk(sk))`\n3. Runs participant processes in parallel under replication (`!`) to allow\n   multiple sessions\n4. Optionally leaks long-term keys for forward-secrecy analysis\n\n```proverif\nprocess\n    new sk_I: skey; let pk_I = pk(sk_I) in out(c, pk_I);\n    new sk_R: skey; let pk_R = pk(sk_R) in out(c, pk_R);\n    (\n        !Initiator(sk_I, pk_R)\n      | !Responder(sk_R, pk_I)\n    )\n```\n\nPlace the full file in this order:\n\n```\n(* 1. Channel declarations (free c: channel. \u002F free ch: channel [private].) *)\n(* 2. noselect directives (if needed for termination) *)\n(* 3. Type declarations *)\n(* 4. Constants *)\n(* 5. Function declarations *)\n(* 6. Equations (algebraic identities on constructors only) *)\n(* 7. Table declarations *)\n(* 8. Events *)\n(* 9. Queries *)\n(* 10. Let processes *)\n(* 11. Main process *)\n```\n\n### Step 8: Verify and Deliver\n\nBefore writing the file:\n\n- [ ] Every participant in the diagram has a matching `let` process\n- [ ] Every `out(c, ...)` has a matching `in(c, ...)` on the other side with\n      compatible types\n- [ ] Every function used in a process is declared in the preamble\n- [ ] Every destructor uses inline `reduc` (not a separate `equation` block)\n- [ ] Every event in a query is declared and triggered in a process\n- [ ] Long-term public keys are output to channel `c` in the main process\n      (attacker can see them — that is the Dolev-Yao model)\n- [ ] No unused declarations (clean up anything added speculatively)\n- [ ] If `table` declarations are present: every `insert T(...)` has a\n      corresponding `get T(...)` with compatible column types and matching\n      pattern constraints (`=key` vs bare name)\n- [ ] If `noselect` is used: its tuple structure matches the actual message\n      shapes sent on `c` (e.g., pairs → `mess(c, (x, y))`)\n- [ ] If the Key Exposure Oracle pattern is used: `event key_exposed(sk_type)`\n      is declared, the oracle `in(c, guess: sk_type); if pk(guess) = pk_new then\n      event key_exposed(guess)` appears at the end of the process that holds the\n      secret, and the query is `query x: sk_type; event(key_exposed(x))`\n\n**Write the model to a `.pv` file.** Choose a filename from the protocol name,\ne.g. `noise-xx-handshake.pv` or `x3dh-key-agreement.pv`.\n\nAfter writing, print a brief summary:\n\n```\nProtocol:   \u003CName>\nOutput:     \u003Cfilename>\nQueries:    \u003Clist each query and what property it tests>\nAssumptions: \u003Clist modeling decisions and simplifications>\n```\n\n---\n\n## Decision Tree\n\n```\n├─ No Mermaid diagram provided?\n│  └─ Ask the user: \"Please provide the Mermaid sequenceDiagram,\n│     or run the crypto-protocol-diagram skill first.\"\n│\n├─ Diagram uses DH (not just symmetric crypto)?\n│  └─ Use dh\u002Fdhpk with commutativity equation\n│     See references\u002Fcrypto-to-proverif-mapping.md → DH section\n│\n├─ Diagram uses asymmetric signatures (Sign\u002FVerify)?\n│  └─ Use sign\u002Fverify with inline reduc (not equation)\n│     verify returns the message on success; let _ = verify(...) in to abort on failure\n│     Distinguish signing key (skey) from verification key (pkey)\n│\n├─ Diagram has an \"alt\" block (abort path)?\n│  └─ Model as if\u002Fthen only — the else branch aborts (process terminates)\n│     Do NOT add out(c, error_message) unless the diagram shows it\n│\n├─ Protocol has N > 2 parties?\n│  └─ Write one process per role, use ! for replication\n│     Pass participant index as a parameter if roles differ by index only\n│\n├─ Forward secrecy requested?\n│  └─ Add a ForwardSecrecy variant in the main process that leaks\n│     long-term sk after session; add secrecy query for past session_key\n│     See references\u002Fsecurity-properties.md → Forward Secrecy\n│\n├─ Type-checker rejects the model?\n│  └─ ProVerif is typed: check every function arg type matches declaration.\n│     bitstring is the catch-all; key\u002Fpkey\u002Fskey\u002Fnonce are stricter.\n│     Cast with explicit constructors when needed.\n│\n├─ Protocol has cross-process state coordination (e.g., one process must wait\n│  for another to record acceptance before proceeding)?\n│  └─ Use ProVerif tables (table\u002Finsert\u002Fget)\n│     See references\u002Fproverif-syntax.md → Tables\n│\n├─ Verification does not terminate after several minutes?\n│  └─ Add noselect directive matching the message tuple structure on c\n│     See references\u002Fproverif-syntax.md → noselect\n│\n├─ Protocol generates a private-type key (type sk [private]) that is never\n│  output directly but whose secrecy should be verified?\n│  └─ Use the Key Exposure Oracle pattern instead of query attacker(sk)\n│     See references\u002Fsecurity-properties.md → Key Exposure Oracle\n│\n└─ Unsure which security properties to verify?\n   └─ Default set: secrecy of session key + injective authentication\n      (both directions). Add forward secrecy if diagram shows ephemeral keys.\n```\n\n---\n\n## Example\n\n`examples\u002Fsimple-handshake\u002F` contains a worked example:\n\n- **`diagram.md`** — Mermaid sequenceDiagram for a two-party authenticated key\n  exchange (X25519 DH + Ed25519 signing + HKDF)\n- **`sample-output.pv`** — exact ProVerif model the skill should produce,\n  with secrecy and injective authentication queries\n\nStudy this before working on an unfamiliar protocol.\n\n---\n\n## Supporting Documentation\n\n- **[references\u002Fcrypto-to-proverif-mapping.md](references\u002Fcrypto-to-proverif-mapping.md)** —\n  Mapping table from Mermaid cryptographic annotations to ProVerif function\n  declarations, equations, and process patterns\n- **[references\u002Fproverif-syntax.md](references\u002Fproverif-syntax.md)** —\n  ProVerif language reference: types, functions, equations, processes, events,\n  queries, and common pitfalls\n- **[references\u002Fsecurity-properties.md](references\u002Fsecurity-properties.md)** —\n  Decision guide for choosing the right queries: secrecy, authentication\n  (weak vs injective), forward secrecy, unlinkability, and how to model them\n","# Mermaid to ProVerif\n\nReads a Mermaid `sequenceDiagram` describing a cryptographic protocol and\nproduces a ProVerif model (`.pv` file) that can be passed directly to the\nProVerif verifier.\n\n**Tools used:** Read, Write, Grep, Glob.\n\nThe typical input is the output of the `crypto-protocol-diagram` skill — a\nMermaid `sequenceDiagram` annotated with cryptographic operations (`Sign`,\n`Verify`, `DH`, `HKDF`, `Enc`, `Dec`, etc.) and message arrows.\n\n## When to Use\n\n- User asks to formally verify a cryptographic protocol described as a Mermaid sequenceDiagram\n- User wants to generate a ProVerif model (.pv file) from a protocol diagram\n- User wants to prove secrecy, authentication, or forward secrecy properties\n- Input is the output of the `crypto-protocol-diagram` skill\n\n## When NOT to Use\n\n- No Mermaid sequenceDiagram exists yet — use `crypto-protocol-diagram` first to generate one\n- User wants to verify properties of non-cryptographic systems (state machines, access control)\n- User wants to run ProVerif on an existing .pv file — just run `proverif model.pv` directly\n\n## Rationalizations to Reject\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"Reachability queries are just busywork\" | If events aren't reachable, all other query results are meaningless | Always add reachability queries first as a sanity check |\n| \"Public channels are fine for all messages\" | Private channels for internal state prevent false attacks | Use private channels for intra-process state threading |\n| \"I'll skip the forward secrecy test\" | Ephemeral keys demand forward secrecy verification | Add the ForwardSecrecyTest process whenever the diagram shows ephemeral keys |\n| \"Unused declarations are harmless\" | ProVerif may report spurious results from orphan declarations | Clean up all unused types, functions, and events |\n| \"The model compiles, so it's correct\" | A compiling model can have dead receives, type mismatches, or impossible guards that make queries vacuously true | Validate reachability before trusting any security query |\n| \"I don't need to check the example first\" | The example defines the expected output quality bar | Study `examples\u002Fsimple-handshake\u002F` before working on unfamiliar protocols |\n\n---\n\n## Workflow\n\n```\nProVerif Model Progress:\n- [ ] Step 1: Parse participants and channels\n- [ ] Step 2: Inventory cryptographic operations\n- [ ] Step 3: Declare types, functions, and equations\n- [ ] Step 4: Identify and declare events\n- [ ] Step 5: Formulate security queries\n- [ ] Step 6: Write participant processes\n- [ ] Step 7: Write main process and finalize\n- [ ] Step 8: Verify and deliver\n```\n\n### Step 1: Parse Participants and Channels\n\nFrom the Mermaid diagram:\n\n1. Extract every `participant` or `actor` declaration. Each becomes a\n   ProVerif process.\n2. Count message arrows (`->>`, `-->>`, `-x`, `--x`). Each distinct\n   `A ->> B: label` creates a communication step on a channel.\n3. Decide channel model:\n   - **Public channel** for any message sent over the network before a\n     secure channel is established (e.g., ClientHello, ephemeral keys,\n     ciphertext to be decrypted by the peer).\n   - **Private channel** only for internal state threading within a single\n     party process (not for cross-party messages).\n   - Default: declare one shared public channel `c` for all cross-party\n     messages. Add per-flow channels only when two distinct parallel sessions\n     must be independent.\n\n```proverif\nfree c: channel.\n```\n\n### Step 2: Inventory Cryptographic Operations\n\nWalk through every `Note over` annotation and message label. Build a list of\nall distinct operations used. Map each to a ProVerif declaration category:\n\n| Mermaid annotation | ProVerif category |\n|--------------------|-------------------|\n| `keygen() → sk, pk` | New name (`new sk`), public key derived via function |\n| `DH(sk_A, pk_B)` | DH function or `exp` with group |\n| `Sign(sk, msg) → σ` | Signature function |\n| `Verify(pk, msg, σ)` | Equation or destructor |\n| `Enc(key, msg) → ct` | Symmetric or asymmetric encryption function |\n| `Dec(key, ct) → msg` | Destructor (equation) |\n| `HKDF(ikm, info) → k` | PRF\u002FKDF function |\n| `HMAC(key, msg) → tag` | MAC function |\n| `H(msg) → digest` | Hash function |\n| `Commit(v, r) → C` | Commitment function |\n| `Open(C, v, r)` | Commitment equation |\n\nConsult [references\u002Fcrypto-to-proverif-mapping.md](references\u002Fcrypto-to-proverif-mapping.md)\nfor exact ProVerif syntax for each.\n\n### Step 3: Declare Types, Functions, and Equations\n\nBuild the cryptographic preamble in this order:\n\n1. **Types** — declare custom types used to distinguish key material:\n\n```proverif\ntype key.\ntype pkey.   (* public key *)\ntype skey.   (* secret key *)\ntype nonce.\n```\n\n2. **Constants** — for fixed strings used as domain separators or labels:\n\n```proverif\nconst msg1_label: bitstring.\nconst msg2_label: bitstring.\nconst info_session_key: bitstring.\n```\n\n3. **Functions** — constructors and destructors. Destructors use inline `reduc`\n   so that the process aborts on verification or decryption failure:\n\n```proverif\n(* Asymmetric encryption *)\nfun aenc(bitstring, pkey): bitstring.\nfun adec(bitstring, skey): bitstring\n    reduc forall m: bitstring, k: skey;\n        adec(aenc(m, pk(k)), k) = m.\nfun pk(skey): pkey.\n\n(* Symmetric encryption \u002F AEAD *)\nfun aead_enc(bitstring, key): bitstring.\nfun aead_dec(bitstring, key): bitstring\n    reduc forall m: bitstring, k: key;\n        aead_dec(aead_enc(m, k), k) = m.\n\n(* Digital signatures — verify returns the message on success, aborts on failure *)\nfun sign(bitstring, skey): bitstring.\nfun verify(bitstring, bitstring, pkey): bitstring\n    reduc forall m: bitstring, k: skey;\n        verify(sign(m, k), m, pk(k)) = m.\n\n(* KDF — first arg is key (from DH), second is bitstring (info\u002Fcontext) *)\nfun hkdf(key, bitstring): key.\n\n(* MAC *)\nfun mac(bitstring, key): bitstring.\n\n(* Hash *)\nfun hash(bitstring): bitstring.\n\n(* DH *)\nfun dh(skey, pkey): key.\nfun dhpk(skey): pkey.\n\n(* Serialization — ProVerif is strongly typed: pkey cannot appear\n * where bitstring is expected. Use these to build signed payloads. *)\nfun pkey2bs(pkey): bitstring.\nfun concat(bitstring, bitstring): bitstring.\n```\n\n4. **Equations** — algebraic identities on constructors only (not on destructors,\n   which already have their rewrite rules inline):\n\n```proverif\nequation forall sk_a: skey, sk_b: skey;\n    dh(sk_a, dhpk(sk_b)) = dh(sk_b, dhpk(sk_a)).\n```\n\nOnly declare what the diagram actually uses. Do not add functions for\noperations not present.\n\n### Step 4: Identify and Declare Events\n\nEvents mark security-relevant moments in the protocol execution. Extract them\nby identifying:\n\n- **Begin events** (`event beginRole(params)`): triggered immediately before a\n  party sends a message that depends on a long-term identity commitment (e.g.,\n  right before sending a signed message or a MAC'd message).\n- **End events** (`event endRole(params)`): triggered immediately after a party\n  successfully verifies the peer's identity (e.g., after `Verify(...)` or MAC\n  check passes, session key confirmed).\n- **Secrecy markers**: any key or nonce that should remain unknown to the\n  attacker after the handshake.\n\n```proverif\nevent beginI(pkey, pkey).     (* pk_I, pk_R — fired before sending the signed message *)\nevent endI(pkey, pkey, key).  (* pk_I, pk_R, session_key — fired after accepting *)\nevent beginR(pkey, pkey).\nevent endR(pkey, pkey, key).\n```\n\nParameters should uniquely identify the session: the parties' public keys,\nplus the session key or a transcript hash.\n\n### Step 5: Formulate Security Queries\n\nWrite one query per security property. Choose from:\n\n**Reachability (always add first — structural sanity check):**\n\nVerify that the success events are actually reachable. If ProVerif reports any\nof these as `false`, the model has a structural bug (dead receive, type mismatch,\nimpossible guard) and no other query result should be trusted. Once the model\nis validated, comment them out if they slow down the main property checks:\n\n```proverif\n(* Sanity: both endpoints must be reachable — comment out once validated. *)\n(*\nquery pk_i: pkey, pk_r: pkey, k: key; event(endI(pk_i, pk_r, k)).\nquery pk_i: pkey, pk_r: pkey, k: key; event(endR(pk_i, pk_r, k)).\n*)\n```\n\n**Secrecy** (key not derivable by attacker):\n\nDeclare a private free name and encrypt it under the session key. The attacker\nknowing `private_I` is equivalent to breaking the session key:\n\n```proverif\nfree private_I: bitstring [private].\n\n(* In process, after deriving sk_session: *)\nout(c, aead_enc(private_I, sk_session));\n\n(* Query: *)\nquery attacker(private_I).\n```\n\n**Weak authentication** (if B accepted, A ran at some point with matching\nparams — does not prevent replay):\n\n```proverif\nquery pk_i: pkey, pk_r: pkey, k: key;\n    event(endR(pk_i, pk_r, k)) ==> event(beginI(pk_i, pk_r)).\n```\n\n**Injective authentication** (prevents replay — each B-accept corresponds to\na distinct A-run):\n\n```proverif\nquery pk_i: pkey, pk_r: pkey, k: key;\n    inj-event(endR(pk_i, pk_r, k)) ==>\n    inj-event(beginI(pk_i, pk_r)).\n```\n\n**Forward secrecy**: add a `ForwardSecrecyTest` process to the main process\nthat leaks both long-term secret keys to the attacker, then check that a past\nsession key remains secret. Pair it with a `free fs_witness: key [private]`\ndeclaration and `query attacker(fs_witness)`. See\n[references\u002Fsecurity-properties.md](references\u002Fsecurity-properties.md) →\nForward Secrecy, and the worked example in\n`examples\u002Fsimple-handshake\u002Fsample-output.pv`.\n\nChoose the strongest applicable query for each property. See\n[references\u002Fsecurity-properties.md](references\u002Fsecurity-properties.md) for\nthe full decision tree.\n\n### Step 6: Write Participant Processes\n\nWrite one `let` process per participant. Structure each process to mirror the\nMermaid diagram step-by-step, in order.\n\n**Template for a two-party protocol:**\n\n```proverif\nlet Initiator(sk_I: skey, pk_R: pkey) =\n    (* Step: generate ephemeral key *)\n    new ek_I: skey;\n    let epk_I = dhpk(ek_I) in\n    (* Step: sign and send msg1 — pkey2bs casts pkey to bitstring *)\n    let sig_I = sign(concat(msg1_label, pkey2bs(epk_I)), sk_I) in\n    event beginI(pk(sk_I), pk_R);\n    out(c, (epk_I, sig_I));\n    (* Step: receive msg2 *)\n    in(c, (epk_R: pkey, sig_R: bitstring));\n    (* Step: verify responder signature — destructor aborts on failure *)\n    let transcript = concat(pkey2bs(epk_I), pkey2bs(epk_R)) in\n    let _ = verify(sig_R, concat(msg2_label, transcript), pk_R) in\n    (* Step: derive session key *)\n    let dh_val = dh(ek_I, epk_R) in\n    let sk_session = hkdf(dh_val, concat(info_session_key, transcript)) in\n    event endI(pk(sk_I), pk_R, sk_session);\n    (* Secrecy witness: encrypt private_I under the session key.\n     * Declared as: free private_I: bitstring [private].\n     * The query attacker(private_I) checks the attacker cannot derive it. *)\n    out(c, aead_enc(private_I, sk_session)).\n```\n\n**Rules for writing processes:**\n\n- Each `A ->> B: msg_contents` in the diagram becomes:\n  - `out(c, msg_contents)` in A's process\n  - `in(c, x)` (with matching destructuring) in B's process\n- Each `Note over A: op → result` becomes a `let result = op in` binding\n- Each `Note over A: Verify(...)` becomes a `let _ = verify(...) in`\n  binding (the destructor aborts on failure — no explicit else needed,\n  modeling abort)\n- Use `alt` blocks in the diagram as `if\u002Fthen\u002Felse` in the process\n- Long-term keys are process parameters; ephemeral values use `new`\n\n**N-party or MPC protocols:** write one process per distinct role. For\nthreshold protocols, write a single role process and replicate it `!N` times\nin the main process.\n\n### Step 7: Write Main Process and Finalize\n\nThe main process:\n\n1. Generates long-term keys with `new`\n2. Publishes public keys to the attacker via `out(c, pk(sk))`\n3. Runs participant processes in parallel under replication (`!`) to allow\n   multiple sessions\n4. Optionally leaks long-term keys for forward-secrecy analysis\n\n```proverif\nprocess\n    new sk_I: skey; let pk_I = pk(sk_I) in out(c, pk_I);\n    new sk_R: skey; let pk_R = pk(sk_R) in out(c, pk_R);\n    (\n        !Initiator(sk_I, pk_R)\n      | !Responder(sk_R, pk_I)\n    )\n```\n\nPlace the full file in this order:\n\n```\n(* 1. Channel declarations (free c: channel. \u002F free ch: channel [private].) *)\n(* 2. noselect directives (if needed for termination) *)\n(* 3. Type declarations *)\n(* 4. Constants *)\n(* 5. Function declarations *)\n(* 6. Equations (algebraic identities on constructors only) *)\n(* 7. Table declarations *)\n(* 8. Events *)\n(* 9. Queries *)\n(* 10. Let processes *)\n(* 11. Main process *)\n```\n\n### Step 8: Verify and Deliver\n\nBefore writing the file:\n\n- [ ] Every participant in the diagram has a matching `let` process\n- [ ] Every `out(c, ...)` has a matching `in(c, ...)` on the other side with\n      compatible types\n- [ ] Every function used in a process is declared in the preamble\n- [ ] Every destructor uses inline `reduc` (not a separate `equation` block)\n- [ ] Every event in a query is declared and triggered in a process\n- [ ] Long-term public keys are output to channel `c` in the main process\n      (attacker can see them — that is the Dolev-Yao model)\n- [ ] No unused declarations (clean up anything added speculatively)\n- [ ] If `table` declarations are present: every `insert T(...)` has a\n      corresponding `get T(...)` with compatible column types and matching\n      pattern constraints (`=key` vs bare name)\n- [ ] If `noselect` is used: its tuple structure matches the actual message\n      shapes sent on `c` (e.g., pairs → `mess(c, (x, y))`)\n- [ ] If the Key Exposure Oracle pattern is used: `event key_exposed(sk_type)`\n      is declared, the oracle `in(c, guess: sk_type); if pk(guess) = pk_new then\n      event key_exposed(guess)` appears at the end of the process that holds the\n      secret, and the query is `query x: sk_type; event(key_exposed(x))`\n\n**Write the model to a `.pv` file.** Choose a filename from the protocol name,\ne.g. `noise-xx-handshake.pv` or `x3dh-key-agreement.pv`.\n\nAfter writing, print a brief summary:\n\n```\nProtocol:   \u003CName>\nOutput:     \u003Cfilename>\nQueries:    \u003Clist each query and what property it tests>\nAssumptions: \u003Clist modeling decisions and simplifications>\n```\n\n---\n\n## Decision Tree\n\n```\n├─ No Mermaid diagram provided?\n│  └─ Ask the user: \"Please provide the Mermaid sequenceDiagram,\n│     or run the crypto-protocol-diagram skill first.\"\n│\n├─ Diagram uses DH (not just symmetric crypto)?\n│  └─ Use dh\u002Fdhpk with commutativity equation\n│     See references\u002Fcrypto-to-proverif-mapping.md → DH section\n│\n├─ Diagram uses asymmetric signatures (Sign\u002FVerify)?\n│  └─ Use sign\u002Fverify with inline reduc (not equation)\n│     verify returns the message on success; let _ = verify(...) in to abort on failure\n│     Distinguish signing key (skey) from verification key (pkey)\n│\n├─ Diagram has an \"alt\" block (abort path)?\n│  └─ Model as if\u002Fthen only — the else branch aborts (process terminates)\n│     Do NOT add out(c, error_message) unless the diagram shows it\n│\n├─ Protocol has N > 2 parties?\n│  └─ Write one process per role, use ! for replication\n│     Pass participant index as a parameter if roles differ by index only\n│\n├─ Forward secrecy requested?\n│  └─ Add a ForwardSecrecy variant in the main process that leaks\n│     long-term sk after session; add secrecy query for past session_key\n│     See references\u002Fsecurity-properties.md → Forward Secrecy\n│\n├─ Type-checker rejects the model?\n│  └─ ProVerif is typed: check every function arg type matches declaration.\n│     bitstring is the catch-all; key\u002Fpkey\u002Fskey\u002Fnonce are stricter.\n│     Cast with explicit constructors when needed.\n│\n├─ Protocol has cross-process state coordination (e.g., one process must wait\n│  for another to record acceptance before proceeding)?\n│  └─ Use ProVerif tables (table\u002Finsert\u002Fget)\n│     See references\u002Fproverif-syntax.md → Tables\n│\n├─ Verification does not terminate after several minutes?\n│  └─ Add noselect directive matching the message tuple structure on c\n│     See references\u002Fproverif-syntax.md → noselect\n│\n├─ Protocol generates a private-type key (type sk [private]) that is never\n│  output directly but whose secrecy should be verified?\n│  └─ Use the Key Exposure Oracle pattern instead of query attacker(sk)\n│     See references\u002Fsecurity-properties.md → Key Exposure Oracle\n│\n└─ Unsure which security properties to verify?\n   └─ Default set: secrecy of session key + injective authentication\n      (both directions). Add forward secrecy if diagram shows ephemeral keys.\n```\n\n---\n\n## Example\n\n`examples\u002Fsimple-handshake\u002F` contains a worked example:\n\n- **`diagram.md`** — Mermaid sequenceDiagram for a two-party authenticated key\n  exchange (X25519 DH + Ed25519 signing + HKDF)\n- **`sample-output.pv`** — exact ProVerif model the skill should produce,\n  with secrecy and injective authentication queries\n\nStudy this before working on an unfamiliar protocol.\n\n---\n\n## Supporting Documentation\n\n- **[references\u002Fcrypto-to-proverif-mapping.md](references\u002Fcrypto-to-proverif-mapping.md)** —\n  Mapping table from Mermaid cryptographic annotations to ProVerif function\n  declarations, equations, and process patterns\n- **[references\u002Fproverif-syntax.md](references\u002Fproverif-syntax.md)** —\n  ProVerif language reference: types, functions, equations, processes, events,\n  queries, and common pitfalls\n- **[references\u002Fsecurity-properties.md](references\u002Fsecurity-properties.md)** —\n  Decision guide for choosing the right queries: secrecy, authentication\n  (weak vs injective), forward secrecy, unlinkability, and how to model them\n",{"name":5,"description":7},"main","321ccfe628eca0d314b0ee4eaffcdd8a05639aaf","plugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif",0,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills","https:\u002F\u002Fgithub.com\u002Fbongkage","2026-11-06 12:15:06",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add bongkage\u002Ftrailofbits-skills --skill mermaid-to-proverif",{"tool":36,"command":37},"bunx","bunx skills add bongkage\u002Ftrailofbits-skills --skill mermaid-to-proverif",{"tool":39,"command":40},"pnpm","pnpm dlx skills add bongkage\u002Ftrailofbits-skills --skill mermaid-to-proverif","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002FSKILL.md",true,[44,50,56,60,66,70,74],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"agents\u002Fopenai.yaml","REFERENCE","参考文档",128,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Fagents\u002Fopenai.yaml",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"assets\u002Ftrail-of-bits-mark.svg","ASSET","资产文件",3084,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Fassets\u002Ftrail-of-bits-mark.svg",{"path":57,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fsimple-handshake\u002Fdiagram.md",1835,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Fexamples\u002Fsimple-handshake\u002Fdiagram.md",{"path":61,"resourceType":62,"resourceTypeDesc":63,"sizeBytes":64,"sourceHtmlUrl":65},"examples\u002Fsimple-handshake\u002Fsample-output.pv","OTHER","其他",9546,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Fexamples\u002Fsimple-handshake\u002Fsample-output.pv",{"path":67,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Fcrypto-to-proverif-mapping.md",10317,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Freferences\u002Fcrypto-to-proverif-mapping.md",{"path":71,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":72,"sourceHtmlUrl":73},"references\u002Fproverif-syntax.md",14109,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Freferences\u002Fproverif-syntax.md",{"path":75,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":76,"sourceHtmlUrl":77},"references\u002Fsecurity-properties.md",11836,"https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fmermaid-to-proverif\u002Freferences\u002Fsecurity-properties.md",[79,86,93,100,107,114],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":18},"01M7CHJAESZRWKJXFQG55BMNAA","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fzeroize-audit\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":18},"01M7CHJ543G42A9GQC3PJE4F4V","yara-rule-authoring","Guides authoring of high-quality YARA-X detection rules for malware identification. Use when writing, reviewing, or optimizing YARA rules. Covers naming conventions, string selection, performance optimization, migration from legacy YARA, and false positive reduction. Triggers on: YARA, YARA-X, malware detection, threat hunting, IOC, signature, crx module, dex module.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fyara-authoring\u002Fskills\u002Fyara-rule-authoring\u002FSKILL.md",[],[],{"skillNo":94,"name":95,"nameZh":6,"description":96,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":99,"publishedAt":18},"01M7CHHYVFS1AKDTH3YDS1Y4K4","writing-lean-proofs","Writes and reviews structured Lean 4 proofs and designs Lean libraries following Mathlib conventions. Use when proving theorems in Lean, formalizing mathematics or specifications in Lean 4, defining new types or definitions in a Lean library, reviewing Lean proofs for readability and maintainability, refactoring long tactic proofs into lemmas, filling in sorry placeholders in a Lean development, setting up CI or linters for a Lean project, diagnosing slow proofs or maxHeartbeats timeouts, or writing custom tactics, macros, or linters.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fwriting-lean-proofs\u002Fskills\u002Fwriting-lean-proofs\u002FSKILL.md",[],[],{"skillNo":101,"name":102,"nameZh":6,"description":103,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":18},"01M7CHHQXA39M4965MV2RMM5YS","vulnerability-triage-brocards","This skill should be used when the user asks to \"triage a vulnerability report\", \"assess a CVE\", \"evaluate a bug bounty submission\", \"decide if a finding is valid\", \"review a security finding\", \"dismiss a vulnerability\", \"should we fix this CVE\", \"prioritize a vulnerability report\", or needs to determine whether an incoming vulnerability report warrants investigation. Applies 7 brocards (rules of thumb) to systematically accept, dismiss, or request more information on vulnerability reports, or needs to filter raw findings from agentic vulnerability discovery pipelines before human review.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvulnerability-triage-brocards\u002Fskills\u002Fvulnerability-triage-brocards\u002FSKILL.md",[],[],{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":111,"categories":112,"keywords":113,"publishedAt":18},"01M7CHHJVQC2ZG2M310GXT0T42","variant-analysis","Hunts for the other instances of a bug already found — the variants of one root cause across a codebase. Use immediately after a vulnerability, logic bug, or bad pattern turns up in a specific file and the question becomes where else it occurs, including the bare conversational form (\"are there others like this?\", \"is this the same bug?\"). Also for generalizing one known instance into a CodeQL or Semgrep query for its whole pattern family, and for triaging a set of look-alike candidates against a known root cause. Not for initial discovery with no bug in hand.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fvariant-analysis\u002Fskills\u002Fvariant-analysis\u002FSKILL.md",[],[],{"skillNo":115,"name":116,"nameZh":6,"description":117,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":118,"categories":119,"keywords":120,"publishedAt":18},"01M7CHHC1GM5GH585ZWGP7D03P","vector-forge","Mutation-driven test vector generation. Finds implementations of a cryptographic algorithm or protocol, runs mutation testing to identify escaped mutants, then generates new test vectors that deliberately exercise the uncovered code paths. Compares before\u002Fafter mutation kill rates to prove vector effectiveness. Use when generating cryptographic test vectors, measuring Wycheproof coverage gaps, finding escaped mutants via mutation testing, creating cross-implementation test suites, or improving test vector coverage for crypto primitives.","https:\u002F\u002Fgithub.com\u002Fbongkage\u002Ftrailofbits-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftrailmark\u002Fskills\u002Fvector-forge\u002FSKILL.md",[],[]]