/dev-flow:quality-checkfrom dev-flow
全面程式碼品質檢查——建置驗證、測試執行、覆蓋率分析、問題優先排序。Use when validating code quality before commit or deployment, "品質檢查", "quality check", "跑測試看覆蓋率", "提交前檢查", "建置測試驗證".
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.
執行全面的品質驗證並產出詳細報告。以 .NET 為例列指令,其他工具鏈比照替換。
commit 前的驗證只回答一件事:這個 repo 自己定義的檢查有沒有過。下面的原則優先於後面所有範例指令。
CONTRIBUTING、CI 設定(.github/workflows/、.gitlab-ci.yml 等)、
package.json scripts、Makefile、scripts/ 找出 CI 實際跑的那組,照抄指令與工作目錄。不自己組 npx tsc、dotnet test <sln> 之類的替代品——
專案 script 帶著 heap 上限、設定檔路徑、環境變數、測試 allowlist 這些不起眼的 flag,少一個結果就不同。
找不到自帶 script 時才退回本頁範例,並在回報裡寫明「無自帶 script,改用 X」。(cd <repo 絕對路徑> && <指令>) > <scratch>/verify-<repo>.log 2>&1; echo "EXIT=$?"
多步用 && 串在同一個子 shell,第一步失敗就停,EXIT 是那一步的碼。| grep/| tail 直接接檢查指令:工具崩潰(OOM、找不到設定)和「檢查通過」在管線後都是空輸出,
而管線的 exit code 是最後一個指令的。要篩就篩落檔後的 log。EXIT=0 才算通過;非 0 就停下不 commit,從 log 取失敗段落(測試名+錯誤訊息)交給使用者。
沒讀到 exit code 的 repo 不算驗證過,回報要寫「未驗證」,不可寫成通過。--no-verify 或加繞過變數。| 念頭 | 實際上 |
|---|---|
| 「沒有輸出,應該是過了」 | 崩潰也是沒有輸出。只認 exit code |
| 「直接跑底層工具比較快」 | 少了 script 的 flag,結果不可信 |
| 「只跑我改到的那支測試」 | 別支測試的 mock 可能因你的改動而壞,整套跑 |
| 「失敗是既有的,先跳過」 | 判斷既有要有證據(stash 後重跑同指令比對),且由使用者決定 |
| 「測試太久,跳過」 | 跳過就明說「未驗證」 |
dotnet restoredotnet build -c Release --no-restore(Release 組態)dotnet test --logger:trx --results-directory TestResultsdotnet build /p:RunAnalyzers=true /p:WarningsAsErrors=true# 完整品質檢查
dotnet restore && dotnet build -c Release && dotnet test --logger:trx
# 帶覆蓋率
dotnet test --collect:"XPlat Code Coverage" --results-directory TestResults
# 格式檢查
dotnet format --verify-no-changes
# 套件檢查
dotnet list package --outdated
dotnet list package --vulnerable
| 優先級 | 類型 | 行動 |
|---|---|---|
| 🔴 Critical | 編譯錯誤、測試失敗 | 立即修復 |
| 🟡 High | 品質警告、低覆蓋率 | 今天修復 |
| 🟠 Medium | 技術債、程式碼異味 | 本週修復 |
| 🟢 Low | 清理、格式化 | 待辦清單 |
複雜問題委派品質分析型 subagent,要求它:
=== 品質檢查報告 ===
【建置狀態】
✅ 建置成功 ⚠️ 警告: 0 ❌ 錯誤: 0
【測試結果】
✅ 通過: {n} ❌ 失敗: 0 ⏭️ 跳過: {n}
總計: {n} 成功率: {%}
【測試覆蓋率】
Domain / Application / Infrastructure:各層 % 與總體 %
【品質分數】: {0-100}
【關鍵問題】 / 【建議】 / 【下一步驟】
# 建置失敗:清理並重建
dotnet clean && dotnet restore && dotnet build
# 測試失敗:詳細輸出
dotnet test -v detailed --logger:trx
# 依賴問題:清 NuGet 快取
dotnet nuget locals all --clear && dotnet restore --force
work-on — 實作段落完成後的品質閘門review — 審查前先跑品質檢查commit — 提交前先驗證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