From 8cd371d9851e8117e9b58731c668b75c73cee023 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 13:48:45 +0800 Subject: [PATCH] =?UTF-8?q?chore(hooks):=20=E6=96=B0=E5=A2=9E=20jsc-hooks?= =?UTF-8?q?=20=E6=95=B4=E5=90=88=E8=85=B3=E6=9C=AC=EF=BC=88session=20timer?= =?UTF-8?q?=E3=80=81STE100=20guard=E3=80=81skill=20usage=20logger=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .kiro/hooks/hooks.json | 20 ++++++++++++++++++++ .kiro/hooks/session-timer.sh | 6 ++++++ .kiro/hooks/skill-usage.sh | 6 ++++++ .kiro/hooks/ste100-guard.sh | 11 +++++++++++ 4 files changed, 43 insertions(+) create mode 100644 .kiro/hooks/hooks.json create mode 100755 .kiro/hooks/session-timer.sh create mode 100755 .kiro/hooks/skill-usage.sh create mode 100755 .kiro/hooks/ste100-guard.sh diff --git a/.kiro/hooks/hooks.json b/.kiro/hooks/hooks.json new file mode 100644 index 0000000..abc49d5 --- /dev/null +++ b/.kiro/hooks/hooks.json @@ -0,0 +1,20 @@ +{ + "_comment": "kiro-cli has no verified native hook system (no 'hooks' field in kiro-cli agent config; no hook subcommand). This file documents the INTENDED wiring for when kiro-cli gains hook support, and doubles as a manual reference for the wrapper scripts in this directory. JSC_CLI=kiro is exported by each wrapper.", + "hooks": { + "SessionStart": [ + { "hooks": [ { "type": "command", "command": "sh \"$PWD/.kiro/hooks/session-timer.sh\" start" } ] } + ], + "UserPromptSubmit": [ + { "hooks": [ { "type": "command", "command": "sh \"$PWD/.kiro/hooks/ste100-guard.sh\"" } ] } + ], + "Stop": [ + { "hooks": [ { "type": "command", "command": "sh \"$PWD/.kiro/hooks/session-timer.sh\" mark" } ] } + ], + "SessionEnd": [ + { "hooks": [ { "type": "command", "command": "sh \"$PWD/.kiro/hooks/session-timer.sh\" mark" } ] } + ], + "PostToolUse": [ + { "matcher": "Skill", "hooks": [ { "type": "command", "command": "sh \"$PWD/.kiro/hooks/skill-usage.sh\"" } ] } + ] + } +} diff --git a/.kiro/hooks/session-timer.sh b/.kiro/hooks/session-timer.sh new file mode 100755 index 0000000..162c5e2 --- /dev/null +++ b/.kiro/hooks/session-timer.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +# session-timer.sh — kiro-cli wrapper for jsc-hooks' session timer. +# See ste100-guard.sh in this directory for the kiro-cli hook-support assumption. +# Usage: session-timer.sh start|mark|report [sid] +export JSC_CLI=kiro +exec sh "/root/.claude/plugins/cache/jsc/jsc-hooks/0.0.2/hooks/session-timer.sh" "$@" diff --git a/.kiro/hooks/skill-usage.sh b/.kiro/hooks/skill-usage.sh new file mode 100755 index 0000000..03bf415 --- /dev/null +++ b/.kiro/hooks/skill-usage.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +# skill-usage.sh — kiro-cli wrapper for jsc-hooks' skill usage logger. +# See ste100-guard.sh in this directory for the kiro-cli hook-support assumption. +# Usage: JSC_SKILL= skill-usage.sh +export JSC_CLI=kiro +exec sh "/root/.claude/plugins/cache/jsc/jsc-hooks/0.0.2/hooks/skill-usage.sh" "$@" diff --git a/.kiro/hooks/ste100-guard.sh b/.kiro/hooks/ste100-guard.sh new file mode 100755 index 0000000..d96ea05 --- /dev/null +++ b/.kiro/hooks/ste100-guard.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env sh +# ste100-guard.sh — kiro-cli wrapper for jsc-hooks' STE100 guard. +# +# ASSUMPTION: kiro-cli (2.18.1) exposes no native "agent hook" / lifecycle-hook +# concept (checked `kiro-cli agent --help`, `kiro-cli agent create --help`, and +# the agent_config.json.example schema — no hooks field). This directory and +# script are a pragmatic manual fallback, not something kiro-cli invokes on +# its own. If kiro-cli later adds a hooks.json-style mechanism, point it at +# the scripts in this directory (they already set JSC_CLI=kiro). +export JSC_CLI=kiro +exec sh "/root/.claude/plugins/cache/jsc/jsc-hooks/0.0.2/hooks/ste100-guard.sh" "$@" -- 2.53.0