write-compressor

Installation
SKILL.md

Write Compressor

Overview

This skill provides strategies for implementing encoders that produce output compatible with existing decoders. It applies to tasks involving compression algorithms, arithmetic coding, entropy encoding, or any scenario requiring the construction of an encoder as the mathematical inverse of a decoder.

Core Principle: Encoder as Decoder Inverse

When implementing an encoder for an existing decoder, the encoder must be the exact mathematical inverse of the decoder operations. Every decoder operation has a corresponding encoder operation that must produce the exact values the decoder expects to read.

Mathematical Derivation First

Before writing any code:

  1. Document the decoder's state machine - Identify all state variables (e.g., low, high, range, fraction) and how they evolve
  2. Derive encoder operations algebraically - For each decoder read operation, derive what the encoder must write
  3. Verify the inverse relationship on paper - Prove mathematically that encoder output → decoder input produces the original data

Recommended Approach

Related skills

More from letta-ai/skills

Installs
33
Repository
letta-ai/skills
GitHub Stars
97
First Seen
Jan 24, 2026