ce-setup
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCompound Engineering Setup
Compound Engineering 环境配置
Interaction Method
交互方式
Ask the user each question below using the platform's blocking question tool (e.g., in Claude Code, in Codex, 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. ). Never skip or auto-configure.
AskUserQuestionrequest_user_inputask_user1, 3Interactive 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 ; project-specific review guidance belongs in or .
ce:reviewCLAUDE.mdAGENTS.md使用平台的阻塞式提问工具(例如 Claude Code 中的 、Codex 中的 、Gemini 中的 )依次向用户询问以下每个问题。如果没有结构化提问工具,可将问题按编号列表展示,每问完一个等待用户回复后再继续。对于多选问题,接受逗号分隔的数字作为回答(例如 ),严禁跳过问题或自动配置。
AskUserQuestionrequest_user_inputask_user1, 3compound-engineering 交互式配置可诊断环境健康状态、清理过时的仓库本地 CE 配置、协助配置所需工具。评审 Agent 选择由 自动处理,项目专属评审指引请存放在 或 中。
ce:reviewCLAUDE.mdAGENTS.mdPhase 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 from the plugin root or cache directory). If the version cannot be determined, skip this step.
plugin.jsonIf a version is found, pass it to the check script via . Otherwise omit the flag.
--version通过读取插件元数据或清单检测已安装的 compound-engineering 插件版本,该操作与平台相关——使用任意可用机制实现即可(例如从插件根目录或缓存目录读取 )。如果无法确定版本,跳过本步骤。
plugin.json如果获取到版本号,通过 参数传给检查脚本,否则省略该参数。
--versionStep 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 guidance in one pass.
.gitignorebash
bash scripts/check-health --version VERSIONOr without version if Step 1 could not determine it:
bash
bash scripts/check-healthScript reference:
scripts/check-healthDisplay the script's output to the user.
运行脚本前,先展示:"Compound Engineering -- 正在检查你的环境..."
运行内置的检查脚本,不要手动执行依赖检查——该脚本会一次性完成所有 CLI 工具检查、仓库本地 CE 文件检查以及 配置指引。
.gitignorebash
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 , this is a Claude Code session and is available. Otherwise, omit any references from output.
CLAUDE_CODE/ce-update/ce-updateAfter the diagnostic report, check whether:
- any dependencies are missing (reported as yellow in the script output)
- is present and needs cleanup
compound-engineering.local.md - does not exist or is not safely gitignored
.compound-engineering/config.local.yaml - is missing or outdated
.compound-engineering/config.local.example.yaml
If everything is installed, no repo-local cleanup is needed, and 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/config.local.yaml ✅ 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 - 不存在或是未被正确加入 gitignore
.compound-engineering/config.local.yaml - 缺失或版本过时
.compound-engineering/config.local.example.yaml
如果所有工具都已安装、无需仓库本地清理、 已存在且已加入 gitignore,展示工具列表和完成提示。从脚本输出中解析工具名称,每个工具前用绿色圆圈标记:
.compound-engineering/config.local.yaml ✅ 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 (). If exists at the repo root, explain that it is obsolete because review-agent selection is automatic and CE now uses for any surviving machine-local state. Ask whether to delete it now. Use the repo-root path when deleting.
git rev-parse --show-toplevelcompound-engineering.local.md.compound-engineering/config.local.yaml获取仓库根目录路径()。如果仓库根目录下存在 ,向用户说明该文件已过时:评审 Agent 选择已自动化,当前 CE 使用 存储所有需保留的本地机器状态,询问用户是否立即删除该文件,删除时使用仓库根目录的绝对路径。
git rev-parse --show-toplevelcompound-engineering.local.md.compound-engineering/config.local.yamlStep 5: Bootstrap Project Config
步骤5:初始化项目配置
Resolve the repository root (). All paths below are relative to the repo root, not the current working directory.
git rev-parse --show-toplevelExample file (always refresh): Copy to , 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.
references/config-template.yaml<repo-root>/.compound-engineering/config.local.example.yamlLocal config (create once): If does not exist, ask whether to create it:
.compound-engineering/config.local.yamlSet 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 thanksIf the user approves, copy to . If is not already covered by , offer to add the entry:
references/config-template.yaml<repo-root>/.compound-engineering/config.local.yaml.compound-engineering/config.local.yaml.gitignoretext
.compound-engineering/*.local.yamlIf the local config already exists, check whether it is safely gitignored. If not, offer to add the entry as above.
.gitignore获取仓库根目录路径(),以下所有路径均相对于仓库根目录,而非当前工作目录。
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.gitignoretext
.compound-engineering/*.local.yaml如果本地配置已存在,检查它是否已被正确加入 gitignore,如未加入,同上询问用户是否添加 条目。
.gitignoreStep 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 demosOnly 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:
-
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 -
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 -
If verification succeeds: Report success.
-
If verification fails or install errors: Display the project URL as fallback and continue to the next dependency.
按顺序为每个选中的依赖执行以下操作:
-
展示安装命令(来自诊断输出)并请求用户批准:
是否安装 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. 跳过 - 我会手动安装 -
如果用户批准: 使用shell执行工具运行安装命令。命令运行完成后,通过运行依赖的检查命令验证安装是否成功(例如)。
command -v agent-browser -
如果验证通过: 报告安装成功。
-
如果验证失败或安装报错: 展示项目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 获取最新插件版本。"