From d89daf9fc2860f2d1e8355bcba5f4da63e95955e Mon Sep 17 00:00:00 2001 From: jiangnan <1394485448@qq.com> Date: Mon, 13 Apr 2026 20:00:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=20Hermes=20Agent=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=EF=BC=88=E7=AC=AC=2016=20=E6=AC=BE=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 安装器新增 Hermes Agent 目标(.hermes/skills/)和别名(hermes/hermes-agent) - 安装时自动生成 HERMES.md bootstrap(含工具映射和 skills 列表) - 新增 references/hermes-tools.md 工具映射表(中文化) - using-superpowers 技能新增 Hermes Agent 平台说明(skill_view 三级渐进式加载) - 各处 description 加入 Hermes Agent 名称,工具数量更新为 16 款 - package.json 添加 hermes/hermes-agent 关键词 --- .claude-plugin/marketplace.json | 4 +- .claude-plugin/plugin.json | 2 +- .cursor-plugin/plugin.json | 2 +- .gitignore | 1 + bin/superpowers-zh.js | 63 +++++++++++++++++++ package.json | 4 +- skills/using-superpowers/SKILL.md | 4 +- .../references/hermes-tools.md | 44 +++++++++++++ 8 files changed, 118 insertions(+), 6 deletions(-) create mode 100644 skills/using-superpowers/references/hermes-tools.md diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index c7c90c2..b33ba69 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,6 +1,6 @@ { "name": "superpowers-zh", - "description": "AI 编程超能力中文增强版:20 个 skills,支持 OpenClaw / Claude Code / Cursor 等 15 款工具", + "description": "AI 编程超能力中文增强版:20 个 skills,支持 Claude Code / Hermes Agent / Cursor 等 16 款工具", "owner": { "name": "jnMetaCode", "url": "https://github.com/jnMetaCode" @@ -8,7 +8,7 @@ "plugins": [ { "name": "superpowers-zh", - "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 OpenClaw / Claude Code / Cursor 等 15 款工具", + "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 Claude Code / Hermes Agent / Cursor 等 16 款工具", "version": "1.1.6", "source": "./", "author": { diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 19dee78..26d1f1d 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "superpowers-zh", - "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 OpenClaw / Claude Code / Cursor 等 15 款工具", + "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 Claude Code / Hermes Agent / Cursor 等 16 款工具", "version": "1.1.6", "author": { "name": "jnMetaCode", diff --git a/.cursor-plugin/plugin.json b/.cursor-plugin/plugin.json index cbcedf0..6a3a2b6 100644 --- a/.cursor-plugin/plugin.json +++ b/.cursor-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "superpowers-zh", "displayName": "Superpowers 中文版", - "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 OpenClaw / Cursor / Claude Code 等 15 款工具", + "description": "AI 编程超能力中文增强版:20 个 skills(14 翻译 + 6 中国原创),支持 Cursor / Claude Code / Hermes Agent 等 16 款工具", "version": "1.1.6", "author": { "name": "jnMetaCode", diff --git a/.gitignore b/.gitignore index 31ff211..8f4d70d 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ triage/ # 安装器生成的 skills 副本(源在 skills/ 目录) .codex/skills/ .gemini/skills/ +.hermes/skills/ .opencode/skills/ diff --git a/bin/superpowers-zh.js b/bin/superpowers-zh.js index b48d6b3..d189176 100755 --- a/bin/superpowers-zh.js +++ b/bin/superpowers-zh.js @@ -44,6 +44,7 @@ const TARGETS = [ { name: 'Aider', dir: '.aider/skills', detect: '.aider' }, { name: 'OpenCode', dir: '.opencode/skills', detect: '.opencode' }, { name: 'Qwen Code', dir: '.qwen/skills', detect: '.qwen' }, + { name: 'Hermes Agent', dir: '.hermes/skills', detect: ['.hermes', 'HERMES.md', '.hermes.md'] }, ]; function countDirs(dir) { @@ -230,6 +231,62 @@ ${skillList} } } +function generateHermesBootstrap(projectDir) { + const skillEntries = scanSkillEntries(SKILLS_SRC); + const skillList = skillEntries.map(s => `- **${s.name}**: ${s.desc}`).join('\n'); + + const content = `# Superpowers-ZH 中文增强版 + +本项目已安装 superpowers-zh 技能框架(${skillEntries.length} 个 skills)。 + +## 核心规则 + +1. **收到任务时,先检查是否有匹配的 skill** — 哪怕只有 1% 的可能性也要检查 +2. **设计先于编码** — 收到功能需求时,先用 brainstorming skill 做需求分析 +3. **测试先于实现** — 写代码前先写测试(TDD) +4. **验证先于完成** — 声称完成前必须运行验证命令 + +## 工具映射 + +技能中引用的 Claude Code 工具名称对应 Hermes Agent 的等价工具: +- \`Read\` → \`read_file\` +- \`Write\` → \`write_file\` +- \`Edit\` → \`patch\` +- \`Bash\` → \`terminal\` +- \`Grep\` / \`Glob\` → \`search_files\` +- \`Skill\` → \`skill_view\` +- \`Task\`(子智能体) → \`delegate_task\` +- \`WebSearch\` → \`web_search\` +- \`WebFetch\` → \`web_extract\` +- \`TodoWrite\` → \`todo\` + +## 可用 Skills + +Skills 位于 \`.hermes/skills/\` 目录,每个 skill 有独立的 \`SKILL.md\` 文件。 + +${skillList} + +## 如何使用 + +当任务匹配某个 skill 时,使用 \`skill_view\` 加载对应 skill 并严格遵循其流程。 +`; + + // 写入 HERMES.md(如果已存在则追加) + const hermesPath = resolve(projectDir, 'HERMES.md'); + if (existsSync(hermesPath)) { + const existing = readFileSync(hermesPath, 'utf8'); + if (!existing.includes('superpowers-zh')) { + writeFileSync(hermesPath, existing + '\n\n' + content, 'utf8'); + console.log(` ✅ Hermes Agent: 追加 skills 引用 -> ${hermesPath}`); + } else { + console.log(` ✅ Hermes Agent: HERMES.md 已包含 superpowers-zh 引用`); + } + } else { + writeFileSync(hermesPath, content, 'utf8'); + console.log(` ✅ Hermes Agent: bootstrap -> ${hermesPath}`); + } +} + // 工具名称别名映射(用户输入 -> TARGETS.name) const TOOL_ALIASES = { 'claude': 'Claude Code', @@ -253,6 +310,8 @@ const TOOL_ALIASES = { 'opencode': 'OpenCode', 'qwen': 'Qwen Code', 'qwen-code': 'Qwen Code', + 'hermes': 'Hermes Agent', + 'hermes-agent': 'Hermes Agent', }; function showHelp() { @@ -302,6 +361,10 @@ function installForTarget(target) { generateGeminiBootstrap(PROJECT_DIR); } + if (target.name === 'Hermes Agent') { + generateHermesBootstrap(PROJECT_DIR); + } + if (target.name === 'Claude Code' && existsSync(AGENTS_SRC)) { const agentsDest = resolve(PROJECT_DIR, '.claude', 'agents'); mkdirSync(agentsDest, { recursive: true }); diff --git a/package.json b/package.json index dda7e71..7b4d364 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "engines": { "node": ">=14.0.0" }, - "description": "AI 编程超能力中文增强版 — superpowers(99k+ ⭐)完整汉化 + 6 个中国原创 skills,支持 Claude Code / Copilot CLI / Cursor / Windsurf / Kiro / Gemini CLI 等 15 款工具", + "description": "AI 编程超能力中文增强版 — superpowers(99k+ ⭐)完整汉化 + 6 个中国原创 skills,支持 Claude Code / Copilot CLI / Hermes Agent / Cursor / Windsurf / Kiro / Gemini CLI 等 16 款工具", "type": "module", "main": ".opencode/plugins/superpowers.js", "bin": { @@ -44,6 +44,8 @@ "qwen", "vscode", "copilot", + "hermes", + "hermes-agent", "ai-coding", "skills", "chinese", diff --git a/skills/using-superpowers/SKILL.md b/skills/using-superpowers/SKILL.md index 04b960e..65ed418 100644 --- a/skills/using-superpowers/SKILL.md +++ b/skills/using-superpowers/SKILL.md @@ -31,13 +31,15 @@ Superpowers 技能覆盖默认系统提示行为,但**用户指令始终具有 **在 Copilot CLI 中:** 使用 `skill` 工具。技能从已安装的插件中自动发现。`skill` 工具的工作方式与 Claude Code 的 `Skill` 工具相同。 +**在 Hermes Agent 中:** 使用 `skill_view` 工具加载技能。Hermes 支持三级渐进式加载:`skills_list` 浏览 → `skill_view(name)` 加载完整内容 → `skill_view(name, path)` 查看引用文件。 + **在 Gemini CLI 中:** 技能通过 `activate_skill` 工具激活。Gemini 在会话开始时加载技能元数据,并按需激活完整内容。 **在其他环境中:** 查看你的平台文档了解技能的加载方式。 ## 平台适配 -技能使用 Claude Code 的工具名称。非 CC 平台:查看 `references/copilot-tools.md`(Copilot CLI)、`references/codex-tools.md`(Codex)了解工具对应关系。Gemini CLI 用户通过 GEMINI.md 自动获得工具映射。 +技能使用 Claude Code 的工具名称。非 CC 平台:查看 `references/copilot-tools.md`(Copilot CLI)、`references/hermes-tools.md`(Hermes Agent)、`references/codex-tools.md`(Codex)了解工具对应关系。Gemini CLI 用户通过 GEMINI.md 自动获得工具映射。 # 使用技能 diff --git a/skills/using-superpowers/references/hermes-tools.md b/skills/using-superpowers/references/hermes-tools.md new file mode 100644 index 0000000..b32cd4b --- /dev/null +++ b/skills/using-superpowers/references/hermes-tools.md @@ -0,0 +1,44 @@ +# Hermes Agent 工具映射 + +技能使用 Claude Code 的工具名称。当你在技能中遇到这些工具时,使用你平台的等价工具: + +| 技能中引用的工具 | Hermes Agent 等价工具 | +|-----------------|----------------------| +| `Read`(读取文件) | `read_file` | +| `Write`(创建文件) | `write_file` | +| `Edit`(编辑文件) | `patch` | +| `Bash`(运行命令) | `terminal` | +| `Grep`(搜索文件内容) | `search_files` | +| `Glob`(按名称搜索文件) | `search_files` | +| `Skill` 工具(调用技能) | `skill_view` | +| `WebFetch` | `web_extract` | +| `WebSearch` | `web_search` | +| `Task` 工具(分派子智能体) | `delegate_task` | +| 多个 `Task` 调用(并行) | 多个 `delegate_task` 调用 | +| `TodoWrite`(任务跟踪) | `todo` | +| `EnterPlanMode` / `ExitPlanMode` | 无等价工具 — 留在主会话中 | + +## 技能管理 + +Hermes Agent 使用三级渐进式技能加载: + +| 操作 | 工具 | +|------|------| +| 列出所有可用技能 | `skills_list` | +| 查看技能完整内容 | `skill_view(name)` | +| 查看技能的引用文件 | `skill_view(name, path)` | +| 管理技能(安装/更新) | `skill_manage` | + +## 额外的 Hermes Agent 工具 + +| 工具 | 用途 | +|------|---------| +| `memory` | 持久化知识供未来会话使用 | +| `session_search` | 搜索历史会话记录 | +| `execute_code` | 在沙箱中执行代码 | +| `process` | 后台进程管理 | +| `vision_analyze` | 图像分析 | +| `image_generate` | 图像生成 | +| `clarify` | 向用户提出澄清性问题 | +| `browser_*` | 浏览器自动化工具集 | +| `mixture_of_agents` | 多智能体高级推理 |