superpowers-zh 1.1.5 → 1.1.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "superpowers-zh",
3
- "description": "AI 编程超能力中文增强版:20 个 skills,支持 OpenClaw / Claude Code / Cursor 等 14 款工具",
3
+ "description": "AI 编程超能力中文增强版:20 个 skills,支持 Claude Code / Hermes Agent / Cursor 等 16 款工具",
4
4
  "owner": {
5
5
  "name": "jnMetaCode",
6
6
  "url": "https://github.com/jnMetaCode"
@@ -8,8 +8,8 @@
8
8
  "plugins": [
9
9
  {
10
10
  "name": "superpowers-zh",
11
- "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 OpenClaw / Claude Code / Cursor 等 14 款工具",
12
- "version": "1.1.1",
11
+ "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 Claude Code / Hermes Agent / Cursor 等 16 款工具",
12
+ "version": "1.1.7",
13
13
  "source": "./",
14
14
  "author": {
15
15
  "name": "jnMetaCode",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "superpowers-zh",
3
- "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 OpenClaw / Claude Code / Cursor 等 14 款工具",
4
- "version": "1.1.1",
3
+ "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 Claude Code / Hermes Agent / Cursor 等 16 款工具",
4
+ "version": "1.1.7",
5
5
  "author": {
6
6
  "name": "jnMetaCode",
7
7
  "url": "https://github.com/jnMetaCode"
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "superpowers-zh",
3
3
  "displayName": "Superpowers 中文版",
4
- "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 OpenClaw / Cursor / Claude Code 等 14 款工具",
5
- "version": "1.1.1",
4
+ "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 Cursor / Claude Code / Hermes Agent 16 款工具",
5
+ "version": "1.1.7",
6
6
  "author": {
7
7
  "name": "jnMetaCode",
8
8
  "url": "https://github.com/jnMetaCode"
@@ -1,13 +1,12 @@
1
1
  /**
2
2
  * Superpowers plugin for OpenCode.ai
3
3
  *
4
- * Injects superpowers bootstrap context via system prompt transform.
4
+ * Injects superpowers bootstrap context via user message transform.
5
5
  * Auto-registers skills directory via config hook (no symlinks needed).
6
6
  */
7
7
 
8
8
  import path from 'path';
9
9
  import fs from 'fs';
10
- import os from 'os';
11
10
  import { fileURLToPath } from 'url';
12
11
 
13
12
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -33,24 +32,8 @@ const extractAndStripFrontmatter = (content) => {
33
32
  return { frontmatter, content: body };
34
33
  };
35
34
 
36
- // Normalize a path: trim whitespace, expand ~, resolve to absolute
37
- const normalizePath = (p, homeDir) => {
38
- if (!p || typeof p !== 'string') return null;
39
- let normalized = p.trim();
40
- if (!normalized) return null;
41
- if (normalized.startsWith('~/')) {
42
- normalized = path.join(homeDir, normalized.slice(2));
43
- } else if (normalized === '~') {
44
- normalized = homeDir;
45
- }
46
- return path.resolve(normalized);
47
- };
48
-
49
35
  export const SuperpowersPlugin = async ({ client, directory }) => {
50
- const homeDir = os.homedir();
51
36
  const superpowersSkillsDir = path.resolve(__dirname, '../../skills');
52
- const envConfigDir = normalizePath(process.env.OPENCODE_CONFIG_DIR, homeDir);
53
- const configDir = envConfigDir || path.join(homeDir, '.config/opencode');
54
37
 
55
38
  // Helper to generate bootstrap content
56
39
  const getBootstrapContent = () => {
@@ -68,8 +51,6 @@ When skills reference tools you don't have, substitute OpenCode equivalents:
68
51
  - \`Skill\` tool → OpenCode's native \`skill\` tool
69
52
  - \`Read\`, \`Write\`, \`Edit\`, \`Bash\` → Your native tools
70
53
 
71
- **Skills location:**
72
- Superpowers skills are in \`${configDir}/skills/superpowers/\`
73
54
  Use OpenCode's native \`skill\` tool to list and load skills.`;
74
55
 
75
56
  return `<EXTREMELY_IMPORTANT>
@@ -96,12 +77,19 @@ ${toolMapping}
96
77
  }
97
78
  },
98
79
 
99
- // Use system prompt transform to inject bootstrap (fixes #226 agent reset bug)
100
- 'experimental.chat.system.transform': async (_input, output) => {
80
+ // Inject bootstrap into the first user message of each session.
81
+ // Using a user message instead of a system message avoids:
82
+ // 1. Token bloat from system messages repeated every turn (#750)
83
+ // 2. Multiple system messages breaking Qwen and other models (#894)
84
+ 'experimental.chat.messages.transform': async (_input, output) => {
101
85
  const bootstrap = getBootstrapContent();
102
- if (bootstrap) {
103
- (output.system ||= []).push(bootstrap);
104
- }
86
+ if (!bootstrap || !output.messages.length) return;
87
+ const firstUser = output.messages.find(m => m.info.role === 'user');
88
+ if (!firstUser || !firstUser.parts.length) return;
89
+ // Only inject once
90
+ if (firstUser.parts.some(p => p.type === 'text' && p.text.includes('EXTREMELY_IMPORTANT'))) return;
91
+ const ref = firstUser.parts[0];
92
+ firstUser.parts.unshift({ ...ref, type: 'text', text: bootstrap });
105
93
  }
106
94
  };
107
95
  };
package/GEMINI.md CHANGED
@@ -1,2 +1,43 @@
1
1
  @./skills/using-superpowers/SKILL.md
2
2
  @./skills/using-superpowers/references/gemini-tools.md
3
+
4
+
5
+ # Superpowers-ZH 中文增强版
6
+
7
+ 本项目已安装 superpowers-zh 技能框架(20 个 skills)。
8
+
9
+ ## 核心规则
10
+
11
+ 1. **收到任务时,先检查是否有匹配的 skill** — 哪怕只有 1% 的可能性也要检查
12
+ 2. **设计先于编码** — 收到功能需求时,先用 brainstorming skill 做需求分析
13
+ 3. **测试先于实现** — 写代码前先写测试(TDD)
14
+ 4. **验证先于完成** — 声称完成前必须运行验证命令
15
+
16
+ ## 可用 Skills
17
+
18
+ Skills 位于 `.gemini/skills/` 目录,每个 skill 有独立的 `SKILL.md` 文件。
19
+
20
+ - **brainstorming**: 在任何创造性工作之前必须使用此技能——创建功能、构建组件、添加功能或修改行为。在实现之前先探索用户意图、需求和设计。
21
+ - **chinese-code-review**: 中文代码审查规范——在保持专业严谨的同时,用符合国内团队文化的方式给出有效反馈
22
+ - **chinese-commit-conventions**: 中文 Git 提交规范 — 适配国内团队的 commit message 规范和 changelog 自动化
23
+ - **chinese-documentation**: 中文技术文档写作规范——排版、术语、结构一步到位,告别机翻味
24
+ - **chinese-git-workflow**: 适配国内 Git 平台和团队习惯的工作流规范——Gitee、Coding、极狐 GitLab 全覆盖
25
+ - **dispatching-parallel-agents**: 当面对 2 个以上可以独立进行、无共享状态或顺序依赖的任务时使用
26
+ - **executing-plans**: 当你有一份书面实现计划需要在单独的会话中执行,并设有审查检查点时使用
27
+ - **finishing-a-development-branch**: 当实现完成、所有测试通过、需要决定如何集成工作时使用——通过提供合并、PR 或清理等结构化选项来引导开发工作的收尾
28
+ - **mcp-builder**: MCP 服务器构建方法论 — 系统化构建生产级 MCP 工具,让 AI 助手连接外部能力
29
+ - **receiving-code-review**: 收到代码审查反馈后、实施建议之前使用,尤其当反馈不明确或技术上有疑问时——需要技术严谨性和验证,而非敷衍附和或盲目执行
30
+ - **requesting-code-review**: 完成任务、实现重要功能或合并前使用,用于验证工作成果是否符合要求
31
+ - **subagent-driven-development**: 当在当前会话中执行包含独立任务的实现计划时使用
32
+ - **systematic-debugging**: 遇到任何 bug、测试失败或异常行为时使用,在提出修复方案之前执行
33
+ - **test-driven-development**: 在实现任何功能或修复 bug 时使用,在编写实现代码之前
34
+ - **using-git-worktrees**: 当需要开始与当前工作区隔离的功能开发或执行实现计划之前使用——创建具有智能目录选择和安全验证的隔离 git 工作树
35
+ - **using-superpowers**: 在开始任何对话时使用——确立如何查找和使用技能,要求在任何响应(包括澄清性问题)之前调用 Skill 工具
36
+ - **verification-before-completion**: 在宣称工作完成、已修复或测试通过之前使用,在提交或创建 PR 之前——必须运行验证命令并确认输出后才能声称成功;始终用证据支撑断言
37
+ - **workflow-runner**: 在 Claude Code / OpenClaw / Cursor 中直接运行 agency-orchestrator YAML 工作流——无需 API key,使用当前会话的 LLM 作为执行引擎。当用户提供 .yaml 工作流文件或要求多角色协作完成任务时触发。
38
+ - **writing-plans**: 当你有规格说明或需求用于多步骤任务时使用,在动手写代码之前
39
+ - **writing-skills**: 当创建新技能、编辑现有技能或在部署前验证技能是否有效时使用
40
+
41
+ ## 如何使用
42
+
43
+ 当任务匹配某个 skill 时,读取对应的 `.gemini/skills/<skill-name>/SKILL.md` 并严格遵循其流程。
package/README.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  🌐 **简体中文** | [English (upstream)](https://github.com/obra/superpowers)
4
4
 
5
- > 🦸 **superpowers(116k+ ⭐)完整汉化 + 6 个中国原创 skills** — 让 OpenClaw / Claude Code / Cursor / Windsurf / Kiro / Gemini CLI 等 **14 款 AI 编程工具**真正会干活。从头脑风暴到代码审查,从 TDD 到调试,每个 skill 都是经过实战验证的工作方法论。
5
+ > 🦸 **superpowers(116k+ ⭐)完整汉化 + 6 个中国原创 skills** — 让 Claude Code / Copilot CLI / Hermes Agent / Cursor / Windsurf / Kiro / Gemini CLI 等 **16 款 AI 编程工具**真正会干活。从头脑风暴到代码审查,从 TDD 到调试,每个 skill 都是经过实战验证的工作方法论。
6
6
 
7
- Chinese community edition of [superpowers](https://github.com/obra/superpowers) — 20 skills across 14 AI coding tools, including full translations and China-specific development skills.
7
+ Chinese community edition of [superpowers](https://github.com/obra/superpowers) — 20 skills across 16 AI coding tools, including full translations and China-specific development skills.
8
8
 
9
9
  <!-- 效果对比 -->
10
10
  <table>
@@ -43,7 +43,7 @@ AI:在开始实现之前,我需要了解几个关键问题:
43
43
 
44
44
  | 📦 翻译 Skills | 🇨🇳 中国特色 Skills | 🤖 支持工具 |
45
45
  |:---:|:---:|:---:|
46
- | **14** | **6** | **OpenClaw / Claude Code / Cursor / Windsurf / Kiro / Gemini CLI / Codex / Aider / Trae / VS Code (Copilot) / DeerFlow / OpenCode / Qwen Code / Antigravity** |
46
+ | **14** | **6** | **Claude Code / Copilot CLI / Hermes Agent / Cursor / Windsurf / Kiro / Gemini CLI / Codex / Aider / Trae / VS Code (Copilot) / DeerFlow / OpenCode / OpenClaw / Qwen Code / Antigravity** |
47
47
 
48
48
  ---
49
49
 
@@ -53,12 +53,13 @@ AI:在开始实现之前,我需要了解几个关键问题:
53
53
 
54
54
  **superpowers-zh** 在完整翻译的基础上,新增了面向中国开发者的特色 skills。
55
55
 
56
- ### 🤖 支持 14 款主流 AI 编程工具
56
+ ### 🤖 支持 16 款主流 AI 编程工具
57
57
 
58
58
  | 工具 | 类型 | 一键安装 | 手动安装 |
59
59
  |------|------|:---:|:---:|
60
- | [OpenClaw](https://github.com/anthropics/openclaw) | CLI | `npx superpowers-zh` | `skills/` |
61
60
  | [Claude Code](https://claude.ai/code) | CLI | `npx superpowers-zh` | `.claude/skills/` |
61
+ | [Copilot CLI](https://githubnext.com/projects/copilot-cli) | CLI | `npx superpowers-zh --tool copilot` | `.claude/skills/` |
62
+ | [Hermes Agent](https://github.com/NousResearch/hermes-agent) | CLI | `npx superpowers-zh --tool hermes` | `.hermes/skills/` |
62
63
  | [Cursor](https://cursor.sh) | IDE | `npx superpowers-zh` | `.cursor/skills/` |
63
64
  | [Windsurf](https://codeium.com/windsurf) | IDE | `npx superpowers-zh` | `.windsurf/skills/` |
64
65
  | [Kiro](https://kiro.dev) | IDE | `npx superpowers-zh` | `.kiro/steering/` |
@@ -69,6 +70,7 @@ AI:在开始实现之前,我需要了解几个关键问题:
69
70
  | [VS Code](https://code.visualstudio.com) (Copilot) | IDE 插件 | `npx superpowers-zh` | `.github/superpowers/` |
70
71
  | [DeerFlow 2.0](https://github.com/bytedance/deer-flow) | Agent 框架 | `npx superpowers-zh` | `skills/custom/` |
71
72
  | [OpenCode](https://opencode.ai) | CLI | `npx superpowers-zh` | `.opencode/skills/` |
73
+ | [OpenClaw](https://github.com/anthropics/openclaw) | CLI | `npx superpowers-zh` | `skills/` |
72
74
  | [Qwen Code](https://tongyi.aliyun.com/lingma) (通义灵码) | IDE 插件 | `npx superpowers-zh` | `.qwen/skills/` |
73
75
  | [Antigravity](https://github.com/anthropics/antigravity) | CLI | `npx superpowers-zh` | `.antigravity/skills/` |
74
76
 
@@ -122,7 +124,8 @@ npx superpowers-zh
122
124
  git clone https://github.com/jnMetaCode/superpowers-zh.git
123
125
 
124
126
  # 复制 skills 到你的项目(选择你使用的工具)
125
- cp -r superpowers-zh/skills /your/project/.claude/skills # Claude Code
127
+ cp -r superpowers-zh/skills /your/project/.claude/skills # Claude Code / Copilot CLI
128
+ cp -r superpowers-zh/skills /your/project/.hermes/skills # Hermes Agent
126
129
  cp -r superpowers-zh/skills /your/project/.cursor/skills # Cursor
127
130
  cp -r superpowers-zh/skills /your/project/.codex/skills # Codex CLI
128
131
  cp -r superpowers-zh/skills /your/project/.kiro/steering # Kiro
@@ -145,6 +148,8 @@ cp -r superpowers-zh/skills /your/project/.qwen/skills # Qwen Code
145
148
  | 工具 | 配置文件 | 说明 |
146
149
  |------|---------|------|
147
150
  | Claude Code | `CLAUDE.md` | 项目根目录 |
151
+ | Copilot CLI | `CLAUDE.md` | 与 Claude Code 共用插件格式 |
152
+ | Hermes Agent | `HERMES.md` 或 `.hermes.md` | 项目根目录,安装时自动生成 |
148
153
  | Kiro | `.kiro/steering/*.md` | 支持 always/globs/手动三种模式 |
149
154
  | DeerFlow 2.0 | `skills/custom/*/SKILL.md` | 字节跳动开源 SuperAgent,自动发现自定义 skills |
150
155
  | Trae | `.trae/rules/project_rules.md` | 项目级规则 |
@@ -156,9 +161,10 @@ cp -r superpowers-zh/skills /your/project/.qwen/skills # Qwen Code
156
161
  | Gemini CLI | `.gemini/skills/*/SKILL.md` | 项目级 skills 目录 |
157
162
  | Aider | `.aider/skills/*/SKILL.md` | 项目级 skills 目录 |
158
163
  | OpenCode | `.opencode/skills/*/SKILL.md` | 项目级 skills 目录 |
164
+ | Hermes Agent | `.hermes/skills/*/SKILL.md` | 项目级 skills 目录 |
159
165
  | Qwen Code | `.qwen/skills/*/SKILL.md` | 项目级 skills 目录 |
160
166
 
161
- > **详细安装指南**:[Kiro](docs/README.kiro.md) · [DeerFlow](docs/README.deerflow.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) · [OpenClaw](docs/README.openclaw.md) · [Windsurf](docs/README.windsurf.md) · [Gemini CLI](docs/README.gemini-cli.md) · [Aider](docs/README.aider.md) · [Qwen Code](docs/README.qwen.md)
167
+ > **详细安装指南**:[Kiro](docs/README.kiro.md) · [DeerFlow](docs/README.deerflow.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) · [OpenClaw](docs/README.openclaw.md) · [Windsurf](docs/README.windsurf.md) · [Gemini CLI](docs/README.gemini-cli.md) · [Aider](docs/README.aider.md) · [Qwen Code](docs/README.qwen.md) · [Hermes Agent](docs/README.hermes.md)
162
168
 
163
169
  ---
164
170
 
@@ -195,10 +201,12 @@ cp -r superpowers-zh/skills /your/project/.qwen/skills # Qwen Code
195
201
 
196
202
  ## 交流 · Community
197
203
 
198
- 微信公众号 **「AI不止语」**(微信搜索 `AI_BuZhiYu`)
199
- 技术问答 · 项目更新 · 实战文章
204
+ 微信公众号 **「AI不止语」**(微信搜索 `AI_BuZhiYu`)— 技术问答 · 项目更新 · 实战文章
200
205
 
201
- 微信群:关注公众号后回复「群」获取入群方式
206
+ | 渠道 | 加入方式 |
207
+ |------|---------|
208
+ | QQ 群 | [点击加入](https://qm.qq.com/q/EeNQA9xCxy)(群号 1071280067) |
209
+ | 微信群 | 关注公众号后回复「群」获取入群方式 |
202
210
 
203
211
  ---
204
212
 
@@ -222,7 +230,7 @@ MIT License — 自由使用,商业或个人均可。
222
230
 
223
231
  <div align="center">
224
232
 
225
- **🦸 AI 编程超能力:让 OpenClaw / Claude Code / Cursor 等 14 款工具真正会干活**
233
+ **🦸 AI 编程超能力:让 Claude Code / Hermes Agent / Cursor 等 16 款工具真正会干活**
226
234
 
227
235
  [Star 本项目](https://github.com/jnMetaCode/superpowers-zh) · [提交 Issue](https://github.com/jnMetaCode/superpowers-zh/issues) · [贡献代码](https://github.com/jnMetaCode/superpowers-zh/pulls)
228
236
 
@@ -1,23 +1,34 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- import { existsSync, mkdirSync, cpSync, readdirSync, readFileSync, writeFileSync, copyFileSync, statSync } from 'fs';
3
+ import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync, copyFileSync, lstatSync, realpathSync } from 'fs';
4
4
  import { resolve, dirname, join } from 'path';
5
5
  import { fileURLToPath } from 'url';
6
6
 
7
- // Node 14/16 兼容:cpSync 在 Node 16.7+ 才可用
7
+ // 手动递归复制:跨 Node 版本和操作系统行为一致
8
+ // 不使用 cpSync —— 在 Windows + npx 缓存(含 junction)+ Node 16.7-18 下不稳定
8
9
  function copyDirSync(src, dest) {
9
- if (typeof cpSync === 'function') {
10
- cpSync(src, dest, { recursive: true });
11
- return;
12
- }
13
- // 手动递归复制(兼容 Node 14+)
10
+ // 解析 junction/symlink,避免 Windows npx 缓存路径下 readdir 返回空
11
+ let realSrc = src;
12
+ try { realSrc = realpathSync(src); } catch {}
13
+
14
14
  mkdirSync(dest, { recursive: true });
15
- for (const entry of readdirSync(src, { withFileTypes: true })) {
16
- const srcPath = join(src, entry.name);
15
+ const entries = readdirSync(realSrc, { withFileTypes: true });
16
+ for (const entry of entries) {
17
+ const srcPath = join(realSrc, entry.name);
17
18
  const destPath = join(dest, entry.name);
18
- if (entry.isDirectory()) {
19
+ let stat;
20
+ try { stat = lstatSync(srcPath); } catch { continue; }
21
+ if (stat.isSymbolicLink()) {
22
+ // 取消引用后按实际类型处理
23
+ try {
24
+ const real = realpathSync(srcPath);
25
+ const realStat = lstatSync(real);
26
+ if (realStat.isDirectory()) copyDirSync(real, destPath);
27
+ else copyFileSync(real, destPath);
28
+ } catch {}
29
+ } else if (stat.isDirectory()) {
19
30
  copyDirSync(srcPath, destPath);
20
- } else {
31
+ } else if (stat.isFile()) {
21
32
  copyFileSync(srcPath, destPath);
22
33
  }
23
34
  }
@@ -31,7 +42,7 @@ const PROJECT_DIR = process.cwd();
31
42
 
32
43
  const TARGETS = [
33
44
  { name: 'Claude Code', dir: '.claude/skills', detect: '.claude' },
34
- { name: 'Cursor', dir: '.cursor/skills', detect: '.cursor' },
45
+ { name: 'Cursor', dir: '.cursor/skills', detect: ['.cursor', '.cursorrules'] },
35
46
  { name: 'Codex CLI', dir: '.codex/skills', detect: '.codex' },
36
47
  { name: 'Kiro', dir: '.kiro/steering', detect: '.kiro' },
37
48
  { name: 'DeerFlow', dir: 'skills/custom', detect: 'deer_flow' },
@@ -44,6 +55,7 @@ const TARGETS = [
44
55
  { name: 'Aider', dir: '.aider/skills', detect: '.aider' },
45
56
  { name: 'OpenCode', dir: '.opencode/skills', detect: '.opencode' },
46
57
  { name: 'Qwen Code', dir: '.qwen/skills', detect: '.qwen' },
58
+ { name: 'Hermes Agent', dir: '.hermes/skills', detect: ['.hermes', 'HERMES.md', '.hermes.md'] },
47
59
  ];
48
60
 
49
61
  function countDirs(dir) {
@@ -77,7 +89,7 @@ function generateTraeBootstrapRule(projectDir) {
77
89
  const rulesDir = resolve(projectDir, '.trae', 'rules');
78
90
  mkdirSync(rulesDir, { recursive: true });
79
91
 
80
- const skillEntries = scanSkillEntries(resolve(projectDir, '.trae', 'skills'));
92
+ const skillEntries = scanSkillEntries(SKILLS_SRC);
81
93
  const skillTable = skillEntries.map(s => `| ${s.name} | ${s.desc} |`).join('\n');
82
94
 
83
95
  const rule = `---
@@ -114,7 +126,7 @@ ${skillTable}
114
126
  }
115
127
 
116
128
  function generateAntigravityBootstrap(projectDir) {
117
- const skillEntries = scanSkillEntries(resolve(projectDir, '.antigravity', 'skills'));
129
+ const skillEntries = scanSkillEntries(SKILLS_SRC);
118
130
  const skillList = skillEntries.map(s => `- **${s.name}**: ${s.desc}`).join('\n');
119
131
 
120
132
  const content = `# Superpowers-ZH 中文增强版
@@ -146,7 +158,7 @@ ${skillList}
146
158
  }
147
159
 
148
160
  function generateAiderBootstrap(projectDir) {
149
- const skillEntries = scanSkillEntries(resolve(projectDir, '.aider', 'skills'));
161
+ const skillEntries = scanSkillEntries(SKILLS_SRC);
150
162
  const skillList = skillEntries.map(s => `- **${s.name}**: ${s.desc}`).join('\n');
151
163
 
152
164
  const content = `# Superpowers-ZH 工作方法论
@@ -189,7 +201,7 @@ ${skillList}
189
201
  }
190
202
 
191
203
  function generateGeminiBootstrap(projectDir) {
192
- const skillEntries = scanSkillEntries(resolve(projectDir, '.gemini', 'skills'));
204
+ const skillEntries = scanSkillEntries(SKILLS_SRC);
193
205
  const skillList = skillEntries.map(s => `- **${s.name}**: ${s.desc}`).join('\n');
194
206
 
195
207
  const content = `# Superpowers-ZH 中文增强版
@@ -230,11 +242,69 @@ ${skillList}
230
242
  }
231
243
  }
232
244
 
245
+ function generateHermesBootstrap(projectDir) {
246
+ const skillEntries = scanSkillEntries(SKILLS_SRC);
247
+ const skillList = skillEntries.map(s => `- **${s.name}**: ${s.desc}`).join('\n');
248
+
249
+ const content = `# Superpowers-ZH 中文增强版
250
+
251
+ 本项目已安装 superpowers-zh 技能框架(${skillEntries.length} 个 skills)。
252
+
253
+ ## 核心规则
254
+
255
+ 1. **收到任务时,先检查是否有匹配的 skill** — 哪怕只有 1% 的可能性也要检查
256
+ 2. **设计先于编码** — 收到功能需求时,先用 brainstorming skill 做需求分析
257
+ 3. **测试先于实现** — 写代码前先写测试(TDD)
258
+ 4. **验证先于完成** — 声称完成前必须运行验证命令
259
+
260
+ ## 工具映射
261
+
262
+ 技能中引用的 Claude Code 工具名称对应 Hermes Agent 的等价工具:
263
+ - \`Read\` → \`read_file\`
264
+ - \`Write\` → \`write_file\`
265
+ - \`Edit\` → \`patch\`
266
+ - \`Bash\` → \`terminal\`
267
+ - \`Grep\` / \`Glob\` → \`search_files\`
268
+ - \`Skill\` → \`skill_view\`
269
+ - \`Task\`(子智能体) → \`delegate_task\`
270
+ - \`WebSearch\` → \`web_search\`
271
+ - \`WebFetch\` → \`web_extract\`
272
+ - \`TodoWrite\` → \`todo\`
273
+
274
+ ## 可用 Skills
275
+
276
+ Skills 位于 \`.hermes/skills/\` 目录,每个 skill 有独立的 \`SKILL.md\` 文件。
277
+
278
+ ${skillList}
279
+
280
+ ## 如何使用
281
+
282
+ 当任务匹配某个 skill 时,使用 \`skill_view\` 加载对应 skill 并严格遵循其流程。
283
+ `;
284
+
285
+ // 写入 HERMES.md(如果已存在则追加)
286
+ const hermesPath = resolve(projectDir, 'HERMES.md');
287
+ if (existsSync(hermesPath)) {
288
+ const existing = readFileSync(hermesPath, 'utf8');
289
+ if (!existing.includes('superpowers-zh')) {
290
+ writeFileSync(hermesPath, existing + '\n\n' + content, 'utf8');
291
+ console.log(` ✅ Hermes Agent: 追加 skills 引用 -> ${hermesPath}`);
292
+ } else {
293
+ console.log(` ✅ Hermes Agent: HERMES.md 已包含 superpowers-zh 引用`);
294
+ }
295
+ } else {
296
+ writeFileSync(hermesPath, content, 'utf8');
297
+ console.log(` ✅ Hermes Agent: bootstrap -> ${hermesPath}`);
298
+ }
299
+ }
300
+
233
301
  // 工具名称别名映射(用户输入 -> TARGETS.name)
234
302
  const TOOL_ALIASES = {
235
303
  'claude': 'Claude Code',
236
304
  'claude-code': 'Claude Code',
237
305
  'claudecode': 'Claude Code',
306
+ 'copilot': 'Claude Code',
307
+ 'copilot-cli': 'Claude Code',
238
308
  'cursor': 'Cursor',
239
309
  'codex': 'Codex CLI',
240
310
  'kiro': 'Kiro',
@@ -251,6 +321,8 @@ const TOOL_ALIASES = {
251
321
  'opencode': 'OpenCode',
252
322
  'qwen': 'Qwen Code',
253
323
  'qwen-code': 'Qwen Code',
324
+ 'hermes': 'Hermes Agent',
325
+ 'hermes-agent': 'Hermes Agent',
254
326
  };
255
327
 
256
328
  function showHelp() {
@@ -279,9 +351,19 @@ function showHelp() {
279
351
 
280
352
  function installForTarget(target) {
281
353
  const dest = resolve(PROJECT_DIR, target.dir);
354
+ const srcCount = countDirs(SKILLS_SRC);
282
355
  mkdirSync(dest, { recursive: true });
283
356
  copyDirSync(SKILLS_SRC, dest);
284
357
  const count = countDirs(dest);
358
+ if (srcCount > 0 && count === 0) {
359
+ throw new Error(
360
+ `复制 skills 失败:源目录 ${SKILLS_SRC} 有 ${srcCount} 个 skill,但目标 ${dest} 为空。` +
361
+ `\n 这通常是 npx 缓存目录权限或路径问题。请尝试:\n` +
362
+ ` 1. 清理缓存后重试: npm cache clean --force && npx superpowers-zh\n` +
363
+ ` 2. 或全局安装: npm i -g superpowers-zh && superpowers-zh\n` +
364
+ ` 3. 或手动克隆复制: 见 https://github.com/jnMetaCode/superpowers-zh#方式二手动安装`
365
+ );
366
+ }
285
367
  console.log(` ✅ ${target.name}: ${count} 个 skills -> ${dest}`);
286
368
 
287
369
  if (target.name === 'Trae') {
@@ -300,6 +382,10 @@ function installForTarget(target) {
300
382
  generateGeminiBootstrap(PROJECT_DIR);
301
383
  }
302
384
 
385
+ if (target.name === 'Hermes Agent') {
386
+ generateHermesBootstrap(PROJECT_DIR);
387
+ }
388
+
303
389
  if (target.name === 'Claude Code' && existsSync(AGENTS_SRC)) {
304
390
  const agentsDest = resolve(PROJECT_DIR, '.claude', 'agents');
305
391
  mkdirSync(agentsDest, { recursive: true });
@@ -335,8 +421,9 @@ function install(forceToolName) {
335
421
  let installed = 0;
336
422
 
337
423
  for (const target of TARGETS) {
338
- const detectPath = resolve(PROJECT_DIR, target.detect);
339
- if (existsSync(detectPath)) {
424
+ const detects = Array.isArray(target.detect) ? target.detect : [target.detect];
425
+ const found = detects.some(d => existsSync(resolve(PROJECT_DIR, d)));
426
+ if (found) {
340
427
  installForTarget(target);
341
428
  installed++;
342
429
  }
@@ -0,0 +1,96 @@
1
+ # Superpowers 中文版 — Hermes Agent 安装指南
2
+
3
+ 在 [Hermes Agent](https://github.com/NousResearch/hermes-agent) 中使用 superpowers-zh 的完整指南。
4
+
5
+ ## 自动安装
6
+
7
+ ```bash
8
+ cd /your/project
9
+ npx superpowers-zh --tool hermes
10
+ ```
11
+
12
+ 安装脚本会将 20 个 skills 复制到 `.hermes/skills/` 目录,并自动生成 `HERMES.md` 引导文件(含工具映射表和 skills 列表)。
13
+
14
+ 如果项目中已存在 `.hermes` 目录或 `HERMES.md` 文件,也会被自动检测到:
15
+
16
+ ```bash
17
+ npx superpowers-zh # 自动检测
18
+ ```
19
+
20
+ ## 手动安装
21
+
22
+ ```bash
23
+ git clone https://github.com/jnMetaCode/superpowers-zh.git
24
+ cp -r superpowers-zh/skills /your/project/.hermes/skills
25
+ ```
26
+
27
+ ## 通过 HERMES.md 引导
28
+
29
+ Hermes Agent 在会话开始时自动加载项目根目录下的 `HERMES.md`(或 `.hermes.md`)作为上下文。安装器会自动生成此文件,内容包括:
30
+
31
+ - 工具映射表(Claude Code → Hermes Agent 工具名称)
32
+ - 所有可用 skills 的列表和描述
33
+ - 核心规则和使用说明
34
+
35
+ ## 通过 config.yaml 配置外部 skills 目录
36
+
37
+ 如果希望全局使用 superpowers-zh skills,可以在 `~/.hermes/config.yaml` 中配置:
38
+
39
+ ```yaml
40
+ skills:
41
+ external_dirs:
42
+ - /path/to/superpowers-zh/skills
43
+ ```
44
+
45
+ ## 工具映射
46
+
47
+ Skills 中引用的 Claude Code 工具名称对应 Hermes Agent 的等价工具:
48
+
49
+ | Claude Code | Hermes Agent |
50
+ |-------------|-------------|
51
+ | `Read` | `read_file` |
52
+ | `Write` | `write_file` |
53
+ | `Edit` | `patch` |
54
+ | `Bash` | `terminal` |
55
+ | `Grep` / `Glob` | `search_files` |
56
+ | `Skill` | `skill_view` |
57
+ | `Task`(子智能体) | `delegate_task` |
58
+ | `WebSearch` | `web_search` |
59
+ | `WebFetch` | `web_extract` |
60
+ | `TodoWrite` | `todo` |
61
+
62
+ 完整映射参见 `skills/using-superpowers/references/hermes-tools.md`。
63
+
64
+ ## 使用技能
65
+
66
+ Hermes Agent 支持三级渐进式加载:
67
+
68
+ ```
69
+ # 浏览所有可用技能
70
+ skills_list
71
+
72
+ # 加载某个技能的完整内容
73
+ skill_view("brainstorming")
74
+
75
+ # 查看技能的引用文件
76
+ skill_view("using-superpowers", "references/hermes-tools.md")
77
+ ```
78
+
79
+ ## 故障排查
80
+
81
+ ### Skills 未发现
82
+
83
+ 1. 确认 `.hermes/skills/` 目录存在且包含 skill 文件夹
84
+ 2. 每个 skill 目录下需要有 `SKILL.md` 文件
85
+ 3. 使用 `skills_list` 查看已发现的技能
86
+
87
+ ### HERMES.md 未加载
88
+
89
+ 1. 确认文件在项目根目录(与 `.hermes/` 同级)
90
+ 2. 文件名可以是 `HERMES.md` 或 `.hermes.md`
91
+
92
+ ## 获取帮助
93
+
94
+ - 提交 Issue:https://github.com/jnMetaCode/superpowers-zh/issues
95
+ - 项目主页:https://github.com/jnMetaCode/superpowers-zh
96
+ - Hermes Agent 文档:https://hermes-agent.nousresearch.com/docs/
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superpowers-zh",
3
3
  "description": "AI 编程超能力中文版 — TDD、调试、代码审查等经过实战验证的工作方法论",
4
- "version": "1.1.1",
4
+ "version": "1.1.6",
5
5
  "contextFileName": "GEMINI.md"
6
6
  }
@@ -35,23 +35,23 @@ warning_escaped=$(escape_for_json "$warning_message")
35
35
  session_context="<EXTREMELY_IMPORTANT>\nYou have superpowers.\n\n**Below is the full content of your 'superpowers:using-superpowers' skill - your introduction to using skills. For all other skills, use the 'Skill' tool:**\n\n${using_superpowers_escaped}\n\n${warning_escaped}\n</EXTREMELY_IMPORTANT>"
36
36
 
37
37
  # Output context injection as JSON.
38
- # Cursor hooks expect additional_context.
39
- # Claude Code hooks expect hookSpecificOutput.additionalContext.
40
- # Claude Code reads BOTH fields without deduplication, so we must only
41
- # emit the field consumed by the current platform to avoid double injection.
38
+ # Cursor hooks expect additional_context (snake_case).
39
+ # Claude Code hooks expect hookSpecificOutput.additionalContext (nested).
40
+ # Copilot CLI (v1.0.11+) and others expect additionalContext (top-level, SDK standard).
41
+ # Claude Code reads BOTH additional_context and hookSpecificOutput without
42
+ # deduplication, so we must emit only the field the current platform consumes.
42
43
  #
43
- # Uses printf instead of heredoc (cat <<EOF) to work around a bash 5.3+
44
- # bug where heredoc variable expansion hangs when content exceeds ~512 bytes.
44
+ # Uses printf instead of heredoc to work around bash 5.3+ heredoc hang.
45
45
  # See: https://github.com/obra/superpowers/issues/571
46
46
  if [ -n "${CURSOR_PLUGIN_ROOT:-}" ]; then
47
- # Cursor sets CURSOR_PLUGIN_ROOT (may also set CLAUDE_PLUGIN_ROOT) — emit additional_context
47
+ # Cursor sets CURSOR_PLUGIN_ROOT (may also set CLAUDE_PLUGIN_ROOT)
48
48
  printf '{\n "additional_context": "%s"\n}\n' "$session_context"
49
- elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ]; then
50
- # Claude Code sets CLAUDE_PLUGIN_ROOT emit only hookSpecificOutput
49
+ elif [ -n "${CLAUDE_PLUGIN_ROOT:-}" ] && [ -z "${COPILOT_CLI:-}" ]; then
50
+ # Claude Code sets CLAUDE_PLUGIN_ROOT without COPILOT_CLI
51
51
  printf '{\n "hookSpecificOutput": {\n "hookEventName": "SessionStart",\n "additionalContext": "%s"\n }\n}\n' "$session_context"
52
52
  else
53
- # Other platformsemit additional_context as fallback
54
- printf '{\n "additional_context": "%s"\n}\n' "$session_context"
53
+ # Copilot CLI (sets COPILOT_CLI=1) or unknown platform SDK standard format
54
+ printf '{\n "additionalContext": "%s"\n}\n' "$session_context"
55
55
  fi
56
56
 
57
57
  exit 0
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "superpowers-zh",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "engines": {
5
5
  "node": ">=14.0.0"
6
6
  },
7
- "description": "AI 编程超能力中文增强版 — superpowers(99k+ ⭐)完整汉化 + 6 个中国原创 skills,支持 OpenClaw / Claude Code / Cursor / Windsurf / Kiro / Gemini CLI 等 14 款工具",
7
+ "description": "AI 编程超能力中文增强版 — superpowers(99k+ ⭐)完整汉化 + 6 个中国原创 skills,支持 Claude Code / Copilot CLI / Hermes Agent / Cursor / Windsurf / Kiro / Gemini CLI 等 16 款工具",
8
8
  "type": "module",
9
9
  "main": ".opencode/plugins/superpowers.js",
10
10
  "bin": {
@@ -18,8 +18,9 @@
18
18
  "hooks/",
19
19
  ".claude-plugin/",
20
20
  ".cursor-plugin/",
21
- ".codex/",
22
- ".opencode/",
21
+ ".codex/INSTALL.md",
22
+ ".opencode/INSTALL.md",
23
+ ".opencode/plugins/",
23
24
  "GEMINI.md",
24
25
  "gemini-extension.json",
25
26
  "docs/",
@@ -43,6 +44,8 @@
43
44
  "qwen",
44
45
  "vscode",
45
46
  "copilot",
47
+ "hermes",
48
+ "hermes-agent",
46
49
  "ai-coding",
47
50
  "skills",
48
51
  "chinese",
@@ -29,13 +29,17 @@ Superpowers 技能覆盖默认系统提示行为,但**用户指令始终具有
29
29
 
30
30
  **在 Claude Code 中:** 使用 `Skill` 工具。当你调用一个技能时,其内容会被加载并呈现给你——直接遵循即可。绝不要用 Read 工具读取技能文件。
31
31
 
32
+ **在 Copilot CLI 中:** 使用 `skill` 工具。技能从已安装的插件中自动发现。`skill` 工具的工作方式与 Claude Code 的 `Skill` 工具相同。
33
+
34
+ **在 Hermes Agent 中:** 使用 `skill_view` 工具加载技能。Hermes 支持三级渐进式加载:`skills_list` 浏览 → `skill_view(name)` 加载完整内容 → `skill_view(name, path)` 查看引用文件。
35
+
32
36
  **在 Gemini CLI 中:** 技能通过 `activate_skill` 工具激活。Gemini 在会话开始时加载技能元数据,并按需激活完整内容。
33
37
 
34
38
  **在其他环境中:** 查看你的平台文档了解技能的加载方式。
35
39
 
36
40
  ## 平台适配
37
41
 
38
- 技能使用 Claude Code 的工具名称。非 CC 平台:查看 `references/codex-tools.md`(Codex)了解工具对应关系。Gemini CLI 用户通过 GEMINI.md 自动获得工具映射。
42
+ 技能使用 Claude Code 的工具名称。非 CC 平台:查看 `references/copilot-tools.md`(Copilot CLI)、`references/hermes-tools.md`(Hermes Agent)、`references/codex-tools.md`(Codex)了解工具对应关系。Gemini CLI 用户通过 GEMINI.md 自动获得工具映射。
39
43
 
40
44
  # 使用技能
41
45
 
@@ -0,0 +1,52 @@
1
+ # Copilot CLI 工具映射
2
+
3
+ 技能使用 Claude Code 的工具名称。当你在技能中遇到这些工具时,使用你平台的等价工具:
4
+
5
+ | 技能中引用的工具 | Copilot CLI 等价工具 |
6
+ |-----------------|----------------------|
7
+ | `Read`(读取文件) | `view` |
8
+ | `Write`(创建文件) | `create` |
9
+ | `Edit`(编辑文件) | `edit` |
10
+ | `Bash`(运行命令) | `bash` |
11
+ | `Grep`(搜索文件内容) | `grep` |
12
+ | `Glob`(按名称搜索文件) | `glob` |
13
+ | `Skill` 工具(调用技能) | `skill` |
14
+ | `WebFetch` | `web_fetch` |
15
+ | `Task` 工具(分派子智能体) | `task`(参见[智能体类型](#智能体类型)) |
16
+ | 多个 `Task` 调用(并行) | 多个 `task` 调用 |
17
+ | Task 状态/输出 | `read_agent`、`list_agents` |
18
+ | `TodoWrite`(任务跟踪) | `sql` 配合内置 `todos` 表 |
19
+ | `WebSearch` | 无等价工具 — 使用 `web_fetch` 配合搜索引擎 URL |
20
+ | `EnterPlanMode` / `ExitPlanMode` | 无等价工具 — 留在主会话中 |
21
+
22
+ ## 智能体类型
23
+
24
+ Copilot CLI 的 `task` 工具接受 `agent_type` 参数:
25
+
26
+ | Claude Code 智能体 | Copilot CLI 等价 |
27
+ |-------------------|----------------------|
28
+ | `general-purpose` | `"general-purpose"` |
29
+ | `Explore` | `"explore"` |
30
+ | 命名的插件智能体(如 `superpowers:code-reviewer`) | 从已安装的插件中自动发现 |
31
+
32
+ ## 异步 Shell 会话
33
+
34
+ Copilot CLI 支持持久化的异步 shell 会话,这在 Claude Code 中没有直接等价物:
35
+
36
+ | 工具 | 用途 |
37
+ |------|---------|
38
+ | `bash` 配合 `async: true` | 在后台启动长时间运行的命令 |
39
+ | `write_bash` | 向运行中的异步会话发送输入 |
40
+ | `read_bash` | 读取异步会话的输出 |
41
+ | `stop_bash` | 终止异步会话 |
42
+ | `list_bash` | 列出所有活跃的 shell 会话 |
43
+
44
+ ## 额外的 Copilot CLI 工具
45
+
46
+ | 工具 | 用途 |
47
+ |------|---------|
48
+ | `store_memory` | 持久化代码库相关事实供未来会话使用 |
49
+ | `report_intent` | 更新 UI 状态行显示当前意图 |
50
+ | `sql` | 查询会话的 SQLite 数据库(待办、元数据) |
51
+ | `fetch_copilot_cli_documentation` | 查阅 Copilot CLI 文档 |
52
+ | GitHub MCP 工具(`github-mcp-server-*`) | 原生 GitHub API 访问(issue、PR、代码搜索) |
@@ -0,0 +1,44 @@
1
+ # Hermes Agent 工具映射
2
+
3
+ 技能使用 Claude Code 的工具名称。当你在技能中遇到这些工具时,使用你平台的等价工具:
4
+
5
+ | 技能中引用的工具 | Hermes Agent 等价工具 |
6
+ |-----------------|----------------------|
7
+ | `Read`(读取文件) | `read_file` |
8
+ | `Write`(创建文件) | `write_file` |
9
+ | `Edit`(编辑文件) | `patch` |
10
+ | `Bash`(运行命令) | `terminal` |
11
+ | `Grep`(搜索文件内容) | `search_files` |
12
+ | `Glob`(按名称搜索文件) | `search_files` |
13
+ | `Skill` 工具(调用技能) | `skill_view` |
14
+ | `WebFetch` | `web_extract` |
15
+ | `WebSearch` | `web_search` |
16
+ | `Task` 工具(分派子智能体) | `delegate_task` |
17
+ | 多个 `Task` 调用(并行) | 多个 `delegate_task` 调用 |
18
+ | `TodoWrite`(任务跟踪) | `todo` |
19
+ | `EnterPlanMode` / `ExitPlanMode` | 无等价工具 — 留在主会话中 |
20
+
21
+ ## 技能管理
22
+
23
+ Hermes Agent 使用三级渐进式技能加载:
24
+
25
+ | 操作 | 工具 |
26
+ |------|------|
27
+ | 列出所有可用技能 | `skills_list` |
28
+ | 查看技能完整内容 | `skill_view(name)` |
29
+ | 查看技能的引用文件 | `skill_view(name, path)` |
30
+ | 管理技能(安装/更新) | `skill_manage` |
31
+
32
+ ## 额外的 Hermes Agent 工具
33
+
34
+ | 工具 | 用途 |
35
+ |------|---------|
36
+ | `memory` | 持久化知识供未来会话使用 |
37
+ | `session_search` | 搜索历史会话记录 |
38
+ | `execute_code` | 在沙箱中执行代码 |
39
+ | `process` | 后台进程管理 |
40
+ | `vision_analyze` | 图像分析 |
41
+ | `image_generate` | 图像生成 |
42
+ | `clarify` | 向用户提出澄清性问题 |
43
+ | `browser_*` | 浏览器自动化工具集 |
44
+ | `mixture_of_agents` | 多智能体高级推理 |