← ClaudeAtlas

bopomofo-rescuelisted

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 th
Oliviaiii/bopomofo-rescue · ★ 0 · AI & Automation · score 75
Install: claude install-skill Oliviaiii/bopomofo-rescue
# 注音鍵盤誤打還原 (Bopomofo Input Recovery) ## 這個 skill 在解決什麼 台灣工程師常用注音輸入法。忘記把輸入法從英文切回中文時,本來想打的中文會 變成一串按鍵序列 —— 例如想打「你好嗎」卻打出 `su3cl3a8`。這串不是英文、也 不是亂碼,而是**注音鍵盤的實體按鍵**。這個 skill 把它還原回中文,讓你不必 重打就能繼續原本的請求。 ## 核心原則 **還原這一步一定要用 `scripts/decode_bopomofo.py`,不要自己心算。** LLM 自己硬猜按鍵映射經常出錯(例如會把 `dj94` 說成「是的」,實際是「快」)。 這支程式是純查表 + 音節切分 + 詞典斷詞(IME 式最大機率),會直接給你**注音**與 **中文猜測**。你的工作是**用上下文確認或修正**它的猜測 —— 這是你的強項,因為 同音字要靠前後文消歧(`ㄕˋ` = 是/事/世/市…),而標準 IME 沒有上下文、你有。 ## 工作流程 當使用者訊息可能含注音誤打時: 1. **執行腳本**(把整段原始訊息交給它,它會自己挑出候選、跳過技術字串): ```bash 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`:把候選換成**中文**(詞典可用時)或 `[注音]` 的整句版本,直接可讀。 2. **依 `tier` 決定行為**(見下)。 3. **用上下文確認 `chinese` 猜測**,代回原句,然後**照還原後的意思繼續做事**。 ## 依信心分級的行為 腳本已經把 `confidence` 轉成三級。請照這個原則反應,重點是**不要打斷開發節奏**: | tier | 信心 | 建議行為 | |------|------|----------| | `high` | ≥ 0.90 | **靜默還原**,直接照還原後的意思繼續。不用大張旗鼓宣告。 | | `medium` | 0.65–0.89 | 用**一句話**標註你的推測(例:「`su3cl3a8` 我理解為『你好嗎』」)再繼續。 | | `low` | < 0.65 | **預設不動**。只有在上下文讓意思非常明顯時才採用,否則照原文理解。 | `low` 多半是純字母、能硬切成音節但其實可能是英文的 token(如 `npm`、`git`、 `html`)。這類**寧可放過**,除非整句語境明顯是中文而這個 token 格格不入。 ## 確認中文猜測(你的工作) 腳本已用詞頻詞典給