superpowers-zh 1.1.0 → 1.1.1

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.
@@ -30,7 +30,7 @@ function showHelp() {
30
30
  superpowers-zh v${PKG.version} — AI 编程超能力中文版
31
31
 
32
32
  用法:
33
- npx superpowers-zh 安装 skills 到当前项目
33
+ npx superpowers-zh 安装 skills(及 agents)到当前项目
34
34
  npx superpowers-zh --help 显示帮助
35
35
  npx superpowers-zh --version 显示版本
36
36
 
@@ -38,14 +38,22 @@ function showHelp() {
38
38
  自动检测当前项目使用的 AI 编程工具:
39
39
  Claude Code / Cursor / Codex / Kiro / Trae / Antigravity / VS Code
40
40
  将 ${countDirs(SKILLS_SRC)} 个 skills 安装到对应目录。
41
- 如果未检测到任何工具,默认安装到 .claude/skills/。
41
+ Claude Code 还会额外安装 agents 到 .claude/agents/。
42
+ 如果未检测到任何工具,默认安装到 .claude/skills/ 和 .claude/agents/。
42
43
 
43
44
  项目:https://github.com/jnMetaCode/superpowers-zh
44
45
  `);
45
46
  }
46
47
 
47
48
  function install() {
49
+ try {
48
50
  console.log(`\n superpowers-zh v${PKG.version} — AI 编程超能力中文版\n`);
51
+
52
+ if (!existsSync(SKILLS_SRC)) {
53
+ console.error(' ❌ 错误:skills 源目录不存在,请重新安装 superpowers-zh。');
54
+ process.exit(1);
55
+ }
56
+
49
57
  console.log(` 源: ${countDirs(SKILLS_SRC)} 个 skills`);
50
58
  console.log(` 目标项目: ${PROJECT_DIR}\n`);
51
59
 
@@ -75,9 +83,20 @@ function install() {
75
83
  mkdirSync(dest, { recursive: true });
76
84
  cpSync(SKILLS_SRC, dest, { recursive: true });
77
85
  console.log(` ✅ 默认安装: ${countDirs(dest)} 个 skills -> ${dest}`);
86
+
87
+ if (existsSync(AGENTS_SRC)) {
88
+ const agentsDest = resolve(PROJECT_DIR, '.claude', 'agents');
89
+ mkdirSync(agentsDest, { recursive: true });
90
+ cpSync(AGENTS_SRC, agentsDest, { recursive: true });
91
+ console.log(` ✅ 默认安装: agents -> ${agentsDest}`);
92
+ }
78
93
  }
79
94
 
80
95
  console.log('\n 安装完成!重启你的 AI 编程工具即可生效。\n');
96
+ } catch (err) {
97
+ console.error(` ❌ 安装失败:${err.message}`);
98
+ process.exit(1);
99
+ }
81
100
  }
82
101
 
83
102
  const arg = process.argv[2];
@@ -85,6 +104,10 @@ if (arg === '--help' || arg === '-h') {
85
104
  showHelp();
86
105
  } else if (arg === '--version' || arg === '-v') {
87
106
  console.log(PKG.version);
107
+ } else if (arg && arg.startsWith('-')) {
108
+ console.warn(` 未知参数: ${arg}\n`);
109
+ showHelp();
110
+ process.exit(1);
88
111
  } else {
89
112
  install();
90
113
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superpowers-zh",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "AI 编程超能力中文版 — 14 个翻译 + 5 个中国特色原创 skills",
5
5
  "type": "module",
6
6
  "main": ".opencode/plugins/superpowers.js",