jq

Solid

Trigger on: jq, jq filter, jq query, process JSON, filter JSON, transform JSON, extract from JSON, parse API response JSON, NDJSON, pretty-print JSON, jq select, group_by JSON, update JSON file with jq. Specialized procedure for complex JSON processing with the jq CLI. Prefer over ad-hoc Python/Node one-offs for extract, filter, format, aggregate, or in-place JSON transforms. Do not use for binary files, CSV/XML conversion, or general scripting unrelated to JSON.

Data & Documents 1 stars 0 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 78/100

Stars 20%
10
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# jq — JSON processing with the jq CLI ## When to use - User wants to extract, filter, transform, aggregate, or pretty-print JSON with `jq` - Input is JSON / JSON array / NDJSON (newline-delimited JSON), API payloads, logs, configs - Prefer this over writing a throwaway Python/Node script for the same JSON job Do **not** use when: - File is binary, CSV, XML, YAML-only (unless already converted to JSON) - Task is general bash/Python scripting with no JSON core - User only needs to open/edit JSON in an editor (no filter) ## Prerequisites ```bash command -v jq >/dev/null || { echo "jq not installed"; exit 1; } jq --version # expect 1.6+ ``` If missing: tell the user to install (`brew install jq` / `apt install jq`) and STOP. ## Procedure Work phases in order. Do not skip. Prefer pure `jq` over `python`/`node` for JSON work. ### Phase 1 — Structure analysis 1. Identify inputs: path(s), stdin, or API response the user provided. 2. Peek schema before complex filters: - Small file: `jq 'type, (if type=="array" then length else keys end)' <file>` - Huge / unknown: `jq -c 'limit(1; .)' <file>` or first NDJSON line via `head -n 1` - Validate: `jq empty <file>` — non-zero exit → report parse error and STOP 3. Note shape: object vs array vs NDJSON stream; nested keys needed; size class (<10MB / large). 4. **Completion:** input path(s) known, type known, filter target keys identified (or error reported). ### Phase 2 — Filter construction Design filter with explicit...

Details

Author
tkolleh
Repository
tkolleh/skills
Created
3 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category