/review-tests:review-testsfrom review-tests
Audits existing tests to find blind spots and produces a self-contained HTML report with severity-ranked findings. Does not modify any source, test, or config files.
Ships in review-tests. 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.
Read when SKILL.md points to them.
純診斷工具。讀一份既有測試,找出盲點、列出建議,產出一份 HTML 報告。
這個 skill 不寫測試、不改測試、不碰 source 與設定。它只負責「指出問題」並把結果呈現成報告,要不要補、怎麼補,由使用者決定。
.review-tests/。tdd:報告列出的缺漏,請使用者改用 tdd skill 一次一個 red-green 補上,不要在這裡批次補。review-tests <path>。可給測試檔,或給 source 檔由本工具找出對應的測試檔。tdd 從頭建立,流程結束。high=會產生假綠燈或掩蓋真 bug、med=驗證力不足、low=可讀性與慣例)。.review-tests/,自動開啟。每一條發現都要標到具體的測試檔行號或測試描述,並對應到一個 source function。
expect(true).toBe(true)。toBeDefined() 帶過、沒有檢查具體內容的斷言。toBeGreaterThan(0) 這種偏弱斷言。toThrow() 沒驗錯誤型別或訊息,或 try/catch 把失敗吞掉。toMatchSnapshot())沒人看得完=實質上沒有斷言。用「行為」角度列出缺漏,描述成「應該驗證 X 行為」,不是列覆蓋率數字:
beforeEach 重設,會不會因執行順序互相污染。這類問題會產生假綠燈——測試過了但什麼都沒驗到,價值最高、也最容易漏:
await 的斷言:async 斷言沒等到就結束,永遠 pass。Date.now()、Math.random()、時區、執行順序等非決定性來源。報告由 skill 目錄下的固定生成器 render.cjs 產出。agent 只負責產 findings 資料,不要手刻 HTML——escape、語法高亮、排版、backlink toggle 全部由生成器內建,手刻容易在 source 片段的 < > & 上出錯。
/tmp/<name>-findings.json。node "<本 skill 目錄>/render.cjs" /tmp/<name>-findings.json
open <路徑>、Linux xdg-open <路徑>、Windows cmd /c start "" <路徑>。.review-tests/ 的 .gitignore 由生成器自動放好,報告不會被 commit,不用另外提醒。){
"testFile": "src/.../x.spec.ts",
"sourceFile": "src/.../x.ts",
"health": { "level": "良好|及格|待補強", "summary": "一句話總評" },
"sections": [
{ "title": "斷言有效性", "findings": [
{ "desc": "通順中文,保留專有名詞",
"loc": "spec 行 …",
"level": "high|med|low(選填,預設 med)",
"src": { "fn": "fnName", "file": "(選填,預設 sourceFile)", "from": 297, "to": 300, "lang": "(選填,預設依副檔名)" } } ] },
{ "title": "Mock 健康度", "clean": "無問題……" }
],
"suggestions": [ "應該驗證 …" ]
}
level:嚴重度。high=假綠燈/掩蓋真 bug,med=驗證力不足,low=可讀性與慣例。生成器會依嚴重度排序並上色,讓使用者知道先修哪個。src:該 finding 的 backlink 定位。fn 是 function 名(toggle 標題用);from–to 是要展開的關鍵行範圍。file 選填,跨檔時才填(例如 .vue 用到的 composable 在另一支 .ts)。lang 選填:預設依副檔名判斷,TS 家族(ts/tsx/js/jsx/vue)套語法高亮,其他語言純文字等寬顯示。desc/suggestion/summary 要讀起來自然、講清楚「為什麼是問題」,保留專有名詞英文原文。只支援 `code` 與 **bold** 標記,不要寫原始 HTML(生成器會 escape)。clean 與 findings 二選一:某類無問題就給 clean 字串,不硬湊 findings。suggestions 沒東西就給空陣列,生成器會整張略過,不會掛一張空卡。<details> toggle、輕量語法高亮(DOM 建構、不用 innerHTML)、source 片段自動 escape。請提供目標檔案路徑,我將開始體檢、產生 HTML 報告並自動開啟。
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub mukiwu/muki-ai-plugins --plugin review-testsOther plugins' skills for the same job