mcpField
S
spacetimedb-serialization

spacetimedb-serialization

github.com/danmossaDevelopment2161 installsUpdated 19w ago
Repository

About spacetimedb-serialization

spacetimedb-serialization is a technical skill for low-level encoding, wire formats, and module ABI work. It is intended for developers handling custom tooling, protocol inspection, ABI tasks, or serialization debugging, and summarizes BSATN, SATS JSON, and WebAssembly ABI details.

Key features

  1. 01Explains BSATN field order and primitive encoding
  2. 02Describes SATS JSON product value forms
  3. 03Covers integer and float encoding details
  4. 04Summarizes the WebAssembly module ABI
  5. 05Notes buffer ownership and UTF-8 caveats

Use cases

  1. 01Debug BSATN serialized data
  2. 02Inspect SATS JSON representation and precision risks
  3. 03Work with the WebAssembly module ABI
  4. 04Analyze wire formats for custom tooling

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/danmossa/spacetimedb-skills --skill spacetimedb-serialization

After installing, type/spacetimedb-serializationin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
bsatn.md
sats-json.md
webassembly-abi.md

Details

From the project README

Use this skill for low-level encoding, wire formats, and module ABI work.

Core encoding facts

  • Prefer generated SDKs and module APIs unless the task is explicitly custom tooling, protocol inspection, ABI work, or serialization debugging.
  • BSATN encodes product values as field values in order; field names are not encoded.
  • BSATN encodes strings as u32 byte length followed by UTF-8 bytes.
  • BSATN encodes integer and float primitive payloads in little-endian form; floats use their raw IEEE bit representation.
  • SATS JSON product values can be arrays by field order or objects by field name.
  • SATS JSON encodes integer types as JSON numbers, so large 64-bit, 128-bit, and 256-bit values can lose precision in normal JavaScript number handling.
  • Sum values are tagged unions; the tag is the variant index or name depending on the format.

ABI cautions

  • WebAssembly ABI functions use the C ABI on wasm32 and often communicate through pointer/length pairs.
  • Most host functions return u16, with 0 meaning success; outputs are written through out pointers.
  • Some UTF-8 handling is lossy; invalid bytes may be replaced.
  • Buffer functions have explicit ownership rules. Do not reuse consumed host buffers.

Reference map

NeedOpen
BSATNreferences/bsatn.md
SATS JSONreferences/sats-json.md
WebAssembly module ABIreferences/webassembly-abi.md

Guidance

  • Prefer high-level SDK and module APIs unless the user's task is explicitly about serialization, ABI, or custom tooling.
  • Keep byte-level examples tied to the reference notation.
  • Route normal client/server code back to the relevant SDK, reducer, table, or procedure skill.

Comments

Markdown supported