define-localization-key
Use when extracting dialogue/UI text into structured localization keys (module.context.identifier pattern) to prevent hard-coded strings.
SKILL.mdskills/game_dev/user/define-localization-key/SKILL.md
GitHubdefine-localization-key
1. Template Binding
- Output:
{TARGET_FOLDER}/docs/localization_keys.md - Logic: Transform raw text sources into structured, language-independent key table; requires dialogue scripts and UI content.
2. Core Pattern: Extract → Keyify → Validate
Strict data extraction and transformation pipeline.
| Phase | Focus | Action |
|---|---|---|
| Extraction | Collect visible text from dialogues, UI, narration, errors | Raw string inventory |
| Key Generation | Create keys using module.context.identifier pattern (e.g., ui.main_menu.play) |
Structured key table |
| Validation | Check uniqueness, write categorized tables | Finalized localization_keys.md |
CRITICAL: Interview the user BEFORE generating any spec via question tool.
Mandatory Interview Steps (SEQUENTIAL — ONE AT A TIME)
RULE: Ask ONE question group per turn. Wait for answer before proceeding.
- Ask about module/context structure via
question→ STOP - Ask about key naming convention confirmation via
question→ STOP - Present key sample for verification via
question→ STOP - Generate
localization_keys.md
3. When to Use
- Scope: Extracting dialogue/UI text into structured keys, preparing for multi-language support, or building i18n key tables from raw content sources. Use
bootstrap-game-projectfor refining existinglocalization_keys.md; usebuilder/implement-localizationfor implementing the i18n system itself.
4. Interaction Protocol
Every step MUST use the question tool. Present concrete key samples, not abstract descriptions. One question per turn.
Intercepts:
- [Context Gap Intercept]: Text without module/context → "I've noted the text. To ensure correct key naming (module.context.identifier), please specify the module and context (e.g., UI/Main Menu)."
5. Quality Gates
- Semantic Keys: All keys use semantic naming only, independent of language.
- Standard Naming: Consistent
module.context.idpattern throughout unless explicitly overridden. - Complete Key Coverage: All visible text captured as localization key references with no raw strings remaining in output spec.
- One Question Per Turn: Single question at a time — wait for user answer before proceeding.
6. Execution Command
Command: /define-localization-key