prefer-jq

prefer-jq is a skill for Claude Code from ncaq/konoka. It costs 58 tokens per session (923 once invoked), scanned A, original, Apache-2.0.

A rule to use jq, a command-line tool for reading and transforming JSON data, instead of general-purpose scripting languages for simple JSON tasks.

In plain words
What is it for?
Use it to extract values, filter records, transform JSON, and calculate simple summaries from JSON input.
Why use it?
It keeps small data operations shorter and more limited in scope, reducing review and approval effort for shell commands.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the programming-tasuke plugin — 10 skills shipped together

Good fit Use it to extract values, filter records, transform JSON, and calculate simple summaries from JSON input.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/prefer-jq
View source ↗ ncaq/konoka
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ncaq/konoka --skill prefer-jq
Clone the repo
git clone --depth 1 https://github.com/ncaq/konoka

Made for: Claude Code.

Or install programming-tasuke, the plugin that ships this one along with the rest of its 10 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prefer-jq

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/prefer-jq/github.svg)](https://agentmods.dev/skills/ncaq/konoka/prefer-jq)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/prefer-jq"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/prefer-jq/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prefer-jq

Your own site · 80×15
<a href="https://agentmods.dev/skills/ncaq/konoka/prefer-jq"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/prefer-jq.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 58 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 923 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00058 $0.00923
Opus 5.5 $0.00023 $0.00369
Sonnet 5.5 $0.00012 $0.00185
Haiku 4.5 $0.00006 $0.00092

Measured 5d ago against content hash 092fbd2b9ac5, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

prefer-jq scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/programming-tasuke/skills/prefer-jq/SKILL.md · 65 lines

What it actually says

JSONの処理にはjqを優先する

JSONを読み取る、絞り込む、変換するだけの用事にはjqを使ってください。 Pythonなどの汎用スクリプト言語は持ち出しません。 node -eやruby -eやperl -eのような、Python以外の汎用言語のワンライナーも同じです。

# 避ける
python3 -c 'import json,sys; d=json.load(sys.stdin); print("\n".join(x["name"] for x in d["items"] if x["active"]))'
# 使う
jq -r '.items[] | select(.active) | .name'

汎用スクリプト言語は何でも出来てしまうので、 コマンドの実行を承認する人間は、毎回スクリプトの中身を読んで安全性を判断することになります。 Bash(python:*)のような包括的な許可を出すのも危険です。 jqに出来ることはデータの変換にほぼ限られていて副作用が少ないので、 包括的な許可を出しやすく、承認の手間が発生しません。

汎用スクリプト言語のワンライナーは、シェルのクォートとスクリプト側のクォートが干渉して壊れやすく、 リトライを繰り返す原因にもなります。 JSONを取り出したり整形したりするだけなら、jqの方が短く書けて読みやすいという利点もあります。

オプション

シェルの値は--arg name valueか--argjson name jsonでフィルタへ渡します。 フィルタの文字列へ連結してJSONを組み立てると、クォートやエスケープが壊れるためです。

# 避ける
jq ".name = \"$name\"" data.json
# 使う
jq --arg name "$name" '.name = $name' data.json

条件判定には-eが使えます。 終了ステータスは、最後の出力がfalseかnullなら1に、出力が一つも無ければ4になります。

ファイルの書き換え

リポジトリ内のファイルを書き換えるときはEditツールを優先してください。 差分が読みやすく、意図しない整形の変化も起きないためです。

jqは読み取りと抽出とパイプでの加工に使います。 jqは入力ファイルを直接書き換えないので、別のファイルへ書き出してから置き換える必要があります。 その手間に見合うのは、機械が生成した巨大なJSONを一括変換するような場合だけです。

例外

以下の場合はPythonなどを使って構いません。 その場合でも、JSONを抽出する部分だけをjqへ切り出せるなら切り出してください。

  • HTTP通信やファイルシステムの操作など、JSONの変換以外の副作用が処理の本体である場合。
  • 統計処理や複雑な日時計算など、jqの標準機能では表現が極端に複雑になる場合。
  • 既存のPythonプロジェクトの一部としてコードを書く場合。
  • 実行環境にjqが入っていない場合。

YAMLやXMLやTOMLやCSVについてはprogramming-tasuke:prefer-yqスキルを参照してください。

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago Changed · -40 lines 092fbd2b9ac5
  2. 2mo ago First seen · 105 lines · 58 tokens per session scan A 5cd6595b2dac

Subscribe to this mod's changes

prefer-jq is a skill published in the GitHub repository ncaq/konoka (3 stars, last pushed yesterday), licensed Apache-2.0. It adds 58 tokens to every session and 923 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-05.

Related

prefer-jq compared with skills from other repositories

prefer-jq next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prefer-jqncaq/konokaSkill3yesterdayApache-2.0A58Claude Code
github-project-automationsecondsky/claude-skillsSkill2573d agoMITA45Claude Code
hono-routingsecondsky/claude-skillsSkill2573d agoMITA41Claude Code
api-testingsecondsky/claude-skillsSkill2573d agoMITA39Claude Code
bun-http-serversecondsky/claude-skillsSkill2573d agoMITA31Claude Code
bun-jest-migrationsecondsky/claude-skillsSkill2573d agoMITA25Claude Code
cloudflare-workers-migrationsecondsky/claude-skillsSkill2573d agoMITA49Claude Code