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 syntax errors in JSON files (e.g. config files, manually edited data).

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "json-repair-kit" with this command: npx skills add wanng-ide/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 Node eval may strip them if they are line comments outside of strings).
  • Hex/Octal Numbers: 0xFF -> 255

Safety

  • Backup: Always creates a .bak file before overwriting (unless --no-backup is used, but default is safe).
  • Validation: Verifies the repaired content is valid JSON before writing.
  • Eval Sandbox: Uses vm.runInNewContext to parse, ensuring no access to global scope or process. It is safer than eval().

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Cny Skill Extracted

Fetch Bank of Taiwan CNY exchange rates and calculate tiered prices with discounts, sending results via configured channels on a set schedule.

Registry SourceRecently Updated
General

Optimacros

Помощь с вопросами Optimacros: формулы, синтаксис, проектирование модели, доступы, скрипты, версии, мультикубы, DCA, UAM и ошибки в OM.

Registry SourceRecently Updated
General

Heartrate

A focused health & wellness tool built for Heartrate. Log entries, review trends, and export reports — all locally.

Registry SourceRecently Updated
General

Phemex Trade

Trade on Phemex (USDT-M futures, Coin-M futures, Spot) — place orders, manage positions, check balances, and query market data. Use when the user wants to (1...

Registry SourceRecently Updated