debug-protocol

debug-protocol is a skill for Claude Code, Codex from curtischoutw/claude-institution. It costs 74 tokens per session (1,276 once invoked), scanned A, original, MIT.

A step-by-step debugging guide based on reproducing a failure, testing one explanation at a time, making the smallest relevant change, and checking the result. It includes a stopping rule for repeated unsuccessful fixes.

In plain words
What is it for?
Use it to investigate reproducible software failures, track debugging hypotheses, inspect recent code changes, narrow down the change that introduced a bug, and decide when to stop and report the remaining uncertainty.
Why use it?
It prevents guesswork from creating additional bugs and keeps a record of what has been tested or ruled out. When a fix does not work, it directs the investigation toward evidence such as logs, history, or a change search.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/curtischoutw/claude-institution/debug-protocol
Any agent
npx skills add curtischoutw/claude-institution --skill debug-protocol
Clone the repo
git clone --depth 1 https://github.com/curtischoutw/claude-institution

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for debug-protocol

README.md
[![agentmods](https://agentmods.dev/badge/skills/curtischoutw/claude-institution/debug-protocol.svg)](https://agentmods.dev/skills/curtischoutw/claude-institution/debug-protocol)
Your own site
<a href="https://agentmods.dev/skills/curtischoutw/claude-institution/debug-protocol"><img src="https://agentmods.dev/badge/skills/curtischoutw/claude-institution/debug-protocol.svg" alt="Measured on agentmods" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,276 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00074 $0.01276
Opus 5 $0.00037 $0.00638
Sonnet 5 $0.00015 $0.00255
Haiku 4.5 $0.00007 $0.00128

Measured 4d ago against content hash 8a70ec629464, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debug-protocol scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

- 找到一條指令能穩定重現失敗(測試指令、curl、script)。貼出失敗輸出。
institution/skills/debug-protocol/SKILL.md · 74 lines

What it actually says

debug-protocol:系統化除錯

核心原則:一次一個假設,一個假設一個最小改動,改完立刻驗證。 沒有失敗重現指令之前,不准動任何程式碼。

步驟

1. 重現(沒有這步就沒有下一步)

  • 找到一條指令能穩定重現失敗(測試指令、curl、script)。貼出失敗輸出。
  • 無法穩定重現 → 先解決重現問題(加 log、固定 seed、記錄環境),不要修「猜的 bug」。

2. 建立假設日誌

在回覆中(或 scratchpad)維護一張表,之後每輪更新:

| # | 假設 | 驗證方式 | 結果 |
|---|------|---------|------|
| 1 | token 過期沒被 refresh | 在 refresh 處加 log 重跑 | 排除:有進 refresh |

2.5 假設從哪來(想不出假設時照此優先序)

  1. 最近改動優先git log -p <相關檔>git diff main——大多數新 bug 來自新改動。
  2. 差異分析:能重現與不能重現的情境差在哪(環境、輸入、版本、時序)?差異處就是嫌疑處。
  3. 按症狀查常見嫌疑
    • 間歇性失敗 → 時序/競態、共享狀態、外部依賴逾時
    • 邊界值出錯 → off-by-one、型別轉換、空集合/None
    • 只在某環境出錯 → 設定、路徑、版本、環境變數
  4. 以上都想不出 → 用二分縮小範圍(git bisect 或註解掉一半邏輯),別憑空猜。

3. 驗證假設(先觀察,後修改)

  • 優先用「唯讀」手段驗證:讀碼、加 log、下斷點、bisect(git bisect 或手動二分註解)。
  • 假設被證實之後才改程式碼;改動必須是針對該假設的最小修改

4. 每輪改動後

  • 重跑步驟 1 的重現指令。
  • 沒修好 → 把這輪改動 revert 乾淨(不留半套修改疊加),更新假設日誌,回步驟 2。

停損規則(3-strike)

連續 3 輪修改都失敗時,強制停手,依序做:

  1. git checkout / revert 回最後乾淨狀態。
  2. 寫下:已排除的假設清單、目前掌握的事實、還沒看過的區域。
  3. 擴大情報面(擇一):
    • 往上游讀更多程式碼(呼叫鏈、設定載入、初始化順序)
    • git log -p <file> 查該區域最近改動
    • 開一個 subagent 平行調查另一條假設線
    • git bisect 找出引入問題的 commit
  4. 帶著新事實重新進 plan mode 再開始。
  5. 若再 3 輪仍失敗 → 停止,如實向使用者回報:事實、已排除假設、卡點、建議方向。如實回報卡住遠優於硬掰一個「可能修好了」。

修好之後(缺一不可)

  1. 用一句話說出根因(說不出根因 = 可能只是碰巧不噴錯了,回步驟 2)。
  2. 加一個會在此 bug 回歸時失敗的測試。
  3. 跑 /done-check(其固定模板已含「已驗證:/範圍外發現:/AUTH:」三個逐字必填欄位)。
  4. 檢查修法是不是貼補:自問「知道根因後,這是優雅解嗎?」

除錯過程中最常踩到 hard-rules #4:查根因時會看到一堆順眼想改的東西。一律記到 tasks/todo.md 不順手修,並在收工回報寫「範圍外發現: <項目,或「無」>」。

禁止事項

  • 禁止一輪改多個地方然後「看哪個有效」。
  • 禁止用 try/except 吞掉錯誤來「修好」。
  • 禁止沒讀過相關程式碼就套 Stack Overflow / 訓練記憶裡的通用解。
  • 禁止修改測試的預期值來讓測試通過(除非能證明測試本身錯,且在總結中說明)。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 74 lines · 74 tokens per session scan A 8a70ec629464

Subscribe to this mod's changes

debug-protocol is a skill published in the GitHub repository curtischoutw/claude-institution (5 stars, last pushed 6d ago), licensed MIT. It adds 74 tokens to every session and 1,276 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

fable-method

A step-by-step problem-solving loop (classify the ask, define done, gather evidence, decide, act surgically, verify by observation, report outcome-first). Use when the user says "/fable-method", "use the fable method", or "approach this like Fable", or proactively when starting any multi-step task that no…

Sahir619/fable-method · 105 tokens

fable-domain

Discuss a domain with the user, research it from real sources, then generate a trusted skill bundle for it - a step-by-step workflow with a flowchart, a domain adapter, a trap fixture, and a smoke eval. Use when the user says "/fable-domain ", "make a skill for ", "add a domain to the fable method", or "give a lesser…

Sahir619/fable-method · 115 tokens

release-helper

Ensures configuration and code changes are released correctly. Use PROACTIVELY whenever you edit config.json, change any setting, or fix a configuration bug in this project, so the change reaches production.

Sahir619/fable-method · 43 tokens

fable-judge

Adversarial verification of finished work. Treats any "done" as a set of claims, then re-runs the claimed verifications, diffs what actually changed, detects weakened tests and false completion claims, and delivers an evidence-based verdict (VERIFIED / VERIFIED WITH CAVEATS / REFUTED). Use after any agent or model…

Sahir619/fable-method · 125 tokens

fable-loop

End-to-end orchestrated workflow that runs a task the way Fable ran sessions - parallel evidence subagents, one committed plan, surgical execution with an intent gate, adversarial verification agents, honest outcome-first report. Use for non-trivial multi-step tasks when the user says "/fable-loop", "run the fable…

Sahir619/fable-method · 111 tokens

feishu

Work with Feishu or Lark bots, docs, sheets, bitables, approval flows, and OpenAPI/MCP setup without hardcoding credentials.

Hmbown/CodeWhale · 33 tokens