diff --git a/README.md b/README.md index 53adb30..8003c18 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ Chinese community edition of [superpowers](https://github.com/obra/superpowers), | 📦 翻译 Skills | 🇨🇳 中国特色 Skills | 🤖 支持工具 | |:---:|:---:|:---:| -| **14** | **5** | **Claude Code / Cursor / Codex / Gemini** | +| **14** | **5** | **Claude Code / Cursor / Codex / Kiro / Trae / Antigravity / VS Code / Gemini** | --- @@ -72,20 +72,29 @@ npx superpowers-zh # 克隆仓库 git clone https://github.com/jnMetaCode/superpowers-zh.git -# 复制 skills 到你的项目 -cp -r superpowers-zh/skills /your/project/.claude/skills -# 或 -cp -r superpowers-zh/skills /your/project/.cursor/skills +# 复制 skills 到你的项目(选择你使用的工具) +cp -r superpowers-zh/skills /your/project/.claude/skills # Claude Code +cp -r superpowers-zh/skills /your/project/.cursor/skills # Cursor +cp -r superpowers-zh/skills /your/project/.codex/skills # Codex CLI +cp -r superpowers-zh/skills /your/project/.kiro/steering # Kiro +cp -r superpowers-zh/skills /your/project/.trae/rules # Trae +cp -r superpowers-zh/skills /your/project/.antigravity # Antigravity ``` -### 方式三:在 CLAUDE.md 中引用 +### 方式三:在配置文件中引用 -```markdown -# CLAUDE.md +根据你使用的工具,在对应配置文件中引用 skills: -请使用 superpowers-zh 的 skills 来指导你的工作流程。 -Skills 位于 ./skills/ 目录下。 -``` +| 工具 | 配置文件 | 说明 | +|------|---------|------| +| Claude Code | `CLAUDE.md` | 项目根目录 | +| Kiro | `.kiro/steering/*.md` | 支持 always/globs/手动三种模式 | +| Trae | `.trae/rules/project_rules.md` | 项目级规则 | +| Antigravity | `GEMINI.md` 或 `AGENTS.md` | 项目根目录 | +| VS Code | `.github/copilot-instructions.md` | Copilot 自定义指令 | +| Cursor | `.cursor/rules/*.md` | 项目级规则目录 | + +> **详细安装指南**:[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) --- diff --git a/bin/superpowers-zh.js b/bin/superpowers-zh.js index c453bea..7481979 100755 --- a/bin/superpowers-zh.js +++ b/bin/superpowers-zh.js @@ -11,9 +11,13 @@ const AGENTS_SRC = resolve(__dirname, '..', 'agents'); const PROJECT_DIR = process.cwd(); const TARGETS = [ - { name: 'Claude Code', dir: '.claude/skills' }, - { name: 'Cursor', dir: '.cursor/skills' }, - { name: 'Codex CLI', dir: '.codex/skills' }, + { name: 'Claude Code', dir: '.claude/skills' }, + { name: 'Cursor', dir: '.cursor/skills' }, + { name: 'Codex CLI', dir: '.codex/skills' }, + { name: 'Kiro', dir: '.kiro/steering' }, + { name: 'Trae', dir: '.trae/rules' }, + { name: 'Antigravity', dir: '.antigravity' }, + { name: 'VS Code', dir: '.github' }, ]; function countDirs(dir) { @@ -31,7 +35,8 @@ function showHelp() { npx superpowers-zh --version 显示版本 说明: - 自动检测当前项目使用的 AI 编程工具(.claude/ .cursor/ .codex/), + 自动检测当前项目使用的 AI 编程工具: + Claude Code / Cursor / Codex / Kiro / Trae / Antigravity / VS Code 将 ${countDirs(SKILLS_SRC)} 个 skills 安装到对应目录。 如果未检测到任何工具,默认安装到 .claude/skills/。 diff --git a/docs/README.antigravity.md b/docs/README.antigravity.md new file mode 100644 index 0000000..b81ab78 --- /dev/null +++ b/docs/README.antigravity.md @@ -0,0 +1,93 @@ +# Superpowers 中文版 — Antigravity 安装指南 + +在 [Google Antigravity](https://antigravity.google)(Google AI IDE)中使用 superpowers-zh 的完整指南。 + +## 快速安装 + +```bash +cd /your/project +npx superpowers-zh +``` + +安装脚本会自动检测 `.antigravity/` 目录并将 skills 复制到该目录。 + +## 手动安装 + +```bash +git clone https://github.com/jnMetaCode/superpowers-zh.git +mkdir -p /your/project/.antigravity +cp -r superpowers-zh/skills/* /your/project/.antigravity/ +``` + +## 工作原理 + +Antigravity 支持多种规则文件格式: + +| 文件 | 优先级 | 说明 | +|------|--------|------| +| `GEMINI.md` | 最高 | Antigravity 专属规则 | +| `AGENTS.md` | 中 | 通用规则(Antigravity、Cursor、Claude Code 共享) | +| `.antigravity/rules.md` | 中 | 项目级规则目录 | +| `CLAUDE.md` | 低 | 也会被自动读取 | + +### 推荐配置方式 + +**方式一**:在项目根目录创建 `GEMINI.md`: + +```markdown +# GEMINI.md + +使用 .antigravity/ 目录下的 superpowers skills 来指导工作流程。 +优先使用 brainstorming(头脑风暴)开始新任务。 + +Skills 列表参见 .antigravity/ 目录。 +``` + +**方式二**:在 `AGENTS.md` 中引用(多工具共享): + +```markdown +# AGENTS.md + +本项目使用 superpowers-zh skills 框架。 +Skills 位于 .antigravity/(Antigravity)或 .claude/skills/(Claude Code)目录下。 +``` + +### 工具映射 + +Antigravity 使用 Gemini 模型,工具名称与 Claude Code 不同: + +| Claude Code | Antigravity (Gemini) | +|-------------|---------------------| +| `Read` | `read_file` | +| `Write` | `write_file` | +| `Edit` | `replace` | +| `Bash` | `run_shell_command` | +| `Skill` | `activate_skill` | + +Skills 中的 Claude Code 工具名称会被 Antigravity 自动适配。 + +## 使用 + +Antigravity 支持 Agent Manager 并行执行多个 agent: +- 与 superpowers-zh 的「派遣并行 Agent」skill 理念一致 +- 可以同时调度多个 skill 处理不同任务 + +## 全局规则 + +个人级别的全局规则放在: +``` +~/.gemini/GEMINI.md +~/.gemini/AGENTS.md +``` + +## 更新 + +```bash +cd /your/project +npx superpowers-zh +``` + +## 获取帮助 + +- 提交 Issue:https://github.com/jnMetaCode/superpowers-zh/issues +- Antigravity 文档:https://antigravity.google/docs/rules-workflows diff --git a/docs/README.kiro.md b/docs/README.kiro.md new file mode 100644 index 0000000..9b2f77c --- /dev/null +++ b/docs/README.kiro.md @@ -0,0 +1,69 @@ +# Superpowers 中文版 — Kiro 安装指南 + +在 [Kiro](https://kiro.dev)(Amazon AI IDE)中使用 superpowers-zh 的完整指南。 + +## 快速安装 + +```bash +cd /your/project +npx superpowers-zh +``` + +安装脚本会自动检测 `.kiro/` 目录并将 skills 复制到 `.kiro/steering/`。 + +## 手动安装 + +```bash +git clone https://github.com/jnMetaCode/superpowers-zh.git +cp -r superpowers-zh/skills/* /your/project/.kiro/steering/ +``` + +## 工作原理 + +Kiro 使用 **Steering** 机制管理 AI 行为规则: + +- **目录**:`.kiro/steering/` +- **格式**:Markdown + YAML frontmatter +- **加载模式**: + - `alwaysApply: true` — 每次对话自动加载 + - `globs: "*.ts"` — 匹配特定文件时加载 + - 手动引用 — 在聊天中输入 `#steering-file-name` + +### Skills 与 Steering 的对应 + +superpowers-zh 的 SKILL.md 文件格式与 Kiro Steering 文件兼容(都是 Markdown + YAML frontmatter)。安装后,Kiro 会自动识别并加载 skills。 + +### 推荐配置 + +在 `.kiro/steering/` 中创建 `superpowers.md`: + +```markdown +--- +description: 加载 superpowers skills 框架 +alwaysApply: true +--- + +使用 .kiro/steering/ 目录下的 superpowers skills 来指导工作流程。 +优先使用 brainstorming(头脑风暴)开始新任务。 +``` + +## 使用 + +在 Kiro 中,你可以: +- 直接提到 skill 名称:「使用头脑风暴来分析这个需求」 +- 手动引用:在聊天中输入 `#brainstorming` +- Skills 会根据任务类型自动激活 + +## 更新 + +```bash +cd /your/project +npx superpowers-zh +``` + +重新运行安装命令即可更新到最新版本。 + +## 获取帮助 + +- 提交 Issue:https://github.com/jnMetaCode/superpowers-zh/issues +- Kiro 文档:https://kiro.dev/docs/steering/ diff --git a/docs/README.trae.md b/docs/README.trae.md new file mode 100644 index 0000000..24462a4 --- /dev/null +++ b/docs/README.trae.md @@ -0,0 +1,62 @@ +# Superpowers 中文版 — Trae 安装指南 + +在 [Trae](https://www.trae.ai)(字节跳动 AI IDE)中使用 superpowers-zh 的完整指南。 + +## 快速安装 + +```bash +cd /your/project +npx superpowers-zh +``` + +安装脚本会自动检测 `.trae/` 目录并将 skills 复制到 `.trae/rules/`。 + +## 手动安装 + +```bash +git clone https://github.com/jnMetaCode/superpowers-zh.git +mkdir -p /your/project/.trae/rules +cp -r superpowers-zh/skills/* /your/project/.trae/rules/ +``` + +## 工作原理 + +Trae 使用 `.rules` 机制管理 AI 行为: + +- **目录**:`.trae/rules/` +- **格式**:Markdown + metadata(description、globs、alwaysApply、priority) +- **规则类型**: + - **项目规则**(Project Rules)— 仅作用于当前项目 + - **个人规则**(Personal Rules)— 用户级别,可被项目规则覆盖 +- **优先级**:1-4,数值越高优先级越高 + +### Skills 适配 + +superpowers-zh 的 SKILL.md 文件可以直接作为 Trae 的 rules 使用。Trae 会在初始化时加载 `.trae/rules/` 下的所有规则文件。 + +### 推荐配置 + +安装完成后,在 Trae 的 Builder Mode 或 Chat 中提到 skill 名称即可激活: + +``` +使用头脑风暴 skill 来分析这个需求 +``` + +## 中文支持 + +Trae 原生支持中文,与 superpowers-zh 完美配合: +- 所有 skills 均为中文 +- 中文代码审查、中文 Git 工作流等国内特色 skills 开箱即用 +- 支持 MCP 协议扩展 + +## 更新 + +```bash +cd /your/project +npx superpowers-zh +``` + +## 获取帮助 + +- 提交 Issue:https://github.com/jnMetaCode/superpowers-zh/issues +- Trae 文档:https://docs.trae.ai/ide/rules diff --git a/docs/README.vscode.md b/docs/README.vscode.md new file mode 100644 index 0000000..943a661 --- /dev/null +++ b/docs/README.vscode.md @@ -0,0 +1,98 @@ +# Superpowers 中文版 — VS Code (Copilot) 安装指南 + +在 VS Code + GitHub Copilot 中使用 superpowers-zh 的完整指南。 + +## 前置条件 + +- VS Code(最新版本) +- GitHub Copilot 扩展(免费版或付费版均可) + +## 快速安装 + +```bash +cd /your/project +npx superpowers-zh +``` + +安装脚本会自动检测 `.github/` 目录并将 skills 复制到该目录。 + +## 手动安装 + +```bash +git clone https://github.com/jnMetaCode/superpowers-zh.git +mkdir -p /your/project/.github +cp -r superpowers-zh/skills/* /your/project/.github/ +``` + +## 工作原理 + +VS Code Copilot 使用 `.github/copilot-instructions.md` 作为项目级自定义指令: + +- **位置**:项目根目录 `.github/copilot-instructions.md` +- **格式**:Markdown +- **生效范围**:该工作区内的所有 Copilot Chat 和内联补全 +- **自动加载**:保存文件后立即生效,无需重启 + +### 推荐配置 + +由于 Copilot 主要通过单个指令文件工作,建议创建 `.github/copilot-instructions.md` 引用 skills: + +```markdown +# Copilot 自定义指令 + +## 工作流方法论 + +本项目使用 superpowers-zh skills 框架。开始新任务前,请参考以下方法论: + +- 新需求 → 先头脑风暴(.github/brainstorming/SKILL.md) +- 写代码 → TDD 驱动(.github/test-driven-development/SKILL.md) +- 修 Bug → 系统化调试(.github/systematic-debugging/SKILL.md) +- 审查代码 → 中文代码审查(.github/chinese-code-review/SKILL.md) + +## 中文项目规范 + +- 代码注释和文档使用中文 +- Git commit 遵循中文提交规范 +- 技术术语保留英文原文 +``` + +### 使用 .instructions.md 文件(推荐) + +VS Code 还支持更细粒度的 `.instructions.md` 文件: + +``` +.github/ + copilot-instructions.md # 全局指令 + .instructions/ + typescript.instructions.md # TypeScript 文件专用 + testing.instructions.md # 测试相关 +``` + +## 使用 + +在 VS Code 中: +- **Copilot Chat**(`Ctrl+Shift+I`):直接引用 skill 名称 +- **内联补全**:自动遵循 copilot-instructions.md 中的规则 +- **`/init`**:在 Chat 中输入,自动生成项目配置 + +## 局限性 + +VS Code Copilot 不像 Claude Code 那样支持 `Skill` 工具或子 Agent 派遣。以下 skills 需要手动参考而非自动执行: + +- 派遣并行 Agent(需要 Agent 框架支持) +- 子 Agent 驱动开发(需要 Agent 框架支持) +- Git Worktree 使用(需要终端操作) + +其他方法论类 skills(头脑风暴、TDD、调试、代码审查等)完全兼容。 + +## 更新 + +```bash +cd /your/project +npx superpowers-zh +``` + +## 获取帮助 + +- 提交 Issue:https://github.com/jnMetaCode/superpowers-zh/issues +- VS Code Copilot 文档:https://code.visualstudio.com/docs/copilot/customization/custom-instructions diff --git a/package.json b/package.json index 7d4c373..670d96b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "superpowers-zh", - "version": "1.0.0", + "version": "1.1.0", "description": "AI 编程超能力中文版 — 14 个翻译 + 5 个中国特色原创 skills", "type": "module", "main": ".opencode/plugins/superpowers.js", @@ -28,6 +28,11 @@ "cursor", "codex", "gemini", + "kiro", + "trae", + "antigravity", + "vscode", + "copilot", "ai-coding", "skills", "chinese",