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.
npx skills add ncaq/konoka --skill prefer-yqgit clone --depth 1 https://github.com/ncaq/konokaWrote 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.
[](https://agentmods.dev/skills/ncaq/konoka/prefer-yq)<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.
<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>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00065 | $0.01715 |
| Opus 5.5 | $0.00026 | $0.00686 |
| Sonnet 5.5 | $0.00013 | $0.00343 |
| Haiku 4.5 | $0.00006 | $0.00171 |
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 1mo 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へ直接パイプするのは避けてください。 How it starts
The opening of the file, as written. The whole thing — 135 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の出来ることはデータの変換にほぼ限られていて副作用が少ないため、
包括的な許可を出しやすく、
承認の手間が発生しません。
sedによる置換はYAMLの構造を理解しないため、
同じ名前のキーが別の階層にもある場合などに、
意図しない箇所まで書き換えてしまいます。
yqはパスを指定して構造として扱うのでその危険がありません。
インデントやアンカーの扱いを自前で組み立てるより、 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のように出力します。
使い方
読み取り。
yq '.services.web.image' compose.yaml
書き換え。
-iで入力ファイルを直接書き換えます。
コメントは保持されます。
yq -i '.version = "2"' compose.yaml
出力形式の変換は-oで指定します。
yq -o=json '.' compose.yaml
入力形式は既定ではautoで、
ファイルの拡張子から判別されます。
拡張子から判別できない入力を渡す時は-pで明示してください。
標準入力を渡す場合や、
.txtのように中身と一致しない拡張子のファイルを渡す場合が該当します。
判別できない入力は黙ってYAMLとして解釈されるため、
気付かないまま誤った結果を得ることがあります。
auto, yaml, kyaml, json, props, csv, tsv, xml, base64, uri, toml, hcl, lua, iniをサポートします。
yq -p=xml -o=yaml '.root.item' response.txt
出力形式も-oで明示してください。
出力形式の既定もautoですが、
こちらが見ているのは入力形式ではなく入力ファイルの拡張子で、
-pを付けても連動しません。
拡張子から判別できないままだと、
YAMLへ倒した旨の警告が出力されます。
リモートから取得したデータをcurlからyqへ直接パイプするのは避けてください。
一度ファイルへ保存して中身を確認してから処理してください。
想定と違う形式が返っていたり、
巨大なデータが返っていたりすることに気付けます。
シェルの値はフィルタへ文字列連結せずに、
環境変数を経由して渡します。
jqの--argに相当します。
version=2 yq -i '.version = strenv(version)' compose.yaml
複数のファイルやドキュメントを横断して処理する時はeval-allを使います。
yq eval-all '. as $item ireduce ({}; . * $item)' base.yaml override.yaml
jqとの違いで戸惑いやすい点
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.
- 1mo ago First seen · 135 lines · 65 tokens per session scan A 487d430c34cd
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,715 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.
Other skills, from other repositories
cloudflare-email-routing
Cloudflare Email Routing for receiving/sending emails via Workers. Use for email workers, forwarding, allowlists, or encountering Email Trigger errors, worker call failures, SPF issues.
bun-sqlite
Use for bun:sqlite, SQLite operations, prepared statements, transactions, and queries.
api-testing
HTTP API testing for TypeScript (Supertest) and Python (httpx, pytest). Test REST APIs, GraphQL, request/response validation, authentication, and error handling.
bun-http-server
Use when building HTTP servers with Bun.serve, handling requests/responses, implementing routing, creating REST APIs, or configuring fetch handlers.
bun-jest-migration
Use when migrating from Jest to Bun's test runner, import compatibility, mocks, and config.
cloudflare-workers-migration
Migrate to Cloudflare Workers from AWS Lambda, Vercel, Express, and Node.js. Use when porting existing applications to the edge, adapting serverless functions, or resolving Node.js API compatibility issues.