docs(hooks): translate SKILL.md into English per guidelines
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,28 +3,28 @@ name: hooks-install
|
|||||||
description: 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.
|
description: 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 — 將 jsc hooks 接線到所有已安裝的 CLI
|
# hooks-install — wire jsc hooks into every installed CLI
|
||||||
|
|
||||||
目標:讓三支 hook(`ste100-guard.sh`、`session-timer.sh`、`skill-usage.sh`)在每個 CLI 生效。
|
Goal: make the three hooks (`ste100-guard.sh`, `session-timer.sh`, `skill-usage.sh`) effective in every CLI.
|
||||||
細節流程**必須以 sub agent 執行**,主 agent 只回報結果摘要。
|
The detailed flow **MUST run as a sub agent**; the main agent only reports the summary.
|
||||||
|
|
||||||
## 步驟
|
## Steps
|
||||||
|
|
||||||
1. 執行 `jsc-cli/tools/detect-clis.sh` 取得已安裝的 CLI 與路徑。
|
1. Run `jsc-cli/tools/detect-clis.sh` to get the installed CLIs and their paths.
|
||||||
2. 對每個 CLI 依下表接線(hook 優先,無 hook 系統就降級為規則檔):
|
2. Wire each CLI per the table below (hooks first; degrade to an instruction file when the CLI has no hook system):
|
||||||
|
|
||||||
| CLI | 接線方式 |
|
| CLI | Wiring |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| claude | plugin 安裝時自動載入 `jsc-hooks/hooks/hooks.json`,只需驗證:`claude plugin list` 有 `jsc-hooks` 且 `/hooks` 顯示已註冊 |
|
| 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 | `~/.codex/config.toml` 設定 `notify` 指向 `session-timer.sh mark`(帶 `JSC_CLI=codex`);STE100 規則追加到 `~/.codex/AGENTS.md`(prompt 降級) |
|
| 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 | 無 hook 系統:STE100 規則追加到 `~/.config/copilot/copilot-instructions.md`(prompt 降級) |
|
| copilot | no hook system: append the STE100 rule to `~/.config/copilot/copilot-instructions.md` (prompt fallback) |
|
||||||
| antigravity | 無公開 hook 系統:STE100 規則追加到全域 rules 檔(prompt 降級) |
|
| antigravity | no public hook system: append the STE100 rule to the global rules file (prompt fallback) |
|
||||||
| kiro | 於工作區 `.kiro/hooks/` 建立 agent hook,觸發時執行對應腳本(帶 `JSC_CLI=kiro`) |
|
| kiro | create an agent hook under the workspace `.kiro/hooks/` that runs the matching script (with `JSC_CLI=kiro`) |
|
||||||
|
|
||||||
3. 規則檔追加內容一律使用 `ste100-guard.sh` 的輸出文字,且以 `<!-- jsc-hooks -->` 標記包住,重複執行時整段取代不重複追加。
|
3. 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.
|
||||||
4. 回報每個 CLI 的接線結果(成功 / 降級為 prompt / 跳過原因)。
|
4. Report the wiring result for every CLI: succeeded, degraded to prompt, or the skip reason.
|
||||||
|
|
||||||
## 注意
|
## Notes
|
||||||
|
|
||||||
- Hook 腳本同時接受 stdin JSON 與環境變數(`JSC_CLI`、`JSC_SESSION_ID`、`JSC_SKILL`),wrapper 只需設環境變數。
|
- 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.
|
||||||
- 資料落在 `$JSC_HOME`(預設 `~/.jsc`),供 `jsc-log:worklog` 與 `jsc-log:stats` 取用。
|
- Data lands in `$JSC_HOME` (default `~/.jsc`), consumed by `jsc-log:worklog` and `jsc-log:stats`.
|
||||||
|
|||||||
Reference in New Issue
Block a user