From 97fdeb92118284b08f33d63a5816b98daf6a85df Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 08:31:12 +0000 Subject: [PATCH 1/2] =?UTF-8?q?fix(hooks):=20=E7=A7=BB=E9=99=A4=20manifest?= =?UTF-8?q?=20=E9=87=8D=E8=A4=87=E7=9A=84=20hooks=20=E8=A8=AD=E5=AE=9A?= =?UTF-8?q?=E4=B8=A6=E5=8D=87=E7=89=88=E8=87=B3=200.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What(改了什麼): 刪除 .claude-plugin/plugin.json 中的 "hooks": "./hooks/hooks.json" 欄位, 並將 plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 三份 manifest 的版本號從 0.0.1 升到 0.0.2。 Why(為什麼改): claude plugin list 回報 jsc-hooks 載入失敗(Hook load failed: Duplicate hooks file detected)。Claude Code 會自動載入標準路徑 hooks/hooks.json,manifest 再宣告同一份檔案就造成重複載入, manifest.hooks 只該用來宣告額外的 hook 檔。 How(怎麼改): 移除多餘的 manifest.hooks 欄位,讓 hooks/hooks.json 只透過標準 自動載入機制載入一次;同步升版三份 manifest 以觸發各 CLI 的 plugin update,並以 python3 -m json.tool 驗證三份 JSON 格式正確。 Who(影響哪個功能/使用者): 影響 jsc-hooks 外掛的所有使用者。修正後外掛可在 claude CLI 正常 載入,STE100 語言強制、工時計時、技能用量記錄等 hooks 恢復生效。 Co-Authored-By: Claude Fable 5 --- .claude-plugin/plugin.json | 5 ++--- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 0f9198a..e6f1c9c 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-hooks", - "version": "0.0.1", + "version": "0.0.2", "description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄", "skills": "./skills", "author": { @@ -13,6 +13,5 @@ "hooks", "skills", "cross-tool" - ], - "hooks": "./hooks/hooks.json" + ] } diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 39f01b3..ab9fbcb 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-hooks", - "version": "0.0.1", + "version": "0.0.2", "description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 8959b93..ecc0924 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-hooks", - "version": "0.0.1", + "version": "0.0.2", "description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄", "skills": "./skills/" } From e0dd3072b2eea77ac40e0cd07ac6a7885490951d Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 21 Aug 2026 16:53:17 +0000 Subject: [PATCH 2/2] =?UTF-8?q?feat(error):=20=E6=96=B0=E5=A2=9E=20ERROR?= =?UTF-8?q?=20wiki=20=E7=AF=84=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 ++++++++++ templates/error-contents.md | 9 +++++++++ templates/error-page.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 templates/error-contents.md create mode 100644 templates/error-page.md diff --git a/README.md b/README.md index 4866ea4..729910f 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,16 @@ Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安 Claude 由 `hooks/hooks.json` 自動接線;其他 CLI 用 `hooks-install` 技能接線或降級為規則檔。 +## 失敗回報範本 + +這兩個模板給外層的 hook 失敗回報流程使用,不改動現有 hook 行為。 +失敗時若要寫入 wiki,套用這兩個檔案即可。 + +| 範本 | 用途 | +| --- | --- | +| `templates/error-page.md` | 單筆 hook 異常頁 `ERROR_{HASH}`,記錄當次失敗的觸發條件、錯誤摘要與處理結果。 | +| `templates/error-contents.md` | 異常目錄 `ERROR_CONTENTS`,彙整所有異常頁,方便先看最新問題再往下追。 | + ## Skills 目錄 呼叫方式:Claude / Antigravity `/jsc-hooks:{name}`;Codex `${name}`;Copilot / Kiro 描述需求自動觸發。 diff --git a/templates/error-contents.md b/templates/error-contents.md new file mode 100644 index 0000000..4e15acc --- /dev/null +++ b/templates/error-contents.md @@ -0,0 +1,9 @@ +# 異常目錄 — ERROR_CONTENTS + +> 由 `jsc-hooks` 的失敗回報流程維護。新異常附加在文末,查問題時先看最新一筆。 + +## 異常清單 + +| 時間 | 頁名 | 存取庫名稱 | 觸發 hook | 退出碼 | 摘要 | +| --- | --- | --- | --- | --- | --- | +| {yyyy-MM-dd HH:mm:ss} | [[ERROR_{HASH}|{error title}]] | {owner}/{repo} | {hook_name} | {exit_code} | {error_summary} | diff --git a/templates/error-page.md b/templates/error-page.md new file mode 100644 index 0000000..f923f59 --- /dev/null +++ b/templates/error-page.md @@ -0,0 +1,32 @@ +# hook 失敗紀錄 — ERROR_{HASH} + +> 由 `jsc-hooks` 的失敗回報流程建立。這是一筆單次異常紀錄,不覆寫舊內容;同類失敗再發生時,請另開新頁。 + +- 頁名:`ERROR_{HASH}` +- 發生時間:{yyyy-MM-dd HH:mm:ss} +- 存取庫名稱:{owner}/{repo} +- CLI:{cli} +- Session:{session_id} +- 觸發 hook:{hook_name} +- 退出碼:{exit_code} +- 錯誤摘要:{error_summary} + +## 現象 + +- {現象描述} + +## 可能原因 + +- {可能原因} + +## 處理結果 + +- {處理方式} + +## 相關資訊 + +| 欄位 | 內容 | +| --- | --- | +| 訊息來源 | {stdin / env / command} | +| 相關輸出 | {stdout / stderr 摘要} | +| 關聯 ticket | [[TICKET_{yyyyMMdd}_{HHmmss}_{HASH}|{ticket 標題}]] |