Bopomofo Rescue
Detect and recover text that was accidentally typed with the Taiwanese Bopomofo /...
Install
npx skills add mxyhi/ok-skills --skill bopomofo-rescue -g -a claude-code -y- Repository
- mxyhi/ok-skills509
- Category
- AI and agents
- Updated
- 6d ago
- License
- Apache-2.0
- Context cost
- Lightabout 954 tokens
- Runs scripts
- No, instructions only
What it does
Detect and recover text that was accidentally typed with the Taiwanese Bopomofo / Zhuyin (注音) keyboard while the input method (IME) was stuck in English/ASCII mode, what Taiwanese users call 注音亂碼 or 注音文, producing meaningless-looking letter+digit sequences such as "su3cl3a8", "cl3", "g4", "2k7", "vu,4", or such garbled runs embedded in an otherwise normal request (e.g. "help me fix su3cl3a8", "看看這個 PR qk4ru.6", "幫我改 su3cl3a8xk7"). Use this skill whenever a user message contains short ASCII tokens that look like keyboard gibberish, do not form real English words, and cannot be understood normally, especially tokens with digits interspersed among letters (tone keys 3/4/6/7 or vowel keys 8/9/0), which are a strong sign of Mandarin phonetic keystrokes typed in the wrong input mode. Run scripts/decode_bopomofo.py to deterministically map the keystrokes back to 注音 symbols with a confidence score, then interpret the intended Traditional Chinese in context and continue the user's original request without making them retype. Do NOT trigger on genuine technical strings, code, file paths, URLs, git hashes, CLI flags, package names, version numbers, the script's exclusion rules and confidence tiers already filter these out. Especially valuable for Taiwanese developers who forget to switch input methods when prompting AI coding agents.
注音鍵盤誤打還原 (Bopomofo Input Recovery)
安裝前提 (Prerequisite)
這個 skill 需要上游 repo 內附的解碼腳本與注音詞典(約 5 MB)才能運作;本目錄
只收錄 SKILL.md 與參考資料。請直接從來源安裝:
git clone https://github.com/Oliviaiii/bopomofo-rescue.git ~/.claude/skills/bopomofo-rescue
安裝後會一併掛上 UserPromptSubmit hook,訊息送出當下就自動解碼,不需任何前綴指令。
需要 Python 3,且 python 在 PATH 上。
This skill requires the decoder script and Bopomofo dictionary (~5 MB) bundled in the
upstream repository, only SKILL.md and references/ are vendored here. Install from
source with the command above. Requires Python 3 on PATH.
這個 skill 在解決什麼
台灣工程師常用注音輸入法。忘記把輸入法從英文切回中文時,本來想打的中文會
變成一串按鍵序列, , 例如想打「你好嗎」卻打出 su3cl3a8。這串不是英文、也
不是亂碼,而是注音鍵盤的實體按鍵。這個 skill 把它還原回中文,讓你不必
重打就能繼續原本的請求。
核心原則
還原這一步一定要用 scripts/decode_bopomofo.py,不要自己心算。
LLM 自己硬猜按鍵映射經常出錯(例如會把 dj94 說成「是的」,實際是「快」)。
這支程式是純查表 + 音節切分 + 詞典斷詞(IME 式最大機率),會直接給你注音與
中文猜測。你的工作是用上下文確認或修正它的猜測, , 這是你的強項,因為
同音字要靠前後文消歧(ㄕˋ = 是/事/世/市…),而標準 IME 沒有上下文、你有。
工作流程
當使用者訊息可能含注音誤打時:
-
執行腳本(把整段原始訊息交給它,它會自己挑出候選、跳過技術字串):
python "${CLAUDE_SKILL_DIR}/scripts/decode_bopomofo.py" --brief "使用者的原始訊息"預設用
--brief:只回傳判讀所需欄位,約為完整 JSON 的 10%,省下大量 context。需要同音字候選或除錯時再拿掉--brief(完整輸出含chinese_alternatives、confidence等;--full另外附上所有 token 的segments)。輸出 JSON 的重點欄位:
has_candidates:是否偵測到疑似誤打中文。candidates[]:每個候選的bopomofo(注音)、chinese(詞典最佳中文猜測)、tier(信心分級)、以及可能出現的repair(打字手誤補救建議,見下)。reconstructed:把候選換成中文(詞典可用時)或[注音]的整句版本,直接可讀。
-
依
tier決定行為(見下)。 -
用上下文確認
chinese猜測,代回原句,然後照還原後的意思繼續做事。
依信心分級的行為
腳本已經把 confidence 轉成三級。請照這個原則反應,重點是不要打斷開發節奏:
| tier | 信心 | 建議行為 |
|---|---|---|
high | ≥ 0.90 | 靜默還原,直接照還原後的意思繼續。不用大張旗鼓宣告。 |
medium | 0.65, 0.89 | 用一句話標註你的推測(例:「su3cl3a8 我理解為『你好嗎』」)再繼續。 |
low | < 0.65 | 預設不動。只有在上下文讓意思非常明顯時才採用,否則照原文理解。 |

