Files
superpowers-zh/docs/README.cline.md
AI不止语 6cb1cd89bc feat(installer): 新增 Cline 与 Kilo Code 适配(22 款工具,#112、#88)
两款都是 VS Code 扩展,加载的是「rules」而非懒加载的 skills —— rules 会
并入每一轮 system prompt。所以照搬「把 20 个 SKILL.md 复制进规则目录」会
让每轮对话背着几万字常驻开销(Cline 官方也提示规则超约 300 行后遵守度下降)。

改用仓库既有的 Trae 模式:规则目录里只放一份小索引(核心规则 + 20 个 skill
的名称/触发条件表),skills 本体放各自的 skills/ 目录由 agent 按需读取。

Cline(#112)
- skills -> .cline/skills/,索引 -> .clinerules/superpowers-zh.md
- 不写 YAML frontmatter:Cline 目前只支持 paths 一个条件字段,
  无 frontmatter 即始终生效,正是所需
- 索引保持在 .clinerules/ 根层单文件 —— 子目录是否递归扫描官方未说明

Kilo Code(#88)
- skills -> .kilocode/skills/,索引 -> .kilocode/rules/superpowers-zh.md
- 走 .kilocode/rules/ 而非 v7 推荐的 .kilo/rules/ + kilo.jsonc:后者需要把
  路径登记进用户的 kilo.jsonc,那是带注释的 JSONC,安装器安全合并容易改坏
  用户配置。官方明确 .kilocode/rules/ 向后兼容且零配置生效,故选它。
  docs 里写了想迁到 v7 方式该改哪一行,以及万一没生效怎么反馈。

接入点(全部为新增,未改动任何既有工具的条目)
- TARGETS 加 2 条,检测标记 .clinerules / [.kilocode,.kilo,kilo.jsonc] 均唯一
- installForTarget 分发、TOOL_ALIASES(cline/kilocode/kilo/kilo-code)
- BOOTSTRAP_DELETE 加两份索引路径,--uninstall 能清干净
- --global 明确拒绝并指向 docs:Cline 全局 rules 路径随 OS 变
  (~/Documents/Cline/Rules,Linux/WSL 还有 ~/Cline/Rules 回退),
  Kilo 全局需改 kilo.jsonc,都不是通用 --global 能可靠命中的
- audit.sh TOOLS 数组加 cline kilocode,纳入 install/幂等/卸载回归
- 新增 docs/README.cline.md、docs/README.kilocode.md
- 计数 20 -> 22:简繁 README、package.json、CLAUDE.md、3 份 plugin manifest
  (RELEASE-NOTES 里的历史计数是过往版本记录,不动)

实测
- 两款均通过 装 / 二次装幂等 / 卸载无残留
- 检测隔离:.clinerules 只触发 Cline、.kilocode|.kilo|kilo.jsonc 只触发
  Kilo Code;.claude/.cursor/.trae/.qoder/.codebuddy 检测结果与改动前一致;
  .claude + .clinerules 共存时两款并行安装正常
- audit.sh: 130 pass / 0 fail(2 项 warn 为既有上游漂移,见 #19)

路径依据:docs.cline.bot/customization/cline-rules、kilo.ai/docs/customize/custom-rules

两款合并为一个提交:共用同一套「rules 型工具」机制与同一批计数改动,
拆开会产生 21 款的中间状态,audit 无法在中间提交上自洽通过。
2026-08-07 17:38:37 +08:00

79 lines
3.3 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Superpowers 中文版 — Cline 安装指南
在 [Cline](https://cline.bot)VS Code AI 编程扩展)中使用 superpowers-zh 的完整指南。
## 快速安装
```bash
cd /your/project
npx superpowers-zh --tool cline
```
自动检测:安装脚本发现项目里有 `.clinerules/` 目录时也会自动装 Cline。**如果你还没建过 rules就用上面的 `--tool cline` 显式指定。**
装完会得到两样东西:
```
.cline/skills/ # 20 个 skill 本体,按需读取
.clinerules/
└── superpowers-zh.md # 一份小索引,常驻 system prompt
```
## 工作原理(和其他工具不一样,值得读一下)
Cline 没有「skills」概念它加载的是 **Rules**`.clinerules/` 目录下所有 `.md` / `.txt` 会被**合并进每一轮的 system prompt**。
这跟 skills 的懒加载完全不同 —— 所以**绝不能把 20 个 SKILL.md 直接放进 `.clinerules/`**那会让每轮对话都背着几万字的常驻开销Cline 官方也提示规则超过约 300 行后遵守度会下降。
superpowers-zh 的做法:
| 放哪 | 内容 | 何时进 prompt |
|------|------|--------------|
| `.clinerules/superpowers-zh.md` | 核心规则 + 20 个 skill 的名称/触发条件索引表 | 每轮常驻(很小) |
| `.cline/skills/<name>/SKILL.md` | skill 完整流程正文 | 仅当任务匹配、Cline 主动读取时 |
索引 rule 里明确告诉 Cline匹配到触发条件就去读对应的 `SKILL.md`**不要**把正文抄进 rules。
### 为什么不写 YAML frontmatter
Cline 目前只支持 `paths`glob 数组)一个条件字段。不写 frontmatter 就是「始终生效」,正是我们要的效果,所以索引 rule 是纯 Markdown。
## 手动安装
```bash
git clone https://github.com/jnMetaCode/superpowers-zh.git
mkdir -p /your/project/.cline/skills /your/project/.clinerules
cp -r superpowers-zh/skills/* /your/project/.cline/skills/
```
然后在 `.clinerules/superpowers-zh.md` 里手写一份索引(内容参考 `npx` 装出来的那份)。**推荐直接用 `npx`** —— 索引表是根据 skills 的 frontmatter 自动生成的,手写容易漏。
## 关于全局安装
`--global` 对 Cline **不支持**。Cline 的全局 rules 目录随操作系统变化:
- macOS / Linux`~/Documents/Cline/Rules`
- Windows`Documents\Cline\Rules`
- Linux / WSL 有时是 `~/Cline/Rules`
没有一条稳定路径能让通用 `--global` 可靠命中,写错等于「装了不生效」,所以宁可不做。请用项目级安装。想全局用的话,把 `npx` 生成的那份 `superpowers-zh.md` 手动拷进你系统上实际的 Cline 全局 rules 目录即可。
## 使用
装好后新开一个 Cline 会话rules 在会话开始时加载)。然后正常提需求即可:
- 「给用户模块加个批量导出功能」→ 应当先触发 brainstorming 做需求澄清,而不是直接写代码
- 也可以手动点名:「用 test-driven-development skill 做这个」
## 更新 / 卸载
```bash
npx superpowers-zh --tool cline # 更新(覆盖式,幂等)
npx superpowers-zh --uninstall # 卸载,同时清掉 .clinerules/superpowers-zh.md
```
## 获取帮助
- 提交 Issuehttps://github.com/jnMetaCode/superpowers-zh/issues
- Cline Rules 文档https://docs.cline.bot/customization/cline-rules