cli-productivity-1-jq-json-processing

Sub-skill of cli-productivity: 1. jq - JSON Processing (+1).

5 stars

Best use case

cli-productivity-1-jq-json-processing is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Sub-skill of cli-productivity: 1. jq - JSON Processing (+1).

Teams using cli-productivity-1-jq-json-processing should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/1-jq-json-processing/SKILL.md --create-dirs "https://raw.githubusercontent.com/vamseeachanta/workspace-hub/main/.agents/skills/_archive/operations/devtools/cli-productivity/1-jq-json-processing/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/1-jq-json-processing/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How cli-productivity-1-jq-json-processing Compares

Feature / Agentcli-productivity-1-jq-json-processingStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Sub-skill of cli-productivity: 1. jq - JSON Processing (+1).

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 1. jq - JSON Processing (+1)

## 1. jq - JSON Processing


**Basic Operations:**
```bash
# Pretty print JSON
echo '{"name":"John","age":30}' | jq '.'

# Extract field
curl -s https://api.github.com/repos/nodejs/node | jq '.stargazers_count'

# Filter arrays
echo '[1,2,3,4,5]' | jq '.[] | select(. > 2)'

# Transform data
echo '{"first":"John","last":"Doe"}' | jq '{fullName: (.first + " " + .last)}'
```

**Common jq Patterns:**
```bash
# Extract multiple fields
jq '{name: .name, stars: .stargazers_count}'

# Array operations
jq '.items | length'                    # Count items
jq '.items | first'                     # First item
jq '.items | last'                      # Last item
jq '.items[0:5]'                        # Slice first 5

# Filtering
jq '.[] | select(.status == "active")'
jq '.[] | select(.count > 100)'
jq '.[] | select(.name | contains("test"))'

# Sorting
jq 'sort_by(.date)'
jq 'sort_by(.date) | reverse'

# Grouping
jq 'group_by(.category)'
jq 'group_by(.category) | map({key: .[0].category, count: length})'

# Mapping
jq '.[] | {id, name}'
jq 'map({id: .id, upper_name: (.name | ascii_upcase)})'
```

**Shell Functions for jq:**
```bash
# Pretty print JSON file
jqp() {
    jq '.' "$1" | bat --language json
}

# Extract field from JSON file
jqf() {
    local file="$1"
    local field="$2"
    jq -r ".$field" "$file"
}

# Count items in JSON array
jqcount() {
    jq 'if type == "array" then length else 1 end' "$1"
}

# Filter JSON by field value
jqfilter() {
    local file="$1"
    local field="$2"
    local value="$3"
    jq --arg val "$value" ".[] | select(.$field == \$val)" "$file"
}
```


## 2. fzf - Fuzzy Finder


**Basic Usage:**
```bash
# Find and edit file
vim $(fzf)

# Find with preview
fzf --preview 'bat --color=always {}'

# Multi-select
fzf --multi

# Filter with query
echo -e "apple\nbanana\norange" | fzf --query "an"
```

**fzf Configuration:**
```bash
# Add to ~/.bashrc or ~/.zshrc

# Default options
export FZF_DEFAULT_OPTS='
    --height 40%
    --layout=reverse
    --border
    --preview-window=right:50%:wrap
    --bind=ctrl-d:preview-page-down
    --bind=ctrl-u:preview-page-up
'

# Use fd for faster file finding
export FZF_DEFAULT_COMMAND='fd --type f --hidden --follow --exclude .git'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_ALT_C_COMMAND='fd --type d --hidden --follow --exclude .git'

# Preview settings
export FZF_CTRL_T_OPTS='--preview "bat --color=always --style=numbers --line-range=:500 {}"'
export FZF_ALT_C_OPTS='--preview "exa --tree --level=2 --color=always {}"'
```

**Powerful fzf Functions:**
```bash
# Fuzzy edit file
fe() {
    local file
    file=$(fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}')
    [[ -n "$file" ]] && ${EDITOR:-vim} "$file"
}

# Fuzzy cd into directory
fcd() {
    local dir
    dir=$(fd --type d --hidden --follow --exclude .git | fzf --preview 'exa --tree --level=2 --color=always {}')
    [[ -n "$dir" ]] && cd "$dir"
}

# Fuzzy kill process
fkill() {
    local pid
    pid=$(ps aux | sed 1d | fzf --multi | awk '{print $2}')
    [[ -n "$pid" ]] && echo "$pid" | xargs kill -9
}

# Fuzzy git checkout branch
fco() {
    local branch
    branch=$(git branch -a --color=always | grep -v '/HEAD' | fzf --ansi | sed 's/^[* ]*//' | sed 's#remotes/origin/##')
    [[ -n "$branch" ]] && git checkout "$branch"
}

# Fuzzy git log
flog() {
    git log --oneline --color=always | fzf --ansi --preview 'git show --color=always {1}' | awk '{print $1}'
}

# Fuzzy history search
fh() {
    local cmd
    cmd=$(history | fzf --tac | sed 's/^[ ]*[0-9]*[ ]*//')
    [[ -n "$cmd" ]] && eval "$cmd"
}

# Fuzzy environment variable
fenv() {
    local var
    var=$(env | fzf | cut -d= -f1)
    [[ -n "$var" ]] && echo "${!var}"
}

# Fuzzy docker container
fdocker() {
    local container
    container=$(docker ps --format '{{.Names}}\t{{.Image}}\t{{.Status}}' | fzf | awk '{print $1}')
    [[ -n "$container" ]] && docker exec -it "$container" sh
}
```

Related Skills

orcaflex-post-processing

5
from vamseeachanta/workspace-hub

Post-process OrcaFlex simulation results using OPP (OrcaFlex Post-Process). Use for extracting summary statistics, linked statistics, range graphs, time series, histograms, and generating interactive HTML reports from .sim files.

weekly-gtm-productivity-steering

5
from vamseeachanta/workspace-hub

Turn interactive weekly GTM priorities into agent-executable packets and run productivity-flow reviews that reduce owner orchestration time.

json-config-loader-6-yaml-configuration-via-yq

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 6. YAML Configuration (via yq).

json-config-loader-5-environment-variable-configuration

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 5. Environment Variable Configuration.

json-config-loader-4-multi-section-ini-parsing

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 4. Multi-Section INI Parsing.

json-config-loader-3-json-report-generation

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 3. JSON Report Generation.

json-config-loader-1-keyvalue-configuration-parsing

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 1. Key=Value Configuration Parsing (+1).

json-config-loader-1-always-provide-defaults

5
from vamseeachanta/workspace-hub

Sub-skill of json-config-loader: 1. Always Provide Defaults (+4).

cli-productivity-8-shell-aliases-and-functions

5
from vamseeachanta/workspace-hub

Sub-skill of cli-productivity: 8. Shell Aliases and Functions.

cli-productivity-3-ripgrep-rg-fast-search

5
from vamseeachanta/workspace-hub

Sub-skill of cli-productivity: 3. ripgrep (rg) - Fast Search (+1).

cli-productivity-3-interactive-script-template

5
from vamseeachanta/workspace-hub

Sub-skill of cli-productivity: 3. Interactive Script Template.

cli-productivity-1-tool-selection-guidelines

5
from vamseeachanta/workspace-hub

Sub-skill of cli-productivity: 1. Tool Selection Guidelines (+2).