home / skills / jackspace / claudeskillz / json-config-helper

json-config-helper skill

/skills/json-config-helper

This skill validates, formats, and manipulates JSON configurations using jq, improving reliability and automation across projects.

npx playbooks add skill jackspace/claudeskillz --skill json-config-helper

Review the files below or copy the command above to add this skill to your agents.

Files (3)
SKILL.md
818 B
---
name: json-config-helper
description: Validate, format, and work with JSON configuration files
---

# Json-config-helper

## Instructions

When working with JSON files:
- Validate syntax with jq
- Pretty-print with jq '.'
- Minify with jq -c
- Sort keys with jq -S
- Extract values: jq '.key.subkey'
- Filter arrays: jq '.[] | select(.name == "value")'
- Map operations: jq 'map(.field)'
- package.json (Node.js)
- .mcp.json (MCP servers)
- .vscode settings
- Docker configs
- jq for command-line processing
- Suggest schema validation tools
- Provide corrected versions
- Find syntax errors (missing commas, quotes)
- Validate against JSON Schema
- Handle encoding issues


## Examples

Add examples of how to use this skill here.

## Notes

- This skill was auto-generated
- Edit this file to customize behavior

Overview

This skill helps validate, format, and manipulate JSON configuration files quickly and reliably. It focuses on command-line workflows and automation patterns for detecting syntax errors, fixing common issues, and preparing JSON for deployment or further validation. It supports schema validation and encoding checks to avoid runtime configuration failures.

How this skill works

The skill inspects JSON text for syntax errors (missing commas, unclosed quotes, stray trailing commas) and can produce corrected, pretty-printed, or minified outputs. It integrates jq-based transforms for sorting keys, extracting and filtering values, and mapping arrays. It also suggests and runs JSON Schema validations and flags encoding issues like BOM or wrong character encodings.

When to use it

  • Checking package.json, .vscode settings, Docker configs, or other project JSON before committing
  • Automating CI steps to validate and minify configuration files
  • Extracting or filtering nested values from large JSON arrays for scripts or reporting
  • Sorting keys and normalizing files for consistent diffs and merges
  • Diagnosing runtime config errors caused by malformed JSON or encoding problems

Best practices

  • Always run a syntax check (jq or a parser) before applying config changes in CI
  • Pretty-print JSON during review and store minified versions for production where needed
  • Keep a JSON Schema for critical configs and validate automatically in pre-commit hooks
  • Use sorted keys (jq -S) to minimize meaningless git diffs and simplify reviews
  • Check file encoding and strip BOM to avoid parser failures in different environments

Example use cases

  • Validate and pretty-print a config: jq '.' config.json to reveal syntax errors and readable output
  • Minify for deployment: jq -c '.' config.json > config.min.json before packaging
  • Sort keys to normalize files: jq -S '.' settings.json > settings.sorted.json for consistent diffs
  • Extract values: jq '.services[] | select(.name=="db") .connection' docker-compose.json
  • Run JSON Schema validation in CI to block malformed configs from merging

FAQ

Can this skill fix broken JSON automatically?

It detects common syntax errors and suggests fixes; some simple fixes can be applied automatically, but always review changes before committing.

Which tools does it use?

Primarily jq for parsing and transforms, plus JSON Schema validators for structural checks and standard encoding checks to catch BOM or charset issues.