From 766142c3baa5db61b3cc9a2cfc297e49bb2a9274 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 17 Aug 2026 14:54:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat(spec-version-guard):=20=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=89=88=E6=9C=AC=E6=AA=A2=E6=9F=A5=20hook=20?= =?UTF-8?q?=E4=B8=A6=E5=9C=A8=209=20=E5=80=8B=20skill=20=E6=AA=94=E9=A0=AD?= =?UTF-8?q?=E5=BC=95=E7=94=A8=E8=A6=8F=E7=AF=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新建 hooks/hooks.json,PreToolUse 沿用跨 plugin 腳本定位手法呼叫 shared 的 version-guard.mjs(判定仍固定讀自己的 plugin.json,只是腳本檔借用 shared 的); action-composite/action-docker/action-node/image/issues/nuget/review-resolve/ sync/target 九個 skill 檔頭補上 spec-version-guard。 Co-Authored-By: Claude Sonnet 5 --- hooks/hooks.json | 17 +++++++++++++++++ skills/action-composite/SKILL.md | 2 +- skills/action-docker/SKILL.md | 2 +- skills/action-node/SKILL.md | 2 +- skills/image/SKILL.md | 2 +- skills/issues/SKILL.md | 2 +- skills/nuget/SKILL.md | 2 +- skills/review-resolve/SKILL.md | 2 +- skills/sync/SKILL.md | 2 +- skills/target/SKILL.md | 2 +- 10 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 hooks/hooks.json diff --git a/hooks/hooks.json b/hooks/hooks.json new file mode 100644 index 0000000..86e2dcf --- /dev/null +++ b/hooks/hooks.json @@ -0,0 +1,17 @@ +{ + "hooks": { + "PreToolUse": [ + { + "matcher": "Read|Write|Edit|MultiEdit|NotebookEdit|Glob|Grep|LS|Bash", + "hooks": [ + { + "type": "command", + "command": "own='shared'; plug='jsc-shared'; rel='scripts/version-guard.mjs'; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\" \"$HOME/.copilot/installed-plugins\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec node --use-system-ca \"$s\"; fi; done; done; ts=$(TZ='Asia/Taipei' date +'%Y/%m/%d %H:%M:%S'); echo \"[$ts][版本檢查][ERR]: 找不到 jsc-shared 的 version-guard.mjs,fail-closed 阻擋。\" >&2; printf '{\"hookSpecificOutput\":{\"hookEventName\":\"PreToolUse\",\"permissionDecision\":\"deny\",\"permissionDecisionReason\":\"找不到 jsc-shared 的 version-guard.mjs,fail-closed 阻擋\"}}\\n'; exit 0", + "timeout": 15, + "statusMessage": "檢查 jsc-code 版本…" + } + ] + } + ] + } +} diff --git a/skills/action-composite/SKILL.md b/skills/action-composite/SKILL.md index c319a14..c1c9222 100644 --- a/skills/action-composite/SKILL.md +++ b/skills/action-composite/SKILL.md @@ -21,7 +21,7 @@ argument-hint: "[--action-dir ] [--manifest ] [--node-version ] [- 先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝, 依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。 -本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-git-safety`、`spec-action-params`、`spec-action-scaffold`、`spec-ask-user`、`spec-node-src-layout`、`spec-time-log`、`spec-dockerfile`、`spec-doc-funcs-handoff`、`spec-skill-invocation` +本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-git-safety`、`spec-action-params`、`spec-action-scaffold`、`spec-ask-user`、`spec-node-src-layout`、`spec-time-log`、`spec-dockerfile`、`spec-doc-funcs-handoff`、`spec-skill-invocation` 本 skill 特有補充: diff --git a/skills/action-node/SKILL.md b/skills/action-node/SKILL.md index f491660..a7e92ba 100644 --- a/skills/action-node/SKILL.md +++ b/skills/action-node/SKILL.md @@ -22,7 +22,7 @@ argument-hint: "[--action-dir ] [--node-version ] [--dockerfile ] [--repo ] [--issues <編號,以 先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝, 依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。 -本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea`、`spec-no-scratch-files`、`spec-issue-read`、`spec-todo-list`、`spec-skill-invocation`、`spec-model` +本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-no-scratch-files`、`spec-issue-read`、`spec-todo-list`、`spec-skill-invocation`、`spec-model` 本 skill 特有補充: diff --git a/skills/nuget/SKILL.md b/skills/nuget/SKILL.md index 93fc0ef..9de0451 100644 --- a/skills/nuget/SKILL.md +++ b/skills/nuget/SKILL.md @@ -12,7 +12,7 @@ argument-hint: "[] [--include-prerelease] [--no-dedupe] [-- 先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝, 依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。 -本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea` +本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea` ## 輸出規範(本 skill 特有) diff --git a/skills/review-resolve/SKILL.md b/skills/review-resolve/SKILL.md index 3fa294a..8416699 100644 --- a/skills/review-resolve/SKILL.md +++ b/skills/review-resolve/SKILL.md @@ -22,7 +22,7 @@ argument-hint: "[--issue <編號|編號清單|all>] [--findings ] [--owner <擁有者,以逗號分隔>] 先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝, 依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。 -本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea`、`spec-git-safety`、`spec-ask-user`、`spec-skill-invocation` +本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-git-safety`、`spec-ask-user`、`spec-skill-invocation` 本 skill 特有補充: diff --git a/skills/target/SKILL.md b/skills/target/SKILL.md index afc9543..613d7ce 100644 --- a/skills/target/SKILL.md +++ b/skills/target/SKILL.md @@ -23,7 +23,7 @@ argument-hint: "[--schedule on|off] [--run] [--project-dir <專案根目錄>] [- 先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝, 依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。 -本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-git-safety`、`spec-gitea`、`spec-time-log`、`spec-todo-list`、`spec-conventional-commit`、`spec-git-push`、`spec-pull-request`、`spec-skill-invocation`、`spec-model` +本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-git-safety`、`spec-gitea`、`spec-time-log`、`spec-todo-list`、`spec-conventional-commit`、`spec-git-push`、`spec-pull-request`、`spec-skill-invocation`、`spec-model` 本 skill 特有補充: -- 2.53.0 From f83879efdf2cf24e8ae002a52157e25aa6764dc8 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 17 Aug 2026 14:54:14 +0800 Subject: [PATCH 2/2] =?UTF-8?q?chore(plugin=20=E7=89=88=E6=9C=AC):=20?= =?UTF-8?q?=E4=B8=89=E5=AE=B6=20manifest=20=E5=8D=87=E7=89=88=200.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增版本檢查 hook 與 9 個 skill 檔頭規範引用,對照 master 現行版本 0.1.0 升版。 Co-Authored-By: Claude Sonnet 5 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- plugin.meta.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index d32ff25..9e843b3 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-code", - "version": "0.1.0", + "version": "0.1.1", "description": "JSC 程式碼工作流 plugin(Claude Code / Codex / Antigravity / OpenCode / GitHub Copilot CLI),提供 Gitea AI review findings 修復/PR 流程、Gitea 議題 TODO 彙整與逐項實作、C# / .NET NuGet 套件更新、Gitea 專案批次同步,以及 action / Dockerfile 標準化流程;於 Claude Code 以 /jsc-code: 前綴呼叫。", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 66b894f..f86a6a1 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-code", - "version": "0.1.0", + "version": "0.1.1", "description": "JSC 程式碼工作流 plugin,提供 Gitea AI review findings 修復/PR 流程、Gitea 議題 TODO 彙整與逐項實作、C# / .NET NuGet 套件更新、Gitea 專案批次同步,以及 action / Dockerfile 標準化流程。", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index c874d03..fe3c684 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-code", - "version": "0.1.0", + "version": "0.1.1", "description": "JSC 程式碼工作流 plugin,提供 Gitea AI review findings 修復/PR 流程、Gitea 議題 TODO 彙整與逐項實作、C# / .NET NuGet 套件更新、Gitea 專案批次同步,以及 action / Dockerfile 標準化流程;於 Antigravity 以 /jsc-code: 前綴呼叫。", "skills": "./skills" } diff --git a/plugin.meta.json b/plugin.meta.json index b0a4623..4fcb785 100644 --- a/plugin.meta.json +++ b/plugin.meta.json @@ -1,7 +1,7 @@ { "name": "jsc-code", "shortName": "code", - "version": "0.1.0", + "version": "0.1.1", "descriptionCore": "JSC 程式碼工作流 plugin,提供 Gitea AI review findings 修復/PR 流程、Gitea 議題 TODO 彙整與逐項實作、C# / .NET NuGet 套件更新、Gitea 專案批次同步,以及 action / Dockerfile 標準化流程。", "assistants": ["Claude Code", "Codex", "Antigravity", "OpenCode", "GitHub Copilot CLI"], "cliPrefix": "/jsc-code:", -- 2.53.0