Files
persona/hooks/hooks.json
T
jiantw83andClaude Sonnet 5 ff61aced5d 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>
2026-08-17 14:55:02 +08:00

86 lines
2.6 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session_start.mjs\"",
"timeout": 20,
"statusMessage": "載入人格執行環境…"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/prompt_submit.mjs\"",
"timeout": 20,
"statusMessage": "回想記憶與情緒…"
}
]
}
],
"PreToolUse": [
{
"matcher": "Read|Write|Edit|MultiEdit|NotebookEdit|Glob|Grep|LS|Bash",
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/guard.mjs\"",
"timeout": 15,
"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": [
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/turn_end.mjs\"",
"timeout": 20
}
]
}
],
"SubagentStop": [
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/subagent_stop.mjs\"",
"timeout": 15
}
]
}
],
"SessionEnd": [
{
"hooks": [
{
"type": "command",
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/session_end.mjs\"",
"timeout": 20
}
]
}
]
}
}