← ClaudeAtlas

jqlisted

This skill should be used when the user asks to "parse this JSON", "extract X from this output", "pull the field with jq", "filter this API response", "reshape this JSON", "aggregate these records", "explain this jq filter", or invokes /jq. Also trigger when the user pastes raw JSON or CLI output (curl, kubectl, aws, gh, docker) and asks to filter, transform, or summarize it. Do NOT use for writing JSON, JSON Schema validation, jsonnet, or non-jq shell scripting.
chrismccoy/skills · ★ 2 · Data & Documents · score 66
Install: claude install-skill chrismccoy/skills
# jq - JSON Querying and Transformation ## Overview `jq` is the standard CLI tool for querying and reshaping JSON. This skill covers practical, expert-level usage: filtering deeply nested data, transforming structures, aggregating values, and composing `jq` into shell pipelines. Every example is copy-paste ready for real workflows. ## Workflow 1. Read the input. Identify the JSON source - pasted text, a file, or a piped command (`curl`, `kubectl`, `aws`, `gh`, `docker`). 2. Inspect the shape. Run `jq 'keys'` or `jq '.[0]'` on a sample to confirm actual field names and nesting before writing the filter. 3. Build the filter incrementally. Start from the root, add one pipe stage at a time, verifying each stage against the sample. 4. Choose output mode. Use `-r` for shell consumption, `-c` for NDJSON pipelines, default pretty-print for human reading. 5. Verify against sample input before embedding in a script. Confirm no `null`/empty surprises. 6. Deliver the final command plus a one-line explanation of each filter stage (see Output Format). ## How It Works `jq` takes a filter expression and applies it to JSON input. Filters compose with pipes (`|`), and `jq` handles arrays, objects, strings, numbers, booleans, and `null` natively. ### Basic Selection ```bash # Extract a field echo '{"name":"alice","age":30}' | jq '.name' # "alice" # Nested access echo '{"user":{"email":"a@b.com"}}' | jq '.user.email' # Array index echo '[10, 20, 30]' | jq '.[1]' # 20 # Array slice ech