Index of every page on this site: llms.txt
All skills
Run it yourself

JSON processor for filtering, transforming, and manipulating JSON data in command line.

Use this Skill: https://skilld.dev/gh/jyasuu/cheat-sheet/jq

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈23 tokens for metadata: the name and description. ≈359 when used: this file.

Description uses 1.1% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈92 characters, or 1.1%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

jq — JSON Processor

Basic Operations

# Pretty-print JSON
jq '.' file.json

# Filter specific field
jq '.fieldName' file.json

# Filter array element by index
jq '.[index]' file.json

# Output all elements from arrays
jq '.[*]' file.json

# Parse from stdin
cat file.json | jq '.fieldName'

# Load JSON from URL
curl -s "http://example.com/file.json" | jq '.fieldName'

Filtering & Transformation

# Select multiple fields
jq '{field1: .field1, field2: .field2}' file.json

# Query nested data
jq '.outerField.innerField' file.json

# Filter by condition
jq 'select(.fieldName == "value")' file.json

# Modify field value
jq '.fieldName = "newValue"' file.json

# Delete a field
jq 'del(.fieldName)' file.json

Array Operations

# Count elements
jq '.arrayName | length' file.json

# Apply function to each element
jq '.arrayName[] | .fieldName' file.json

# First element
jq '.[0]' file.json

# First element's key
jq '.[0].key_name' file.json

Advanced

# Concatenate fields
jq '.field1 + " " + .field2' file.json

# Group by field
jq 'group_by(.fieldName)' file.json

# Sort by field
jq 'sort_by(.fieldName)' file.json

# Find unique values
jq 'unique' file.json

# Print keys and values
jq 'to_entries | .[] | "\(.key): \(.value)"' file.json

# Combine two JSON files
jq -s '.[0] + .[1]' file1.json file2.json

# Compact output (no whitespace)
jq -c '.' file.json

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    The skill provides standard documentation and examples for using the jq JSON processor utility. No security issues were detected.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: MEDIUM · 1 issue

Signed by skilld at d3e2684. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 10 months ago

README badge

README badge for jyasuu/cheat-sheet/jq