Skip to content
Back to skills

Json Repair Kit

ASecurity

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).

  • 21 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 7, 2026
toolsjavascriptjavabashnode

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 7, 2026

npx -y skills add modbender/skill-library-mcp --skill json-repair-kit --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Json Repair Kit?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Json Repair Kit
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-json-repair-kit/badge)](https://www.skillsdirectory.com/skills/modbender-json-repair-kit)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: json-repair-kit
description: 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).
---

# 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

```bash
# 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()`.

Files in this skill

  • SKILL.md1.5 KB
  • index.js3.6 KB
  • package.json299 B
  • scripts/test.js1.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in tools →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.