enact/formatter

Format JSON strings with configurable indentation and validation.

Updated Dec 30, 2025
One-click install
npx skills add https://github.com/while-basic/enact-template --skill enact-formatter
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: enact/formatter
Source: https://github.com/while-basic/enact-template/tree/main/examples/formatter
Command: npx skills add https://github.com/while-basic/enact-template --skill enact-formatter

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

JSON data often arrives minified or in a single line, making it hard to read and debug. This tool formats and prettifies JSON strings into readable, properly indented output.

Core Features & Use Cases

  • Indentation-based formatting: pretty-prints JSON with configurable indentation to suit your workspace.
  • Validation and readability: detects invalid JSON and returns a clear result indicating success or failure.
  • Use Case: when consuming API responses or logs, pass the JSON string and receive a formatted version for quick analysis.

Quick Start

Use the formatter to prettify a compact JSON string, for example: enact run enact/formatter --args '{"json": "{"name":"Alice","age":30}", "indent": 2}'

Frequently Asked Questions about enact/formatter

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

FAQPage Schema
How do I format a minified JSON string for better readability?▼

To format JSON for readability, use a prettifier tool that parses the string and applies indentation. This tool restructures compact JSON into clean, readable text, making it easier to analyze logs or API responses.

Can I configure the indentation level when pretty-printing JSON?▼

Yes, you can configure the indentation level when pretty-printing JSON. This tool supports configurable indentation, allowing you to specify the number of spaces to match your workspace formatting preferences.

Does the JSON formatter validate the input string?▼

Yes, the JSON formatter validates the input string. If the JSON is invalid, the tool detects the formatting issue and returns a clear result indicating failure rather than attempting to process malformed data.

What is the best way to prettify API responses in a development workflow?▼

The best way to prettify API responses in a development workflow is to pass the raw JSON string to a formatter. This tool automatically parses and indents the data, providing a clean output version for quick analysis.

How do I use a Node script to format JSON in my logs?▼

To format JSON in your logs using a Node script, run the formatter command and pass the log string as an argument. The tool will parse the data and return properly indented text for easier troubleshooting.