JSON Formatter Pro
Paste the following prompt into your AI chat to install this skill:
Follow https://skillhub.cn/install/skillhub.md to install @user_15292d5a/yjkj-json-formatter-pro into your AI assistant.
About this skill
Problem Solved
When debugging APIs, checking config files, or processing logs, JSON often needs to be pretty-printed and syntax-validated quickly. Manual indentation, pasting into web tools, or mixing separate validators makes the workflow fragmented. json-formatter-pro combines both tasks: it can emit readable JSON with controlled indentation and can also validate JSON without producing formatted output, which is useful in local scripts or CI checks.
How It Works and Limitations
- Format: reads from a file or
stdin, applies indentation from-i, defaults to 2 spaces, writes to-oif provided, or defaults tostdout. - Validate:
validatemode only checks JSON validity, making it easy to wire into automation through exit codes. - Optional sorting:
--sort-keysorders keys alphabetically for stable diffs and manual review. - Exit codes:
0success,1invalid JSON syntax,2file not found or permission error,3other error.
This is not a general-purpose data transformer. It does not rewrite nested structures, compress fields, or process non-JSON content. Keep the original file and avoid overwriting source data with formatted output.
Use Cases
- When debugging API responses, pretty-print JSON with fixed indentation to inspect fields visually.
- Before committing config, use `validate` to catch JSON syntax errors before the build fails.
- When writing API examples, sort keys with `--sort-keys` to make structural diffs easier to review.
- When processing log snippets, read JSON from `stdin` and write formatted output to a target file.
Best For
- Frontend engineers: debugging API responses and needing quick inspection and validation of JSON structures.
- Backend engineers: validating config file syntax in CI scripts and failing builds based on exit codes.
- Data engineers: cleaning JSON fragments from logs and needing consistent indentation plus sorted keys.
- DevOps engineers: checking deployment configs for valid JSON before applications start and report errors.
Related Skills
A one-shot coding agent built on Claude Code CLI that runs non-interactively, supports a specified workdir, and can be monitored in the foreground or background.
Preview and confirm file sorting by extension, with recursive cleanup, ignore rules, and transactional rollback.
An engineering assistant for static HTML/CSS/JS pages, design-token extraction, IE8-compatible review, and structured delivery.
An engineering workflow for requirement analysis, scenario modeling, risk planning, quality gates, testing, and knowledge capture, with lightweight, standard, and full modes.