Not loaded · from flightwake
Registers non-obvious traps (weird errors, vendor quirks, encoding issues) into a TRAPS registry so the whole project only hits each trap once. Use when a surprising root cause is found or when told to log a trap.
Claude Code won't load this skill
It ships in flightwake at skills/, but Claude Code only loads skills/<name>/SKILL.md and folders listed under skills in plugin.json. Installing the plugin doesn't add it.
目的:同一個坑,全專案(含未來的 session 和其他 agent)只踩一次。
動筆前先問兩題(只增不減的登記簿會累積沒人需要的條目):
registry 最貴的失效不是漏記,是把誤診寫成定案——讀的人分不出「受控實驗坐實的」和 「當下最像的解釋」,照著錯的根因走比沒有 registry 更遠。所以根因必須標把握度:
| confidence | 意思 | 佐證要求 |
|---|---|---|
confirmed | 受控實驗:改變因 → 症狀跟著出現/消失,至少兩次。非因果類的事實(某功能存不存在、清單有哪些、版本行為)改用「直接窮盡查證 + 指得出一手來源(原始碼行號/官方文件/後台逐項確認)」 | 佐證欄必須指得出那個實驗或那份來源 |
probable | 多次觀察一致,但沒做對照組 | 寫出觀察次數與時間範圍 |
suspected | 單次觀察,或「當下最像的解釋」 | 註明還沒排除掉什麼 |
三條規則:
confirmed 的條目,「解法」一律寫成「繞法」,且不得當行為準則probable 就夠(錯了只是多做防護);
論證「這樣是安全的」→ 必須 confirmed(錯了直接打到 prod 和使用者)把握度升級(suspected → confirmed)是就地改同一條,不是 supersede; supersede 保留給「根因本身換了」的情況。寫入前查重(第 1 步)遇到候選時,也照這條判斷。
npx flightwake traps similar --name='<slug>' --tags='<a,b>' --paths='src/db/**,*.sql' --commands='npm run migrate,psql' <<'EOF'
<症狀(原樣貼上錯誤訊息)+ 一句話根因>
EOF
內文一律走加引號的 heredoc(<<'EOF' … EOF,結尾的 EOF 單獨一行、頂格),其他值一律用單引號——絕不用雙引號:
雙引號裡,shell 會執行貼上的錯誤訊息中的反引號與 $(…)。條目沒有 paths / commands 就省略 --paths / --commands。
列出候選時三選一,不要直接再加一條:
status: superseded、內文指向新的 [[名稱]].flightwake/TRAPS.md,有相近條目一樣三選一.flightwake/TRAPS.md 檔頭示範的條目格式(OKF 式 frontmatter:name/type/status/confidence/tags/discovered)
寫進 .flightwake/TRAPS.md 最上面
選填 paths / commands——坑綁在特定檔案或指令上時才填,讓坑提示(Claude Code 與 Codex 的 PreToolUse hook,以及選配的 Claude Code mod)在 agent 碰到之後把這條提示出來:
paths: ["src/db/**", "*.sql"](repo 相對路徑的 glob;不含 / 的樣式比對任何深度的同名檔)、
commands: ["npm run migrate", "psql"](指令前綴,逐字比對)。不支援 regex。拿不準、或坑是觀念而不是某個位置?留空即可——
不填的條目照常運作
選填 retire_when——一行寫出這條什麼時候可以標 superseded(例:retire_when: "codex exec 會載入專案 hook 時"、
retire_when: "smoke 有檢查守住時")。壓實時先看這欄。[[name]] 互連confidence: suspected 並寫下還沒排除什麼,不要空著等想清楚,也不要把猜測寫成定論。
之後坐實了回頭升級status 改 superseded、內文指向 [[新條目]]——不刪行,
讓「舊 md vs 新 md」的衝突有明確方向邊.agents/hooks.json 裡有 flightwake-state-check)且條目有 paths:寫完後跑
npx flightwake traps rules。它會從 TRAPS.md 重新產生 .agents/rules/flightwake-trap-*.md,Antigravity 靠這些檔在改那些檔案之前
看到這條坑。產生出來的檔不要手改。What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
trap-registry, knowledge-base, debugging, root-cause-analysis
Generated from the plugin's indexed repository (kaiwutech-tw/flightwake) — no native marketplace selected
npx claudepluginhub p/kaiwutech-tw-flightwake16 skills in this plugin
/fw-coldstartflightwake cold start — restore state before touching a repo. Use when starting work in a repo that has .flightwake/, when the user says take over / continue / coldstart, or at the start of any session touching a flightwake-managed repo./fw-handoffflightwake cross-session handoff — write CONTEXT for work that is unfinished and will continue later. Use when stopping mid-build on multi-session work, when the user says handoff / continue next time, or before context runs out on a large task./fw-recordflightwake wrap-up record — write the flight record and update STATE. Use when wrapping up: 3+ commits since the last record, the session is ending, or (in code repos) work that touched schema/prod; also when the user says wrap up / record this./fw-trapflightwake trap registration — write a non-obvious trap into the TRAPS registry. Use immediately when a surprising root cause is found (weird error, vendor quirk, encoding trap), or when the user says log this trap / trap./fw-coldstartflightwake コールドスタート — repo に触る前に状態を復元する。Use when starting work in a repo that has .flightwake/, when the user says 引き継ぎ/続きから/coldstart, or at the start of any session touching a flightwake-managed repo./fw-handoffflightwake セッションをまたぐ引き継ぎ — 「まだ終わっておらず、後で続ける」作業のために CONTEXT を書く。Use when stopping mid-build on multi-session work, when the user says 引き継ぎ/handoff/次回続き, or before context runs out on a large task.Other plugins' skills for the same job