feat(spec-version-guard): 新增版本檢查 hook 並在 7 個 skill 檔頭引用規範
hooks/hooks.json 在既有 Stop(worklog)之外新增 PreToolUse 條目,沿用跨 plugin 腳本定位手法呼叫 shared 的 version-guard.mjs;docker/funcs/issues-analyze-to-file/ issues-analyze/issues-sync/notifications/worklog 七個 skill 檔頭補上 spec-version-guard。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,18 @@
|
||||
{
|
||||
"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-doc 版本…"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
{
|
||||
"hooks": [
|
||||
|
||||
@@ -9,7 +9,7 @@ description: 整理並對齊 docker-compose.yaml 的行內註解與標題區塊
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-time-log`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-time-log`
|
||||
|
||||
整理並對齊 `docker-compose.yaml` 的行內註解與標題。請優先使用自動化腳本執行。
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ description: 先判斷專案語言,再為每個 function 與每個指令檔(
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-subagent`、`spec-time-log`、`spec-ask-user`、`spec-git-safety`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-subagent`、`spec-time-log`、`spec-ask-user`、`spec-git-safety`
|
||||
|
||||
## 第 0 步:先判斷語言與生態
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ description: 讀取一或多筆 Gitea issue URL(優先用 tea,否則用 Gite
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea`、`spec-issue-read`、`spec-ask-user`、`spec-subagent`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-issue-read`、`spec-ask-user`、`spec-subagent`
|
||||
|
||||
## 前置:輸入與工具
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ description: 讀取使用者選擇的一或多種來源(專案編號、議題
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea`、`spec-issue-read`、`spec-no-scratch-files`、`spec-subagent`、`spec-todo-list`、`spec-project-board`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-issue-read`、`spec-no-scratch-files`、`spec-subagent`、`spec-todo-list`、`spec-project-board`
|
||||
|
||||
## 絕對準則(不可違反)
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ description: 讀取一個 Gitea 專案(project)或單一議題(優先用 t
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea`、`spec-project-board`、`spec-issue-read`、`spec-todo-list`、`spec-ask-user`、`spec-subagent`、`spec-no-scratch-files`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-project-board`、`spec-issue-read`、`spec-todo-list`、`spec-ask-user`、`spec-subagent`、`spec-no-scratch-files`
|
||||
|
||||
## 絕對準則(不可違反)
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ description: 讀取 Gitea 通知,依通知類型分組後逐組執行;若沒
|
||||
|
||||
先載入 `/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`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-no-scratch-files`
|
||||
|
||||
# 依 REVIEW.md 處理 Gitea 通知
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ WORKLOG_DIR="<skill base directory>/../../scripts/worklog"
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-gitea`、`spec-time-log`、`spec-no-scratch-files`、`spec-script-path`、`spec-skill-invocation`、`spec-model`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-gitea`、`spec-time-log`、`spec-no-scratch-files`、`spec-script-path`、`spec-skill-invocation`、`spec-model`
|
||||
|
||||
本 skill 特有補充:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user