LaunchKit · 2026
Back to Skills

json-modifier

Safely apply structured JSON patches (RFC 6902) to files.

0
455 downloads
by @wanng-ide

Setup & Installation

openclaw skills install @wanng-ide/json-modifier

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install json-modifier

What This Skill Does

Applies structured JSON patches in RFC 6902 format to files without rewriting them. Supports add, remove, replace, move, copy, and test operations. Writes atomically to prevent data corruption and preserves indentation.

Avoids brittle regex and full-file rewrites by applying targeted, validated patches that leave the rest of the document unchanged.

When to use it

  • Bumping version numbers in package.json
  • Adding feature flags to a config file
  • Removing deprecated keys from API response configs
  • Appending items to arrays in settings files
  • Updating nested values in multi-environment config files

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: update the version field in package.json from 1.0.0 to 2.0.0

AGENT
  1. 1Identify the target file: package.json
  2. 2Construct an RFC 6902 patch: [{"op": "replace", "path": "/version", "value": "2.0.0"}]
  3. 3Run: node skills/json-modifier/index.js --file package.json --patch '[{"op": "replace", "path": "/version", "value": "2.0.0"}]'
  4. 4Confirm patch validates and applies without error
OUTPUT

package.json updated with version set to 2.0.0, original indentation preserved