superpowers-zh 1.0.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.
- package/README.md +28 -21
- package/bin/superpowers-zh.js +68 -21
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Chinese community edition of [superpowers](https://github.com/obra/superpowers), including full translations and China-specific development skills.
|
|
8
8
|
|
|
9
9
|
[](https://github.com/jnMetaCode/superpowers-zh)
|
|
10
|
+
[](https://www.npmjs.com/package/superpowers-zh)
|
|
10
11
|
[](https://opensource.org/licenses/MIT)
|
|
11
12
|
[](https://makeapullrequest.com)
|
|
12
13
|
[](https://qm.qq.com/q/x8kyqzlfDc)
|
|
@@ -15,7 +16,7 @@ Chinese community edition of [superpowers](https://github.com/obra/superpowers),
|
|
|
15
16
|
|
|
16
17
|
| 📦 翻译 Skills | 🇨🇳 中国特色 Skills | 🤖 支持工具 |
|
|
17
18
|
|:---:|:---:|:---:|
|
|
18
|
-
| **14** | **5** | **Claude Code / Cursor / Codex / Gemini** |
|
|
19
|
+
| **14** | **5** | **Claude Code / Cursor / Codex / Kiro / Trae / Antigravity / VS Code / Gemini** |
|
|
19
20
|
|
|
20
21
|
---
|
|
21
22
|
|
|
@@ -71,20 +72,29 @@ npx superpowers-zh
|
|
|
71
72
|
# 克隆仓库
|
|
72
73
|
git clone https://github.com/jnMetaCode/superpowers-zh.git
|
|
73
74
|
|
|
74
|
-
# 复制 skills
|
|
75
|
-
cp -r superpowers-zh/skills /your/project/.claude/skills
|
|
76
|
-
#
|
|
77
|
-
cp -r superpowers-zh/skills /your/project/.
|
|
75
|
+
# 复制 skills 到你的项目(选择你使用的工具)
|
|
76
|
+
cp -r superpowers-zh/skills /your/project/.claude/skills # Claude Code
|
|
77
|
+
cp -r superpowers-zh/skills /your/project/.cursor/skills # Cursor
|
|
78
|
+
cp -r superpowers-zh/skills /your/project/.codex/skills # Codex CLI
|
|
79
|
+
cp -r superpowers-zh/skills /your/project/.kiro/steering # Kiro
|
|
80
|
+
cp -r superpowers-zh/skills /your/project/.trae/rules # Trae
|
|
81
|
+
cp -r superpowers-zh/skills /your/project/.antigravity # Antigravity
|
|
78
82
|
```
|
|
79
83
|
|
|
80
|
-
###
|
|
84
|
+
### 方式三:在配置文件中引用
|
|
81
85
|
|
|
82
|
-
|
|
83
|
-
# CLAUDE.md
|
|
86
|
+
根据你使用的工具,在对应配置文件中引用 skills:
|
|
84
87
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
+
| 工具 | 配置文件 | 说明 |
|
|
89
|
+
|------|---------|------|
|
|
90
|
+
| Claude Code | `CLAUDE.md` | 项目根目录 |
|
|
91
|
+
| Kiro | `.kiro/steering/*.md` | 支持 always/globs/手动三种模式 |
|
|
92
|
+
| Trae | `.trae/rules/project_rules.md` | 项目级规则 |
|
|
93
|
+
| Antigravity | `GEMINI.md` 或 `AGENTS.md` | 项目根目录 |
|
|
94
|
+
| VS Code | `.github/copilot-instructions.md` | Copilot 自定义指令 |
|
|
95
|
+
| Cursor | `.cursor/rules/*.md` | 项目级规则目录 |
|
|
96
|
+
|
|
97
|
+
> **详细安装指南**:[Kiro](docs/README.kiro.md) · [Trae](docs/README.trae.md) · [Antigravity](docs/README.antigravity.md) · [VS Code](docs/README.vscode.md) · [Codex](docs/README.codex.md) · [OpenCode](docs/README.opencode.md)
|
|
88
98
|
|
|
89
99
|
---
|
|
90
100
|
|
|
@@ -107,18 +117,15 @@ Skills 位于 ./skills/ 目录下。
|
|
|
107
117
|
|
|
108
118
|
欢迎参与!翻译改进、新增 skills、Bug 修复都可以。
|
|
109
119
|
|
|
110
|
-
###
|
|
120
|
+
### 贡献方向
|
|
121
|
+
|
|
122
|
+
我们只接收符合 superpowers 定位的 skill——**AI 编程工作流方法论**。好的 skill 应该:
|
|
111
123
|
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
115
|
-
- [ ] 阿里巴巴 Java 开发规范
|
|
116
|
-
- [ ] 合规检查(等保/个人信息保护法)
|
|
117
|
-
- [ ] 国内云平台部署(阿里云/腾讯云/华为云)
|
|
118
|
-
- [ ] 飞书/钉钉项目管理集成
|
|
119
|
-
- [ ] 出海全栈开发(i18n + 多支付 + CDN 分流)
|
|
124
|
+
- 教 AI 助手**怎么干活**,而不是某个框架/语言的教程
|
|
125
|
+
- 解决上游英文版不覆盖的**中国开发者痛点**
|
|
126
|
+
- 有明确的步骤、检查清单、示例,AI 加载后能直接执行
|
|
120
127
|
|
|
121
|
-
|
|
128
|
+
欢迎提 Issue 讨论你的想法!
|
|
122
129
|
|
|
123
130
|
---
|
|
124
131
|
|
package/bin/superpowers-zh.js
CHANGED
|
@@ -1,49 +1,75 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { existsSync, mkdirSync, cpSync, readdirSync } from 'fs';
|
|
4
|
-
import { resolve, dirname
|
|
3
|
+
import { existsSync, mkdirSync, cpSync, readdirSync, readFileSync } from 'fs';
|
|
4
|
+
import { resolve, dirname } from 'path';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
6
|
|
|
7
7
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
const PKG = JSON.parse(readFileSync(resolve(__dirname, '..', 'package.json'), 'utf8'));
|
|
8
9
|
const SKILLS_SRC = resolve(__dirname, '..', 'skills');
|
|
9
10
|
const AGENTS_SRC = resolve(__dirname, '..', 'agents');
|
|
10
11
|
const PROJECT_DIR = process.cwd();
|
|
11
12
|
|
|
12
13
|
const TARGETS = [
|
|
13
|
-
{ name: 'Claude Code',
|
|
14
|
-
{ name: 'Cursor',
|
|
15
|
-
{ name: 'Codex CLI',
|
|
14
|
+
{ name: 'Claude Code', dir: '.claude/skills', detect: '.claude' },
|
|
15
|
+
{ name: 'Cursor', dir: '.cursor/skills', detect: '.cursor' },
|
|
16
|
+
{ name: 'Codex CLI', dir: '.codex/skills', detect: '.codex' },
|
|
17
|
+
{ name: 'Kiro', dir: '.kiro/steering', detect: '.kiro' },
|
|
18
|
+
{ name: 'Trae', dir: '.trae/rules', detect: '.trae' },
|
|
19
|
+
{ name: 'Antigravity', dir: '.antigravity/skills', detect: '.antigravity' },
|
|
20
|
+
{ name: 'VS Code', dir: '.github/superpowers', detect: '.github/copilot-instructions.md' },
|
|
16
21
|
];
|
|
17
22
|
|
|
18
|
-
function
|
|
23
|
+
function countDirs(dir) {
|
|
19
24
|
if (!existsSync(dir)) return 0;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
+
return readdirSync(dir, { withFileTypes: true }).filter(e => e.isDirectory()).length;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function showHelp() {
|
|
29
|
+
console.log(`
|
|
30
|
+
superpowers-zh v${PKG.version} — AI 编程超能力中文版
|
|
31
|
+
|
|
32
|
+
用法:
|
|
33
|
+
npx superpowers-zh 安装 skills(及 agents)到当前项目
|
|
34
|
+
npx superpowers-zh --help 显示帮助
|
|
35
|
+
npx superpowers-zh --version 显示版本
|
|
36
|
+
|
|
37
|
+
说明:
|
|
38
|
+
自动检测当前项目使用的 AI 编程工具:
|
|
39
|
+
Claude Code / Cursor / Codex / Kiro / Trae / Antigravity / VS Code
|
|
40
|
+
将 ${countDirs(SKILLS_SRC)} 个 skills 安装到对应目录。
|
|
41
|
+
Claude Code 还会额外安装 agents 到 .claude/agents/。
|
|
42
|
+
如果未检测到任何工具,默认安装到 .claude/skills/ 和 .claude/agents/。
|
|
43
|
+
|
|
44
|
+
项目:https://github.com/jnMetaCode/superpowers-zh
|
|
45
|
+
`);
|
|
25
46
|
}
|
|
26
47
|
|
|
27
48
|
function install() {
|
|
28
|
-
|
|
29
|
-
console.log(
|
|
49
|
+
try {
|
|
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
|
+
|
|
57
|
+
console.log(` 源: ${countDirs(SKILLS_SRC)} 个 skills`);
|
|
30
58
|
console.log(` 目标项目: ${PROJECT_DIR}\n`);
|
|
31
59
|
|
|
32
60
|
let installed = 0;
|
|
33
61
|
|
|
34
62
|
for (const target of TARGETS) {
|
|
35
|
-
const
|
|
36
|
-
// 只安装到已存在配置目录的工具,或者全部安装
|
|
63
|
+
const detectPath = resolve(PROJECT_DIR, target.detect);
|
|
37
64
|
const dest = resolve(PROJECT_DIR, target.dir);
|
|
38
65
|
|
|
39
|
-
if (existsSync(
|
|
66
|
+
if (existsSync(detectPath)) {
|
|
40
67
|
mkdirSync(dest, { recursive: true });
|
|
41
68
|
cpSync(SKILLS_SRC, dest, { recursive: true });
|
|
42
|
-
const count =
|
|
69
|
+
const count = countDirs(dest);
|
|
43
70
|
console.log(` ✅ ${target.name}: ${count} 个 skills -> ${dest}`);
|
|
44
71
|
installed++;
|
|
45
72
|
|
|
46
|
-
// 为 Claude Code 额外安装 agents
|
|
47
73
|
if (target.name === 'Claude Code' && existsSync(AGENTS_SRC)) {
|
|
48
74
|
const agentsDest = resolve(PROJECT_DIR, '.claude', 'agents');
|
|
49
75
|
mkdirSync(agentsDest, { recursive: true });
|
|
@@ -53,14 +79,35 @@ function install() {
|
|
|
53
79
|
}
|
|
54
80
|
|
|
55
81
|
if (installed === 0) {
|
|
56
|
-
// 默认安装到 .claude/skills
|
|
57
82
|
const dest = resolve(PROJECT_DIR, '.claude', 'skills');
|
|
58
83
|
mkdirSync(dest, { recursive: true });
|
|
59
84
|
cpSync(SKILLS_SRC, dest, { recursive: true });
|
|
60
|
-
console.log(` ✅ 默认安装: ${
|
|
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
|
+
}
|
|
61
93
|
}
|
|
62
94
|
|
|
63
95
|
console.log('\n 安装完成!重启你的 AI 编程工具即可生效。\n');
|
|
96
|
+
} catch (err) {
|
|
97
|
+
console.error(` ❌ 安装失败:${err.message}`);
|
|
98
|
+
process.exit(1);
|
|
99
|
+
}
|
|
64
100
|
}
|
|
65
101
|
|
|
66
|
-
|
|
102
|
+
const arg = process.argv[2];
|
|
103
|
+
if (arg === '--help' || arg === '-h') {
|
|
104
|
+
showHelp();
|
|
105
|
+
} else if (arg === '--version' || arg === '-v') {
|
|
106
|
+
console.log(PKG.version);
|
|
107
|
+
} else if (arg && arg.startsWith('-')) {
|
|
108
|
+
console.warn(` 未知参数: ${arg}\n`);
|
|
109
|
+
showHelp();
|
|
110
|
+
process.exit(1);
|
|
111
|
+
} else {
|
|
112
|
+
install();
|
|
113
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "superpowers-zh",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "AI 编程超能力中文版 — 14 个翻译 + 5 个中国特色原创 skills",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": ".opencode/plugins/superpowers.js",
|
|
@@ -28,6 +28,11 @@
|
|
|
28
28
|
"cursor",
|
|
29
29
|
"codex",
|
|
30
30
|
"gemini",
|
|
31
|
+
"kiro",
|
|
32
|
+
"trae",
|
|
33
|
+
"antigravity",
|
|
34
|
+
"vscode",
|
|
35
|
+
"copilot",
|
|
31
36
|
"ai-coding",
|
|
32
37
|
"skills",
|
|
33
38
|
"chinese",
|