Files
hooks/skills/hooks-install/SKILL.md

3.5 KiB

name, description
name description
hooks-install Wire jsc hooks (STE100 guard, session timer, skill usage logger, SDLC model gate, plugin version guard) into every installed AI CLI. Detect CLIs via jsc-cli detect-clis.sh, then apply native hook config, the jsc-wrap.sh launcher, or an instruction-file fallback per CLI. Use after installing or updating the jsc plugin set; not for writing new hooks.

hooks-install — wire jsc hooks into every installed CLI

Goal: make the five hooks (ste100-guard.sh, session-timer.sh, skill-usage.sh, sdlc-gate.sh, version-guard.sh) effective in every CLI. version-guard.sh runs on PreToolUse(Skill) and blocks a skill whose locally loaded plugin version is behind the published one. Where a CLI has no pre-tool hook, that guard cannot be wired — say so in the report rather than implying every CLI is covered. Claude wiring is automatic via hooks.json. On codex and kiro the SDLC gate degrades to the skill-step check only; the lock file still works because the SDLC skills call sdlc-gate.sh lock {stage} directly — that call is where the capability-tag comparison happens, so the gate keeps its force even where the prompt hook cannot be wired. The gate needs $JSC_HOME/model-tags.tsv; when it is missing, report that jsc-cli:models (or jsc-cli/tools/model-tags.sh sync) must run once, because sdlc-gate.sh lock refuses to lock without it. The detailed flow MUST run as a sub agent; the main agent only reports the summary.

Steps

  1. Run jsc-cli/tools/detect-clis.sh. Done when you hold the list of installed CLIs; when the list is empty, report that and stop.
  2. For each installed CLI, run tools/wire-cli.sh {cli}. The script performs the config edit, wrapper alias install, or hook file creation for that CLI, and replaces its <!-- jsc-hooks --> (or # jsc-hooks) marker block idempotently — reruns never duplicate content. Read its exit code and first output line (status=wired|degraded|skipped reason=...), then confirm against the table below:
CLI Exit / status Verify
claude status=wired (exit 0) — hooks.json auto-wires everything, nothing to write claude plugin list shows jsc-hooks and /hooks shows the registrations
codex status=degraded (exit 1) — notify + AGENTS.md prompt fallback ~/.codex/config.toml contains the notify entry and AGENTS.md contains the block
copilot status=wired (exit 0) when the CLI is detected, status=skipped (exit 3) otherwise the alias resolves to jsc-wrap.sh copilot and copilot-instructions.md contains the block
antigravity status=wired (exit 0) when the CLI is detected, status=skipped (exit 3) otherwise the alias resolves to jsc-wrap.sh antigravity and the rules file contains the block
kiro status=degraded (exit 1) the hook file exists under .kiro/hooks/ and names the script

A row counts as done only when its verify check passes. Exit 2 means bad usage (wrong CLI name), not a wiring outcome. 3. Report the exact status= line tools/wire-cli.sh printed for each CLI; do not reinterpret or recompute the outcome by hand. Done when every detected CLI has exactly one reported status: wired, degraded, or skipped with a reason.

Notes

  • The hook scripts accept both stdin JSON and environment variables (JSC_CLI, JSC_SESSION_ID, JSC_SKILL, JSC_MODEL); jsc-wrap.sh sets the first two itself.
  • Data lands in $JSC_HOME (default ~/.jsc), consumed by jsc-log:worklog and jsc-log:stats.