claude-pangu 2.2.14 → 2.2.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://code.claude.com/plugin-schema.json",
3
3
  "name": "oh-my-claude",
4
- "version": "2.2.14",
4
+ "version": "2.2.16",
5
5
  "hooks": "../hooks/hooks.json",
6
6
  "description": "基于中国传统文化的 Claude Code 智能编排插件 - A Claude Code plugin inspired by Chinese traditional culture",
7
7
  "author": "ZDragon17",
package/hooks/hooks.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "SessionStart": [
4
4
  {
5
5
  "type": "command",
6
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/auto-update-checker.sh --session-start",
6
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/auto-update-checker.sh --session-start",
7
7
  "timeout": 10000,
8
8
  "continueOnError": true,
9
9
  "priority": "low",
@@ -14,7 +14,7 @@
14
14
  "Stop": [
15
15
  {
16
16
  "type": "command",
17
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/ralph-loop.sh",
17
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/ralph-loop.sh",
18
18
  "timeout": 3000,
19
19
  "continueOnError": true,
20
20
  "priority": "critical",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  {
24
24
  "type": "command",
25
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/todo-continuation.sh",
25
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/todo-continuation.sh",
26
26
  "timeout": 3000,
27
27
  "continueOnError": true,
28
28
  "priority": "critical",
@@ -30,7 +30,7 @@
30
30
  },
31
31
  {
32
32
  "type": "command",
33
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/agent-ready-notification.sh",
33
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/agent-ready-notification.sh",
34
34
  "timeout": 3000,
35
35
  "continueOnError": true,
36
36
  "priority": "low",
@@ -41,7 +41,7 @@
41
41
  "UserPromptSubmit": [
42
42
  {
43
43
  "type": "command",
44
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/first-use-onboarding.sh",
44
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/first-use-onboarding.sh",
45
45
  "timeout": 2000,
46
46
  "continueOnError": true,
47
47
  "priority": "critical",
@@ -50,7 +50,7 @@
50
50
  },
51
51
  {
52
52
  "type": "command",
53
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/keyword-detector.sh",
53
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/keyword-detector.sh",
54
54
  "timeout": 3000,
55
55
  "continueOnError": true,
56
56
  "priority": "critical",
@@ -59,7 +59,7 @@
59
59
  },
60
60
  {
61
61
  "type": "command",
62
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/at-agent-summoner.sh",
62
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/at-agent-summoner.sh",
63
63
  "timeout": 2000,
64
64
  "continueOnError": true,
65
65
  "priority": "critical",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  {
70
70
  "type": "command",
71
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/atlas.sh",
71
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/atlas.sh",
72
72
  "timeout": 3000,
73
73
  "continueOnError": true,
74
74
  "priority": "high",
@@ -76,7 +76,7 @@
76
76
  },
77
77
  {
78
78
  "type": "command",
79
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/agent-collaboration.sh",
79
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/agent-collaboration.sh",
80
80
  "timeout": 5000,
81
81
  "continueOnError": true,
82
82
  "priority": "high",
@@ -84,7 +84,7 @@
84
84
  },
85
85
  {
86
86
  "type": "command",
87
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/error-recovery.sh",
87
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/error-recovery.sh",
88
88
  "timeout": 5000,
89
89
  "continueOnError": true,
90
90
  "priority": "high",
@@ -92,7 +92,7 @@
92
92
  },
93
93
  {
94
94
  "type": "command",
95
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/session-recovery.sh",
95
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/session-recovery.sh",
96
96
  "timeout": 3000,
97
97
  "continueOnError": true,
98
98
  "priority": "high",
@@ -100,7 +100,7 @@
100
100
  },
101
101
  {
102
102
  "type": "command",
103
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/task-checkpointing.sh",
103
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/task-checkpointing.sh",
104
104
  "timeout": 3000,
105
105
  "continueOnError": true,
106
106
  "priority": "normal",
@@ -108,7 +108,7 @@
108
108
  },
109
109
  {
110
110
  "type": "command",
111
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/context-compression.sh",
111
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/context-compression.sh",
112
112
  "timeout": 3000,
113
113
  "continueOnError": true,
114
114
  "priority": "normal",
@@ -116,7 +116,7 @@
116
116
  },
117
117
  {
118
118
  "type": "command",
119
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/preemptive-compaction.sh",
119
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/preemptive-compaction.sh",
120
120
  "timeout": 3000,
121
121
  "continueOnError": true,
122
122
  "priority": "normal",
@@ -124,7 +124,7 @@
124
124
  },
125
125
  {
126
126
  "type": "command",
127
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/rules-injector.sh",
127
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/rules-injector.sh",
128
128
  "timeout": 3000,
129
129
  "continueOnError": true,
130
130
  "priority": "normal",
@@ -132,7 +132,7 @@
132
132
  },
133
133
  {
134
134
  "type": "command",
135
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/think-mode.sh",
135
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/think-mode.sh",
136
136
  "timeout": 3000,
137
137
  "continueOnError": true,
138
138
  "priority": "normal",
@@ -140,7 +140,7 @@
140
140
  },
141
141
  {
142
142
  "type": "command",
143
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/lsp-tools.sh",
143
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/lsp-tools.sh",
144
144
  "timeout": 5000,
145
145
  "continueOnError": true,
146
146
  "priority": "low",
@@ -149,7 +149,7 @@
149
149
  },
150
150
  {
151
151
  "type": "command",
152
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/ast-grep.sh",
152
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/ast-grep.sh",
153
153
  "timeout": 5000,
154
154
  "continueOnError": true,
155
155
  "priority": "low",
@@ -158,7 +158,7 @@
158
158
  },
159
159
  {
160
160
  "type": "command",
161
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/code-quality-checker.sh",
161
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/code-quality-checker.sh",
162
162
  "timeout": 3000,
163
163
  "continueOnError": true,
164
164
  "priority": "low",
@@ -166,7 +166,7 @@
166
166
  },
167
167
  {
168
168
  "type": "command",
169
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/output-truncator.sh",
169
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/output-truncator.sh",
170
170
  "timeout": 2000,
171
171
  "continueOnError": true,
172
172
  "priority": "low",
@@ -174,7 +174,7 @@
174
174
  },
175
175
  {
176
176
  "type": "command",
177
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/directory-agents-injector.sh",
177
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/directory-agents-injector.sh",
178
178
  "timeout": 3000,
179
179
  "continueOnError": true,
180
180
  "priority": "low",
@@ -182,7 +182,7 @@
182
182
  },
183
183
  {
184
184
  "type": "command",
185
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/directory-readme-injector.sh",
185
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/directory-readme-injector.sh",
186
186
  "timeout": 3000,
187
187
  "continueOnError": true,
188
188
  "priority": "low",
@@ -190,7 +190,7 @@
190
190
  },
191
191
  {
192
192
  "type": "command",
193
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/auto-slash-command.sh",
193
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/auto-slash-command.sh",
194
194
  "timeout": 2000,
195
195
  "continueOnError": true,
196
196
  "priority": "low",
@@ -198,7 +198,7 @@
198
198
  },
199
199
  {
200
200
  "type": "command",
201
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/auto-update-checker.sh",
201
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/auto-update-checker.sh",
202
202
  "timeout": 5000,
203
203
  "continueOnError": true,
204
204
  "priority": "low",
@@ -206,7 +206,7 @@
206
206
  },
207
207
  {
208
208
  "type": "command",
209
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/interactive-bash-session.sh",
209
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/interactive-bash-session.sh",
210
210
  "timeout": 2000,
211
211
  "continueOnError": true,
212
212
  "priority": "low",
@@ -215,7 +215,7 @@
215
215
  },
216
216
  {
217
217
  "type": "command",
218
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/agent-usage-reminder.sh",
218
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/agent-usage-reminder.sh",
219
219
  "timeout": 2000,
220
220
  "continueOnError": true,
221
221
  "priority": "low",
@@ -225,7 +225,7 @@
225
225
  "PostToolUse": [
226
226
  {
227
227
  "type": "command",
228
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/progress-notifier.sh",
228
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/progress-notifier.sh",
229
229
  "timeout": 2000,
230
230
  "continueOnError": true,
231
231
  "priority": "critical",
@@ -234,7 +234,7 @@
234
234
  },
235
235
  {
236
236
  "type": "command",
237
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/context-window-monitor.sh",
237
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/context-window-monitor.sh",
238
238
  "timeout": 2000,
239
239
  "continueOnError": true,
240
240
  "priority": "critical",
@@ -242,7 +242,7 @@
242
242
  },
243
243
  {
244
244
  "type": "command",
245
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/context-smart-alert.sh",
245
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/context-smart-alert.sh",
246
246
  "timeout": 2000,
247
247
  "continueOnError": true,
248
248
  "priority": "high",
@@ -251,7 +251,7 @@
251
251
  },
252
252
  {
253
253
  "type": "command",
254
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/anthropic-context-window-limit-recovery.sh",
254
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/anthropic-context-window-limit-recovery.sh",
255
255
  "timeout": 2000,
256
256
  "continueOnError": true,
257
257
  "priority": "critical",
@@ -259,7 +259,7 @@
259
259
  },
260
260
  {
261
261
  "type": "command",
262
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/failure-transparency.sh",
262
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/failure-transparency.sh",
263
263
  "timeout": 2000,
264
264
  "continueOnError": true,
265
265
  "priority": "high",
@@ -268,7 +268,7 @@
268
268
  },
269
269
  {
270
270
  "type": "command",
271
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/tool-output-validator.sh",
271
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/tool-output-validator.sh",
272
272
  "timeout": 2000,
273
273
  "continueOnError": true,
274
274
  "priority": "high",
@@ -276,7 +276,7 @@
276
276
  },
277
277
  {
278
278
  "type": "command",
279
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/edit-error-recovery.sh",
279
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/edit-error-recovery.sh",
280
280
  "timeout": 2000,
281
281
  "continueOnError": true,
282
282
  "priority": "high",
@@ -284,7 +284,7 @@
284
284
  },
285
285
  {
286
286
  "type": "command",
287
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/delegate-task-retry.sh",
287
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/delegate-task-retry.sh",
288
288
  "timeout": 5000,
289
289
  "continueOnError": true,
290
290
  "priority": "high",
@@ -292,7 +292,7 @@
292
292
  },
293
293
  {
294
294
  "type": "command",
295
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/empty-task-response-detector.sh",
295
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/empty-task-response-detector.sh",
296
296
  "timeout": 2000,
297
297
  "continueOnError": true,
298
298
  "priority": "normal",
@@ -300,7 +300,7 @@
300
300
  },
301
301
  {
302
302
  "type": "command",
303
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/thinking-block-validator.sh",
303
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/thinking-block-validator.sh",
304
304
  "timeout": 2000,
305
305
  "continueOnError": true,
306
306
  "priority": "normal",
@@ -308,7 +308,7 @@
308
308
  },
309
309
  {
310
310
  "type": "command",
311
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/output-truncator.sh",
311
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/output-truncator.sh",
312
312
  "timeout": 2000,
313
313
  "continueOnError": true,
314
314
  "priority": "normal",
@@ -316,7 +316,7 @@
316
316
  },
317
317
  {
318
318
  "type": "command",
319
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/session-notification.sh",
319
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/session-notification.sh",
320
320
  "timeout": 3000,
321
321
  "continueOnError": true,
322
322
  "priority": "normal",
@@ -325,7 +325,7 @@
325
325
  },
326
326
  {
327
327
  "type": "command",
328
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/background-notification.sh",
328
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/background-notification.sh",
329
329
  "timeout": 3000,
330
330
  "continueOnError": true,
331
331
  "priority": "low",
@@ -333,7 +333,7 @@
333
333
  },
334
334
  {
335
335
  "type": "command",
336
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/tmux-agent-visualizer.sh",
336
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/tmux-agent-visualizer.sh",
337
337
  "timeout": 3000,
338
338
  "continueOnError": true,
339
339
  "priority": "low",
@@ -342,7 +342,7 @@
342
342
  },
343
343
  {
344
344
  "type": "command",
345
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/background-compaction.sh",
345
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/background-compaction.sh",
346
346
  "timeout": 2000,
347
347
  "continueOnError": true,
348
348
  "priority": "low",
@@ -350,7 +350,7 @@
350
350
  },
351
351
  {
352
352
  "type": "command",
353
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/hook-performance-monitor.sh cleanup",
353
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/hook-performance-monitor.sh cleanup",
354
354
  "timeout": 2000,
355
355
  "continueOnError": true,
356
356
  "priority": "low",
@@ -359,7 +359,7 @@
359
359
  },
360
360
  {
361
361
  "type": "command",
362
- "command": "bash $HOME/.claude/plugins/oh-my-claude/hooks/agent-handoff-prompt.sh",
362
+ "command": "bash ~/.claude/plugins/oh-my-claude/hooks/agent-handoff-prompt.sh",
363
363
  "timeout": 2000,
364
364
  "continueOnError": true,
365
365
  "priority": "normal",
@@ -368,7 +368,7 @@
368
368
  },
369
369
  {
370
370
  "type": "command",
371
- "command": "sh $HOME/.claude/plugins/oh-my-claude/hooks/error-friendly-display.sh",
371
+ "command": "sh ~/.claude/plugins/oh-my-claude/hooks/error-friendly-display.sh",
372
372
  "timeout": 2000,
373
373
  "continueOnError": true,
374
374
  "priority": "normal",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-pangu",
3
- "version": "2.2.14",
3
+ "version": "2.2.16",
4
4
  "description": "基于中国传统文化的 Claude Code 智能编排插件 - A Claude Code plugin inspired by Chinese traditional culture (原名 oh-my-claude)",
5
5
  "keywords": [
6
6
  "claude-code",
package/scripts/cli.js CHANGED
@@ -382,29 +382,39 @@ function copyPluginFiles(packageDir, pluginDir, showProgress = true) {
382
382
  return stats;
383
383
  }
384
384
 
385
- /**
386
- * 设置 hook 脚本权限(Unix
387
- * @param {string} pluginDir - 插件目录
388
- */
389
- function setHookPermissions(pluginDir) {
390
- if (os.platform() === 'win32') {
391
- return; // Windows 不需要设置权限
392
- }
393
-
394
- const hooksDir = path.join(pluginDir, 'hooks');
395
- if (!fs.existsSync(hooksDir)) {
396
- return;
397
- }
398
-
399
- const hookFiles = fs.readdirSync(hooksDir).filter(f => f.endsWith('.sh'));
400
- for (const hookFile of hookFiles) {
401
- try {
402
- fs.chmodSync(path.join(hooksDir, hookFile), '755');
403
- } catch (err) {
404
- warn(`设置权限失败: ${hookFile}`);
405
- }
406
- }
407
- }
385
+ /**
386
+ * 设置 hook 脚本权限(Unix)- 递归处理所有子目录
387
+ * @param {string} pluginDir - 插件目录
388
+ */
389
+ function setHookPermissions(pluginDir) {
390
+ if (os.platform() === 'win32') {
391
+ return; // Windows 不需要设置权限
392
+ }
393
+
394
+ const hooksDir = path.join(pluginDir, 'hooks');
395
+ if (!fs.existsSync(hooksDir)) {
396
+ return;
397
+ }
398
+
399
+ // 递归设置权限
400
+ function setPermissionsRecursive(dir) {
401
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
402
+ for (const entry of entries) {
403
+ const fullPath = path.join(dir, entry.name);
404
+ if (entry.isDirectory()) {
405
+ setPermissionsRecursive(fullPath);
406
+ } else if (entry.name.endsWith('.sh')) {
407
+ try {
408
+ fs.chmodSync(fullPath, '755');
409
+ } catch (err) {
410
+ warn(`设置权限失败: ${entry.name}`);
411
+ }
412
+ }
413
+ }
414
+ }
415
+
416
+ setPermissionsRecursive(hooksDir);
417
+ }
408
418
 
409
419
  /**
410
420
  * 安装 slash commands 到 ~/.claude/commands/
@@ -540,47 +550,77 @@ function installSkills(packageDir) {
540
550
  return stats;
541
551
  }
542
552
 
543
- /**
544
- * 验证安装结果
545
- * @returns {Object} 验证结果
546
- */
547
- function verifyInstallation() {
548
- info('验证安装...');
549
- const commandsDir = getCommandsDir();
550
- const result = { success: true, errors: [] };
551
-
552
- // 检查关键命令文件
553
- const yishanPath = path.join(commandsDir, 'yishan.md');
554
- if (fs.existsSync(yishanPath)) {
555
- success('✓ yishan.md 已安装');
556
- } else {
557
- warn('✗ yishan.md 未找到');
558
- result.errors.push('yishan.md 未找到');
559
- result.success = false;
560
- }
561
-
562
- // 检查命令数量
563
- if (fs.existsSync(commandsDir)) {
564
- const cmdFiles = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md'));
565
- if (cmdFiles.length > 0) {
566
- success(`✓ 已安装 ${cmdFiles.length} 个命令`);
567
- } else {
568
- warn('✗ 未检测到任何命令文件');
569
- result.errors.push('未检测到命令文件');
570
- result.success = false;
571
- }
572
- } else {
573
- warn('✗ commands 目录不存在');
574
- result.errors.push('commands 目录不存在');
575
- result.success = false;
576
- }
577
-
578
- if (!result.success) {
579
- warn('安装可能不完整,请检查上述警告');
580
- }
581
-
582
- return result;
583
- }
553
+ /**
554
+ * 验证安装结果
555
+ * @returns {Object} 验证结果
556
+ */
557
+ function verifyInstallation() {
558
+ info('验证安装...');
559
+ const commandsDir = getCommandsDir();
560
+ const pluginDir = getPluginDir();
561
+ const result = { success: true, errors: [] };
562
+
563
+ // 检查关键命令文件
564
+ const yishanPath = path.join(commandsDir, 'yishan.md');
565
+ if (fs.existsSync(yishanPath)) {
566
+ success('✓ yishan.md 已安装');
567
+ } else {
568
+ warn('yishan.md 未找到');
569
+ result.errors.push('yishan.md 未找到');
570
+ result.success = false;
571
+ }
572
+
573
+ // 检查命令数量
574
+ if (fs.existsSync(commandsDir)) {
575
+ const cmdFiles = fs.readdirSync(commandsDir).filter(f => f.endsWith('.md'));
576
+ if (cmdFiles.length > 0) {
577
+ success(`✓ 已安装 ${cmdFiles.length} 个命令`);
578
+ } else {
579
+ warn('✗ 未检测到任何命令文件');
580
+ result.errors.push('未检测到命令文件');
581
+ result.success = false;
582
+ }
583
+ } else {
584
+ warn('commands 目录不存在');
585
+ result.errors.push('commands 目录不存在');
586
+ result.success = false;
587
+ }
588
+
589
+ // 检查 hooks 目录和关键 hook 文件
590
+ const hooksDir = path.join(pluginDir, 'hooks');
591
+ if (fs.existsSync(hooksDir)) {
592
+ const hookFiles = fs.readdirSync(hooksDir).filter(f => f.endsWith('.sh'));
593
+ if (hookFiles.length > 0) {
594
+ success(`✓ 已安装 ${hookFiles.length} 个 hooks`);
595
+ } else {
596
+ warn('✗ hooks 目录为空');
597
+ result.errors.push('hooks 目录为空');
598
+ result.success = false;
599
+ }
600
+
601
+ // 检查关键 hook 文件
602
+ const criticalHooks = ['todo-continuation.sh', 'ralph-loop.sh', 'keyword-detector.sh', 'hooks.json'];
603
+ for (const hook of criticalHooks) {
604
+ const hookPath = path.join(hooksDir, hook);
605
+ if (!fs.existsSync(hookPath)) {
606
+ warn(`✗ 缺少关键 hook: ${hook}`);
607
+ result.errors.push(`缺少关键 hook: ${hook}`);
608
+ result.success = false;
609
+ }
610
+ }
611
+ } else {
612
+ warn('✗ hooks 目录不存在');
613
+ result.errors.push('hooks 目录不存在');
614
+ result.success = false;
615
+ }
616
+
617
+ if (!result.success) {
618
+ warn('安装可能不完整,请检查上述警告');
619
+ warn('建议重新安装: npx claude-pangu@latest install');
620
+ }
621
+
622
+ return result;
623
+ }
584
624
 
585
625
  /**
586
626
  * 注册插件到 Claude Code
@@ -1075,9 +1115,9 @@ function verify() {
1075
1115
  }
1076
1116
  success(`插件目录存在: ${pluginDir}`);
1077
1117
 
1078
- // 检查必需目录
1079
- const requiredDirs = ['agents', 'commands', 'skills', '.claude-plugin'];
1080
- const optionalDirs = ['hooks'];
1118
+ // 检查必需目录 - hooks 是核心功能,必须存在
1119
+ const requiredDirs = ['agents', 'commands', 'skills', '.claude-plugin', 'hooks'];
1120
+ const optionalDirs = [];
1081
1121
 
1082
1122
  info('\n检查目录结构...');
1083
1123
  for (const dir of requiredDirs) {
@@ -1118,20 +1158,34 @@ function verify() {
1118
1158
  hasErrors = true;
1119
1159
  }
1120
1160
 
1121
- // 检查关键 Agent 文件
1122
- info('\n检查核心 Agent...');
1123
- const coreAgents = ['yugong.md', 'zhuge.md', 'baozheng.md'];
1124
- for (const agent of coreAgents) {
1125
- const agentPath = path.join(pluginDir, 'agents', agent);
1126
- if (fs.existsSync(agentPath)) {
1127
- success(`agents/${agent}`);
1128
- } else {
1129
- error(`缺少核心 Agent: ${agent}`);
1130
- hasErrors = true;
1131
- }
1132
- }
1133
-
1134
- // 检查 Claude Code
1161
+ // 检查关键 Agent 文件
1162
+ info('\n检查核心 Agent...');
1163
+ const coreAgents = ['yugong.md', 'zhuge.md', 'baozheng.md'];
1164
+ for (const agent of coreAgents) {
1165
+ const agentPath = path.join(pluginDir, 'agents', agent);
1166
+ if (fs.existsSync(agentPath)) {
1167
+ success(`agents/${agent}`);
1168
+ } else {
1169
+ error(`缺少核心 Agent: ${agent}`);
1170
+ hasErrors = true;
1171
+ }
1172
+ }
1173
+
1174
+ // 检查关键 Hook 文件
1175
+ info('\n检查核心 Hooks...');
1176
+ const coreHooks = ['todo-continuation.sh', 'ralph-loop.sh', 'keyword-detector.sh', 'hooks.json'];
1177
+ const hooksDir = path.join(pluginDir, 'hooks');
1178
+ for (const hook of coreHooks) {
1179
+ const hookPath = path.join(hooksDir, hook);
1180
+ if (fs.existsSync(hookPath)) {
1181
+ success(`hooks/${hook}`);
1182
+ } else {
1183
+ error(`缺少核心 Hook: ${hook}`);
1184
+ hasErrors = true;
1185
+ }
1186
+ }
1187
+
1188
+ // 检查 Claude Code
1135
1189
  info('\n检查 Claude Code CLI...');
1136
1190
  if (checkClaudeCode()) {
1137
1191
  success('Claude Code CLI 可用');