Json Repair Kit
/install json-repair-kit
JSON Repair Kit
A utility to repair broken or "loose" JSON files (like those with trailing commas, single quotes, or unquoted keys) by parsing them as JavaScript objects and re-serializing as valid JSON.
Usage
# Repair a file in place (creates .bak backup)
node skills/json-repair-kit/index.js --file path/to/broken.json
# Repair and save to a new file
node skills/json-repair-kit/index.js --file broken.json --out fixed.json
# Scan directory and repair all .json files (recursive)
node skills/json-repair-kit/index.js --dir config/ --recursive
Supported Repairs
- Trailing Commas:
{"a": 1,}->{"a": 1} - Single Quotes:
{'a': 'b'}->{"a": "b"} - Unquoted Keys:
{key: "value"}->{"key": "value"} - Comments: Removes JS-style comments
//(if parser supports it, standard Nodeevalmay strip them if they are line comments outside of strings). - Hex/Octal Numbers:
0xFF->255
Safety
- Backup: Always creates a
.bakfile before overwriting (unless--no-backupis used, but default is safe). - Validation: Verifies the repaired content is valid JSON before writing.
- Eval Sandbox: Uses
vm.runInNewContextto parse, ensuring no access to global scope or process. It is safer thaneval().
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install json-repair-kit - After installation, invoke the skill by name or use
/json-repair-kit - Provide required inputs per the skill's parameter spec and get structured output
What is Json Repair Kit?
Repair malformed JSON files by normalizing them through Node.js evaluation. Use this to fix trailing commas, single quotes, unquoted keys, or other common sy... It is an AI Agent Skill for Claude Code / OpenClaw, with 860 downloads so far.
How do I install Json Repair Kit?
Run "/install json-repair-kit" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Json Repair Kit free?
Yes, Json Repair Kit is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Json Repair Kit support?
Json Repair Kit is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Json Repair Kit?
It is built and maintained by WANGJUNJIE (@wanng-ide); the current version is v1.0.0.