Turn JSON or PostgreSQL jsonb payloads into compact readable context for LLMs. Use when a user wants to compress JSON, reduce token usage, summarize API responses, or convert structured data into model-friendly text without dumping raw paths.
85
85%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Risky
Do not use without reviewing
Use this skill when raw JSON is too noisy for direct prompting. It converts JSON or exported jsonb
content into short, readable summaries that preserve entities, status, relationships, and counts.
Prefer this skill for:
jsonb exportsDo not use this skill for PDF, DOCX, image OCR, or arbitrary prose documents.
jsonb-style JSON text.scripts/json_to_readable_context.py on the file or pipe JSON through stdin.--max-samples,
--max-depth, or --max-string-len.python3 scripts/json_to_readable_context.py --input payload.jsonFrom stdin:
cat payload.json | python3 scripts/json_to_readable_context.pyWrite to a file:
python3 scripts/json_to_readable_context.py --input payload.json --output summary.txtCommon tuning:
python3 scripts/json_to_readable_context.py \
--input payload.json \
--style sectioned \
--strict \
--preserve status,profile.email \
--show-paths \
--expand collections \
--max-samples 2 \
--max-depth 2 \
--max-string-len 48The script aims for layer-2 readable output, for example:
User[123]: Tom
Summary
- Status: active.
- Profile: email a@b.com (verified).
Collections
- Roles: 2 total; values: admin and editor.Behavior rules:
User[123]: TomSummary, Details, and Collections when available--style sectioned (default): emits Summary, Details, and Collections--style flat: emits a simpler header + bullet list without section headingsExample flat output:
User[123]: Tom
- Status: active.
- Profile: email a@b.com (verified).
- Roles: 2 total; values: admin and editor.--strict: reduces aggressive compression and keeps more explicit structure--preserve key1,key2,path.to.field: always keeps those keys or dotted paths, even when empty or normally dropped--expand collections|details|all: adds local sub-bullets so important parts are less compressed--show-paths: appends source markers like [@status] or [@orders[0]] to rendered linesExample:
python3 scripts/json_to_readable_context.py \
--input payload.json \
--strict \
--preserve status,profile.email,orders \
--expand all \
--show-pathsExample with paths:
User[123]: Tom [@root]
Summary
- Status: active. [@active]
Collections
- Roles: 2 total; values: admin and editor. [@roles]Read references/rules.md only when you need:
--max-depthjson and PostgreSQL jsonb are treated the same once parsed