compressed-json-repair
Installation
SKILL.md
Client-Side JSON Self-Repair & Healing Protocol
Overview
When an LLM generates structured JSON, minor formatting glitches frequently occur: a trailing comma before a closing bracket ([1, 2,]), single quotes ('key': 'value'), unquoted keys ({ name: "John" }), or markdown code fences enclosing the payload.
Naive agent runtimes treat a JSON.parse() exception as a fatal error and send an apologetic follow-up turn to the model ("Your JSON was invalid because of a trailing comma. Please re-generate the entire payload").
Re-prompting for trivial syntax errors burns 1,000 to 4,000 tokens and incurs 5 to 10 seconds of roundtrip latency.
The Client-Side JSON Repair Protocol intercepts malformed JSON strings and heals them locally in 1 millisecond using deterministic parser heuristics.