sync-string-cataloglisted
Install: claude install-skill rterakedis/leanwheel-skills
# Sync String Catalog
**Why this exists.** `xcodebuild` extracts strings but never merges them into an `.xcstrings`
catalog; only a build inside the Xcode IDE does. Agents only run `xcodebuild`, so a new key or
a translator-comment edit passes every gate and merges with a stale catalog. The drift surfaces
later as an unexplained diff in the main checkout. Mechanism and footguns:
`docs/setup/swift/xcode-footguns.md` → *A green `xcodebuild` leaves the String Catalog stale*
(project copy) and [reference.md](reference.md) (Xcode MCP notes).
**The script does the work; this skill decides.** `scripts/xcode-catalog-sync.py` drives
Xcode's MCP server (`xcrun mcpbridge`, Xcode 26.3+) to open **this checkout's** project — a
worktree, not `main` — build until the catalog stops changing, and diff each tracked catalog
against HEAD as parsed JSON. It never commits. Zero model tokens until its last line is read.
**Preconditions:** macOS, Xcode running with MCP enabled (Settings → Intelligence), and the
agent approved in Xcode's prompt on first use. Without them the script exits 2 — see CHECK.
---
## CHECK (composable — the gate)
Run from the checkout root. Zero tokens: read only the **last line** of stdout.
```bash
python3 scripts/xcode-catalog-sync.py --check 2>&1 | tee .leanwheel/logs/catalog-sync.log | tail -n 25
```
Map the exit code to the `CATALOG` report field (last stdout line is already in this form):
| Exit | Last line | Meaning | Gate outcome |
|---|---|---|---|
| 0 | `C