by vc999999999
原始JSON转储浪费token且让模型困惑。此技能可将复杂JSON转换为简洁的摘要,在保留实体、关系和关键数据的同时,将token使用量减少高达80%。
1. 打开 Claude 聊天界面
2. 点击下方 "📋 复制" 按钮
3. 粘贴到 Claude 聊天框中并发送
4. 输入 "使用 json-to-llm-context 技能" 开始使用
=== json-to-llm-context 技能 === 作者: vc999999999 描述: 原始JSON转储浪费token且让模型困惑。此技能可将复杂JSON转换为简洁的摘要,在保留实体、关系和关键数据的同时,将token使用量减少高达80%。 使用方法: 1. 调用技能: "使用 json-to-llm-context 技能" 2. 提供相关信息: 根据技能要求提供必要参数 3. 查看结果: 技能会返回处理结果 示例: "使用 json-to-llm-context 技能,帮我分析一下这段代码"
这种方法适用于所有 Claude 用户,不需要安装额外工具。
data
safe
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.json
From stdin:
cat payload.json | python3 scripts/json_to_readable_context.py
Write to a file:
python3 scripts/json_to_readable_context.py --input payload.json --output summary.txt
Common 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 48
The 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-paths
Example 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 parsedView Count
0
Download Count
0
Favorite Count
0
Quality Score
80