prefer-yq

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

A command-line usage guide for `yq`, a tool that reads and changes structured YAML, XML, TOML, and CSV files. It also explains how this version differs from another incompatible tool with the same name.

In plain words
What is it for?
Use it when reading or editing structured configuration files from the command line, especially when selecting fields by their path.
Why use it?
It avoids unsafe text substitutions that can change the wrong configuration field and reduces confusion about which `yq` syntax is installed.

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 when reading or editing structured configuration files from the command line, especially when selecting fields by their path.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ncaq/konoka/prefer-yq
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-yq
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-yq

README.md
[![agentmods](https://agentmods.dev/badge/skills/ncaq/konoka/prefer-yq/github.svg)](https://agentmods.dev/skills/ncaq/konoka/prefer-yq)
Your own site
<a href="https://agentmods.dev/skills/ncaq/konoka/prefer-yq"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/prefer-yq/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-yq

Your own site · 80×15
<a href="https://agentmods.dev/skills/ncaq/konoka/prefer-yq"><img src="https://agentmods.dev/badge/skills/ncaq/konoka/prefer-yq.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,586 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00065 $0.01586
Opus 5.5 $0.00026 $0.00634
Sonnet 5.5 $0.00013 $0.00317
Haiku 4.5 $0.00006 $0.00159

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

Security

Grade A, and why

prefer-yq scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

リモートから取得したデータは、`curl`からyqへ直接パイプせず、
plugins/programming-tasuke/skills/prefer-yq/SKILL.md · 94 lines

How it starts

The opening of the file, as written. The whole thing — 94 lines — stays where its author put it; the contents beside it link to each section on GitHub.

YAMLなどの処理にはyqを優先する

YAMLやXMLやTOMLやCSVといった構造化データを読み取ったり変換したりする用事には、yqを使ってください。 Pythonなどの汎用スクリプト言語や、sedによる場当たり的なテキスト置換は持ち出しません。

JSONにはyqではなくjqを使います。 yqでもJSONは扱えますが、形式ごとに道具を使い分けた方が読み手に意図が伝わるためです。 programming-tasuke:prefer-jqスキルを参照してください。

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

sedによる置換はYAMLの構造を理解しないので、 同じ名前のキーが別の階層にもある場合などに、意図しない箇所まで書き換えてしまいます。 yqはパスを指定して構造として扱うので、その危険がありません。

実装の区別

yqという名前のコマンドには、互換性のない2つの実装があります。

  • mikefarah/yq: Go製の単体バイナリで、nixpkgsではyq-goです。このスキルはこちらを前提にします。
  • kislyuk/yq: Python製のjqラッパーで、nixpkgsではyqです。フィルタの構文はjqと同一です。

書いたフィルタが構文エラーになったときは、実装の違いを疑ってyq --versionで判別してください。 mikefarah版はyq (https://github.com/mikefarah/yq/) version v4.53.2のように出力します。

入力形式と出力形式

入力形式の既定はautoで、ファイルの拡張子から判別されます。 判別できない入力は黙ってYAMLとして解釈されるので、気付かないまま誤った結果を得ることがあります。 標準入力や、.txtのように中身と一致しない拡張子のファイルを渡すときは、-pで入力形式を明示してください。 -pはauto, yaml, kyaml, json, props, csv, tsv, xml, base64, uri, toml, hcl, lua, iniをサポートします。

出力形式の既定もautoですが、入力形式ではなく入力ファイルの拡張子から決まり、 判別できなければYAMLになります。 JSONが欲しいときは-o=jsonを付けます。

-pを付けても出力形式は連動しないので、-pを付けるときは-oで出力形式も明示してください。 -oを省くと出力はYAMLになり、入力がファイルならYAMLへ倒した旨の警告も出ます。

yq -p=xml -o=yaml '.root.item' response.txt

リモートから取得したデータは、curlからyqへ直接パイプせず、 一度ファイルへ保存して中身を確認してから処理してください。 想定と違う形式や巨大なデータが返っていることに気付けるためです。

jqとの違いで戸惑いやすい点

  • シェルの値は、フィルタへ文字列として連結せずに環境変数を経由して渡します。 jqの--argの代わりに、env(NAME)かstrenv(NAME)で参照します。
  • スカラーの展開は出力形式によって変わります。 YAML出力では既定でクォートなしに展開されますが、-o=jsonでは"a"のようにクォートが付きます。 生の値が欲しいときは、--unwrapScalarの短縮形である-rを明示してください。
  • -sはjqのslurpではなく--split-expで、式の評価結果を名前にしたファイルを生成します。 入力をまとめたいときはeval-allや[...]を使います。
  • 複数のファイルやドキュメントを横断して処理するときはeval-allを使います。
version=2 yq -i '.version = strenv(version)' compose.yaml

yq eval-all '. as $item ireduce ({}; . * $item)' base.yaml override.yaml

Read the full file on GitHub · 94 lines

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 · -41 lines f3cdba97e21d
  2. 2mo ago First seen · 135 lines · 65 tokens per session scan A 487d430c34cd

Subscribe to this mod's changes

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

Related

prefer-yq compared with skills from other repositories

prefer-yq next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prefer-yqncaq/konokaSkill3yesterdayApache-2.0A65Claude 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