mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-03 06:34:16 +08:00
fix(skills): document plugin vs manual hook setup for strategic-compact (#2420)
The Hook Setup section told all users to wire
`node ~/.claude/scripts/hooks/suggest-compact.js` into settings.json.
That path only exists on manual `./install.sh` installs; for plugin
installs the hook is already registered by the plugin's hooks/hooks.json
(id `pre:edit-write:suggest-compact`, standard/strict profiles), so the
snippet fails silently and would double-register the hook.
- Add a plugin-install note (mirrors continuous-learning-v2 wording)
and scope the snippet to manual installs — applied to the canonical
skill, the .kiro mirror, and ja-JP/zh-CN/zh-TW/ko-KR translations
- ko-KR: also replace the settings.json snippet that used
`${CLAUDE_PLUGIN_ROOT}`, which does not resolve in user settings.json
This commit is contained in:
@@ -38,7 +38,9 @@ The `suggest-compact.js` script runs on PreToolUse (Edit/Write) and:
|
||||
|
||||
## Hook Setup
|
||||
|
||||
Add to your `~/.claude/settings.json`:
|
||||
**Installed as a plugin?** No setup is needed. The plugin's `hooks/hooks.json` already registers `suggest-compact.js` (hook id `pre:edit-write:suggest-compact`, active in the `standard` and `strict` hook profiles). Do not copy the block below into `~/.claude/settings.json` — `~/.claude/scripts/` does not exist on plugin installs, and duplicating a plugin hook causes double execution.
|
||||
|
||||
**If installed manually** (`./install.sh`), add to your `~/.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -29,7 +29,9 @@ description: 任意の自動コンパクションではなく、タスクフェ
|
||||
|
||||
## フック設定
|
||||
|
||||
`~/.claude/settings.json`に追加:
|
||||
**プラグインとしてインストール済みの場合**:設定は不要です。プラグインの `hooks/hooks.json` が既に `suggest-compact.js` を登録しています(フック ID `pre:edit-write:suggest-compact`、`standard` と `strict` フックプロファイルで有効)。下のブロックを `~/.claude/settings.json` にコピーしないでください — プラグインインストールでは `~/.claude/scripts/` は存在せず、プラグインフックを重複させると二重実行になります。
|
||||
|
||||
**手動インストール**(`./install.sh`)の場合、`~/.claude/settings.json` に追加:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -38,21 +38,21 @@ origin: ECC
|
||||
|
||||
## Hook 설정
|
||||
|
||||
`~/.claude/settings.json`에 추가합니다:
|
||||
**플러그인으로 설치한 경우**: 별도 설정이 필요 없습니다. 플러그인의 `hooks/hooks.json`이 이미 `suggest-compact.js`를 등록합니다(훅 ID `pre:edit-write:suggest-compact`, `standard` 및 `strict` 훅 프로파일에서 활성). 아래 블록을 `~/.claude/settings.json`에 복사하지 마세요 — 플러그인 설치에는 `~/.claude/scripts/`가 존재하지 않으며, 플러그인 훅을 중복하면 이중 실행이 발생합니다(`${CLAUDE_PLUGIN_ROOT}`는 사용자 `settings.json`에서 해석되지 않습니다).
|
||||
|
||||
**수동 설치**(`./install.sh`)인 경우 `~/.claude/settings.json`에 추가합니다:
|
||||
|
||||
```json
|
||||
{
|
||||
"hooks": {
|
||||
"PreToolUse": [
|
||||
{
|
||||
"matcher": "Edit|Write",
|
||||
"hooks": [
|
||||
{
|
||||
"type": "command",
|
||||
"command": "node \"${CLAUDE_PLUGIN_ROOT}/scripts/hooks/run-with-flags.js\" \"pre:edit-write:suggest-compact\" \"scripts/hooks/suggest-compact.js\" \"standard,strict\""
|
||||
}
|
||||
],
|
||||
"description": "Suggest manual compaction at logical intervals"
|
||||
"matcher": "Edit",
|
||||
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
|
||||
},
|
||||
{
|
||||
"matcher": "Write",
|
||||
"hooks": [{ "type": "command", "command": "node ~/.claude/scripts/hooks/suggest-compact.js" }]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -40,7 +40,9 @@ origin: ECC
|
||||
|
||||
## 钩子设置
|
||||
|
||||
添加到你的 `~/.claude/settings.json`:
|
||||
**作为插件安装?** 无需任何设置。插件的 `hooks/hooks.json` 已经注册了 `suggest-compact.js`(钩子 ID `pre:edit-write:suggest-compact`,在 `standard` 和 `strict` 钩子配置档中生效)。不要把下面的代码块复制到 `~/.claude/settings.json` — 插件安装中不存在 `~/.claude/scripts/`,并且重复注册插件钩子会导致双重执行。
|
||||
|
||||
**如果是手动安装**(`./install.sh`),添加到你的 `~/.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -29,7 +29,9 @@ description: Suggests manual context compaction at logical intervals to preserve
|
||||
|
||||
## Hook 設定
|
||||
|
||||
新增到你的 `~/.claude/settings.json`:
|
||||
**以外掛安裝?** 無需任何設定。外掛的 `hooks/hooks.json` 已經註冊了 `suggest-compact.js`(Hook ID `pre:edit-write:suggest-compact`,在 `standard` 與 `strict` hook 設定檔中生效)。請勿將下方區塊複製到 `~/.claude/settings.json` — 外掛安裝中不存在 `~/.claude/scripts/`,且重複註冊外掛 hook 會導致重複執行。
|
||||
|
||||
**如果是手動安裝**(`./install.sh`),新增到你的 `~/.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
@@ -40,7 +40,9 @@ Tool count alone is a weak proxy for window pressure: a few large file reads or
|
||||
|
||||
## Hook Setup
|
||||
|
||||
Add to your `~/.claude/settings.json`:
|
||||
**Installed as a plugin?** No setup is needed. The plugin's `hooks/hooks.json` already registers `suggest-compact.js` (hook id `pre:edit-write:suggest-compact`, active in the `standard` and `strict` hook profiles). Do not copy the block below into `~/.claude/settings.json` — `~/.claude/scripts/` does not exist on plugin installs, and duplicating a plugin hook causes double execution.
|
||||
|
||||
**If installed manually** (`./install.sh`), add to your `~/.claude/settings.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user