MessagePack — Efficient Binary Serialization

You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.

25 stars

Best use case

MessagePack — Efficient Binary Serialization is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.

Teams using MessagePack — Efficient Binary Serialization should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/msgpack/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/TerminalSkills/skills/msgpack/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/msgpack/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How MessagePack — Efficient Binary Serialization Compares

Feature / AgentMessagePack — Efficient Binary SerializationStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# MessagePack — Efficient Binary Serialization

You are an expert in MessagePack, the efficient binary serialization format. You help developers replace JSON with a compact binary format that's 30-50% smaller and 2-10x faster to parse — supporting all JSON types plus binary data, timestamps, and custom extensions, with libraries available for 50+ programming languages.

## Core Capabilities

### Node.js Usage

```typescript
import { encode, decode, Encoder, Decoder, ExtensionCodec } from "@msgpack/msgpack";

// Basic encode/decode
const data = {
  name: "Alice",
  age: 30,
  scores: [95, 87, 92],
  active: true,
  metadata: { role: "admin", lastLogin: new Date() },
};

const packed = encode(data);              // Uint8Array (binary)
console.log(packed.length);               // ~65 bytes vs ~120 bytes JSON

const unpacked = decode(packed);          // Original object

// Custom extension for Date
const extensionCodec = new ExtensionCodec();
extensionCodec.register({
  type: 0,                                // Extension type ID (0-127)
  encode: (input: unknown) => {
    if (input instanceof Date) {
      return encode(input.getTime());
    }
    return null;
  },
  decode: (data: Uint8Array) => {
    return new Date(decode(data) as number);
  },
});

const encoder = new Encoder({ extensionCodec });
const decoder = new Decoder({ extensionCodec });

// Streaming decode for large data
import { decodeMultiStream } from "@msgpack/msgpack";
for await (const item of decodeMultiStream(readableStream)) {
  processItem(item);
}

// WebSocket with MessagePack
ws.binaryType = "arraybuffer";
ws.onmessage = (event) => {
  const data = decode(new Uint8Array(event.data));
  handleMessage(data);
};
ws.send(encode({ type: "subscribe", channel: "metrics" }));
```

### Comparison

```typescript
const testData = { users: Array.from({ length: 1000 }, (_, i) => ({
  id: i, name: `User ${i}`, email: `user${i}@example.com`, score: Math.random() * 100,
}))};

// JSON: 89,234 bytes, encode 2.1ms, decode 3.4ms
// MessagePack: 52,847 bytes (41% smaller), encode 0.8ms, decode 1.2ms
```

## Installation

```bash
npm install @msgpack/msgpack              # JavaScript/TypeScript
pip install msgpack                       # Python
go get github.com/vmihailenco/msgpack/v5  # Go
```

## Best Practices

1. **Replace JSON for internal APIs** — Use MessagePack between microservices; keep JSON for public APIs (human-readable)
2. **WebSocket payloads** — Use MessagePack for real-time binary data over WebSocket; smaller frames, faster parsing
3. **Cache storage** — Store MessagePack in Redis/Memcached; 30-50% less memory than JSON strings
4. **Extension types** — Register custom types (Date, BigInt, Decimal) with extension codec; type-safe round-trip
5. **Streaming decode** — Use `decodeMultiStream` for large datasets; process items as they arrive
6. **Content-Type** — Use `application/x-msgpack` or `application/msgpack` header for HTTP APIs
7. **Schema evolution** — Like JSON, MessagePack is schema-less; add/remove fields freely
8. **Fallback to JSON** — Support both formats via Accept header; MessagePack for performance, JSON for debugging

Related Skills

binary-analysis-patterns

25
from ComeOnOliver/skillshub

Master binary analysis patterns including disassembly, decompilation, control flow analysis, and code pattern recognition. Use when analyzing executables, understanding compiled code, or performing static analysis on binaries.

binary-analysis

25
from ComeOnOliver/skillshub

Analyze binary files (exe, dll, sys, bin, ocx, scr, cpl, drv) to assess if they are malicious, perform decompilation, extract strings/imports/exports, detect malware, and provide threat assessment. Use this skill when user asks to analyze, examine, check, or assess any binary file, asks if a file is malicious/suspicious/safe, or provides a file path to a binary. Trigger for phrases like "Is [file] malicious?", "Analyze [file]", "What does [binary] do?", or any request involving binary file analysis.

context7-efficient

25
from ComeOnOliver/skillshub

Token-efficient library documentation fetcher using Context7 MCP with 86.8% token savings through intelligent shell pipeline filtering. Fetches code examples, API references, and best practices for JavaScript, Python, Go, Rust, and other libraries. Use when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information. Triggers include questions like "Show me React hooks", "How do I use Prisma", "What's the Next.js routing syntax", or any request for library/framework documentation.

binary-re-triage

25
from ComeOnOliver/skillshub

Use when first encountering an unknown binary, ELF file, executable, or firmware blob. Fast fingerprinting via rabin2 - architecture detection (ARM, x86, MIPS), ABI identification, dependency mapping, string extraction. Keywords - "what is this binary", "identify architecture", "check file type", "rabin2", "file analysis", "quick scan"

binary-re-tool-setup

25
from ComeOnOliver/skillshub

Use when reverse engineering tools are missing, not working, or need configuration. Installation guides for radare2 (r2), Ghidra, GDB, QEMU, Frida, binutils, and cross-compilation toolchains. Keywords - "install radare2", "setup ghidra", "r2 not found", "qemu missing", "tool not installed", "configure gdb", "cross-compiler"

binary-re-synthesis

25
from ComeOnOliver/skillshub

Use when ready to document findings, generate a report, or summarize binary analysis results. Compiles analysis findings into structured reports - correlates facts from triage/static/dynamic phases, validates hypotheses, generates documentation with evidence chains. Keywords - "summarize findings", "generate report", "document analysis", "what did we find", "write up results", "export findings"

binary-re-static-analysis

25
from ComeOnOliver/skillshub

Use when analyzing binary structure, disassembling code, or decompiling functions. Deep static analysis via radare2 (r2) and Ghidra headless - function enumeration, cross-references (xrefs), decompilation, control flow graphs. Keywords - "disassemble", "decompile", "what does this function do", "find functions", "analyze code", "r2", "ghidra", "pdg", "afl"

binary-re-dynamic-analysis

25
from ComeOnOliver/skillshub

Use when you need to run a binary, trace execution, or observe runtime behavior. Runtime analysis via QEMU emulation, GDB debugging, and Frida hooking - syscall tracing (strace), breakpoints, memory inspection, function interception. Keywords - "run binary", "execute", "debug", "trace syscalls", "set breakpoint", "qemu", "gdb", "frida", "strace", "watch memory"

binary-re

25
from ComeOnOliver/skillshub

This skill should be used when analyzing binaries, executables, or bytecode to understand what they do or how they work. Triggers on "binary", "executable", "ELF", "what does this do", "reverse engineer", "disassemble", "decompile", "pyc file", "python bytecode", "analyze binary", "figure out", "marshal". Routes to sub-skills for triage, static analysis, dynamic analysis, synthesis, or tool setup.

Protocol Buffers — Efficient Binary Serialization

25
from ComeOnOliver/skillshub

You are an expert in Protocol Buffers (protobuf), Google's language-neutral binary serialization format. You help developers define data schemas with `.proto` files, generate typed code for multiple languages, build efficient APIs with gRPC, and handle schema evolution with backward/forward compatibility — achieving 3-10x smaller payloads and 20-100x faster serialization than JSON.

SKILL: Insecure Deserialization

25
from ComeOnOliver/skillshub

## Metadata

PEFT (Parameter-Efficient Fine-Tuning)

25
from ComeOnOliver/skillshub

Fine-tune LLMs by training <1% of parameters using LoRA, QLoRA, and 25+ adapter methods.