json-repair-kit for Openclaw

A specialized Node.js utility designed to automatically repair and normalize malformed or loose JSON syntax into valid standards.

wanng-ide
v1.0.0
Feb 16, 2026
0
1.7k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install json-repair-kit

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install json-repair-kit using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is json-repair-kit?

The JSON Repair Kit is a robust utility within the Openclaw Skills ecosystem that streamlines the process of fixing "loose" JSON files. Developers often encounter JSON files with trailing commas, single quotes, or unquoted keys—errors that typically break strict parsers. This skill leverages a secure Node.js environment to evaluate these malformed structures as JavaScript objects and re-serialize them into perfectly formatted, valid JSON.

By integrating this tool into your local development environment, you ensure that configuration files, manually edited data, and legacy exports remain compatible with modern applications. As part of the Openclaw Skills library, it focuses on providing a developer-friendly interface for data sanitization and workflow automation.

json-repair-kit Use Cases

  • Cleaning up configuration files that have trailing commas after manual editing.
  • Converting JavaScript-style objects with single quotes into strict JSON format.
  • Fixing data exports that contain unquoted keys or non-standard numeric formats like hex or octal.
  • Batch-repairing nested JSON files across an entire directory structure.
  • Stripping comments from JSON-like files to make them compatible with strict environments.

How json-repair-kit Works

  1. The skill accepts a target file or directory path through command-line arguments.
  2. It reads the content of the malformed file into memory.
  3. The raw string is evaluated within a secure vm.runInNewContext sandbox to safely transform loose syntax into a standard JavaScript object.
  4. A validation step ensures the resulting object structure is sound before any writing occurs.
  5. The skill creates a .bak backup file to preserve the original data integrity.
  6. Finally, the sanitized object is stringified and written back to the disk as valid JSON.

json-repair-kit Setup

To use this component from the Openclaw Skills collection, ensure you have a Node.js environment configured. Run the following commands to repair your files:

# Repair a specific file in place (automatically creates a .bak backup)
node skills/json-repair-kit/index.js --file path/to/broken.json

# Repair a file and save the output to a specific location
node skills/json-repair-kit/index.js --file broken.json --out fixed.json

# Recursively scan and repair all JSON files in a directory
node skills/json-repair-kit/index.js --dir config/ --recursive

json-repair-kit Data Schema & Taxonomy

The JSON Repair Kit processes text-based data files and produces a standardized output. It organizes file operations according to the following schema:

Attribute Description Output Format
Source File The malformed JSON or .txt file Loose JS Object Notation
Repaired File The sanitized, valid JSON output Strict RFC 8259 JSON
Backup File A .bak copy of the original source Original Content

It handles data types including strings, booleans, arrays, nested objects, and numeric conversions (Hex/Octal to Decimal).

json-repair-kit Advanced Features

  • Recursive processing: Effortlessly crawl through deep directory trees to fix JSON syntax errors at scale.
  • Sandbox execution: Uses the Node.js VM module for parsing, which is significantly safer than standard eval() for processing untrusted data.
  • Automatic Backups: Protects your data by creating .bak files before any overwrite operation occurs, which is a standard safety feature in Openclaw Skills.
  • Numeric Normalization: Automatically converts hexadecimal (0xFF) and octal numbers into standard decimal integers.
  • Flexible CLI: Supports both in-place repairs and redirected output to new file paths.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*