Skip to main content

parse-json

Inspect and extract data from unknown JSON files without fumbling

Ir a la instalación

Datos de origen

Repositorio
AMindToThink/claude-code-settings
Última actividad en el origen
20 de marzo de 2026 a las 16:12
Idioma detectado de SKILL.md
inglés
Estrellas
4
Forks
0

Opciones de instalación

De forma predeterminada está seleccionado el prompt que primero revisa el origen. Puedes cambiar a un comando directo o descargar una copia local.

Revisa los archivos de origen

Lee SKILL.md y los archivos complementarios que muestra SkillsMP antes de decidir si quieres instalarlo.

Mostrando SKILL.md

SKILL.md
Instrucciones de origen · Vista previa de solo lectura
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
Ver en GitHub