2.0 KiB
2.0 KiB
name, description
| name | description |
|---|---|
| hooks-install | Wire jsc hooks (STE100 guard, session timer, skill usage logger) into every installed AI CLI. Detect CLIs via jsc-cli detect-clis.sh, then apply native hook config per CLI or fall back to instruction files. 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 three hooks (ste100-guard.sh, session-timer.sh, skill-usage.sh) effective in every CLI.
The detailed flow MUST run as a sub agent; the main agent only reports the summary.
Steps
- Run
jsc-cli/tools/detect-clis.shto get the installed CLIs and their paths. - Wire each CLI per the table below (hooks first; degrade to an instruction file when the CLI has no hook system):
| CLI | Wiring |
|---|---|
| claude | the plugin loads jsc-hooks/hooks/hooks.json automatically on install; verify only: claude plugin list shows jsc-hooks and /hooks shows the registrations |
| codex | set notify in ~/.codex/config.toml to session-timer.sh mark (with JSC_CLI=codex); append the STE100 rule to ~/.codex/AGENTS.md (prompt fallback) |
| copilot | no hook system: append the STE100 rule to ~/.config/copilot/copilot-instructions.md (prompt fallback) |
| antigravity | no public hook system: append the STE100 rule to the global rules file (prompt fallback) |
| kiro | create an agent hook under the workspace .kiro/hooks/ that runs the matching script (with JSC_CLI=kiro) |
- The appended rule text is always the exact output of
ste100-guard.sh(a Traditional Chinese literal). Wrap it in<!-- jsc-hooks -->markers; on re-run, replace the whole block instead of appending again. - Report the wiring result for every CLI: succeeded, degraded to prompt, or the skip reason.
Notes
- The hook scripts accept both stdin JSON and environment variables (
JSC_CLI,JSC_SESSION_ID,JSC_SKILL); a wrapper only needs to set the variables. - Data lands in
$JSC_HOME(default~/.jsc), consumed byjsc-log:worklogandjsc-log:stats.