npx skills add ...
npx skills add sanity-io/plugins --skill i18n-array-groq-query-migration
npx skills add sanity-io/plugins --skill i18n-array-groq-query-migration
Detect and update legacy GROQ patterns where language is read from _key for sanity-plugin-internationalized-array when users mention v4 to v5 migration, or @sanity/document-internationalization from v5 to v6. GROQ query updates, localized arrays, or patterns like `_key == "en"` and `_key == $language`.
Help users find GROQ queries that still read locale from _key and rewrite them safely for v5.
Use this skill when a user asks to:
sanity-plugin-internationalized-array from v4 to v5@sanity/document-internationalization from v5 to v6 alongside sanity-plugin-internationalized-array language field changes_key for language lookup_key == "en" or _key == $languageDetection commands below use grep. If your environment differs, use your editor's global search with equivalent patterns.
_key:_key:field[_key == ...][0].valueselect(...) branches that compare _key to a language valueCheck for uses of groq and verify if they use _key as the language, if it is using it, update them.
Explicitly check for template-interpolated language expressions and keep the same operand, for example:
_key == "${language}"_key == "${locale}"Review each match to avoid false positives where _key is used for unrelated array item identity.
Use the same language operand from the original query. The language operand can be a string literal (for example "en"), a variable (for example $language), or a template-interpolated expression (for example "${language}").
_key == <languageExpr> -> language == <languageExpr> || _key == <languageExpr>language == <languageExpr> || _key == <languageExpr> -> language == <languageExpr>Legacy:
Backwards compatible:
Post-migration final form:
When reporting findings to a user:
_key as language source.backwards-compatible (pre-migration), orfinal (post-migration complete).runtime, docs/example, or ambiguous._key usage that needs manual review.*[_type == "person"]{
"greeting": greeting[language == $language || _key == $language][0].value
}*[_type == "person"]{
"greeting": greeting[language == $language][0].value
}