/dev-flow:debuggingfrom dev-flow
TDD 系統性除錯——先寫失敗測試重現 bug,追根因、修復、驗證無回歸。Use when 遇到 bug、測試失敗、或非預期行為需要追蹤根因, "除錯", "debug", "重現 bug", "測試失敗", "找根因", "systematic debugging".
Ships in dev-flow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
採 TDD 方式系統性除錯:先用測試重現問題,再改碼,最後用同一測試驗證修復。沒有可重現的失敗測試就不動手改碼。
收集資訊:錯誤訊息或非預期行為、重現步驟、預期行為 vs 實際行為。
建立失敗測試把 bug 條件固定下來(以 .NET / xUnit 為例,其他框架比照):
[Fact]
public async Task MethodName_WhenBugCondition_ShouldExpectedBehavior()
{
// Arrange - 重現 bug 的條件
var sut = new ServiceUnderTest(mockDependency);
// Act
var result = await sut.ProblematicMethodAsync();
// Assert - 預期的正確行為
result.Should().Be(expected);
}
執行並確認它失敗(先看到紅燈才有意義):
dotnet test --filter "FullyQualifiedName~BugCondition"
追蹤程式碼路徑:
常見根因對照:
| 症狀 | 可能原因 |
|---|---|
| Null 參考例外 | 依賴未註冊、設定值/連線字串為空 |
| 資料不正確 | 查詢或轉換邏輯錯誤 |
| 輸出未更新 | 狀態變更未觸發、快取未失效 |
| 操作無回應 | 前置條件判斷回傳 false、事件未綁定 |
追「為何」到源頭,別在下游改讀另一處資料把症狀遮掉。
依 Clean Architecture 對症下藥,改在正確的層:
先跑先前的失敗測試轉綠,再跑全部測試確認無回歸:
dotnet test --filter "FullyQualifiedName~BugCondition" # 目標測試轉綠
dotnet test # 全體無回歸
dotnet build
# 查看測試詳細輸出
dotnet test --verbosity normal
# 執行特定測試專案
dotnet test tests/{Project}.Application.Tests
Mock 呼叫驗證(語法依你採用的 mocking 框架):
// 確認方法被呼叫 / 未被呼叫
await mock.Received(1).MethodAsync(Arg.Any<string>());
mock.DidNotReceive().MethodAsync(Arg.Any<string>());
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kerryhuang/kerryhuang-plugins --plugin dev-flow17 skills in this plugin
/agent-orchestration適用於多階段 agent chain(≥2 個 agent 接力)、需要用 output file 交棒、把多步工作流展示給使用者確認、偵測到「工作完成」需清理階段性產物、跨 agent 任務串接決策。涵蓋 chain 規範、output 路徑、清理流程、工作流呈現格式、subagent 作為 context 隔離工具的使用時機。觸發語:「召喚某 agent」「多階段流程」「派 subagent」「工作流規劃」「agent 交棒」「orchestration」。/commit建立符合 Conventional Commits 規範的語義化提交訊息,支援 Git Flow + Semantic Release 工作流程。Use when creating git commits, "commit 這些變更", "幫我提交", "建立 commit", "semantic commit"./context-hygieneUse when 對話很長 / context 變長 / context 快滿 / 感覺 Claude 變笨 / 連續修同一錯誤失敗 / 即將切換到無關任務 / 要讀大量檔案探索 / agent 交接(handoff)/ 使用者說「對話太長」「感覺變笨」「context 滿了」「要不要清一下」「clean context」時。Other plugins' skills for the same job