superpowers-zh 1.1.6 → 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.
Files changed (115) hide show
  1. package/.claude-plugin/marketplace.json +3 -3
  2. package/.claude-plugin/plugin.json +2 -2
  3. package/.cursor-plugin/plugin.json +2 -2
  4. package/.opencode/plugins/superpowers.js +13 -25
  5. package/README.md +14 -8
  6. package/bin/superpowers-zh.js +97 -11
  7. package/docs/README.hermes.md +96 -0
  8. package/gemini-extension.json +1 -1
  9. package/hooks/session-start +11 -11
  10. package/package.json +7 -4
  11. package/skills/using-superpowers/SKILL.md +5 -1
  12. package/skills/using-superpowers/references/copilot-tools.md +52 -0
  13. package/skills/using-superpowers/references/hermes-tools.md +44 -0
  14. package/.codex/skills/brainstorming/SKILL.md +0 -164
  15. package/.codex/skills/brainstorming/scripts/frame-template.html +0 -214
  16. package/.codex/skills/brainstorming/scripts/helper.js +0 -88
  17. package/.codex/skills/brainstorming/scripts/server.cjs +0 -338
  18. package/.codex/skills/brainstorming/scripts/start-server.sh +0 -153
  19. package/.codex/skills/brainstorming/scripts/stop-server.sh +0 -55
  20. package/.codex/skills/brainstorming/spec-document-reviewer-prompt.md +0 -48
  21. package/.codex/skills/brainstorming/visual-companion.md +0 -286
  22. package/.codex/skills/chinese-code-review/SKILL.md +0 -277
  23. package/.codex/skills/chinese-commit-conventions/SKILL.md +0 -364
  24. package/.codex/skills/chinese-documentation/SKILL.md +0 -448
  25. package/.codex/skills/chinese-git-workflow/SKILL.md +0 -510
  26. package/.codex/skills/dispatching-parallel-agents/SKILL.md +0 -182
  27. package/.codex/skills/executing-plans/SKILL.md +0 -175
  28. package/.codex/skills/finishing-a-development-branch/SKILL.md +0 -200
  29. package/.codex/skills/mcp-builder/SKILL.md +0 -255
  30. package/.codex/skills/receiving-code-review/SKILL.md +0 -213
  31. package/.codex/skills/requesting-code-review/SKILL.md +0 -105
  32. package/.codex/skills/requesting-code-review/code-reviewer.md +0 -146
  33. package/.codex/skills/subagent-driven-development/SKILL.md +0 -277
  34. package/.codex/skills/subagent-driven-development/code-quality-reviewer-prompt.md +0 -26
  35. package/.codex/skills/subagent-driven-development/implementer-prompt.md +0 -113
  36. package/.codex/skills/subagent-driven-development/spec-reviewer-prompt.md +0 -61
  37. package/.codex/skills/systematic-debugging/CREATION-LOG.md +0 -119
  38. package/.codex/skills/systematic-debugging/SKILL.md +0 -296
  39. package/.codex/skills/systematic-debugging/condition-based-waiting-example.ts +0 -158
  40. package/.codex/skills/systematic-debugging/condition-based-waiting.md +0 -115
  41. package/.codex/skills/systematic-debugging/defense-in-depth.md +0 -122
  42. package/.codex/skills/systematic-debugging/find-polluter.sh +0 -63
  43. package/.codex/skills/systematic-debugging/root-cause-tracing.md +0 -169
  44. package/.codex/skills/systematic-debugging/test-academic.md +0 -14
  45. package/.codex/skills/systematic-debugging/test-pressure-1.md +0 -58
  46. package/.codex/skills/systematic-debugging/test-pressure-2.md +0 -68
  47. package/.codex/skills/systematic-debugging/test-pressure-3.md +0 -69
  48. package/.codex/skills/test-driven-development/SKILL.md +0 -371
  49. package/.codex/skills/test-driven-development/testing-anti-patterns.md +0 -299
  50. package/.codex/skills/using-git-worktrees/SKILL.md +0 -218
  51. package/.codex/skills/using-superpowers/SKILL.md +0 -134
  52. package/.codex/skills/using-superpowers/references/codex-tools.md +0 -25
  53. package/.codex/skills/using-superpowers/references/gemini-tools.md +0 -33
  54. package/.codex/skills/verification-before-completion/SKILL.md +0 -139
  55. package/.codex/skills/workflow-runner/SKILL.md +0 -172
  56. package/.codex/skills/writing-plans/SKILL.md +0 -152
  57. package/.codex/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
  58. package/.codex/skills/writing-skills/SKILL.md +0 -654
  59. package/.codex/skills/writing-skills/anthropic-best-practices.md +0 -1149
  60. package/.codex/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  61. package/.codex/skills/writing-skills/graphviz-conventions.dot +0 -172
  62. package/.codex/skills/writing-skills/persuasion-principles.md +0 -187
  63. package/.codex/skills/writing-skills/render-graphs.js +0 -168
  64. package/.codex/skills/writing-skills/testing-skills-with-subagents.md +0 -384
  65. package/.opencode/skills/brainstorming/SKILL.md +0 -164
  66. package/.opencode/skills/brainstorming/scripts/frame-template.html +0 -214
  67. package/.opencode/skills/brainstorming/scripts/helper.js +0 -88
  68. package/.opencode/skills/brainstorming/scripts/server.cjs +0 -338
  69. package/.opencode/skills/brainstorming/scripts/start-server.sh +0 -153
  70. package/.opencode/skills/brainstorming/scripts/stop-server.sh +0 -55
  71. package/.opencode/skills/brainstorming/spec-document-reviewer-prompt.md +0 -48
  72. package/.opencode/skills/brainstorming/visual-companion.md +0 -286
  73. package/.opencode/skills/chinese-code-review/SKILL.md +0 -277
  74. package/.opencode/skills/chinese-commit-conventions/SKILL.md +0 -364
  75. package/.opencode/skills/chinese-documentation/SKILL.md +0 -448
  76. package/.opencode/skills/chinese-git-workflow/SKILL.md +0 -510
  77. package/.opencode/skills/dispatching-parallel-agents/SKILL.md +0 -182
  78. package/.opencode/skills/executing-plans/SKILL.md +0 -175
  79. package/.opencode/skills/finishing-a-development-branch/SKILL.md +0 -200
  80. package/.opencode/skills/mcp-builder/SKILL.md +0 -255
  81. package/.opencode/skills/receiving-code-review/SKILL.md +0 -213
  82. package/.opencode/skills/requesting-code-review/SKILL.md +0 -105
  83. package/.opencode/skills/requesting-code-review/code-reviewer.md +0 -146
  84. package/.opencode/skills/subagent-driven-development/SKILL.md +0 -277
  85. package/.opencode/skills/subagent-driven-development/code-quality-reviewer-prompt.md +0 -26
  86. package/.opencode/skills/subagent-driven-development/implementer-prompt.md +0 -113
  87. package/.opencode/skills/subagent-driven-development/spec-reviewer-prompt.md +0 -61
  88. package/.opencode/skills/systematic-debugging/CREATION-LOG.md +0 -119
  89. package/.opencode/skills/systematic-debugging/SKILL.md +0 -296
  90. package/.opencode/skills/systematic-debugging/condition-based-waiting-example.ts +0 -158
  91. package/.opencode/skills/systematic-debugging/condition-based-waiting.md +0 -115
  92. package/.opencode/skills/systematic-debugging/defense-in-depth.md +0 -122
  93. package/.opencode/skills/systematic-debugging/find-polluter.sh +0 -63
  94. package/.opencode/skills/systematic-debugging/root-cause-tracing.md +0 -169
  95. package/.opencode/skills/systematic-debugging/test-academic.md +0 -14
  96. package/.opencode/skills/systematic-debugging/test-pressure-1.md +0 -58
  97. package/.opencode/skills/systematic-debugging/test-pressure-2.md +0 -68
  98. package/.opencode/skills/systematic-debugging/test-pressure-3.md +0 -69
  99. package/.opencode/skills/test-driven-development/SKILL.md +0 -371
  100. package/.opencode/skills/test-driven-development/testing-anti-patterns.md +0 -299
  101. package/.opencode/skills/using-git-worktrees/SKILL.md +0 -218
  102. package/.opencode/skills/using-superpowers/SKILL.md +0 -134
  103. package/.opencode/skills/using-superpowers/references/codex-tools.md +0 -25
  104. package/.opencode/skills/using-superpowers/references/gemini-tools.md +0 -33
  105. package/.opencode/skills/verification-before-completion/SKILL.md +0 -139
  106. package/.opencode/skills/workflow-runner/SKILL.md +0 -172
  107. package/.opencode/skills/writing-plans/SKILL.md +0 -152
  108. package/.opencode/skills/writing-plans/plan-document-reviewer-prompt.md +0 -49
  109. package/.opencode/skills/writing-skills/SKILL.md +0 -654
  110. package/.opencode/skills/writing-skills/anthropic-best-practices.md +0 -1149
  111. package/.opencode/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -189
  112. package/.opencode/skills/writing-skills/graphviz-conventions.dot +0 -172
  113. package/.opencode/skills/writing-skills/persuasion-principles.md +0 -187
  114. package/.opencode/skills/writing-skills/render-graphs.js +0 -168
  115. package/.opencode/skills/writing-skills/testing-skills-with-subagents.md +0 -384
@@ -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/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
 
@@ -224,7 +230,7 @@ MIT License — 自由使用,商业或个人均可。
224
230
 
225
231
  <div align="center">
226
232
 
227
- **🦸 AI 编程超能力:让 OpenClaw / Claude Code / Cursor 等 14 款工具真正会干活**
233
+ **🦸 AI 编程超能力:让 Claude Code / Hermes Agent / Cursor 等 16 款工具真正会干活**
228
234
 
229
235
  [Star 本项目](https://github.com/jnMetaCode/superpowers-zh) · [提交 Issue](https://github.com/jnMetaCode/superpowers-zh/issues) · [贡献代码](https://github.com/jnMetaCode/superpowers-zh/pulls)
230
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
  }
@@ -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) {
@@ -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 });
@@ -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.6",
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` | 多智能体高级推理 |