Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .kimi-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"name": "superpowers-zh",
"version": "1.5.0",
"description": "AI 编程超能力中文增强版:头脑风暴、subagent 驱动开发、规划、TDD、调试、代码审查、收尾工作流,附 4 个中文 skills 沉淀。",
"author": {
"name": "jnMetaCode",
"url": "https://github.com/jnMetaCode"
},
"homepage": "https://github.com/jnMetaCode/superpowers-zh",
"repository": "https://github.com/jnMetaCode/superpowers-zh",
"license": "MIT",
"keywords": [
"brainstorming",
"subagent-driven-development",
"skills",
"planning",
"tdd",
"debugging",
"code-review",
"workflow",
"chinese",
"中文"
],
"skills": "./skills/",
"sessionStart": {
"skill": "using-superpowers"
},
"skillInstructions": "Kimi Code tool mapping for Superpowers skills:\n\n- When a Superpowers skill says to ask the user, ask clarifying questions, ask one question at a time, present multiple-choice options, use the terminal for a question, or wait for the user's choice, call Kimi Code's `AskUserQuestion` tool. Do not render those choices as plain assistant text unless `AskUserQuestion` is unavailable or the session is in auto permission mode.\n- For `AskUserQuestion`, provide 1 question with 2-4 concrete options when possible. Put the recommended option first and suffix its label with `(Recommended)`.\n- When a Superpowers skill refers to `TodoWrite`, use Kimi Code's `TodoList` tool.\n- When a Superpowers skill says `Task tool (general-purpose)` or asks you to dispatch an implementer/reviewer subagent, use Kimi Code's `Agent` tool with a Kimi subagent type. Do not pass `general-purpose` as `subagent_type`.\n- For implementation, code review, spec review, quality review, and filled Superpowers subagent prompt templates, call `Agent` with `subagent_type: \"coder\"`, paste the fully filled prompt into `prompt`, and provide a short `description`.\n- For read-only codebase exploration that would take several searches, use `Agent` with `subagent_type: \"explore\"`.\n- For read-only planning or architecture design, use `Agent` with `subagent_type: \"plan\"`.\n- Keep dependent Superpowers subagent steps sequential. Use multiple `Agent` calls, or `run_in_background: true` only when the work is independent and background agents are available.\n- When a Superpowers skill refers to the `Skill` tool, use Kimi Code's native `Skill` tool.\n- Use Kimi Code's `Read`, `Write`, `Edit`, `Bash`, `Grep`, `Glob`, `FetchURL`, `WebSearch`, and MCP tools by their actual exposed names.\n- When a skill asks to search file contents, use `Grep`; when it asks to find files by path or pattern, use `Glob`; when it asks to fetch a URL, use `FetchURL`; when it asks to search the web, use `WebSearch`.",
"interface": {
"displayName": "Superpowers 中文版",
"shortDescription": "面向编程 agent 的规划、TDD、调试、交付工作流(中文增强版)",
"longDescription": "用 Superpowers 中文版引导 agent 完成头脑风暴、实现规划、测试驱动开发、系统化调试、并行执行、代码审查与分支收尾。在上游 obra/superpowers 之上叠加 4 个中国原创 skill 与多工具适配。",
"developerName": "jnMetaCode",
"capabilities": [
"Interactive",
"Read",
"Write"
],
"websiteURL": "https://github.com/jnMetaCode/superpowers-zh"
}
}
1 change: 1 addition & 0 deletions .version-bump.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{ "path": ".claude-plugin/plugin.json", "field": "version" },
{ "path": ".cursor-plugin/plugin.json", "field": "version" },
{ "path": ".codex-plugin/plugin.json", "field": "version" },
{ "path": ".kimi-plugin/plugin.json", "field": "version" },
{ "path": ".claude-plugin/marketplace.json", "field": "plugins.0.version" },
{ "path": "gemini-extension.json", "field": "version" }
],
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ cp -r superpowers-zh/skills /your/project/.qoder/skills # Qoder(阿里 AI
| Claw Code | `.claw/skills/*/SKILL.md` | Rust 版 CLI agent,兼容 Claude Code 的 SKILL.md 格式 |
| Qoder | `.qoder/skills/*/SKILL.md` + `.qoder/rules/superpowers-zh.md` | 阿里 AI IDE,自动生成 `trigger: always_on` 的 bootstrap rule |

> **详细安装指南**:[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) · [Qoder](docs/README.qoder.md)
> **详细安装指南**:[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) · [Qoder](docs/README.qoder.md) · [Kimi Code](docs/README.kimi.md)

### 卸载 / 误装清理(v1.2.1+)

Expand Down
86 changes: 86 additions & 0 deletions docs/README.kimi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# Superpowers 中文版 · Kimi Code 指南

在 [Kimi Code](https://github.com/MoonshotAI/kimi-code) 上使用 superpowers-zh 的完整说明。

## 安装

superpowers-zh 通过 Kimi Code 的插件清单 `.kimi-plugin/plugin.json` 集成,**直接指向仓库现有的 `skills/` 目录**——不复制 skill、不建 symlink、不装 hook、无任何运行时依赖。

打开插件管理器:

```text
/plugins
```

如果 Kimi 插件市场已收录,进入 `Marketplace` > `Superpowers 中文版` 安装即可。

也可以直接从本仓库安装:

```text
/plugins install https://github.com/jnMetaCode/superpowers-zh
```

如需验证尚未发布的改动,显式指定分支:

```text
/plugins install https://github.com/jnMetaCode/superpowers-zh/tree/main
```

Kimi Code 在**新会话**才会应用插件变更。安装、更新、启用、禁用或重载插件后,用 `/new` 开一个新会话。

## 工作原理

Kimi 插件清单位于 `.kimi-plugin/plugin.json`,做三件事:

1. 把 Kimi Code 指向仓库现有的 `skills/` 目录;
2. 通过 `sessionStart.skill` 在会话开始时加载 `using-superpowers`(这是让 skill 在恰当时机自动触发的关键);
3. 通过 `skillInstructions` 提供 Kimi 专属的工具映射。

## 工具映射

skill 内容描述的是「动作」而非写死某个运行时的工具名。在 Kimi Code 上它们对应到:

- 「向用户提问」/「问澄清问题」/「给出多选项」→ `AskUserQuestion`
- 「创建待办」/「在待办清单中标记完成」→ `TodoList`
- 「分派子智能体」/「Task tool (general-purpose)」→ `Agent`(用 Kimi 的 subagent 类型,如 `coder`/`explore`/`plan`,**不要**传 `general-purpose`)
- 「调用某个 skill」→ Kimi Code 原生 `Skill` 工具
- 「读文件」/「写文件」/「改文件」→ `Read` / `Write` / `Edit`
- 「跑 shell 命令」→ `Bash`
- 「搜索文件内容」→ `Grep`
- 「按路径/模式找文件」→ `Glob`
- 「抓取 URL」→ `FetchURL`
- 「联网搜索」→ `WebSearch`

完整映射写在清单的 `skillInstructions` 字段里,由 Kimi 在运行时读取。

## 更新

用 Kimi Code 的插件管理器:

```text
/plugins
```

选中 Superpowers 中文版更新,更新后用 `/new` 开新会话。

## 排错

### 插件没加载

1. 跑 `/plugins info superpowers-zh` 看诊断信息;
2. 确认插件已启用;
3. 安装或更新后用 `/new` 开新会话。

### 直接 GitHub 安装装到了旧版本

对于裸仓库 URL,Kimi Code 会装最新的 GitHub release(若存在)。要在下一个 release 前测试未发布的改动,显式指定分支:

```text
/plugins install https://github.com/jnMetaCode/superpowers-zh/tree/main
```

### skill 不触发

1. 用 `/plugins info superpowers-zh` 确认插件已启用;
2. 用 `/new` 开新会话;
3. 试验收提示词:`我们来做个 react todo list`。集成正常的话,会在写任何代码之前先加载 `brainstorming`。
1 change: 1 addition & 0 deletions scripts/sync-plugin-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const TARGETS = [
{ path: '.claude-plugin/plugin.json', field: 'version' },
{ path: '.cursor-plugin/plugin.json', field: 'version' },
{ path: '.codex-plugin/plugin.json', field: 'version' },
{ path: '.kimi-plugin/plugin.json', field: 'version' },
{ path: '.claude-plugin/marketplace.json', field: 'plugins.0.version' },
{ path: 'gemini-extension.json', field: 'version' },
];
Expand Down
6 changes: 6 additions & 0 deletions tests/kimi/run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"

bash "$SCRIPT_DIR/test-plugin-manifest.sh"
86 changes: 86 additions & 0 deletions tests/kimi/test-plugin-manifest.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#!/usr/bin/env bash
set -euo pipefail

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
MANIFEST="$REPO_ROOT/.kimi-plugin/plugin.json"

python3 - "$MANIFEST" <<'PY'
import json
import sys
from pathlib import Path

manifest_path = Path(sys.argv[1])
manifest = json.loads(manifest_path.read_text(encoding="utf-8"))

def assert_equal(actual, expected, label):
if actual != expected:
raise AssertionError(f"{label}: expected {expected!r}, got {actual!r}")

def assert_present(text, needle, label):
if needle not in text:
raise AssertionError(f"{label}: missing {needle!r}")

assert_equal(manifest.get("name"), "superpowers-zh", "plugin name")
assert_equal(manifest.get("skills"), "./skills/", "skills path")
assert_equal(
manifest.get("sessionStart", {}).get("skill"),
"using-superpowers",
"sessionStart.skill",
)

instructions = manifest.get("skillInstructions")
if not isinstance(instructions, str) or not instructions.strip():
raise AssertionError("skillInstructions must be a non-empty string")

for token in [
"AskUserQuestion",
"TodoList",
"Agent",
"Skill",
"Read",
"Write",
"Edit",
"Bash",
"Grep",
"Glob",
"FetchURL",
"WebSearch",
]:
assert_present(instructions, token, "skillInstructions")

version_config = json.loads(
(manifest_path.parents[1] / ".version-bump.json").read_text(encoding="utf-8")
)
version_entries = version_config.get("files")
if not isinstance(version_entries, list):
raise AssertionError(".version-bump.json must contain files list")

if not any(
entry.get("path") == ".kimi-plugin/plugin.json" and entry.get("field") == "version"
for entry in version_entries
if isinstance(entry, dict)
):
raise AssertionError(
".version-bump.json must update .kimi-plugin/plugin.json version"
)

unsupported_fields = [
"tools",
"commands",
"hooks",
"apps",
"inject",
"configFile",
"config_file",
"bootstrap",
]
present_unsupported = sorted(field for field in unsupported_fields if field in manifest)
if present_unsupported:
raise AssertionError(
"unsupported Kimi runtime fields present: "
+ ", ".join(present_unsupported)
)

print("Kimi plugin manifest looks good")
PY
Loading