@liangjie559567/ultrapower 5.0.16 → 5.0.18

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
  "name": "ultrapower",
3
3
  "description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution. Combines superpowers' TDD/debugging discipline with OMC's multi-agent execution capabilities.",
4
- "version": "5.0.16",
4
+ "version": "5.0.18",
5
5
  "author": {
6
6
  "name": "Jesse Vincent & oh-my-claudecode contributors"
7
7
  },
package/docs/CLAUDE.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <!-- OMC:START -->
2
- <!-- OMC:VERSION:5.0.14 -->
2
+ <!-- OMC:VERSION:5.0.18 -->
3
3
  # ultrapower - Multi-Agent Orchestration 智能多 Agent 编排
4
4
 
5
5
  你正在使用 ultrapower(OMC),这是 Claude Code 的多 agent 编排层。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liangjie559567/ultrapower",
3
- "version": "5.0.16",
3
+ "version": "5.0.18",
4
4
  "description": "Disciplined multi-agent orchestration: workflow enforcement + parallel execution",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -55,7 +55,8 @@
55
55
  "sync-metadata:verify": "tsx scripts/sync-metadata.ts --verify",
56
56
  "sync-metadata:dry-run": "tsx scripts/sync-metadata.ts --dry-run",
57
57
  "prepare": "npm run build",
58
- "prepublishOnly": "npm run build && npm run compose-docs"
58
+ "prepublishOnly": "npm run build && npm run compose-docs",
59
+ "postinstall": "node scripts/plugin-setup.mjs"
59
60
  },
60
61
  "dependencies": {
61
62
  "@anthropic-ai/claude-agent-sdk": "^0.1.0",
@@ -54,6 +54,66 @@ function fixNestedCacheDir() {
54
54
 
55
55
  fixNestedCacheDir();
56
56
 
57
+ // Fix: npm install strips hidden directories (starting with '.'), so .claude-plugin/plugin.json
58
+ // is never extracted to the plugin cache. We recreate it directly in the plugin cache.
59
+ // The postinstall script runs from the npm-cache node_modules dir, so we must target the
60
+ // plugin cache path explicitly rather than relying on __dirname.
61
+ function fixMissingPluginJson() {
62
+ try {
63
+ const pluginRoot = dirname(__dirname);
64
+ const pkgPath = join(pluginRoot, 'package.json');
65
+ if (!existsSync(pkgPath)) return;
66
+ const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
67
+ const version = pkg.version || '0.0.0';
68
+
69
+ const pluginJson = {
70
+ name: 'ultrapower',
71
+ description: pkg.description || '',
72
+ version,
73
+ author: pkg.author ? { name: typeof pkg.author === 'string' ? pkg.author : pkg.author.name } : undefined,
74
+ homepage: pkg.homepage || '',
75
+ repository: pkg.repository?.url || pkg.repository || '',
76
+ license: pkg.license || 'MIT',
77
+ keywords: pkg.keywords || [],
78
+ skills: './skills/',
79
+ mcpServers: './.mcp.json'
80
+ };
81
+ const pluginJsonStr = JSON.stringify(pluginJson, null, 2);
82
+
83
+ // 1. Write to current install location (npm-cache node_modules dir)
84
+ const localPluginJsonDir = join(pluginRoot, '.claude-plugin');
85
+ const localPluginJsonPath = join(localPluginJsonDir, 'plugin.json');
86
+ if (!existsSync(localPluginJsonPath)) {
87
+ mkdirSync(localPluginJsonDir, { recursive: true });
88
+ writeFileSync(localPluginJsonPath, pluginJsonStr);
89
+ console.log('[OMC] Created .claude-plugin/plugin.json in install dir');
90
+ }
91
+
92
+ // 2. Write directly to plugin cache (marketplace: ultrapower, plugin: ultrapower)
93
+ // Claude Code copies from npm-cache but skips hidden dirs, so we patch the cache directly.
94
+ const pluginCacheBase = join(CLAUDE_DIR, 'plugins/cache/ultrapower/ultrapower');
95
+ if (existsSync(pluginCacheBase)) {
96
+ const versions = readdirSync(pluginCacheBase);
97
+ for (const v of versions) {
98
+ const cacheVersionDir = join(pluginCacheBase, v);
99
+ const cachePluginJsonDir = join(cacheVersionDir, '.claude-plugin');
100
+ const cachePluginJsonPath = join(cachePluginJsonDir, 'plugin.json');
101
+ if (!existsSync(cachePluginJsonPath)) {
102
+ mkdirSync(cachePluginJsonDir, { recursive: true });
103
+ // Use version-specific content for each cached version
104
+ const versionedPkg = { ...pluginJson, version: v };
105
+ writeFileSync(cachePluginJsonPath, JSON.stringify(versionedPkg, null, 2));
106
+ console.log(`[OMC] Created .claude-plugin/plugin.json in plugin cache v${v}`);
107
+ }
108
+ }
109
+ }
110
+ } catch (e) {
111
+ console.log('[OMC] Warning: Could not create .claude-plugin/plugin.json:', e.message);
112
+ }
113
+ }
114
+
115
+ fixMissingPluginJson();
116
+
57
117
  // 1. Create HUD directory
58
118
  if (!existsSync(HUD_DIR)) {
59
119
  mkdirSync(HUD_DIR, { recursive: true });
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-analyze-error
3
3
  description: "/ax-analyze-error — Axiom 错误分析工作流:根因诊断 → 自动修复 → 知识入队"
4
- triggers: ["ax-analyze-error", "analyze error", "报错了", "修 bug", "错误分析"]
5
4
  ---
6
5
 
7
6
  # Axiom 错误分析工作流
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-context
3
3
  description: "/ax-context — Axiom 上下文管理:读取/更新/保存记忆系统,维护任务状态"
4
- triggers: ["ax-context", "context manager", "上下文管理", "读取记忆", "保存状态"]
5
4
  ---
6
5
 
7
6
  # Axiom 上下文管理 Skill
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-decompose
3
3
  description: "/ax-decompose — Axiom 任务拆解工作流:Rough PRD → 系统架构 → 原子任务 DAG → Manifest 清单"
4
- triggers: ["ax-decompose", "decompose task", "拆解任务", "任务拆解", "细化设计"]
5
4
  ---
6
5
 
7
6
  # Axiom 任务拆解工作流 (Phase 2)
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-draft
3
3
  description: "/ax-draft — Axiom 需求起草工作流:需求澄清循环 → PRD 初稿生成 → 用户评审门禁"
4
- triggers: ["ax-draft", "draft requirement", "起草需求", "需求起草", "新需求"]
5
4
  ---
6
5
 
7
6
  # Axiom 需求起草工作流 (Phase 1)
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-evolution
3
3
  description: "/ax-evolution — Axiom 进化引擎触发:手动触发知识收割、模式检测和反思"
4
- triggers: ["ax-evolution", "evolution engine", "进化引擎", "查询知识库", "查询模式库"]
5
4
  ---
6
5
 
7
6
  # Axiom 进化引擎触发 Skill
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-evolve
3
3
  description: "/ax-evolve — Axiom 进化工作流:处理学习队列 → 更新知识库 → 模式检测 → 生成进化报告"
4
- triggers: ["ax-evolve", "evolve", "反思总结", "进化", "ax-reflect"]
5
4
  ---
6
5
 
7
6
  # Axiom 进化工作流
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-export
3
3
  description: "/ax-export — Axiom 系统导出:将 Axiom 配置打包为可移植 zip,支持模板模式和完整模式"
4
- triggers: ["ax-export", "export axiom", "导出系统", "axiom export"]
5
4
  ---
6
5
 
7
6
  # Axiom 系统导出
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-implement
3
3
  description: "/ax-implement — Axiom 实施交付工作流:按 Manifest 顺序执行原子任务,含 CI 门禁和自动修复"
4
- triggers: ["ax-implement", "implement feature", "开始开发", "交付流水线", "ax implement"]
5
4
  ---
6
5
 
7
6
  # Axiom 实施交付工作流 (Phase 3)
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-knowledge
3
3
  description: "/ax-knowledge — Axiom 知识查询:搜索知识库和模式库,返回相关条目"
4
- triggers: ["ax-knowledge", "knowledge query", "pattern query", "知识查询", "模式查询"]
5
4
  ---
6
5
 
7
6
  # Axiom 知识查询
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-reflect
3
3
  description: "/ax-reflect — Axiom 反思工作流:会话总结 → 经验提取 → Action Items → 知识入队"
4
- triggers: ["ax-reflect", "reflect", "反思", "总结", "session reflect"]
5
4
  ---
6
5
 
7
6
  # Axiom 反思工作流
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-review
3
3
  description: "/ax-review — Axiom 专家评审工作流:5专家并行评审 → 冲突仲裁 → Rough PRD 生成"
4
- triggers: ["ax-review", "expert review", "需求评审", "专家审查", "ax review"]
5
4
  ---
6
5
 
7
6
  # Axiom 专家评审工作流 (Phase 1.5)
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-rollback
3
3
  description: "/ax-rollback — Axiom 回滚工作流:回滚到最近检查点,恢复系统状态"
4
- triggers: ["ax-rollback", "rollback", "回滚", "恢复状态", "undo"]
5
4
  ---
6
5
 
7
6
  # Axiom 回滚工作流
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-status
3
3
  description: "/ax-status — Axiom 状态仪表盘:显示当前任务状态、进度、记忆摘要和系统健康"
4
- triggers: ["ax-status", "axiom status", "查看状态", "系统状态", "status"]
5
4
  ---
6
5
 
7
6
  # Axiom 状态仪表盘
@@ -1,7 +1,6 @@
1
1
  ---
2
2
  name: ax-suspend
3
3
  description: "/ax-suspend — Axiom 暂停保存工作流:保存当前状态快照,安全退出会话"
4
- triggers: ["ax-suspend", "suspend", "暂停任务", "保存退出", "save and exit"]
5
4
  ---
6
5
 
7
6
  # Axiom 暂停保存工作流
@@ -24,6 +24,53 @@ npm view @liangjie559567/ultrapower version 2>/dev/null || echo "Latest: (unavai
24
24
  - 已安装版本 != 最新版本:警告——插件已过时
25
25
  - 存在多个版本:警告——缓存陈旧
26
26
 
27
+ ### 第一步 bis:检查 npm-cache 复用问题
28
+
29
+ 检查插件缓存目录标注的版本号与实际内容是否一致:
30
+
31
+ ```bash
32
+ node -e "
33
+ const p=require('path'),f=require('fs'),h=require('os').homedir();
34
+ const d=process.env.CLAUDE_CONFIG_DIR||p.join(h,'.claude');
35
+ const b=p.join(d,'plugins','cache','omc','ultrapower');
36
+ try {
37
+ const vs=f.readdirSync(b).filter(x=>/^\d/.test(x)).sort((a,c)=>a.localeCompare(c,void 0,{numeric:true}));
38
+ if(!vs.length){console.log('No cache versions found');process.exit();}
39
+ const latest=vs[vs.length-1];
40
+ const pkgPath=p.join(b,latest,'package.json');
41
+ if(f.existsSync(pkgPath)){
42
+ const pkg=JSON.parse(f.readFileSync(pkgPath,'utf-8'));
43
+ if(pkg.version!==latest){
44
+ console.log('MISMATCH: dir='+latest+' pkg.version='+pkg.version);
45
+ console.log('CAUSE: npm-cache reuse (semver range satisfied old version)');
46
+ } else {
47
+ console.log('OK: version matches ('+latest+')');
48
+ }
49
+ } else {
50
+ console.log('WARN: package.json not found in cache/'+latest);
51
+ }
52
+ } catch(e){console.log('Error:',e.message);}
53
+ "
54
+
55
+ # 检查 npm-cache 中存储的 semver 范围
56
+ node -e "
57
+ const p=require('path'),f=require('fs'),h=require('os').homedir();
58
+ const d=process.env.CLAUDE_CONFIG_DIR||p.join(h,'.claude');
59
+ const npmCachePkg=p.join(d,'plugins','npm-cache','package.json');
60
+ if(f.existsSync(npmCachePkg)){
61
+ const pkg=JSON.parse(f.readFileSync(npmCachePkg,'utf-8'));
62
+ const dep=pkg.dependencies&&pkg.dependencies['@liangjie559567/ultrapower'];
63
+ console.log('npm-cache range:',dep||'(not found)');
64
+ } else {
65
+ console.log('npm-cache: not present (normal for fresh installs)');
66
+ }
67
+ "
68
+ ```
69
+
70
+ **诊断**:
71
+ - `MISMATCH: dir=X pkg.version=Y`:严重错误——npm-cache 复用导致旧内容被安装到新版本目录
72
+ - npm-cache range 显示旧版本范围(如 `^5.0.11`):警告——下次安装仍会复用旧缓存
73
+
27
74
  ### 第二步:检查 settings.json 中的旧版 hook
28
75
 
29
76
  读取 `~/.claude/settings.json`(用户级)和 `./.claude/settings.json`(项目级),检查是否存在包含以下条目的 `"hooks"` 键:
@@ -109,6 +156,7 @@ ls -la ~/.claude/skills/ 2>/dev/null
109
156
  | 检查项 | 状态 | 详情 |
110
157
  |-------|--------|---------|
111
158
  | 插件版本 | OK/WARN/CRITICAL | ... |
159
+ | npm-cache 复用 | OK/WARN/CRITICAL | ... |
112
160
  | 旧版 Hook (settings.json) | OK/CRITICAL | ... |
113
161
  | 旧版脚本 (~/.claude/hooks/) | OK/WARN | ... |
114
162
  | CLAUDE.md | OK/WARN/CRITICAL | ... |
@@ -150,6 +198,21 @@ rm -f ~/.claude/hooks/stop-continuation.sh
150
198
  node -e "const p=require('path'),f=require('fs'),d=process.env.CLAUDE_CONFIG_DIR||p.join(require('os').homedir(),'.claude'),b=p.join(d,'plugins','cache','omc','ultrapower');try{f.rmSync(b,{recursive:true,force:true});console.log('Plugin cache cleared. Restart Claude Code to fetch latest version.')}catch{console.log('No plugin cache found')}"
151
199
  ```
152
200
 
201
+ ### 修复:npm-cache 复用(插件内容是旧版本)
202
+
203
+ 症状:插件缓存目录版本号与 `package.json` 内 `version` 字段不一致。
204
+
205
+ ```bash
206
+ # 完整清洁重装(必须同时清除 npm-cache)
207
+ claude plugin uninstall ultrapower
208
+ rm -rf ~/.claude/plugins/npm-cache # 关键:清除 semver 范围缓存
209
+ rm -rf ~/.claude/plugins/cache/ultrapower
210
+ claude plugin marketplace update ultrapower
211
+ claude plugin install ultrapower
212
+ ```
213
+
214
+ > ⚠️ 仅清除插件缓存不够——npm-cache 中的 `^` semver 范围会导致安装器继续复用旧内容。
215
+
153
216
  ### 修复:陈旧缓存(多个版本)
154
217
  ```bash
155
218
  # 仅保留最新版本(跨平台)
@@ -365,6 +365,23 @@ EOF
365
365
  node -e "const p=require('path'),f=require('fs'),h=require('os').homedir(),d=process.env.CLAUDE_CONFIG_DIR||p.join(h,'.claude'),b=p.join(d,'plugins','cache','omc','ultrapower');try{const v=f.readdirSync(b).filter(x=>/^\d/.test(x)).sort((a,c)=>a.localeCompare(c,void 0,{numeric:true}));if(v.length<=1){console.log('Cache is clean');process.exit()}v.slice(0,-1).forEach(x=>{f.rmSync(p.join(b,x),{recursive:true,force:true})});console.log('Cleared',v.length-1,'stale cache version(s)')}catch{console.log('No cache directory found (normal for new installs)')}"
366
366
  ```
367
367
 
368
+ ### 如果插件内容是旧版本(npm-cache 复用问题)
369
+
370
+ **症状**:插件缓存目录标注为新版本号,但实际内容是旧版本(`package.json` 中 `version` 字段不匹配)。
371
+
372
+ **原因**:`~/.claude/plugins/npm-cache/package.json` 使用 `^` semver 范围,Claude Code 安装器判断旧缓存满足范围后直接复用,不重新下载。
373
+
374
+ **完整清洁重装**:
375
+ ```bash
376
+ claude plugin uninstall ultrapower
377
+ rm -rf ~/.claude/plugins/npm-cache # 关键:必须清除 npm-cache
378
+ rm -rf ~/.claude/plugins/cache/ultrapower
379
+ claude plugin marketplace update ultrapower
380
+ claude plugin install ultrapower
381
+ ```
382
+
383
+ > ⚠️ 仅清除插件缓存不够,必须同时清除 `npm-cache`。
384
+
368
385
  ## 步骤 3.6:检查更新
369
386
 
370
387
  如果有新版本可用,通知用户:
@@ -712,6 +729,23 @@ EOF
712
729
  node -e "const p=require('path'),f=require('fs'),h=require('os').homedir(),d=process.env.CLAUDE_CONFIG_DIR||p.join(h,'.claude'),b=p.join(d,'plugins','cache','omc','ultrapower');try{const v=f.readdirSync(b).filter(x=>/^\d/.test(x)).sort((a,c)=>a.localeCompare(c,void 0,{numeric:true}));if(v.length<=1){console.log('Cache is clean');process.exit()}v.slice(0,-1).forEach(x=>{f.rmSync(p.join(b,x),{recursive:true,force:true})});console.log('Cleared',v.length-1,'stale cache version(s)')}catch{console.log('No cache directory found (normal for new installs)')}"
713
730
  ```
714
731
 
732
+ ### 如果插件内容是旧版本(npm-cache 复用问题)
733
+
734
+ **症状**:插件缓存目录标注为新版本号,但实际内容是旧版本(`package.json` 中 `version` 字段不匹配)。
735
+
736
+ **原因**:`~/.claude/plugins/npm-cache/package.json` 使用 `^` semver 范围,Claude Code 安装器判断旧缓存满足范围后直接复用,不重新下载。
737
+
738
+ **完整清洁重装**:
739
+ ```bash
740
+ claude plugin uninstall ultrapower
741
+ rm -rf ~/.claude/plugins/npm-cache # 关键:必须清除 npm-cache
742
+ rm -rf ~/.claude/plugins/cache/ultrapower
743
+ claude plugin marketplace update ultrapower
744
+ claude plugin install ultrapower
745
+ ```
746
+
747
+ > ⚠️ 仅清除插件缓存不够,必须同时清除 `npm-cache`。
748
+
715
749
  ## 步骤 3.6:检查更新
716
750
 
717
751
  如果有新版本可用,通知用户:
@@ -20,13 +20,18 @@ description: ultrapower 的自动化发布工作流
20
20
  按顺序执行以下步骤:
21
21
 
22
22
  ### 1. 版本升级
23
- 在所有位置更新版本:
23
+ 在所有位置更新版本(**必须同步,缺一不可**):
24
24
  - `package.json`
25
25
  - `src/installer/index.ts`(VERSION 常量)
26
26
  - `src/__tests__/installer.test.ts`(预期版本)
27
27
  - `.claude-plugin/plugin.json`
28
+ - `.claude-plugin/marketplace.json`(`"version"` 和 `"source.version"` 两处)
29
+ - `docs/CLAUDE.md`(`<!-- OMC:VERSION:X.Y.Z -->`)
28
30
  - `README.md`(版本徽章和标题)
29
31
 
32
+ > ⚠️ `marketplace.json` 是安装器读取的入口,版本不同步会导致用户始终安装旧版本。
33
+ > ⚠️ `docs/CLAUDE.md` 是 `/ultrapower:omc-setup` 下载的模板,版本不同步会导致用户安装后显示旧版本号。
34
+
30
35
  ### 2. 运行测试
31
36
  ```bash
32
37
  npm run test:run
@@ -46,17 +51,24 @@ git push origin main
46
51
  git push origin v<version>
47
52
  ```
48
53
 
49
- ### 5. 发布到 npm
54
+ ### 5. 刷新本地 marketplace 缓存
55
+ ```bash
56
+ claude plugin marketplace update ultrapower
57
+ ```
58
+ > 推送到 GitHub 后必须执行此步,否则本地安装器仍读取旧版 `marketplace.json`。
59
+
60
+ ### 6. 发布到 npm
50
61
  ```bash
51
62
  npm publish --access public
52
63
  ```
64
+ > ⚠️ npm 不允许覆盖已发布版本,版本号必须先升级再发布。
53
65
 
54
- ### 6. 创建 GitHub Release
66
+ ### 7. 创建 GitHub Release
55
67
  ```bash
56
68
  gh release create v<version> --title "v<version> - <title>" --notes "<release notes>"
57
69
  ```
58
70
 
59
- ### 7. 验证
71
+ ### 8. 验证
60
72
  - [ ] npm: https://www.npmjs.com/package/@liangjie559567/ultrapower
61
73
  - [ ] GitHub: https://github.com/liangjie559567/ultrapower/releases
62
74
 
@@ -68,6 +80,8 @@ gh release create v<version> --title "v<version> - <title>" --notes "<release no
68
80
  | `src/installer/index.ts` | `export const VERSION = 'X.Y.Z'` |
69
81
  | `src/__tests__/installer.test.ts` | `expect(VERSION).toBe('X.Y.Z')` |
70
82
  | `.claude-plugin/plugin.json` | `"version": "X.Y.Z"` |
83
+ | `.claude-plugin/marketplace.json` | `"version": "X.Y.Z"` 和 `"source": { "version": "X.Y.Z" }` |
84
+ | `docs/CLAUDE.md` | `<!-- OMC:VERSION:X.Y.Z -->` |
71
85
  | `README.md` | 标题 + 版本徽章 |
72
86
 
73
87
  ## 语义化版本
@@ -80,7 +94,104 @@ gh release create v<version> --title "v<version> - <title>" --notes "<release no
80
94
 
81
95
  - 发布前始终运行测试
82
96
  - 创建总结变更的发布说明
83
- - 插件市场从 GitHub releases 自动同步
97
+ - 推送到 GitHub 后必须运行 `claude plugin marketplace update ultrapower` 刷新本地缓存
98
+ - npm 不允许覆盖已发布版本,每次发布前必须升级版本号
99
+ - `.npmignore` 必须排除缓存目录(`ultrapower/`、`*.tgz`、`.claude/`),防止安装时产生无限嵌套
100
+
101
+ ## .npmignore 必要内容
102
+
103
+ 发布前确认 `.npmignore` 包含以下排除项:
104
+
105
+ ```
106
+ # 防止缓存目录被打包(会导致安装时无限嵌套)
107
+ ultrapower/
108
+ .claude/
109
+ plugins/cache/
110
+ *.tgz
111
+ *.tar.gz
112
+ node_modules/
113
+ .git/
114
+ dist/
115
+ ```
116
+
117
+ ## 故障排查
118
+
119
+ ### 安装后 skill 无法识别
120
+
121
+ 检查插件缓存路径是否正确:
122
+ ```bash
123
+ ls ~/.claude/plugins/cache/ultrapower/ultrapower/<version>/skills/
124
+ ```
125
+ 正确路径应直接包含 `skills/`、`dist/` 等目录。
126
+
127
+ ### 缓存目录无限嵌套
128
+
129
+ 症状:`cache/ultrapower/ultrapower/5.x.x/ultrapower/5.x.x/ultrapower/...`
130
+
131
+ 原因:npm 包中包含了 `ultrapower/` 子目录(通常是缓存目录被打包进去)。
132
+
133
+ 修复步骤:
134
+ ```bash
135
+ # 1. 卸载插件
136
+ claude plugin uninstall ultrapower
137
+
138
+ # 2. 清除缓存
139
+ rm -rf ~/.claude/plugins/cache/ultrapower
140
+ rm -rf ~/.claude/plugins/marketplaces/ultrapower
141
+
142
+ # 3. 确认 .npmignore 已排除 ultrapower/ 目录
143
+
144
+ # 4. 重新发布(需升级版本号)
145
+ npm publish --access public
146
+
147
+ # 5. 重新安装
148
+ claude plugin install ultrapower
149
+ ```
150
+
151
+ ### 安装后仍是旧版本
152
+
153
+ 原因:本地 marketplace 缓存未更新,安装器读取的是旧版 `marketplace.json`。
154
+
155
+ 修复:
156
+ ```bash
157
+ claude plugin marketplace update ultrapower
158
+ claude plugin uninstall ultrapower
159
+ claude plugin install ultrapower
160
+ ```
161
+
162
+ ### 安装后插件内容是旧版本(npm-cache 复用)
163
+
164
+ 症状:插件缓存目录标注为新版本号(如 `5.0.17/`),但 `package.json` 内的 `version` 字段仍是旧版本(如 `5.0.11`)。
165
+
166
+ 原因:`~/.claude/plugins/npm-cache/package.json` 中存储了 semver 范围(如 `"^5.0.11"`),Claude Code 安装器判断旧缓存满足该范围,直接复用旧文件而不重新下载。
167
+
168
+ 验证:
169
+ ```bash
170
+ cat ~/.claude/plugins/npm-cache/package.json
171
+ # 如果看到 "^5.0.11" 之类的旧版本范围,即为此问题
172
+ cat ~/.claude/plugins/cache/ultrapower/ultrapower/5.0.17/package.json
173
+ # 如果 version 字段不是 5.0.17,确认是 npm-cache 复用导致
174
+ ```
175
+
176
+ 修复(完整清洁重装):
177
+ ```bash
178
+ # 1. 卸载插件
179
+ claude plugin uninstall ultrapower
180
+
181
+ # 2. 清除 npm-cache(关键!仅清除插件缓存不够)
182
+ rm -rf ~/.claude/plugins/npm-cache
183
+
184
+ # 3. 清除插件缓存
185
+ rm -rf ~/.claude/plugins/cache/ultrapower
186
+
187
+ # 4. 刷新 marketplace 缓存
188
+ claude plugin marketplace update ultrapower
189
+
190
+ # 5. 重新安装(此时会强制从 npm 下载最新版)
191
+ claude plugin install ultrapower
192
+ ```
193
+
194
+ > ⚠️ 仅执行步骤 3(清除插件缓存)不够——npm-cache 仍会导致安装器复用旧内容。必须同时清除 npm-cache。
84
195
 
85
196
  ## 路由触发
86
197