msgpack

MessagePack expert: Describes MessagePack’s purpose and benefits — a compact binary serialization format used as an alternative to JSON. Notes it is typically 30–50% smaller than JSON and parses 2–10× faster, supports all JSON types plus binary data, timestamps, and custom extensions, and that libraries exist for more than 50 programming languages to help developers serialize data into a smaller, faster binary format.

Last repository push
GitHub Stars
219
Forks
38
Issues / PRs
7

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "msgpack" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-b4bb9d9445e1e51a6777b2a9f203656b665724cdf690ef747be89e7ef230d7f3. Verify the upstream source and version against https://github.com/TerminalSkills/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

MessagePack expert: Describes MessagePack’s purpose and benefits — a compact binary serialization format used as an alternative to JSON. Notes it is typically 30–50% smaller than JSON and parses 2–10× faster, supports all JSON types plus binary data, timestamps, and custom extensions, and that libraries exist for more than 50 programming languages to help developers serialize data into a smaller, faster binary format.

0 Downloads

Introduction source: third_party · TerminalSkills · 1.0.0 Reference

SkillPi interpretation

Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: msgpack
description: >-
  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.
license: Apache-2.0
compatibility: ''
metadata:
  author: terminal-skills
  version: 1.0.0
  category: Developer Tools
  tags:
    - serialization
    - binary
    - json-alternative
    - performance
    - compact
    - cross-language

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

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

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

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

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供 MessagePack 二进制序列化的全面指导,包括多语言支持与性能优势
  • 涵盖实际开发场景如微服务通信、WebSocket 数据传输、缓存存储等
  • 包含可运行的代码示例和性能对比数据,实用性强
Trigger Precision95/100

Highlights

  • description 在 frontmatter 和正文中均完整且一致
  • 清晰定义了 MessagePack 的核心能力与适用场景,触发边界明确
Structure and Standards90/100

Highlights

  • 文档结构清晰,分章节组织内容,逻辑流畅
  • 包含端到端代码示例、安装命令和最佳实践清单
  • frontmatter 完整,符合规范
Execution Reliability88/100

Highlights

  • 工具来源明确(官方 npm/pip/go 包),参数正确
  • 代码示例覆盖基本用法、自定义扩展、流式处理等关键场景
  • 无不可逆操作,无需额外确认机制
Evidence Verifiability (mean of the first four)90/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 96, 97

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.