ce-setup

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Compound Engineering Setup

Compound Engineering 环境配置

Interaction Method

交互方式

Ask the user each question below using the platform's blocking question tool (e.g.,
AskUserQuestion
in Claude Code,
request_user_input
in Codex,
ask_user
in Gemini). If no structured question tool is available, present each question as a numbered list and wait for a reply before proceeding. For multiSelect questions, accept comma-separated numbers (e.g.
1, 3
). Never skip or auto-configure.
Interactive setup for compound-engineering — diagnoses environment health, cleans obsolete repo-local CE config, and helps configure required tools. Review agent selection is handled automatically by
ce:review
; project-specific review guidance belongs in
CLAUDE.md
or
AGENTS.md
.
使用平台的阻塞式提问工具(例如 Claude Code 中的
AskUserQuestion
、Codex 中的
request_user_input
、Gemini 中的
ask_user
)依次向用户询问以下每个问题。如果没有结构化提问工具,可将问题按编号列表展示,每问完一个等待用户回复后再继续。对于多选问题,接受逗号分隔的数字作为回答(例如
1, 3
),严禁跳过问题或自动配置。
compound-engineering 交互式配置可诊断环境健康状态、清理过时的仓库本地 CE 配置、协助配置所需工具。评审 Agent 选择由
ce:review
自动处理,项目专属评审指引请存放在
CLAUDE.md
AGENTS.md
中。

Phase 1: Diagnose

阶段1:诊断

Step 1: Determine Plugin Version

步骤1:确认插件版本

Detect the installed compound-engineering plugin version by reading the plugin metadata or manifest. This is platform-specific -- use whatever mechanism is available (e.g., reading
plugin.json
from the plugin root or cache directory). If the version cannot be determined, skip this step.
If a version is found, pass it to the check script via
--version
. Otherwise omit the flag.
通过读取插件元数据或清单检测已安装的 compound-engineering 插件版本,该操作与平台相关——使用任意可用机制实现即可(例如从插件根目录或缓存目录读取
plugin.json
)。如果无法确定版本,跳过本步骤。
如果获取到版本号,通过
--version
参数传给检查脚本,否则省略该参数。

Step 2: Run the Health Check Script

步骤2:运行健康检查脚本

Before running the script, display: "Compound Engineering -- checking your environment..."
Run the bundled check script. Do not perform manual dependency checks -- the script handles all CLI tools, repo-local CE file checks, and
.gitignore
guidance in one pass.
bash
bash scripts/check-health --version VERSION
Or without version if Step 1 could not determine it:
bash
bash scripts/check-health
Script reference:
scripts/check-health
Display the script's output to the user.
运行脚本前,先展示:"Compound Engineering -- 正在检查你的环境..."
运行内置的检查脚本,不要手动执行依赖检查——该脚本会一次性完成所有 CLI 工具检查、仓库本地 CE 文件检查以及
.gitignore
配置指引。
bash
bash scripts/check-health --version VERSION
如果步骤1无法确定版本,使用以下命令:
bash
bash scripts/check-health
脚本参考:
scripts/check-health
向用户展示脚本的输出内容。

Step 3: Evaluate Results

步骤3:评估检查结果

Platform detection (pre-resolved): !
[ -n "${CLAUDE_PLUGIN_ROOT}" ] && echo "CLAUDE_CODE" || echo "OTHER"
If the line above resolved to
CLAUDE_CODE
, this is a Claude Code session and
/ce-update
is available. Otherwise, omit any
/ce-update
references from output.
After the diagnostic report, check whether:
  • any dependencies are missing (reported as yellow in the script output)
  • compound-engineering.local.md
    is present and needs cleanup
  • .compound-engineering/config.local.yaml
    does not exist or is not safely gitignored
  • .compound-engineering/config.local.example.yaml
    is missing or outdated
If everything is installed, no repo-local cleanup is needed, and
.compound-engineering/config.local.yaml
already exists and is gitignored, display the tool list and completion message. Parse the tool names from the script output and list each with a green circle:
 ✅ Compound Engineering setup complete

    Tools: 🟢 agent-browser  🟢 gh  🟢 jq  🟢 vhs  🟢 silicon  🟢 ffmpeg
    Config: ✅

    Run /ce-setup anytime to re-check.
If this is a Claude Code session, append to the message: "Run /ce-update to grab the latest plugin version."
Stop here.
Otherwise proceed to Phase 2 to resolve any issues. Handle repo-local cleanup (Step 4) first, then config bootstrapping (Step 5), then missing dependencies (Step 6).
平台检测(预解析): !
[ -n "${CLAUDE_PLUGIN_ROOT}" ] && echo "CLAUDE_CODE" || echo "OTHER"
如果上述行解析结果为
CLAUDE_CODE
,说明当前是 Claude Code 会话,支持
/ce-update
命令,否则输出内容中需省略所有
/ce-update
相关引用。
拿到诊断报告后,检查以下几项:
  • 是否存在缺失的依赖(脚本输出中标记为黄色的项)
  • compound-engineering.local.md
    是否存在且需要清理
  • .compound-engineering/config.local.yaml
    不存在或是未被正确加入 gitignore
  • .compound-engineering/config.local.example.yaml
    缺失或版本过时
如果所有工具都已安装、无需仓库本地清理、
.compound-engineering/config.local.yaml
已存在且已加入 gitignore,展示工具列表和完成提示。从脚本输出中解析工具名称,每个工具前用绿色圆圈标记:
 ✅ Compound Engineering 配置完成

    Tools: 🟢 agent-browser  🟢 gh  🟢 jq  🟢 vhs  🟢 silicon  🟢 ffmpeg
    Config: ✅

    可随时运行 /ce-setup 重新检查。
如果是 Claude Code 会话,在消息末尾追加:"运行 /ce-update 获取最新插件版本。"
流程到此结束。
否则进入阶段2解决所有问题,优先处理仓库本地清理(步骤4),其次是配置初始化(步骤5),最后处理缺失依赖(步骤6)。

Phase 2: Fix

阶段2:问题修复

Step 4: Resolve Repo-Local CE Issues

步骤4:解决仓库本地 CE 相关问题

Resolve the repository root (
git rev-parse --show-toplevel
). If
compound-engineering.local.md
exists at the repo root, explain that it is obsolete because review-agent selection is automatic and CE now uses
.compound-engineering/config.local.yaml
for any surviving machine-local state. Ask whether to delete it now. Use the repo-root path when deleting.
获取仓库根目录路径(
git rev-parse --show-toplevel
)。如果仓库根目录下存在
compound-engineering.local.md
,向用户说明该文件已过时:评审 Agent 选择已自动化,当前 CE 使用
.compound-engineering/config.local.yaml
存储所有需保留的本地机器状态,询问用户是否立即删除该文件,删除时使用仓库根目录的绝对路径。

Step 5: Bootstrap Project Config

步骤5:初始化项目配置

Resolve the repository root (
git rev-parse --show-toplevel
). All paths below are relative to the repo root, not the current working directory.
Example file (always refresh): Copy
references/config-template.yaml
to
<repo-root>/.compound-engineering/config.local.example.yaml
, creating the directory if needed. This file is committed to the repo and always overwritten with the latest template so teammates can see available settings.
Local config (create once): If
.compound-engineering/config.local.yaml
does not exist, ask whether to create it:
Set up a local config file for this project?
This saves your Compound Engineering preferences (like which tools to use and how workflows behave).
Everything starts commented out -- you only enable what you need.

1. Yes, create it (Recommended)
2. No thanks
If the user approves, copy
references/config-template.yaml
to
<repo-root>/.compound-engineering/config.local.yaml
. If
.compound-engineering/config.local.yaml
is not already covered by
.gitignore
, offer to add the entry:
text
.compound-engineering/*.local.yaml
If the local config already exists, check whether it is safely gitignored. If not, offer to add the
.gitignore
entry as above.
获取仓库根目录路径(
git rev-parse --show-toplevel
),以下所有路径均相对于仓库根目录,而非当前工作目录。
示例文件(始终更新):
references/config-template.yaml
复制到
<repo-root>/.compound-engineering/config.local.example.yaml
,如果目录不存在则先创建。该文件会被提交到仓库,始终会被最新模板覆盖,方便团队成员查看可用配置项。
本地配置(仅创建一次): 如果
.compound-engineering/config.local.yaml
不存在,询问用户是否要创建该文件:
是否要为本项目设置本地配置文件?
该文件会保存你的 Compound Engineering 偏好设置(比如使用哪些工具、工作流的运行方式等)。
所有配置项初始为注释状态——你只需开启需要的部分即可。

1. 是的,创建该文件(推荐)
2. 不用了,谢谢
如果用户同意,将
references/config-template.yaml
复制到
<repo-root>/.compound-engineering/config.local.yaml
。如果
.compound-engineering/config.local.yaml
未被
.gitignore
覆盖,询问用户是否添加如下条目:
text
.compound-engineering/*.local.yaml
如果本地配置已存在,检查它是否已被正确加入 gitignore,如未加入,同上询问用户是否添加
.gitignore
条目。

Step 6: Offer Installation

步骤6:提供安装选项

Present the missing dependencies using a multiSelect question with all items pre-selected. Use the install commands and URLs from the script's diagnostic output.
The following tools are missing. Select which to install:
(All items are pre-selected)

Recommended:
  [x] agent-browser - Browser automation for testing and screenshots
  [x] gh - GitHub CLI for issues and PRs
  [x] jq - JSON processor
  [x] vhs (charmbracelet/vhs) - Create GIFs from CLI output
  [x] silicon (Aloxaf/silicon) - Generate code screenshots
  [x] ffmpeg - Video processing for feature demos
Only show dependencies that are actually missing. Omit installed ones.
用多选问题向用户展示缺失的依赖,所有选项默认全选,使用脚本诊断输出中的安装命令和URL。
以下工具缺失,请选择你要安装的项:
(所有项默认已选中)

推荐安装:
  [x] agent-browser - 用于测试和截图的浏览器自动化工具
  [x] gh - 用于处理issue和PR的GitHub CLI
  [x] jq - JSON处理工具
  [x] vhs (charmbracelet/vhs) - 从CLI输出生成GIF的工具
  [x] silicon (Aloxaf/silicon) - 生成代码截图的工具
  [x] ffmpeg - 用于功能演示的视频处理工具
仅展示实际缺失的依赖,省略已安装的项。

Step 7: Install Selected Dependencies

步骤7:安装选中的依赖

For each selected dependency, in order:
  1. Show the install command (from the diagnostic output) and ask for approval:
    Install agent-browser?
    Command: CI=true npm install -g agent-browser --no-audit --no-fund --loglevel=error && agent-browser install && npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser -g -y
    
    1. Run this command
    2. Skip - I'll install it manually
  2. If approved: Run the install command using a shell execution tool. After the command completes, verify installation by running the dependency's check command (e.g.,
    command -v agent-browser
    ).
  3. If verification succeeds: Report success.
  4. If verification fails or install errors: Display the project URL as fallback and continue to the next dependency.
按顺序为每个选中的依赖执行以下操作:
  1. 展示安装命令(来自诊断输出)并请求用户批准:
    是否安装 agent-browser?
    命令:CI=true npm install -g agent-browser --no-audit --no-fund --loglevel=error && agent-browser install && npx skills add https://github.com/vercel-labs/agent-browser --skill agent-browser -g -y
    
    1. 运行该命令
    2. 跳过 - 我会手动安装
  2. 如果用户批准: 使用shell执行工具运行安装命令。命令运行完成后,通过运行依赖的检查命令验证安装是否成功(例如
    command -v agent-browser
    )。
  3. 如果验证通过: 报告安装成功。
  4. 如果验证失败或安装报错: 展示项目URL作为备用方案,继续处理下一个依赖。

Step 8: Summary

步骤8:总结

Display a brief summary:
 ✅ Compound Engineering setup complete

    Installed: agent-browser, gh, jq
    Skipped:   rtk

    Run /ce-setup anytime to re-check.
If this is a Claude Code session (per platform detection in Step 3), append: "Run /ce-update to grab the latest plugin version."
展示简短总结:
 ✅ Compound Engineering 配置完成

    已安装:agent-browser, gh, jq
    已跳过:rtk

    可随时运行 /ce-setup 重新检查。
如果是 Claude Code 会话(根据步骤3的平台检测结果),追加:"运行 /ce-update 获取最新插件版本。"