croql について
自然言語の絞り込み要件を、有効な Crowdin CroQL 式に変換するスキルです。ソース文字列、翻訳、翻訳メモリ、用語集に対応し、フィールドや言語範囲、構文を確認して、曖昧な場合は別案も示します。
主な機能
- 01絞り込み要件を CroQL に変換
- 02複数の Crowdin データ文脈に対応
- 03論理条件とネストした条件の構成
- 04フィールドと対象言語の確認
- 05クエリ例と代替案の提示
活用シーン
- 01特定言語の翻訳を絞り込む
- 02未翻訳または未承認の文字列を探す
- 03用語集の状態や翻訳メモリを検索する
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ crowdin/ skills --skill croqlインストール後、Claude Code で/croqlを入力して読み込まれたか確認します。
同梱ファイルevals/evals.json
詳細
CroQL スキル
このスキルを使用して、自然言語によるフィルタリングの目的を有効な Crowdin CroQL 式に変換します。
完全なドキュメント
出力する内容
CroQL のサポートでは、次の内容を返します。
- 主な CroQL 式。
- その式がリクエストに一致する理由の簡単な説明。
- リクエストが曖昧な場合は、より厳密または広範な別の式を 1 つ。
クイックワークフロー
- データのコンテキストを特定します。
- ソース文字列
- 言語翻訳
- TM セグメント
- 用語集の用語
- ユーザーの意図を CroQL のフィールドと演算子に対応付けます。
- 小さな句でクエリを組み立て、
and/orで結合します。 - 起こりやすい問題を検証します(誤ったコンテキストのフィールド、言語スコープの欠落、クエリの未エンコード)。
- 最終的なクエリと、そのまま実行できるエンドポイントの例を提示します。
基本構文のチートシート
- 比較:
=、!=、>、>=、<、<=、between ... and ...、contains - 論理:
and、or、xor、not - コレクションのフィルタリング:
collection where (predicate) - カウント:
count of translations、count of comments where (...) - オブジェクトメンバーへのアクセス:
id of file、count of votes - メンション:
- ユーザー:
@user:"username" - 言語:
@language:"uk"
- ユーザー:
コンテキストに応じたクエリパターン
適切なコンテキストに属するフィールドを選択します。よくある失敗の原因は、別のコンテキストのフィールドを使用することです。
1) ソース文字列のコンテキスト
一般的なフィールド:
text、identifier、contextis hidden、is duplicatecount of translations、count of comments、count of screenshotscount of languages summary where (...)id of file、added、updated- Enterprise フィールドのフィルター:
count of fields where (name = "Priority" and value = "High") > 0
例:
- 翻訳がある、非重複の非表示項目:
is hidden and not is duplicate and count of translations > 0
- ソースには
ABCが含まれるが、翻訳には含まれない:text contains "ABC" and count of translations where (text contains "ABC") = 0
- いずれかの言語で少なくとも 1 件の承認がある:
count of languages summary where (approvalsCount >= 1) > 0
2) 翻訳のコンテキスト
一般的なフィールド:
text、plural form、is pre translated、provider、user、updated- ネストされたフィールド:
count of votes where (is up)、count of approvals where (...)
例:
- 特定のユーザーによる翻訳、または高評価の翻訳:
user = @user:"crowdin" or count of votes where (is up) >= 100
3) TM セグメントのコンテキスト
一般的な構造はレコードベースです。
count of records where (usageCount > 0) > 0count of records where (createdBy = @user:"crowdin") > 0
4) 用語集の用語のコンテキスト
一般的なフィールド:
text、description、language、user、partOfSpeech、status、type、gendernote、lemma、url、createdAt、updatedAt
例:
- 非推奨、または推奨されない用語:
status = "not_recommended" or status = "obsolete"
- 英語の原形:
lemma = "cancel" and language = @language:"en"
エディターの詳細フィルター
API 呼び出しで UI フィルターを再現しようとするユーザーから、よく寄せられるリクエストです。
- 未翻訳:
count of languages summary = 0
- 翻訳済み:
count of languages summary where (is translated) > 0
- 承認済み:
count of languages summary where (is approved) > 0
- QA の問題あり:
count of languages summary where (has qa issues) > 0
- 重複のみ:
is duplicate
対象言語が重要な場合は、明示的にスコープを指定します。
count of languages summary where (language = @language:"uk" and is translated) > 0
クエリの組み立て方針
ユーザーのリクエストが不明確な場合:
- 最も厳密な解釈から始めます。
- より広範な代替クエリを 1 つ提示します。
- どの前提を変更したかを説明します(言語スコープ、承認のしきい値、期間など)。
例:
- 厳密:
count of languages summary where (language = @language:"uk" and is translated and not is approved) > 0
- より広範:
count of languages summary where (is translated and not is approved) > 0
よくある間違いを防ぐ
- ソース文字列のフィールドと、翻訳専用または用語集専用のフィールドを混在させる。
- API で Editor のフィルターを再現する際に、言語のスコープ指定を忘れる。
- リクエスト URL で生の(エンコードされていない)CroQL を使用する。
- ネストされた
where句で括弧を付け忘れる。 - 条件をグループ化せずに
orを多用する。
コメント
Markdown 対応