feat(spec-version-guard): 新增版本檢查 hook 並在 13 個 skill 檔頭引用規範
既有 PreToolUse 陣列(guard.mjs 人格隔離)之外新增第二個條目,沿用跨 plugin 腳本定位手法呼叫 shared 的 version-guard.mjs;13 個 persona-* skill 檔頭補上 spec-version-guard(persona-create 原分析誤判為清單空白,實際是項目符號格式, 已在既有清單最前補一行,不變動格式)。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,17 @@
|
||||
"statusMessage": "檢查人格隔離…"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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-persona 版本…"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"Stop": [
|
||||
|
||||
@@ -15,7 +15,7 @@ description: 用「動漫作品名稱 + 角色名稱」快速建立人格:先
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ description: 載入一個人格並以人格化方式對話:取得該人格的
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ description: 建立一個新的 AI 人格(persona),並以「與 OpenClaw
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:
|
||||
- spec-version-guard
|
||||
- spec-output
|
||||
- spec-execution
|
||||
- spec-time-log
|
||||
|
||||
@@ -13,7 +13,7 @@ description: 產生或更新人格的形象圖(icon.svg + icon.png):先找
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
**流程**:找高解析度官方圖 → 量測 → **去背** → 裁頭肩 → 合成 → 更新頭像與 Wiki。
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ description: 邀請另一個人格透過 sub agent 加入當前對話,形成
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-time-log`、`spec-script-path`、`spec-subagent`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-time-log`、`spec-script-path`、`spec-subagent`
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ description: 整理人格的記憶系統:把短期記憶固化為長期記憶
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ description: 維護人格的人際關係圖:新增或更新人物/人格/群
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ description: 讓人格睡覺:把一天的活狀態收成能留下來的形狀
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path、spec-subagent、spec-gitea、spec-git-safety
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path、spec-subagent、spec-gitea、spec-git-safety
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ description: 查看與管理人格的載入狀態:列出所有人格、誰被
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
## 鎖的規則(設計上的硬約束)
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ description: 把小說(或漫畫、劇本、遊戲文本)匯入成一個既
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -13,7 +13,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-time-log、spec-script-path、spec-gitea、spec-git-safety
|
||||
本 skill 需要的規範:spec-version-guard、spec-output、spec-execution、spec-time-log、spec-script-path、spec-gitea、spec-git-safety
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ description: 以專業心理醫生(溝通諮商)的第三方身分診斷一
|
||||
|
||||
先載入 `/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
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ bundle 是**單一 JSON 檔**(可 gzip),不依賴任何外部工具,複
|
||||
|
||||
先載入 `/jsc-shared:spec-preflight` 並依其流程處理;載入不到即代表 shared plugin 未安裝,
|
||||
依該 spec 詢問使用者是否安裝 `https://gitea.jsc.idv.tw/plugins/shared.git`,不安裝則中斷本 skill。
|
||||
本 skill 需要的規範:`spec-output`、`spec-execution`、`spec-time-log`、`spec-script-path`
|
||||
本 skill 需要的規範:`spec-version-guard`、`spec-output`、`spec-execution`、`spec-time-log`、`spec-script-path`
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user