skills/mobile/localize-ios/SKILL.md
Localizes UIKit Views and ViewControllers and SwiftUI Views. Extracts hardcoded text, generates camelCase keys, replaces literals with String(localized:) or LocalizedStringKey, and creates or updates Localizable.xcstrings. Use when: (1) localizing a UIKit or SwiftUI file, (2) extracting hardcoded strings from Swift, (3) adding xcstrings entries. Triggers on: localize, extract strings, add localization, make localizable, xcstrings, localize this view, localize this file. NOT for general Swift tasks unrelated to localization.
npx skillsauth add ravnhq/ai-toolkit localize-iosInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Localize UIKit Views and ViewControllers and SwiftUI Views: extract hardcoded strings, generate consistent keys, replace literals with the correct Swift API, and create or update the .xcstrings String Catalog.
String Catalogs (.xcstrings, Xcode 15+) are the Apple-recommended localization format. This skill guides extraction of hardcoded strings, generation of camelCase keys, and replacement with typed APIs (String(localized:) or xcstrings-tool's .localizable(...)).
See rules index for detailed patterns covering:
.strings filesThis step is a hard gate. Do not read the target file, extract strings, propose keys, or take any other action until this step reaches a terminal outcome. The workflow does not advance until one of the two outcomes below is confirmed.
Search for xcstrings-tool in Package.swift and for XCStringsToolPlugin in project.pbxproj.
Outcome A — Already installed: note it and move to step 2.
Outcome B — Not installed: inform the user it is not present, explain the benefit (compile-time key safety), and ask: "Would you like to install xcstrings-tool before continuing, or proceed without it?" Then stop and wait.
String(localized:) will be used throughout, then move to step 2.references/xcstrings-tool.md → Installation, ask them to build (Cmd+B), then verify XCStringsToolPlugin appears in project.pbxproj. If not found, inform the user the plugin is still missing and do not advance. Only move to step 2 once confirmed present.Read the Swift file the user points to. Classify it as one of:
title, message, buttonLabel) consumed by a viewvar title: String switch, a date formatter returning display text)The classification affects the replacement API (see step 6) but all three types can contain strings that need localization.
Find all raw string literals that represent user-visible text. For ViewModel and helper files, apply the data-flow heuristic in references/key-naming.md → User-Facing Strings in ViewModels and Helper Classes to determine whether each string reaches the UI. See the full exclusion list there as well.
Present all candidates to the user before making changes.
Use camelCase — featureNameComponentNameDescription. Derive the prefix from the file name or feature folder.
| Source string | Proposed key |
|---|---|
| "Screen title" | featureTitle |
| "Always ask" | featureAlwaysAskToggleLabel |
| "Done" | featureDoneButtonLabel |
| "No results" | featureEmptyStateMessage |
See references/key-naming.md for naming rules and conflict resolution. Present the full key list to the user and confirm before making any changes. Accept corrections.
See references/xcstrings-format.md for exact JSON structure.
Search the project for all *.xcstrings files.
Creating Localizable.xcstrings — locate the Resources folder in the main target. Identify it by the presence of any of: *.xcassets directories, .mp4 files, .json files, or other static resource files. Inside Resources, create a Localization/ subfolder and write Localizable.xcstrings there using the base structure from references/xcstrings-format.md:
Resources/
└── Localization/
└── Localizable.xcstrings
Then immediately register it in project.pbxproj by running the bundled script:
swift sh .claude/skills/localize-ios/scripts/add_to_xcodeproj.swift \
"path/to/App.xcodeproj" \
"path/to/Resources/Localization/Localizable.xcstrings" \
--group Localization
The script will:
productType = "com.apple.product-type.application")Localization PBXGroup if it doesn't exist, nested under the parent Resources grouppath = Localizable.xcstrings (the group's path handles the directory)PBXResourcesBuildPhaseVerify the script output confirms the target name, file reference UUID, and build file UUID.
Unless the user explicitly requests otherwise, the .xcstrings file must always belong to the main app target. Use --target "TargetName" to override if needed.
Add each new key as an entry under "strings" with:
"extractionState": "manual""comment" describing context for translators"state": "new"Check for existing translations. Search project.pbxproj for the knownRegions array to detect all languages configured in the project. Do not rely on inspecting the .xcstrings file itself. For each language code found in knownRegions other than en and Base:
"localizations" entry for that language on every new key"state": "translated""state": "needs_review" and add a note in the reportApply API selection in this order:
.localizable(...)) everywhere in the target.String(localized:).XCStringsToolPlugin → use String(localized:, table:).See references/xcstrings-tool.md → Usage by Context for code patterns covering UIKit, SwiftUI, and switch statements.
After all changes, output:
.xcstrings fileUser: "Localize ProfileViewController.swift"
Expected behavior: Read the file, extract all hardcoded user-facing strings, propose camelCase keys, confirm with the user, replace strings with String(localized:), and create/update Localizable.xcstrings.
User: "Fix the layout bug in ProfileViewController where the button is clipped."
Expected behavior: Do not use this skill. Investigate and fix the layout issue directly without invoking the localization workflow.
String(localized: "key") or .localizable(.key) one by one.Localizable.xcstrings file exists in the project.Resources/Localization/Localizable.xcstrings using the base structure from references/xcstrings-format.md, then run scripts/add_to_xcodeproj.swift (via swift sh) to register it in project.pbxproj. Both steps are required — the file must exist on disk AND be referenced in the project.Localizable.xcstrings exists on disk but does not appear in Xcode's project navigator and is not bundled.project.pbxproj was not updated.scripts/add_to_xcodeproj.swift (via swift sh) with the correct .xcodeproj path and file path. Confirm the script output shows the target and group where the file was added, then reopen the project in Xcode..xcstrings, .localizable(...) properties are not available.Localizable.xcstrings is registered in project.pbxproj but xcstrings-tool does not generate typed accessors, or the strings are not found at runtime.PBXResourcesBuildPhase instead of the main app target's.add_to_xcodeproj.swift script automatically finds the main app target by productType = .application. If you need a specific target, use --target "TargetName". For manual fixes, move the build file entry from the extension target's PBXResourcesBuildPhase to the main app target's phase.scripts/add_to_xcodeproj.swift created the Localization PBXGroup but nested it under the wrong parent group (e.g. UI instead of Resources). Xcode resolves the file path by walking the group chain, so the wrong parent causes the resolved path to differ from the actual disk path.project.pbxproj that the Localization group appears in the children array of the Resources group (not any other group). If it is under the wrong parent, remove the entry from the wrong group's children array and add it to the Resources group's children array..xcstrings with a different source string.featureConfirmButtonLabel instead of featureLabel.testing
Transform user requests into detailed, precise prompts for AI models. Use when users say 'promptify', 'promptify this', 'rewrite this prompt', 'make this prompt better/more specific', or explicitly request prompt engineering or improvement of their request for better AI responses.
tools
Manage AI skills from the Ravn AI Toolkit via corvus CLI — install, update, remove, search, and configure skills for any project. Use when: (1) Installing AI skills into a project, (2) Updating installed skills to latest versions, (3) Browsing or searching available skills, (4) Configuring global or per-project skill sets, (5) Troubleshooting corvus setup. Triggers on: "install skills", "add skills", "update skills", "corvus", "skill manager", "browse skills", "set up AI rules".
development
Generate a gallery of design variations for a UI component. Takes an existing component (referenced by name, pasted code, or screenshot) and produces N distinct rendered alternatives in a single comparison page. Use when exploring visual directions, generating mockups, comparing design approaches for a component, creating A/B candidates, or when anyone says "show me options" or "give me variations" for a UI element.
tools
Create custom QA agent personalities for project-specific testing needs. Guided builder that asks about the specialty, tools, and test scenarios, then generates a personality file and registers it in the QA config. Trigger on "create a QA personality", "add a custom test agent", "build a webhook tester", or when the user needs a project-specific QA agent. Also triggered by /qa-create-personality.