agentleFS
aniq-ui-proaniq-ui-pro/agent-skills/skills/i18n-keys-check/SKILL.md

i18n-keys-check

Skill1 starsChanged 2 days agoMITView on GitHub

Checks the next-intl message files of a Next.js App Router app against each other and against the code. Reports keys the code uses that no file has, keys missing from one locale, placeholders and rich-text tags that differ between locales, invalid ICU messages, plural forms a language needs, and text copied from the base locale without translation. Use after adding or changing user-facing text, after adding a locale, and before a commit or release.

The file

We split this skill into the rules it gives an agent

8 rules. About 0 are common, 4 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Check: the header names the messages folder, the layout (merge when every file is merged at the root, folder when each file sits under its …

    line 17
  2. Distinctive:

    Create each missing file with the base file's keys, translated.

    line 24
  3. Distinctive:

    Check: run again; sections 1, 3 and 4 show 0.

    line 28
  4. Very specific:

    Every locale uses the base's argument names ({count}, {name}), the same argument types ({count, plural, ...} stays a plural) and the same …

    line 40
  5. Distinctive:

    Check: section 5 shows 0, or each line left is a sentence you read and kept on purpose.

    line 45
  6. Distinctive:

    Check: every line left in section 8 is one you kept on purpose.

    line 68
  7. Very specific:

    Run with --show-dynamic. For each call such as t(item.labelKey) or t(status.${s}), open the constant or type that feeds it and confirm …

    line 72
  8. Very specific:

    Check: the last run ends with 0 errors and exits with code 0.

    line 76

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

i18n keys check

The script reads the message JSON and the source files and changes nothing. Node 20+, no dependencies. It finds messages/ or src/messages/ by itself, and reads the locales from defineRouting({ locales }) or export const locales = [...].

1. Run it from the app folder

node ${CLAUDE_SKILL_DIR}/scripts/check-i18n.mjs

Check: the header names the messages folder, the layout (merge when every file is merged at the root, folder when each file sits under its folder path) and every locale the app routes to, base locale first. If any of that is wrong, pass --messages <dir>, --locales en,fr,es,ar, --base en or --layout merge|folder and run again before reading on.

2. Add missing files and keys (sections 1, 3 and 4)

Create each missing file with the base file's keys, translated. Add each key a locale lacks, with a real translation, never a copy of the base text. A key that exists only outside the base locale was usually renamed or deleted in the base: rename or delete it in every locale.

Check: run again; sections 1, 3 and 4 show 0.

3. Fix keys the code uses but no file has (section 2)

Open each file:line. Either the call has a typo (fix the call) or the text was never added (add the key to every locale in the same change). "points to a group of keys" means the call reads an object: call a key inside it, or use t.raw.

Check: section 2 shows 0.

4. Make placeholders and tags match (section 5)

Every locale uses the base's argument names ({count}, {name}), the same argument types ({count, plural, ...} stays a plural) and the same rich-text tags (<link>). Translate the words, never the argument names. A different sentence shape can be right when it reads well for every value: read it, then decide.

Check: section 5 shows 0, or each line left is a sentence you read and kept on purpose.

5. Fix invalid messages (section 6)

Close every {, give every plural and select an other branch, and replace dots inside JSON keys with nesting.

Check: section 6 shows 0.

6. Give plurals the forms the language uses (section 7)

The script asks Intl.PluralRules which forms each locale uses for 0 to 1000 and names the numbers that would fall back to other. Arabic uses one, two, few (3 to 10), many (11 to 99) and other (100 and up). Write each one. A zero form for 0 alone is optional.

Check: section 7 shows 0.

7. Translate copies (section 8)

Each line is a value of two or more words identical to the base locale. Translate it unless it is a brand or product name, a code, or a sample meant to stay in that language. Run once with --show-single to review single words too.

Check: every line left in section 8 is one you kept on purpose.

8. Read the dynamic keys

Run with --show-dynamic. For each call such as t(item.labelKey) or t(`status.${s}`), open the constant or type that feeds it and confirm every key it can hold exists in every locale.

Check: the last run ends with 0 errors and exits with code 0. In CI, --strict also fails on warnings and --json prints the whole report.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.