Skip to content
Built 26/04/15 10:53commit de0ee65

中文 | English

Compound Engineering

一个插件市场,主打 Compound Engineering 插件 这一套 AI skills 与 agents,让每一个工程工作单元都比上一个更容易。

理念

每一个工程工作单元,都应该让后续工作更容易,而不是更难。

传统开发会不断积累技术债。每加一个功能,复杂度就更高。代码库会随着时间变得越来越难维护。

Compound engineering 反过来思考这个问题。80% 的工作在 planning 和 review,20% 才是 execution:

  • 写代码前先把计划做透
  • 通过 review 发现问题并沉淀经验
  • 把知识编码下来,方便复用
  • 维持高质量,让未来改动更轻松

了解更多

工作流

text
Brainstorm -> Plan -> Work -> Review -> Compound -> Repeat
    ^
  Ideate (optional -- when you need ideas)
命令用途
/ce:ideate通过发散式构思和对抗式筛选,发现高影响力的项目改进点
/ce:brainstorm在规划前探索需求与可行方案
/ce:plan把功能想法转成详细的实现计划
/ce:work结合 worktree 和任务跟踪执行计划
/ce:review在合并前做多 agent 代码审查
/ce:compound记录经验,让后续工作更轻松

/ce:brainstorm 是主要入口,它通过交互式问答把想法整理成需求计划;如果没有必要走完整套流程,也会自动缩短步骤。/ce:plan 则接收 brainstorming 产出的需求文档,或接收一个足够详细的想法,再把它提炼为 agent(或人)都能据此执行的技术计划。

/ce:ideate 的使用频率较低,但有时会带来很高的杠杆效应,它可以基于你的代码库主动提出有价值的改进想法,并允许你提供额外引导。

每一个循环都会产生复利:brainstorm 会让 plan 更清晰,plan 会帮助未来的 plan,review 会捕捉更多问题,而模式会被文档化保存下来。

开始使用

安装后,在任意项目中运行 /ce-setup。它会检查你的环境,安装缺失工具(agent-browser、gh、jq、vhs、silicon、ffmpeg),并初始化项目配置。


安装

Claude Code

text
/plugin marketplace add EveryInc/compound-engineering-plugin
/plugin install compound-engineering

Cursor

text
/add-plugin compound-engineering

OpenCode、Codex、Droid、Pi、Gemini、Copilot、Kiro、Windsurf、OpenClaw 与 Qwen(实验性)

这个仓库包含一个 Bun/TypeScript CLI,可把 Claude Code plugins 转换为 OpenCode、Codex、Factory Droid、Pi、Gemini CLI、GitHub Copilot、Kiro CLI、Windsurf、OpenClaw 和 Qwen Code 可用的格式。

text
# 将 compound-engineering plugin 转成 OpenCode 格式
bunx @every-env/compound-plugin install compound-engineering --to opencode

# 转成 Codex 格式
bunx @every-env/compound-plugin install compound-engineering --to codex

# 转成 Factory Droid 格式
bunx @every-env/compound-plugin install compound-engineering --to droid

# 转成 Pi 格式
bunx @every-env/compound-plugin install compound-engineering --to pi

# 转成 Gemini CLI 格式
bunx @every-env/compound-plugin install compound-engineering --to gemini

# 转成 GitHub Copilot 格式
bunx @every-env/compound-plugin install compound-engineering --to copilot

# 转成 Kiro CLI 格式
bunx @every-env/compound-plugin install compound-engineering --to kiro

# 转成 OpenClaw 格式
bunx @every-env/compound-plugin install compound-engineering --to openclaw

# 转成 Windsurf 格式(默认全局作用域)
bunx @every-env/compound-plugin install compound-engineering --to windsurf

# 转成 Windsurf workspace 作用域
bunx @every-env/compound-plugin install compound-engineering --to windsurf --scope workspace

# 转成 Qwen Code 格式
bunx @every-env/compound-plugin install compound-engineering --to qwen

# 自动检测已安装工具并全部安装
bunx @every-env/compound-plugin install compound-engineering --to all

各目标输出格式细节

目标输出路径说明
opencode~/.config/opencode/Commands 会写成 .md 文件;opencode.json 的 MCP 配置会做深度合并;覆盖前会先备份
codex~/.codex/prompts + ~/.codex/skillsClaude commands 会被转成 prompt + skill 配对;规范的 ce:* workflow skills 也会获得 prompt 包装;已弃用的 workflows:* 别名会被省略
droid~/.factory/工具名会被映射(Bash -> ExecuteWrite -> Create);命名空间前缀会被移除
pi~/.pi/agent/输出 prompts、skills、extensions,以及用于 MCPorter 互操作的 mcporter.json
gemini.gemini/Skills 来自 agents;commands 写成 .toml;带命名空间的 commands 会转成目录(workflows:plan -> commands/workflows/plan.toml
copilot.github/Agents 会写成带 Copilot frontmatter 的 .agent.md;MCP 环境变量会加上 COPILOT_MCP_ 前缀
kiro.kiro/Agents 写成 JSON 配置加 prompt .md 文件;仅支持 stdio MCP servers
openclaw~/.openclaw/extensions/<plugin>/输出入口 TypeScript skill 文件,以及用于 MCP servers 的 openclaw-extension.json
windsurf~/.codeium/windsurf/(全局)或 .windsurf/(workspace)Agents 会变成 skills;commands 会变成扁平 workflows;mcp_config.json 会合并
qwen~/.qwen/extensions/<plugin>/Agents 写成 .yaml;带占位符的环境变量会被提取成 settings;嵌套 commands 使用冒号分隔

所有 provider 目标都仍处于实验阶段,随着格式演进,行为可能变化。


本地开发

从本地 checkout 运行

适合主动开发阶段,修改插件源码后效果会立即反映出来。

Claude Code:添加一个 shell alias,让本地副本与常规插件并行加载:

text
alias cce='claude --plugin-dir ~/code/compound-engineering-plugin/plugins/compound-engineering'

cce 代替 claude 来测试改动。你原本的正式安装保持不变。

Codex 和其他目标:直接用本地 checkout 运行 CLI:

text
# 在仓库根目录执行
bun run src/index.ts install ./plugins/compound-engineering --to codex

# 其他目标同理
bun run src/index.ts install ./plugins/compound-engineering --to opencode

从已推送的分支运行

适合测试别人或自己 worktree 中的分支,而不需要切换当前 checkout。这里通过 --branch 把该分支克隆到一个确定性的缓存目录。

尚未推送的本地分支:如果分支只存在于本地 worktree、还没推送,请直接把 --plugin-dir 指到该 worktree 路径(例如 claude --plugin-dir /path/to/worktree/plugins/compound-engineering)。

Claude Code:使用 plugin-path 获取缓存 clone 路径:

text
# 在仓库根目录执行
bun run src/index.ts plugin-path compound-engineering --branch feat/new-agents
# 输出:
#   claude --plugin-dir ~/.cache/compound-engineering/branches/compound-engineering-feat~new-agents/plugins/compound-engineering

缓存路径是确定性的(同一个分支总映射到同一个目录)。再次运行会把该 checkout 更新到分支上的最新提交。

Codex、OpenCode 和其他目标:给 install 传入 --branch

text
# 在仓库根目录执行
bun run src/index.ts install compound-engineering --to codex --branch feat/new-agents

# 任意目标都可以
bun run src/index.ts install compound-engineering --to opencode --branch feat/new-agents

# 配合 --also 一次安装多个目标
bun run src/index.ts install compound-engineering --to codex --also opencode --branch feat/new-agents

这两类功能都会通过 COMPOUND_PLUGIN_GITHUB_SOURCE 环境变量来解析仓库地址,默认值是 https://github.com/EveryInc/compound-engineering-plugin

Shell aliases

把下面内容加到 ~/.zshrc~/.bashrc。所有 alias 都使用本地 CLI,因此不依赖 npm 发布。plugin-path 只把路径输出到 stdout(进度信息写到 stderr),所以能方便地与 $() 组合。

text
CE_REPO=~/code/compound-engineering-plugin

ce-cli() { bun run "$CE_REPO/src/index.ts" "$@"; }

# --- 本地 checkout(主动开发) ---
alias cce='claude --plugin-dir $CE_REPO/plugins/compound-engineering'

codex-ce() {
  ce-cli install "$CE_REPO/plugins/compound-engineering" --to codex "$@"
}

# --- 已推送分支(测试 PR、worktree 工作流) ---
ccb() {
  claude --plugin-dir "$(ce-cli plugin-path compound-engineering --branch "$1")" "${@:2}"
}

codex-ceb() {
  ce-cli install compound-engineering --to codex --branch "$1" "${@:2}"
}

用法:

text
cce                              # 在 Claude Code 中使用本地 checkout
codex-ce                         # 把本地 checkout 安装到 Codex
ccb feat/new-agents              # 在 Claude Code 中测试一个已推送分支
ccb feat/new-agents --verbose    # 额外参数会继续传给 claude
codex-ceb feat/new-agents        # 把一个已推送分支安装到 Codex

同步个人配置

把你的个人 Claude Code 配置(~/.claude/)同步到其他 AI coding 工具。如果省略 --target,会默认同步到所有检测到的受支持工具:

text
# 同步到所有检测到的工具(默认)
bunx @every-env/compound-plugin sync

# 同步 skills 和 MCP servers 到 OpenCode
bunx @every-env/compound-plugin sync --target opencode

# 同步到 Codex
bunx @every-env/compound-plugin sync --target codex

# 同步到 Pi
bunx @every-env/compound-plugin sync --target pi

# 同步到 Droid
bunx @every-env/compound-plugin sync --target droid

# 同步到 GitHub Copilot(skills + MCP servers)
bunx @every-env/compound-plugin sync --target copilot

# 同步到 Gemini(skills + MCP servers)
bunx @every-env/compound-plugin sync --target gemini

# 同步到 Windsurf
bunx @every-env/compound-plugin sync --target windsurf

# 同步到 Kiro
bunx @every-env/compound-plugin sync --target kiro

# 同步到 Qwen
bunx @every-env/compound-plugin sync --target qwen

# 同步到 OpenClaw(仅 skills;MCP 会通过校验门控)
bunx @every-env/compound-plugin sync --target openclaw

# 同步到所有检测到的工具
bunx @every-env/compound-plugin sync --target all

同步内容包括:

  • ~/.claude/skills/ 中的个人 skills(以符号链接方式同步)
  • ~/.claude/commands/ 中的个人 slash commands(会按 provider 能力转成本地 prompts、workflows 或转换后的 skills)
  • ~/.claude/settings.json 中的 MCP servers

Skills 采用符号链接而不是拷贝,因此你在 Claude Code 中的修改会立即反映到其他工具。

支持的同步目标:

  • opencode
  • codex
  • pi
  • droid
  • copilot
  • gemini
  • windsurf
  • kiro
  • qwen
  • openclaw

说明:

  • Codex 同步会保留未被管理的 config.toml 内容,现在也包含 remote MCP servers。
  • Command 同步会复用各 provider 现有的 Claude command 转换逻辑,因此有些目标拿到的是 prompts 或 workflows,另一些目标拿到的是转换后的 skills。
  • Copilot 同步会把个人 skills 写入 ~/.copilot/skills/,并把 MCP 配置写入 ~/.copilot/mcp-config.json
  • Gemini 同步会把 MCP 配置写入 ~/.gemini/,并避免镜像 Gemini 已经会从 ~/.agents/skills 发现的 skills,从而避免 duplicate-skill 警告。
  • Droid、Windsurf、Kiro 和 Qwen 同步会把 MCP servers 合并到各自 provider 文档规定的用户配置中。
  • OpenClaw 当前只同步 skills。个人 commands 不会同步,因为这个仓库还没有文档化的用户级 OpenClaw command surface;MCP 也不会同步,因为当前官方 OpenClaw 文档还没有明确记录 MCP server 配置契约。