Skip to main content

parse-json

Inspect and extract data from unknown JSON files without fumbling

ソース情報

リポジトリ
AMindToThink/claude-code-settings
ソースの最終更新活動
2026年3月20日 16:12
検出された SKILL.md の言語
英語
スター
4
フォーク
0

インストール方法

デフォルトでは、最初にソースを確認する Prompt が選択されています。直接コマンドに切り替えるか、ローカルコピーをダウンロードすることもできます。

ソースファイルを確認

インストールを決める前に、SKILL.md と SkillsMP に表示されている付属ファイルをお読みください。

SKILL.md を表示中

SKILL.md
ソースの指示 · 読み取り専用プレビュー
name
parse-json
description
Inspect and extract data from unknown JSON files without fumbling
user_invocable
true
## Parse JSON Skill When the user asks you to parse, inspect, or extract data from a JSON file (or when you encounter an unknown JSON file during work), follow this two-phase approach. **Never guess the structure — always inspect first.** ### Phase 1: Structure Discovery (single call) Run a single Python snippet that reveals the full structure: ```python python3 -c " import json, sys with open('FILE_PATH') as f: data = json.load(f) def describe(obj, path='root', depth=0, max_depth=3): indent = ' ' * depth if isinstance(obj, dict): print(f'{indent}{path}: dict with {len(obj)} keys: {list(obj.keys())[:15]}') if depth < max_depth: for k in list(obj.keys())[:5]: describe(obj[k], f'{path}[\"{k}\"]', depth+1, max_depth) elif isinstance(obj, list): print(f'{indent}{path}: list of {len(obj)} items') if len(obj) > 0 and depth < max_depth: describe(obj[0], f'{path}[0]', depth+1, max_depth) else: val = repr(obj) if len(val) > 80: val = val[:80] + '...' print(f'{indent}{path}: {type(obj).__name__} = {val}') describe(data) " ``` ### Phase 2: Targeted Extraction Only after structure is known, write extraction code using the actual keys and nesting. Use `statistics.mean/stdev` for aggregation. Print results in a clean tabular format. ### Rules 1. **Never assume keys exist** — use the discovered structure from Phase 1 2. **One inspection call, then one extraction call** — no trial-and-error loops 3. **For large files** (>256KB), use the Python approach rather than the Read tool 4. **Print scalar summaries**, not raw arrays — the user wants insight, not data dumps 5. If the file has nested groups (e.g., scenarios with per-prompt results), aggregate with mean +/- std across the group
GitHubで見る