bnadlerjr/dotfiles/using-jq

Claude Code and agent skill by bnadlerjr/dotfiles

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

jq command-line JSON processor expertise covering basic usage and CLI tool integration patterns. Use when processing JSON output from CLI tools (jira, gh, curl), extracting fields from API responses, transforming JSON data structures, or formatting JSON for shell consumption.

Install

npx vskill@latest install bnadlerjr/dotfiles/using-jq

SKILL.md

Using jq

Expert guidance for processing JSON on the command line with jq.

Quick Start

For immediate help, identify your task type and consult the relevant reference:

Working OnReference FileKey Topics
Filter syntax, arrays, objectscore-filtersAccess, select, map, conditionals, built-ins
Jira CLI, GitHub CLI, curlcli-integrationsTool-specific JSON patterns
Shell variables, TSV, CSVoutput-formatting-r, @tsv, @csv, null handling

Core Principles

Use -e for Error Detection

Always use jq -e when checking for values — it sets exit code 1 when the result is false or null, enabling proper error handling in shell pipelines.

Use -r for Shell Consumption

Always use jq -r when the output feeds into shell variables, pipes, or further processing. Without -r, strings include surrounding quotes.

Build Filters Incrementally with Pipe

Compose complex filters by chaining simple ones with |:

bash
# Build up step by step
jq '.items' # get array
jq '.items[]' # iterate elements
jq '.items[] | .name' # extract field from each
Inject Variables with --arg

Never interpolate shell variables into jq filter strings. Use --arg and --argjson:

bash
# Correct: --arg for strings, --argjson for numbers/booleans/null
jq --arg name "$user" '.users[] | select(.name == $name)' data.json
jq --argjson id "$numeric_id" '.items[] | select(.id == $id)' data.json
# WRONG: shell interpolation — breaks on special characters, injection risk
jq ".users[] | select(.name == \"$user\")" data.json

Common Pattern Template

The canonical pipeline pattern for extracting data from a command:

bash
command_producing_json | jq -r '.path.to.field'

For multiple fields per record:

bash
command_producing_json | jq -r '.items[] | [.field1, .field2] | @tsv'

Anti-Patterns

String Interpolation in Filters
bash
# BAD — breaks on special characters, injection risk
jq ".users[] | select(.name == \"$name\")" file.json
# GOOD — safe variable injection
jq --arg name "$name" '.users[] | select(.name == $name)' file.json
Using grep/sed on JSON
bash
# BAD — fragile, breaks on formatting changes
curl -s "$url" | grep '"name"' | sed 's/.*: "//;s/".*//'
# GOOD — structural access
curl -s "$url" | jq -r '.name'
Unquoted jq Output in Shell
bash
# BAD — word splitting on values with spaces
name=$(curl -s "$url" | jq '.name') # includes quotes!
# GOOD — raw output, quoted assignment
name="$(curl -s "$url" | jq -r '.name')"
Ignoring Null Values
bash
# BAD — prints "null" as literal string
jq -r '.optional_field'
# GOOD — skip nulls or provide defaults
jq -r '.optional_field // empty'
jq -r '.optional_field // "default"'

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bnadlerjr/dotfiles/using-jq/badge)](https://verified-skill.com/skills/bnadlerjr/dotfiles/using-jq)

Something wrong with this skill or its page? Tell us.