架构 · 难度:参考
模式与令牌
覆盖全部 36 个技能的每一个 mode: 令牌与每一个支撑参数令牌。权威参考。
在改动任何令牌值之前,请先阅读本节
mode: 令牌值是调用方的 if/else 判别项。改写拼写会破坏解析它的编排器。状态枚举 页所列的每一个状态枚举值都是契约 —— 请把它当作已有测试套件来对待(位于 bun run test 中)。
五个 mode: 令牌
| 令牌 | 含义 | 设置方 | 返回形态 |
|---|---|---|---|
| (default) interactive | 有真人参与。技能可使用宿主阻塞式提问工具。用户可在任何决策点介入。 | 直接调用 | 聊天文本、工件路径,或结构化的内联结果 |
| mode:non-interactive | 无人在场。每个“询问用户”都采取保守默认。仅输出终结信号。 | 调度器、cron、没有用户的编排器 | Documentation complete / Documentation skipped(ce-compound);Recording complete(ce-riffrec) |
| mode:pipeline | 编排器以有界步骤的形式调用此技能。抑制所有阻塞式询问。返回调用方可解析的结构化状态。 | ce-babysit-pr、lfg、ce-sweep、ce-commit-push-pr | JSON status 枚举(如 fixed-and-pushed、complete、needs-human);精确拼写见 状态枚举 |
| mode:return-to-caller | 仅限 LFG 第 2 步。ce-work 执行实现 + 验证,并交回一个结构化结果;调用方负责发布。 | lfg(第 2 步) | {status, plan_path, changed_files, verification_results, ...} |
| mode:agent | 仅限 ce-code-review。返回 JSON 而非 Markdown 表格;跳过第 5c 阶段的“应用”。由调用方负责应用。 | lfg(第 4 步) | JSON {status, verdict, actionable_findings, ...} |
已废弃的别名
| 令牌 | 所属技能 | 含义 |
|---|---|---|
mode:headless | ce-code-review | 等价于 mode:agent |
mode:headless | ce-compound | 等价于 mode:non-interactive |
mode:headless | ce-sweep | 等价于 mode:non-interactive |
mode:autofix | ce-code-review | 已废弃;忽略。不会构成冲突。 |
mode:report-only | ce-code-review | 已废弃;忽略。默认即为仅报告。 |
mode:non-interactive | ce-code-review | 非法 —— 视为冲突并中止本轮运行。 |
mode:headless 的歧义该令牌在不同技能中具有两种不同含义:在 ce-code-review 中等价于 mode:agent(JSON 输出),而在 ce-compound 与 ce-sweep 中等价于 mode:non-interactive(抑制提示)。切勿将其视作统一令牌 —— 请查看所在技能自身的“Mode Detection”小节。
非法组合
| 组合 | 技能 | 结果 |
|---|---|---|
单独使用 mode:non-interactive | ce-code-review | 冲突;在不调度评审者的情况下停止 |
mode:agent + apply:local | ce-code-review | 冲突;流水线交接始终为“仅报告” |
mode:pipeline + mode:non-interactive | 任意技能 | 两个不同的 mode: 令牌;在 ce-code-review 中构成冲突;其他技能:冗余 |
多个不同的 mode: 令牌 | 任意技能 | 以冲突停止(mode:headless/mode:agent 别名对除外) |
多个不同的 grouping: 令牌 | ce-code-review | 冲突 |
按技能列出的模式支持
| 技能 | mode:pipeline |
mode:non-interactive |
mode:return-to-caller |
mode:agent |
|---|---|---|---|---|
| lfg | 由其调用 | — | — | — |
| ce-work | — | — | 核心模式 | — |
| ce-debug | 状态枚举 | 保守默认 | 状态枚举 | — |
| ce-babysit-pr | 有界停止 | — | — | — |
| ce-resolve-pr-feedback | 永不阻塞 | — | — | — |
| ce-commit-push-pr | 核心流水线 | — | — | — |
| ce-code-review | 非法 | 非法 | — | JSON 输出 |
| ce-doc-review | — | Phase 5.3.8 默认 | — | — |
| ce-compound | — | 终结信号 | — | — |
| ce-compound-refresh | — | 保守默认 | — | — |
| ce-brainstorm | — | — | 结构化返回 | — |
| ce-test-browser | 无头、永不暂停 | — | — | — |
| ce-plan | 无菜单 | — | — | — |
| ce-sweep | — | 保守默认 | — | — |
非 mode 类令牌
| 令牌 | 技能 | 用途 |
|---|---|---|
branding:on / branding:off | ce-commit-push-pr | PR 描述中的 Compound Engineering 徽标;默认关闭;仅当此令牌或用户明确请求时打开 |
babysit:off / continuous / checkpoint | ce-commit-push-pr | 按本次调用覆盖 auto_babysit;off 跳过,continuous/checkpoint 即便在常设 opt-out 下也强制开启 |
posture:target / stack-ready / stack-land | ce-babysit-pr | 托管栈模式;详见 ce-babysit-pr tick |
plan:<path> | ce-code-review | 传入计划文件以核对需求;支持 .md 与 .html 的统一计划 |
apply:local | ce-code-review | 明确授权将已核实的发现应用到本地工作区 |
base:<sha-or-ref> | ce-code-review | 覆盖当前工作区的差异基线;跳过自动基线检测 |
depth:full / depth:auto | ce-code-review | full = 强制完整多 agent 主流程;auto = 由 Review 深度门槛自适应决定 |
depth:lite / depth:focused | ce-code-review | 仅由深度门槛自身设置;不是用户令牌 |
grouping:auto / off / always | ce-code-review | 是否构建主题分组的分流;auto = 仅当发现跨不同关注点时启用 |
output:md / output:html | ce-plan, ce-brainstorm, ce-ideate, ce-explain | 工件格式;html 为计划/构思/解释器的默认 |
audience:<who> | ce-explain | 针对特定读者而非用户本人渲染 |
diff:<ref> / since:<window> | ce-explain | 强制差异模式或回顾模式,并给出明确的 ref 或日期范围 |
archive:on / archive:off | ce-commit-push-pr | 按本次调用覆盖 pr_teaching_archive |
depth:lightweight / depth:full | ce-compound | 学习深度;lightweight 跳过会话历史;full 运行自动探测;仅在 mode:non-interactive 下有效 |
exclude:<paths> | ce-commit, ce-commit-push-pr | 即使已修改也保持不提交的文件 |
--port <PORT> | ce-test-browser, ce-dogfood | 覆盖开发服务器的端口 |
pack:<id> | ce-setup | 搭建一个 Compound Pack |
bar:<n> | ce-retune | 清除阈值所需的预注册连续干净运行次数 |
参数提示(CLI 用法)
每个 SKILL.md 在 frontmatter 中声明一个 argument-hint。这些是面向用户的用法行,会展示在宿主的调用提示中;它们不会被技能自身解析。关键示例:
# lfg
[feature, bug, issue reference, or plan path]
# ce-commit-push-pr
[PR ref] [mode:pipeline] [archive:on|off] [branding:on|off] [babysit:off|continuous|checkpoint]
# ce-babysit-pr
[PR number|URL|blank=current branch] [watch|checkpoint] [duration] [posture:target|stack-ready|stack-land]
# ce-code-review
[mode:agent] [apply:local] [blank to review current branch, or provide PR link]
# ce-brainstorm
[feature idea or problem to explore] [output:html]
# ce-compound
[optional: brief context] [mode:non-interactive] [depth:lightweight|full]
令牌的解析方式
令牌解析约定(摘自 ce-explain/references/intake.md,但全平台通用):
一个
word:value对只在读起来像一个标志时才是标志。它要么位于请求的开头,要么单独成行;冒号后没有空格;并且 —— 决定性的一点 —— 把该标志去掉后整段请求依然读得通。若去掉它会让句子变得支离破碎,那它就从来不是标志。把它留在请求正文中,按含义归类。
看似标志、实际不是标志的示例:
"walk me through the diff: why did we split the parser"—— 去掉diff:why后整句破碎。这是正文,不是diff:令牌。"explain how we pick the audience: engineers vs designers"—— 一个概念请求,不是audience:标志。"feat: add retry logic"—— 正文里的约定式提交前缀,不是标志。
真正的标志:
diff:main..HEADaudience:teammode:pipelinedepth:lightweight