Find Used-But-Undefined Translation Keys
find_undefined_keysFind translation keys referenced in source code but defined in no consumed locale file to prevent raw keys from shipping to production.
Instructions
The inverse of find_orphan_keys: find keys referenced in source code but defined in NO locale file of the using app's consumed layers — the direction that ships raw keys to production. Scope-aware: each scan unit (app) is checked against the layers it consumes (summary.searchedLayersByApp); a key defined only in a layer the using app does not consume is still undefined for that app. Known limitation: extraction is line-based and static — dynamically built keys (template literals, concatenation) cannot be verified and are reported as uncertainKeys, never as hard findings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| locale | No | Reference locale to resolve key definitions in (e.g., "en", "en-US"). Defaults to the project default locale. | |
| scanDirs | No | Absolute paths to directories to scan for source code usage. Overrides scope-aware scanning: every layer counts as resolvable from these dirs. Example: ["/home/user/my-app/apps/admin"]. | |
| outputFile | No | Absolute path to write full JSON output. Returns only a compact summary to the caller — use this for large outputs to avoid flooding the conversation context. Example: "/tmp/undefined-keys.json" | |
| projectDir | No | Absolute path to the Nuxt project root. Defaults to I18N_PROJECT_DIR, then server cwd. Example: "/home/user/my-app". | |
| excludeDirs | No | Directory names to skip when scanning source files. Example: ["storybook", "__tests__", "node_modules"]. |