# Format JSON with Clear Validation

Compact JSON is hard to review, and invalid data slows debugging. This skill validates JSON and returns a clean, indented version with errors.

## Install

```bash
npx skillstore add enactprotocol/enact-json-formatter
```

## Metadata

- Status: approved
- Slug: enactprotocol-enact-json-formatter
- Version: 1.0.1
- Author version: 1.0.1
- Skillstore revision: r1
- Version status: valid
- Tree hash: 752280ac228560064f57c538562d1eb6ad2850b73205e2644898c7a77e6ac6df
- Author: EnactProtocol
- GitHub username: EnactProtocol
- License: MIT
- Repository: https://github.com/EnactProtocol/enact/tree/main/examples/json-formatter
- Ref: 30c73eac2afe762f6aa9c4553158769369d47351
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands
- Quality score: 81
- Quality tier: silver
- Public page: https://skillstore.pages.dev/skills/enactprotocol-enact-json-formatter
- Manifest: https://skillstore.pages.dev/api/skills/enactprotocol-enact-json-formatter/manifest

## Capabilities

- Parses JSON strings and reports whether they are valid.
- Returns formatted JSON text using configurable spaces.
- Uses a default two-space indentation when no indent is supplied.
- Reports parse errors in structured output.
- Runs locally with Node.js in a container command.

## Use Cases

- Review API responses: Format minified response data before comparing fields or sharing examples.
- Check pasted data samples: Validate JSON snippets before using them in reports or data tools.
- Prepare test fixtures: Create readable JSON payloads for bug reports and regression tests.

## Prompt Templates

### Format a JSON string

```
Format this JSON with the default indentation. Return the formatted result and validation status.
```

### Use custom indentation

```
Format this JSON with four-space indentation. If it is invalid, explain the parse error from the tool output.
```

### Validate an API response

```
Validate this minified JSON from an API response, format it, and highlight whether parsing failed before I compare fields.
```

### Prepare a testing payload

```
Use the JSON formatter on this generated payload, preserve all values, and summarize any parse error before downstream testing.
```

## Limitations

- It does not repair malformed JSON.
- It does not fetch remote files or URLs.
- It accepts JSON as a string argument, so very large payloads may be unwieldy.
- It formats data only; it does not validate business schemas.

## Best Practices

- Choose two-space indentation for shared configuration unless your team uses another standard.
- Run invalid inputs through the tool before debugging downstream consumers.
- Review parse errors before assuming an application bug.

## Anti Patterns

- Do not use it to validate domain rules or required fields.
- Do not paste secrets into sample JSON unless your environment permits it.
- Do not assume formatting changes the data values.

## Security Audit

- Audited at: 2026-07-05T16:15:38.097\+00:00
- Summary: The static findings are false positives from Markdown code fences and an output schema description. I found no prompt injection, data exfiltration intent, or malicious behavior in the reviewed files.

## Stats

- Views: 155
- Downloads: 9
- Favorites: 0
- Popularity score: 0
