What:新增 hooks/sdlc-gate.sh,提供 lock、unlock、check、report 四個子指令;hooks.json 於 UserPromptSubmit 加掛 check。
Why:SDLC 各階段對模型能力有硬性要求,僅靠技能提示無法防止中途切換模型,需要 hook 層強制。
How:以 session 為鍵把「階段 模型」寫入 $JSC_HOME/sessions/{sid}.stage;check 依 stdin JSON、JSC_MODEL、~/.claude/settings.json 順序判定目前模型,別名互含視為相符,不符時注入繁中封鎖提醒;缺資料一律安靜降級、永遠 exit 0。
Who:jsc-sdlc 四個階段技能(plan、analyze、implement、maintain)於閘門通過時上鎖,Claude Code 的 UserPromptSubmit hook 負責攔查。
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
23 lines
859 B
JSON
23 lines
859 B
JSON
{
|
|
"hooks": {
|
|
"SessionStart": [
|
|
{ "hooks": [ { "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/session-timer.sh\" start" } ] }
|
|
],
|
|
"UserPromptSubmit": [
|
|
{ "hooks": [
|
|
{ "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/ste100-guard.sh\"" },
|
|
{ "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/sdlc-gate.sh\" check" }
|
|
] }
|
|
],
|
|
"Stop": [
|
|
{ "hooks": [ { "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/session-timer.sh\" mark" } ] }
|
|
],
|
|
"SessionEnd": [
|
|
{ "hooks": [ { "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/session-timer.sh\" mark" } ] }
|
|
],
|
|
"PostToolUse": [
|
|
{ "matcher": "Skill", "hooks": [ { "type": "command", "command": "sh \"${CLAUDE_PLUGIN_ROOT}/hooks/skill-usage.sh\"" } ] }
|
|
]
|
|
}
|
|
}
|