Agent skill · research science · aiskillstore

json-to-llm-context

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.

Why this skill is useful

Adds a specialized script for transforming JSON and jsonb payloads into concise, model-friendly summaries that the AI wouldn't generate on its own.

What it needs

Requires python3 installed locally. About 2k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.

What this skill does

JSON to LLM Context Overview 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: API responses PostgreSQL jsonb exports nested config/state payloads large arrays of records that need compact summaries Do not use this skill for PDF, DOCX, image OCR, or arbitrary prose documents. Workflow 1. Confirm the input is valid JSON or jsonb-style JSON text. 2. Run scripts/jsontoreadablecontext.py on the file or pipe JSON through stdin. 3. Return the generated readable summary as the primary artifact. 4. If the output still feels too long, rerun with tighter limits such as lower --max-samples, --max-depth, or --max-string-len. 5. If parsing fails, report the JSON error clearly instead of guessing. Quick Start From stdin: Write to a file: Common tuning: Output Style The script aims for layer-2 readable output, for example: Behavior rules: prefer entity headers like User[123]: Tom group top-level output into Summary, Details, and Collections when available convert fields into short report-style bullets when possible summarize large arrays as totals, statuses, and short examples keep stable ordering so repeated runs are comparable avoid raw path dumps unless the structure is too irregular to beautify safely Style Options --style sectioned (default): emits Summary, Details, and Collections --style flat: emits a simpler header + bullet list without section headings Example flat output: Safety Controls --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 lines Example: Example with paths: When To Read References R …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills aiskillstore/json-to-llm-context

View the source on GitHub

Browse the @skills marketplace