TsukiNi22/ai-utils / skills/docs/protocol-doc
protocol-doc
VerifiedDocument a network / application protocol in Tsukini's way (from the 2ETP protocol doc of his myteams project) - name + version + acronym, what it provides, the framing of a transmission (control bytes ENQ / ETB / EOT...), the payload types table (byte, hex, link), one section per message type (grammar + field bullets), the code tables (errors, events, commands, with the data sent), a summary of every frame, the handshake / key exchange step by step with the exact frames and a sequence diagram, the commands of the client and of the server (purpose, answer, usage), the storage format (separators, layout, parsed type) - always asking first the output (Markdown, PDF, HTML section inside the existing docs/ site). Use whenever the user wants to document, specify, describe or review a protocol, a wire format, a message format, a handshake, the commands of a client / server, or the files format of a networking project.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 10.5 KB |
| requires.txt | markdown | 40 B |
| scripts/check_protocol.pyexecutable | script | 11.5 KB |
| templates/PROTOCOL.md | markdown | 5.3 KB |
| templates/protocol.html | other | 12.1 KB |
templates/protocol.html
View on GitHub<!--
Protocol sections for the technical page of html-doc (docs/technical.html, or index.html without a guide).
Paste them after the last <section> (renumber N, N+1...), add their links to <aside class="sidebar">, keep both
languages. Placeholders: {{NAME}}, {{VERSION}}, {{ACRONYM_EN}} / {{ACRONYM_FR}}. Arrows: data-from / data-to only.
A bracket of a frame is written <tag> (a raw <tag> is swallowed by the browser). In a drawing a text per language is one
<text data-lang="...">, never a <span> (the browser leaves the drawing there: all that follows falls out of it).
-->
<!-- N -->
<section id="protocol">
<h2><span data-lang="en">N. {{NAME}} protocol (v{{VERSION}})</span><span data-lang="fr">N. Protocole {{NAME}} (v{{VERSION}})</span></h2>
<p><span data-lang="en">{{ACRONYM_EN}}: an application-layer protocol for typed messages over a reliable transport.</span><span data-lang="fr">{{ACRONYM_FR}} : un protocole applicatif de messages typés sur un transport fiable.</span></p>
<h3 id="protocol-payload"><span data-lang="en">N.1 Payload</span><span data-lang="fr">N.1 Trame</span></h3>
<pre data-title="Transmission"><code>ENQ <tag> ETB <payload> EOT</code></pre>
<div class="table-wrap"><table>
<thead><tr><th scope="col"><span data-lang="en">Element</span><span data-lang="fr">Élément</span></th><th scope="col"><span data-lang="en">Byte</span><span data-lang="fr">Octet</span></th><th scope="col"><span data-lang="en">Role</span><span data-lang="fr">Rôle</span></th></tr></thead>
<tbody>
<tr><td><code>ENQ</code></td><td><code>0x05</code></td><td><span data-lang="en">Start of transmission</span><span data-lang="fr">Début de transmission</span></td></tr>
<tr><td><code>ETB</code></td><td><code>0x17</code></td><td><span data-lang="en">Separator</span><span data-lang="fr">Séparateur</span></td></tr>
<tr><td><code>EOT</code></td><td><code>0x04</code></td><td><span data-lang="en">End of transmission</span><span data-lang="fr">Fin de transmission</span></td></tr>
<tr><td><code><tag></code></td><td>—</td><td><span data-lang="en">Integrity tag (Base64)</span><span data-lang="fr">Tag d'intégrité (Base64)</span></td></tr>
<tr><td><code><payload></code></td><td>—</td><td><span data-lang="en">Message content (Base64)</span><span data-lang="fr">Contenu du message (Base64)</span></td></tr>
</tbody>
</table></div>
<h3 id="protocol-types"><span data-lang="en">N.2 Payload types</span><span data-lang="fr">N.2 Types de message</span></h3>
<div class="table-wrap"><table>
<thead><tr><th scope="col"><span data-lang="en">Byte</span><span data-lang="fr">Octet</span></th><th scope="col">Type</th><th scope="col"><span data-lang="en">Grammar</span><span data-lang="fr">Grammaire</span></th></tr></thead>
<tbody>
<tr><td><code>SYN</code> (<code>0x16</code>)</td><td><span data-lang="en">Connection</span><span data-lang="fr">Connexion</span></td><td><code>SYN</code></td></tr>
<tr><td><code>NAK</code> (<code>0x15</code>)</td><td><span data-lang="en">Error</span><span data-lang="fr">Erreur</span></td><td><code>NAK <code> ETB <message></code></td></tr>
<tr><td><code>SOH</code> (<code>0x01</code>)</td><td><span data-lang="en">Command</span><span data-lang="fr">Commande</span></td><td><code>SOH <code> ETB <data> *(ETB <data>)</code></td></tr>
</tbody>
</table></div>
<div class="callout"><p><span data-lang="en">A peer receiving an unknown type byte answers with an error (<code>127</code>).</span><span data-lang="fr">Un pair qui reçoit un type inconnu répond par une erreur (<code>127</code>).</span></p></div>
<h3 id="protocol-codes"><span data-lang="en">N.3 Codes</span><span data-lang="fr">N.3 Codes</span></h3>
<p><span data-lang="en">A code is a number from 0 to 127.</span><span data-lang="fr">Un code est un nombre de 0 à 127.</span></p>
<div class="ctabs" data-tabs="codes">
<button type="button" data-tab="errors"><span data-lang="en">Errors</span><span data-lang="fr">Erreurs</span></button>
<button type="button" data-tab="events"><span data-lang="en">Events</span><span data-lang="fr">Événements</span></button>
</div>
<div class="ctab-panel" data-tabs="codes" data-tab="errors">
<div class="table-wrap"><table>
<thead><tr><th scope="col">Code</th><th scope="col"><span data-lang="en">Error</span><span data-lang="fr">Erreur</span></th></tr></thead>
<tbody>
<tr><td><code>127</code></td><td><span data-lang="en">Unknown error</span><span data-lang="fr">Erreur inconnue</span></td></tr>
</tbody>
</table></div>
</div>
<div class="ctab-panel" data-tabs="codes" data-tab="events">
<div class="table-wrap"><table>
<thead><tr><th scope="col">Code</th><th scope="col"><span data-lang="en">Event</span><span data-lang="fr">Événement</span></th><th scope="col"><span data-lang="en">Data sent</span><span data-lang="fr">Données envoyées</span></th></tr></thead>
<tbody>
<tr><td><code>0</code></td><td><span data-lang="en">Client logged in</span><span data-lang="fr">Client connecté</span></td><td><code>user_uuid</code>, <code>user_name</code></td></tr>
</tbody>
</table></div>
</div>
<h3 id="protocol-summary"><span data-lang="en">N.4 Every frame</span><span data-lang="fr">N.4 Toutes les trames</span></h3>
<pre data-title="Frames"><code>/* Connection */ ENQ <tag> ETB SYN EOT
/* Error */ ENQ <tag> ETB NAK <code> ETB <message> EOT
/* Command */ ENQ <tag> ETB SOH <code> ETB <data> *(ETB <data>) EOT</code></pre>
</section>
<!-- N+1 -->
<section id="handshake">
<h2><span data-lang="en">N+1. Handshake</span><span data-lang="fr">N+1. Poignée de main</span></h2>
<figure>
<!-- Drawn at its size on every screen (the frames stay readable): on a phone it scrolls in its box, it never shrinks. A longer frame: widen the viewBox and this width with it -->
<div class="table-wrap" tabindex="0" role="region" aria-label="Handshake between the client and the server">
<svg viewBox="0 0 560 328" style="width:560px;max-width:none;margin-inline:auto" role="img" aria-label="Handshake between the client and the server">
<defs>
<marker id="arr-hs" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path class="arrow" d="M0 0L10 5L0 10z"/>
</marker>
<marker id="arr-hs-accent" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path class="arrow-accent" d="M0 0L10 5L0 10z"/>
</marker>
</defs>
<rect class="box" x="8" y="16" width="120" height="40" rx="8"/>
<text class="lbl" x="68" y="41" text-anchor="middle">Client</text>
<rect class="box-alt" x="432" y="16" width="120" height="40" rx="8"/>
<text class="lbl" x="492" y="41" text-anchor="middle" data-lang="en">Server</text>
<text class="lbl" x="492" y="41" text-anchor="middle" data-lang="fr">Serveur</text>
<path class="edge dash" d="M68 56V322"/>
<path class="edge dash" d="M492 56V322"/>
<!-- one message a row: an activation box on each lifeline at the same height, the arrow joins them (data-from / data-to), its frame starts next to the client (read on a phone without scrolling) -->
<rect id="c1" class="box" x="62" y="84" width="12" height="18"/>
<rect id="s1" class="box-alt" x="486" y="84" width="12" height="18"/>
<rect id="c2" class="box" x="62" y="124" width="12" height="18"/>
<rect id="s2" class="box-alt" x="486" y="124" width="12" height="18"/>
<rect id="c3" class="box" x="62" y="164" width="12" height="18"/>
<rect id="s3" class="box-alt" x="486" y="164" width="12" height="18"/>
<rect id="c4" class="box" x="62" y="204" width="12" height="18"/>
<rect id="s4" class="box-alt" x="486" y="204" width="12" height="18"/>
<rect id="c5" class="box" x="62" y="244" width="12" height="18"/>
<rect id="s5" class="box-alt" x="486" y="244" width="12" height="18"/>
<rect id="c6" class="box" x="62" y="284" width="12" height="18"/>
<rect id="s6" class="box-alt" x="486" y="284" width="12" height="18"/>
<path id="m1" class="edge" data-from="c1:right" data-to="s1:left" marker-end="url(#arr-hs)"/>
<text class="small" x="80" y="86">ENQ ETB SYN EOT</text>
<path id="m2" class="edge" data-from="s2:left" data-to="c2:right" marker-end="url(#arr-hs)"/>
<text class="small" x="80" y="126">ENQ ETB ACK EOT</text>
<path id="m3" class="edge" data-from="c3:right" data-to="s3:left" marker-end="url(#arr-hs)"/>
<text class="small" x="80" y="166">ENQ ETB SO <RSA public key> EOT</text>
<path id="m4" class="edge-accent" data-from="s4:left" data-to="c4:right" marker-end="url(#arr-hs-accent)"/>
<text class="small" x="80" y="206">ENQ ETB SO <AES key> ETB <iv> EOT</text>
<path id="m5" class="edge-accent" data-from="c5:right" data-to="s5:left" marker-end="url(#arr-hs-accent)"/>
<text class="small" x="80" y="246">ENQ <tag> ETB SOH ... EOT (AES)</text>
<path id="m6" class="edge-accent" data-from="s6:left" data-to="c6:right" marker-end="url(#arr-hs-accent)"/>
<text class="small" x="80" y="286">ENQ <tag> ETB ACK EOT (AES)</text>
</svg>
</div>
<figcaption><span data-lang="en">Figure N: the handshake, then the encrypted exchange.</span><span data-lang="fr">Figure N : la poignée de main, puis l'échange chiffré.</span></figcaption>
</figure>
<h3 id="handshake-first"><span data-lang="en">N+1.1 First step (tag = 0 byte)</span><span data-lang="fr">N+1.1 Première étape (tag = 0 octet)</span></h3>
<ol>
<li><strong><span data-lang="en">Client</span><span data-lang="fr">Client</span></strong> <span data-lang="en">sends a connection request</span><span data-lang="fr">envoie une demande de connexion</span> <code>ENQ ETB SYN EOT</code></li>
<li><strong><span data-lang="en">Server</span><span data-lang="fr">Serveur</span></strong> <span data-lang="en">answers</span><span data-lang="fr">répond</span> <code>ENQ ETB ACK EOT</code></li>
</ol>
<div class="callout warn"><p><span data-lang="en">Any other request: the server answers <code>ENQ ETB EM EOT</code> and closes the connection.</span><span data-lang="fr">Toute autre requête : le serveur répond <code>ENQ ETB EM EOT</code> et ferme la connexion.</span></p></div>
</section>
<!-- N+2 -->
<section id="commands">
<h2><span data-lang="en">N+2. Commands</span><span data-lang="fr">N+2. Commandes</span></h2>
<!-- min-width on a th: a table too wide for a phone scrolls in its box, its column of sentences (14em) or of long names (18ch) keeps some width: never a word per line -->
<div class="table-wrap"><table>
<thead><tr><th scope="col">Code</th><th scope="col"><span data-lang="en">Command</span><span data-lang="fr">Commande</span></th><th scope="col" style="min-width:14em"><span data-lang="en">Purpose</span><span data-lang="fr">Rôle</span></th><th scope="col"><span data-lang="en">Answer</span><span data-lang="fr">Réponse</span></th></tr></thead>
<tbody>
<tr><td><code>1</code></td><td><code>login "user_name"</code></td><td><span data-lang="en">Log the client as the user (created when missing)</span><span data-lang="fr">Connecte le client avec cet utilisateur (créé s'il n'existe pas)</span></td><td><code>ACK</code> + event <code>0</code></td></tr>
</tbody>
</table></div>
</section>
<!-- N+3 -->
<section id="storage">
<h2><span data-lang="en">N+3. Storage</span><span data-lang="fr">N+3. Stockage</span></h2>
<div class="callout warn"><p><span data-lang="en">The storage is not encrypted.</span><span data-lang="fr">Le stockage n'est pas chiffré.</span></p></div>
<pre data-title="Files"><code>.server_save/
└── users.data</code></pre>
<div class="table-wrap"><table>
<thead><tr><th scope="col"><span data-lang="en">Byte</span><span data-lang="fr">Octet</span></th><th scope="col"><span data-lang="en">Usage</span><span data-lang="fr">Usage</span></th></tr></thead>
<tbody>
<tr><td><code>GS</code> (<code>0x1D</code>)</td><td><span data-lang="en">End of a data record</span><span data-lang="fr">Fin d'un enregistrement</span></td></tr>
</tbody>
</table></div>
</section>
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 197k | Updated | Claude CodeCodex | Verified | Install |