change-the-protocol
Skill33 starsChanged 27 days agoApache-2.0View on GitHub
Add something to deck's wire format — a field on a group, a ref, a diagram node, a review comment. Use before editing PROTOCOL.md or the types in crates/core/src/protocol.rs and diagram.rs. Version 1 is frozen, so what is allowed is narrower than it looks, and a change has to land in five places to be real.
In this repository4 other files it gives its agents.
- AGENTS.mdAGENTS.md
- change-the-skillSkill
- change-the-windowSkill
- cut-a-releaseSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
If you need one of those, the answer is a v2 and a conversation, not a quiet edit.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Changing the protocol
PROTOCOL.md is version 1 and stays that way. A deck is written by one program
and read by another, often not the same version, so every field in it is a
promise to somebody else's client.
What is allowed
Additions. A new optional field, a new enum value. A v1 client ignores what it does not recognise, and unknown enum values read as that field's default — which is what makes this safe.
Not changes or removals. Renaming a field, changing its type, making an optional field required, or removing anything already there breaks every client that trusted the old shape.
If you need one of those, the answer is a v2 and a conversation, not a quiet edit.
The five places
A field added in one place and not the others is a field that half exists.
- The type, in
crates/core/src/protocol.rsordiagram.rs:
/// What this is for, in the reader's terms.
///
/// Optional, and absent is the ordinary case — say why somebody would set it.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub color: Option<Rgb>,skip_serializing_if matters: a deck that does not use the field must not grow
an empty one on the way out, or every existing document changes shape.
PROTOCOL.md— the table for that object, plus a sentence on what a client does with it. Somebody is writing a second client from this document alone.- The skill,
crates/app/skill/— in the reference the field belongs to (references/groups.mdfor adeck groupflag), and inSKILL.md's verb list for a new verb. An agent cannot use a field it has never been told about. This is the step most often missed, and the symptom is a feature nothing ever emits. - The app, so the field does something.
- A test that the old shape still parses:
#[test]
fn a_diagram_with_no_flows_reads_and_writes_without_them() {
let plain: Diagram = serde_json::from_str(
r#"{ "nodes": [ { "id": "a", "label": "A" } ] }"#,
).expect("a diagram with no flows is a diagram");
assert!(plain.flows.is_empty());
let back = serde_json::to_string(&plain).expect("it serialises");
assert!(!back.contains("flows"), "and says nothing about them");
}That test is the whole promise of "additions are safe", written down.
Two habits worth copying
A lenient enum. Unknown values become the default rather than an error, so a v1 client meeting a v2 document carries on:
#[serde(rename_all = "lowercase", from = "String")]
pub enum Role { … }A shape that can grow. A step in a flow is written as a bare id or as an object, so the common case stays short and the rare one is expressible:
#[serde(untagged)]
pub enum Step {
Node(String),
Lit { node: String, color: Option<Rgb> },
}"steps": ["a", { "node": "b", "color": "#c33" }]Before you send it
A pull request touching PROTOCOL.md gets a CI comment quoting the diff and the
freeze rule. That is a prompt to say in the description which kind of change
this is — addition, or something that needs a conversation — not a refusal.
cargo test -p deck-coreDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

