配置系统
两个文件,一个特殊键,覆盖所有消费方。本页文档化整个配置系统。
每一个 CE 配置键的解析顺序为:.compound-engineering/config.local.yaml(用户覆盖,永不提交)→ .compound-engineering/config.yaml(共享,已提交)→ 技能默认值。首个有效值胜出。唯一的例外是 docs_root,它只从 config.yaml 读取。
双层规则
精确规则(所有读取 CE 键的技能通用):
- 先读
.compound-engineering/config.local.yaml,再读.compound-engineering/config.yaml。缺失的文件跳过。 - 以首个有效(非
#注释)的值胜出。 - 对于标量:空值视为未设置(跳到下一个文件);非法值继续到下一个文件,再回退到技能默认值。
- 对于列表与映射:只要键存在(包括空列表或空映射),就整体替换该键。
- 本规则不适用于
docs_root(见下文)。
docs_root —— 唯一的特殊键
| 维度 | 取值 |
|---|---|
| 读取来源 | .compound-engineering/config.yaml 唯一来源 —— 绝不从 config.local.yaml 读取 |
| 未设置时 → | <root> = docs/ |
| 校验 | 必须是相对仓库的目录,其真实路径(解析符号链接后)必须位于仓库内,既不能是仓库根目录,也不能位于 .git/ 之下 |
| 非法时 → | 直接报错并指出 docs_root 及其值;绝不回退到 docs/ |
| 使用方 | 所有写入工件的技能:ce-brainstorm, ce-plan, ce-ideate, ce-debug, ce-explain, ce-dogfood, ce-code-review, ce-commit-push-pr, ce-compound, ce-compound-refresh, ce-optimize, ce-sweep, ce-product-pulse, ce-setup, lfg |
config.local.yaml 不参与docs_root 定义的是物理机器上的位置。若某位开发者的本地覆盖泄漏到了 CI,CI runner 就会试图将工件写入本机不存在的路径。把它保留在共享文件里,是最稳妥的护栏。
全部 CE 配置键
下面是完整的键清单。“Consumer”列标明读取该键的技能;“Default”列展示当两文件中都未设置时,技能自身的默认值。
| 键 | 类型 | 默认值 | 消费方技能 | 特殊规则 |
|---|---|---|---|---|
docs_root | string | docs | 所有写入工件的技能 | 仅来自 config.yaml |
| 实现路由 | ||||
work_engine_mode | string | (无) | ce-work | 从 references/execution-engines.md 读取 |
work_engine_preferences | map | (无) | ce-work | 格式异常 → 通过 ce-setup 修复 |
| 规划输出 | ||||
brainstorm_output | string | html | ce-brainstorm | html | md |
brainstorm_model | string | (无) | ce-brainstorm | brainstorm 子代理使用的模型 |
ideate_output | string | html | ce-ideate | html | md |
| PR 描述 | ||||
pr_teaching_section | boolean | true | ce-commit-push-pr | 只有有效(非注释)的键才计入;模板里的注释行不是默认 |
pr_teaching_archive | boolean | false | ce-commit-push-pr | |
auto_babysit | boolean | true | ce-commit-push-pr | false = 跳过 PR babysit 交接 |
| 产品脉搏 | ||||
pulse_product_name | string | (无) | ce-product-pulse | 未设置 = 首次运行时进行访谈 |
pulse_lookback_default | string | 24h | ce-product-pulse | 回溯时间窗(24h、7d 等) |
pulse_db_enabled | boolean | false | ce-product-pulse | DB 查询为可选项 |
| 反馈扫描 | ||||
feedback_sources | list | (无) | ce-sweep | 未设置 = 首次运行时进行访谈;详见 docs/guides/packs.md |
sweep_interval | string | (无) | ce-sweep | 给 cron 用的调度提示 |
| 代码评审 | ||||
cross_model_review_mode | string | (无) | ce-code-review + ce-doc-review | off = 跳过跨模型评审;在跨模型评审前检查 |
| Compound Packs | ||||
packs | list | [] | ce-code-review + ce-dogfood | 已声明的 Pack ID |
ce-docs-root 与 ce-config-layers 代码段
每个读取 docs_root 的 SKILL.md 都包含如下逐字段(摘自 docs/solutions/developer-experience/always-on-agents-md.md):
<!-- ce-docs-root:start -->
Resolve the CE artifact root <root> before composing any artifact path.
- **Read** `docs_root` from `<repo-root>/.compound-engineering/config.yaml` only
- **Validate**: repo-relative, real path inside repo, not repo root, not under .git/
- **Use** `<root>` as sole artifact location; create if absent
<!-- ce-docs-root:end -->
普通键对应的代码段:
<!-- ce-config-layers:start -->
Resolve ordinary CE yaml keys from the two repo files.
- Read config.local.yaml, then config.yaml (git rev-parse --show-toplevel)
- First active (non-commented) value wins
- For scalars: empty = unset; invalid → next file → skill default
- For lists/maps: present key (including empty list/map) replaces whole key
- Do NOT use for docs_root
<!-- ce-config-layers:end -->
提交到 config.yaml:docs_root、packs、feedback_sources(若全团队共用)以及任何 CI 可见的项。
保留在 config.local.yaml:brainstorm_model、ideate_output、pr_teaching_archive、pulse_product_name 以及任何用户特定的项。
模板与示例文件
skills/ce-setup/references/config-template.yaml 是模板。其逐字节一致的副本是 .compound-engineering/config.example.yaml。新增或修改配置项时,两者必须保持同步。
ce-setup 的 Phase 2 会刷新 config.example.yaml,并在缺失时询问是否创建 config.yaml。