agentsclimarketplace

Json query

Skill MauricioPerera/agent-skills-pack/skills/json-query

A curated pack of 7 practical agent-skills demonstrating real-world patterns: HTTP, GitHub CLI, ripgrep, file ops, JSON processing, encoding. Each SKILL.md validated against the v0.1 spec.

Install
npx -y skills add MauricioPerera/agent-skills-pack --skill json-query

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Applies a jq filter to a literal JSON value and writes the result to stdout. Pass the JSON as a string in the {input} arg — no file paths.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

4.9 KB, as published. Nobody here has run it

Query JSON with jq

Wraps jq — the canonical command-line JSON processor — as an agent skill.

Common patterns

GoalFilter
Pretty-print'.'
Get a single field'.field'
Get nested field'.user.profile.email'
Iterate array'.[] | .name'
Filter array'.[] | select(.active == true)'
Map / reshape'.users | map({id, email})'
Count'. | length'
Aggregate'.items | map(.amount) | add'
Pipe through chain'.data | .[].user.name'

Why jq is the agent's friend

  • Deterministic: same input + same filter always = same output.
  • Readable: jq filters are essentially a domain-specific query language.
  • Composable: pipes between jq invocations work as expected.
  • Stable: jq's behavior has been remarkably consistent for a decade+.

Output format

By default, jq output is pretty-printed with 2-space indentation. Use -c (compact) or -r (raw, no JSON quotes) for different forms — extend this skill or pipe through a second jq invocation if needed.

Errors

  • Parse error in input: jq: error: Cannot iterate over null etc. — jq diagnostic on stderr, exit 5.
  • Invalid filter syntax: jq: error: ... at compile time, exit 3.

The skill does NOT remap jq's exit codes; the agent SHOULD interpret them per jq's man page.

Migration from v1

v1 took input as a file path (jq {filter} {input}); v2 takes input as the literal JSON value piped via stdin. The change makes the skill work for the dominant agent use case — passing JSON the LLM produced or received from another skill, without needing host filesystem access (which the v2 sandbox doesn't expose anyway). If you need to query a JSON file on disk, read it with read-file first and pass the result here.

Caveats

  • The filter arg's pattern is permissive (any string up to 4KB). jq syntax includes characters like |, (, ), [, ], ., \, " — all of which the bank's single-quoting handles correctly. Hostile filter values are still potentially problematic if they contain logic like system("rm -rf /") (jq has a --exec flag, but it's NOT enabled in the default invocation). The agent SHOULD review filter strings before execution.
  • The input arg is capped at 1MB. For multi-megabyte JSON, query upstream (file → jq stream) instead of materialising the full string in the bank.
  • For non-JSON input, jq fails with a parse error.
  • For arbitrary computation beyond jq's scope (e.g., regex on field values), chain skills: this one's stdout is parseable as JSON for the next.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.