files-edit-json

Edit and validate JSON files by round-tripping through Python data structures.

1|Updated Jun 23, 2026
One-click install
npx skills add https://github.com/bitranox/bitranox-skills --skill files-edit-json-bitranox
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: files-edit-json
Source: https://github.com/bitranox/bitranox-skills/tree/main/plugins/bitranox/skills/files-edit-json
Command: npx skills add https://github.com/bitranox/bitranox-skills --skill files-edit-json-bitranox

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Hand-editing JSON as raw text invites classic breakages: trailing commas, unquoted keys, single quotes, and missing braces. This Skill replaces manual text edits and sed/regex hacks with a load-edit-dump-reload workflow that produces valid JSON by construction. ## Core Features & Use Cases - Structured Editing: Load JSON with Python's stdlib json module, modify the parsed data structure, and serialize it back with json.dump using indent=2, ensure_ascii=False, or sort_keys=True. - Validation by Re-loading: After writing, re-load the file and assert expected values so malformed output raises a JSONDecodeError immediately instead of breaking downstream consumers. - JSONC/JSON5 Handling: Load comment-bearing files like tsconfig or VS Code settings with pyjson5/json5, then write back strict JSON unless the consumer requires the relaxed form. - Use Case: Bump the version field in a plugin.json manifest programmatically, then confirm the file still parses and contains the new value before committing. ## Quick Start Use the files-edit-json skill to update the version field in my plugin.json file and verify it still parses.

Frequently Asked Questions about files-edit-json

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I edit a JSON file in Python without breaking it?▼

Load the file with json.load into a Python dict, modify the data structure, then write it back with json.dump using indent=2. Re-load the file afterward and assert the expected value to confirm it still parses.

Should I use json or orjson for JSON processing in Python?▼

The stdlib json module is the default: correct, always available, and supports indent and sort_keys options. Use orjson when speed and throughput matter; it is faster, returns bytes, and is strict, but requires pip install orjson.

Why does json.load fail on my tsconfig or VS Code settings file?▼

Those files use JSONC, which allows // comments and trailing commas that strict JSON forbids. Load them with pyjson5 or json5 instead, then write back strict JSON unless the consumer requires the relaxed form.

Can I edit JSON with sed or regex instead of a parser?▼

No. Text-based edits easily produce trailing commas, single quotes, or unquoted keys that break parsing. Loading into a Python structure and re-serializing guarantees valid output because the serializer emits correct syntax by construction.

How do I keep JSON key order and stable diffs when editing?▼

Python dicts preserve insertion order, so a load-edit-dump round trip keeps existing key order. Pass sort_keys=True to json.dump when you want alphabetically sorted keys for stable, minimal diffs across commits.