cad3-encoding
Installation
SKILL.md
CAD3 Encoding
CAD3 is the byte-level encoding for all Convex data. Normative spec:
https://docs.convex.world/docs/cad/encoding. Read it before changing encoder
or decoder behaviour — this skill is orientation, not a substitute.
The Model
A cell is the unit of encoding. Cells reference other cells, forming a Merkle DAG: every reference carries the hash of the referenced encoding.
- Encoding is a byte sequence. Every cell maps to exactly one encoding, and distinct cells map to distinct encodings. Both directions matter — the round-trip and the uniqueness.
- Value ID = SHA3-256 of the encoding. This is the content address.
- Maximum encoding length is 16383 bytes, so any cell fits a fixed buffer and most operations stay O(1).
- The first byte is the tag, which determines how the rest is read. A tag not defined in CAD3 MUST be rejected.