synthesize
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSynthesis Skill
合成技能
VCS Provider
版本控制系统(VCS)提供商
This skill uses VCS operations through Exarchos MCP actions (, , , , etc.).
These actions automatically detect and route to the correct VCS provider (GitHub, GitLab, Azure DevOps).
No // commands needed — the MCP server handles provider dispatch.
create_prmerge_prlist_prscheck_cighglabazNot to be confused with the integration merge. This skill callsto land a user-facing PR onmerge_prvia the VCS provider — a remote operation. The upstream sibling ismain(serialize_merge): the integration-merge path that holds a single-writer lease and composes a local@skills/merge-orchestrator/SKILL.mdof a subagent worktree branch onto the integration branch during thegit mergeHSM loop (rawdelegate → merge-pending → delegateis that composed executor / the non-integration path). Synthesize never invokesmerge_orchestrateorserialize_merge; merge-pending never invokesmerge_orchestrate.merge_pr
本技能通过Exarchos MCP操作(、、、等)执行VCS操作。
这些操作会自动检测并路由到正确的VCS提供商(GitHub、GitLab、Azure DevOps)。
无需使用//命令——MCP服务器会处理提供商调度。
create_prmerge_prlist_prscheck_cighglabaz请勿与集成合并混淆。 本技能调用通过VCS提供商将面向用户的PR合并到merge_pr分支——这是一项远程操作。对应的上游技能是main(serialize_merge):集成合并路径在@skills/merge-orchestrator/SKILL.md的HSM循环中持有单写入者租约,并将子代理工作树分支本地delegate → merge-pending → delegate到集成分支(原生git merge是该组合执行器/非集成路径)。合成技能绝不会调用merge_orchestrate或serialize_merge;merge-pending阶段绝不会调用merge_orchestrate。merge_pr
Overview
概述
Submit stacked PRs after review phase completes. The composite action consolidates readiness checks, stack verification, test validation, and quality signal analysis into a single call -- eliminating the multi-script coordination that historically caused synthesis failures.
prepare_synthesisPrerequisites:
- All delegated tasks complete with reviews passed (spec + quality)
- The integration branch already exists from delegation phase
- Task branches present and pushed to remote
Do NOT proceed if either review is incomplete or failed -- return to first.
reviewEntry points: Synthesis is normally reached from the phase of
feature / debug / refactor workflows. It is also reachable from
workflows via the opt-in path — when a user signals "let's open a PR for
this" during or , the event is
appended, and then resolves the choice state and
transitions the workflow to . See
for the opt-in mechanics and
semantics.
reviewoneshotplanimplementingrequest_synthesizefinalize_oneshotsynthesize@skills/oneshot/SKILL.mdsynthesisPolicy在评审阶段完成后提交堆叠PR。复合操作将就绪检查、堆叠验证、测试验证和质量信号分析整合为一次调用——消除了过去导致合成失败的多脚本协调问题。
prepare_synthesis前提条件:
- 所有委托任务均已完成且评审通过(规格+质量)
- 集成分支已在委托阶段创建
- 任务分支已存在并推送到远程仓库
如果评审未完成或失败,请勿继续——先回到阶段。
review入口点: 合成阶段通常从功能/调试/重构工作流的阶段进入。也可通过选择路径从工作流进入——当用户在或阶段表示“为这个创建PR”时,会追加事件,会解析选择状态并将工作流转换到阶段。有关选择机制和语义,请参阅。
reviewoneshotplanimplementingrequest_synthesizefinalize_oneshotsynthesizesynthesisPolicy@skills/oneshot/SKILL.mdTriggers
触发条件
Activate this skill when:
- User runs command
synthesize - All reviews have passed successfully
- Ready to submit PRs
- Oneshot workflow resolved to via
synthesizefinalize_oneshot
满足以下条件时激活本技能:
- 用户运行命令
synthesize - 所有评审已成功通过
- 准备好提交PR
- 一次性工作流通过解析为
finalize_oneshot阶段synthesize
Process
流程
Runbook: Follow the synthesis-flow runbook:If runbook unavailable, useexarchos_orchestrate({ action: "runbook", id: "synthesis-flow" })to retrieve action schemas:describeexarchos_orchestrate({ action: "describe", actions: ["prepare_synthesis"] })
运行手册: 遵循合成流程运行手册:如果运行手册不可用,使用exarchos_orchestrate({ action: "runbook", id: "synthesis-flow" })获取操作 schema:describeexarchos_orchestrate({ action: "describe", actions: ["prepare_synthesis"] })
Step 1: Verify Readiness
步骤1:验证就绪状态
Call the composite action to validate all preconditions in a single operation:
prepare_synthesistypescript
exarchos:exarchos_orchestrate({
action: "prepare_synthesis",
featureId: "<id>"
})This action performs:
- Phase readiness -- Confirms workflow is in the correct phase with all reviews complete
- Stack integrity -- Detects diverged branches, missing task branches, or broken parent chains and reconstructs automatically
- Test verification -- Runs from the stack top
npm run test:run && npm run typecheck - Benchmark regression -- If is true, checks for performance regressions
state.verification.hasBenchmarks - Quality signals -- Queries view for regressions and actionable hints
code_quality - Document readiness -- Touched doc-surfaces must carry corresponding doc updates (auto-waives when no doc surface is touched)
- Gate events -- Auto-emits events for each check (tests, benchmarks, CodeRabbit)
gate.executed
For the full breakdown of individual checks the composite action performs, see .
references/synthesis-steps.mdOn success: All checks passed. The response includes a readiness summary with any quality hints to present to the user. Proceed to Step 2.
On failure: The response identifies which check failed and provides remediation guidance. Follow the guidance -- typically returning to or .
reviewdelegateIf any quality hint has , present the to the user before proceeding.
confidenceLevel: 'actionable'suggestedAction调用复合操作,一次性验证所有前置条件:
prepare_synthesistypescript
exarchos:exarchos_orchestrate({
action: "prepare_synthesis",
featureId: "<id>"
})该操作执行以下检查:
- 阶段就绪性——确认工作流处于正确阶段且所有评审已完成
- 堆叠完整性——检测分支偏离、缺失任务分支或父链断裂,并自动重建
- 测试验证——从堆叠顶部运行
npm run test:run && npm run typecheck - 基准回归检查——如果为true,检查性能回归
state.verification.hasBenchmarks - 质量信号——查询视图获取回归信息和可操作提示
code_quality - 文档就绪性——被修改的文档表面必须有对应的文档更新(未修改文档表面时自动豁免)
- 网关事件——为每项检查(测试、基准、CodeRabbit)自动发送事件
gate.executed
有关该复合操作执行的各项检查的详细说明,请参阅。
references/synthesis-steps.md成功时: 所有检查通过。响应包含就绪状态摘要以及需呈现给用户的质量提示。继续步骤2。
失败时: 响应会指出哪项检查失败并提供修复指导。遵循指导操作——通常回到或阶段。
reviewdelegate如果任何质量提示的为'actionable',在继续之前需向用户呈现。
confidenceLevelsuggestedActionStep 2: Write and Validate PR Descriptions
步骤2:编写并验证PR描述
For each PR in the stack, write a structured description following . Required sections: Summary, Changes, Test Plan, plus a footer. Projects can override required sections via .
references/pr-descriptions.md.exarchos/pr-template.mdTitle format: (max 72 chars)
<type>: <what>Write the PR body to a temp file:
bash
cat > /tmp/pr-body.md <<'EOF'对于堆叠中的每个PR,遵循编写结构化描述。必填部分:摘要、变更内容、测试计划,以及页脚。项目可通过覆盖必填部分。
references/pr-descriptions.md.exarchos/pr-template.md标题格式: (最多72字符)
<type>: <what>将PR正文写入临时文件:
bash
cat > /tmp/pr-body.md <<'EOF'Summary
Summary
[2-3 sentences: what changed, why it matters]
[2-3句话:变更内容及其重要性]
Changes
Changes
- Component -- Description of change
- Component -- 变更描述
Test Plan
Test Plan
[Testing approach and coverage]
Results: Tests X pass · Build 0 errors
Design: doc
Related: #issue
EOF
Validate **before** creating the PR:
```typescript
exarchos:exarchos_orchestrate({
action: "validate_pr_body",
bodyFile: "/tmp/pr-body.md"
})Do NOT call until validation passes. If validation fails, fix the body and re-validate.
create_pr[测试方法和覆盖范围]
Results: Tests X pass · Build 0 errors
Design: doc
Related: #issue
EOF
在创建PR之前进行验证:
```typescript
exarchos:exarchos_orchestrate({
action: "validate_pr_body",
bodyFile: "/tmp/pr-body.md"
})验证通过前请勿调用。 如果验证失败,修改正文后重新验证。
create_prStep 3: Submit and Merge
步骤3:提交并合并
Create PRs using the validated body and enable auto-merge. For each branch in the stack (bottom-up):
typescript
// Create PR via VCS MCP action
exarchos_orchestrate({
action: "create_pr",
base: "<parent-branch>",
head: "<branch>",
title: "<type>: <what>",
body: "<pr-body>"
})
// Enable auto-merge
exarchos_orchestrate({
action: "merge_pr",
prId: "<number>",
strategy: "squash"
})After submission:
- Apply benchmark label -- If is true, apply label:
verification.hasBenchmarksgh pr edit <number> --add-label has-benchmarks - Record PR URLs -- Capture URLs via
exarchos_orchestrate({ action: "list_prs", state: "open" }) - Update state:
typescript
exarchos:exarchos_workflow({
action: "update", featureId: "<id>", updates: {
"artifacts": { "pr": ["<url1>", "<url2>"] },
"synthesis": { "mergeOrder": ["<branch1>", ...], "prUrl": ["<url1>", ...], "prFeedback": [] }
}
})For merge ordering strategy, see .
references/merge-ordering.mdHuman checkpoint: Output "Stacked PRs enqueued: [URLs]. Waiting for CI/merge queue." then PAUSE for user input: "Merge stack? (yes/no/feedback)"
- 'yes' -- PRs merge; transition to completed via
cleanup - 'feedback' -- Route to to address comments, then return here
shepherd [PR_URL] - 'no' -- Pause workflow; resume later with
rehydrate
使用已验证的正文创建PR并启用自动合并。对于堆叠中的每个分支(从下到上):
typescript
// 通过VCS MCP操作创建PR
exarchos_orchestrate({
action: "create_pr",
base: "<parent-branch>",
head: "<branch>",
title: "<type>: <what>",
body: "<pr-body>"
})
// 启用自动合并
exarchos_orchestrate({
action: "merge_pr",
prId: "<number>",
strategy: "squash"
})提交后:
- 添加基准标签——如果为true,添加标签:
verification.hasBenchmarksgh pr edit <number> --add-label has-benchmarks - 记录PR URL——通过捕获URL
exarchos_orchestrate({ action: "list_prs", state: "open" }) - 更新状态:
typescript
exarchos:exarchos_workflow({
action: "update", featureId: "<id>", updates: {
"artifacts": { "pr": ["<url1>", "<url2>"] },
"synthesis": { "mergeOrder": ["<branch1>", ...], "prUrl": ["<url1>", ...], "prFeedback": [] }
}
})有关合并排序策略,请参阅。
references/merge-ordering.md人工检查点: 输出“堆叠PR已入队:[URL]。等待CI/合并队列处理。”然后暂停等待用户输入:“合并堆叠?(是/否/反馈)”
- '是'——PR合并;通过转换到已完成阶段
cleanup - '反馈'——路由到处理评论,然后返回此阶段
shepherd [PR_URL] - '否'——暂停工作流;稍后通过恢复
rehydrate
Event Emissions (REQUIRED)
事件发送(必填)
After PRs are created and auto-merge is enabled, emit the event:
stack.submittedtypescript
exarchos:exarchos_event({ action: "append", stream: "<featureId>", event: {
type: "stack.submitted",
data: {
branches: ["task-001-branch", "task-002-branch"],
prNumbers: [101, 102]
}
}})During shepherd iterations (CI monitoring loop), emit after each assessment:
typescript
exarchos:exarchos_event({ action: "append", stream: "<featureId>", event: {
type: "shepherd.iteration",
data: {
iteration: 1,
prsAssessed: 2,
fixesApplied: 0,
status: "all-green"
}
}})These events are checked by during workflow validation. Missing emissions will trigger warnings.
check-event-emissions创建PR并启用自动合并后,发送事件:
stack.submittedtypescript
exarchos:exarchos_event({ action: "append", stream: "<featureId>", event: {
type: "stack.submitted",
data: {
branches: ["task-001-branch", "task-002-branch"],
prNumbers: [101, 102]
}
}})在shepherd迭代(CI监控循环)期间,每次评估后发送事件:
typescript
exarchos:exarchos_event({ action: "append", stream: "<featureId>", event: {
type: "shepherd.iteration",
data: {
iteration: 1,
prsAssessed: 2,
fixesApplied: 0,
status: "all-green"
}
}})这些事件会在工作流验证期间被检查。缺失事件会触发警告。
check-event-emissionsPost-Merge Cleanup
合并后清理
After PRs merge, invoke cleanup:
typescript
exarchos:exarchos_workflow({
action: "cleanup", featureId: "<id>", mergeVerified: true,
prUrl: ["<url>", ...], mergedBranches: ["<branch>", ...]
})Then sync: and reclaim worktrees.
git fetch --pruneWorktree GC cadence — after synthesize (INV-12). Once a workflow reaches synthesis its governed worktrees are no longer needed, so this is the point to reclaim them. Use the governed garbage-collectorrather than ad-hocprune_worktrees: dry-run first (the default — reports candidatesgit worktree remove
- reclaimable bytes, deletes nothing), then re-invoke with
to apply.dryRun: falsetypescriptexarchos:exarchos_orchestrate({ action: "prune_worktrees", repoRoot: "<repo-root>" }) // dry-run (default) exarchos:exarchos_orchestrate({ action: "prune_worktrees", repoRoot: "<repo-root>", dryRun: false }) // applyTheprojection surfaces this samenext_actionsdry-run affordance once the workflow is parked in synthesis. The full apply flow lands inprune_worktrees.@skills/cleanup/SKILL.md
PR合并后,调用清理操作:
typescript
exarchos:exarchos_workflow({
action: "cleanup", featureId: "<id>", mergeVerified: true,
prUrl: ["<url>", ...], mergedBranches: ["<branch>", ...]
})然后同步:并回收工作树。
git fetch --prune工作树GC节奏——合成之后(INV-12)。 一旦工作流进入合成阶段,其管控的工作树不再需要,因此此时是回收它们的时机。使用管控垃圾回收器而非临时的prune_worktrees:先执行试运行(默认设置——报告候选对象+可回收字节数,不删除任何内容),然后使用git worktree remove重新调用以执行清理。dryRun: falsetypescriptexarchos:exarchos_orchestrate({ action: "prune_worktrees", repoRoot: "<repo-root>" }) // 试运行(默认) exarchos:exarchos_orchestrate({ action: "prune_worktrees", repoRoot: "<repo-root>", dryRun: false }) // 执行清理当工作流停留在合成阶段时,投影会提供相同的next_actions试运行功能。完整的执行流程在prune_worktrees中。@skills/cleanup/SKILL.md
Idempotency
幂等性
create_prsynthesis.prUrlartifacts.prcreate_pr(head, base)PR_ALREADY_OWNEDThe post-merge cleanup case is distinct from create-time idempotency and is NOT governed by : if the PR is already merged, transition to via , (the runtime rejects ; the canonical action runs the HSM guard and emits ). This transition is normally owned by via ; the bare phase-only transition is a manual-cleanup escape hatch.
create_prcompletedaction: "transition"target: "completed"updates.phasetransitionworkflow.transitioncompletedcleanupaction: "cleanup"create_prsynthesis.prUrlartifacts.prcreate_pr(head, base)PR_ALREADY_OWNED合并后清理场景与创建时的幂等性不同,不受管控:如果PR已合并,通过、转换到已完成阶段(运行时拒绝;标准的操作会运行HSM防护并发送事件)。这种转换通常由通过操作处理;单纯的阶段转换是手动清理的逃生舱口。
create_praction: "transition"target: "completed"updates.phasetransitionworkflow.transitioncompletedcleanupaction: "cleanup"Direct Edits to Stack Branches
对堆叠分支的直接编辑
You can make direct edits to stack branches at any time — edit files, then stage and amend (). Push with the explicit-SHA lease, never a bare :
git add <files> && git commit --amend--force-with-leasebash
git push --force-with-lease=<ref>:<expected-sha>A bare lease anchors to the (possibly stale) local remote-tracking ref and can clobber a concurrent push. is the remote SHA the loop last observed via , or read fresh with .
<expected-sha>assess_stackgit ls-remote --heads origin <ref>您可随时对堆叠分支进行直接编辑——编辑文件,然后暂存并修正提交()。使用显式SHA租约推送,绝不要使用裸:
git add <files> && git commit --amend--force-with-leasebash
git push --force-with-lease=<ref>:<expected-sha>裸租约会锚定到(可能过时的)本地远程跟踪引用,可能会覆盖并发推送。是循环最后一次通过观察到的远程SHA,或通过读取最新值。
<expected-sha>assess_stackgit ls-remote --heads origin <ref>Completion Output
完成输出
When the PR is created and checks pass, report:
markdown
undefined当PR创建且检查通过后,报告:
markdown
undefinedSynthesis Complete
合成完成
PR: [URL]
Tests: X pass | Build: 0 errors
undefinedPR: [URL]
Tests: X pass | Build: 0 errors
undefinedAnti-Patterns
反模式
| Don't | Do Instead |
|---|---|
| Skip review phase | Always run |
| Force push stack branches | Use normal push |
| Delete worktrees before merge | Wait for merge confirmation |
| Create PR with failing tests | Ensure review phase passes first |
| Run readiness scripts manually | Use |
| 请勿 | 正确做法 |
|---|---|
| 跳过评审阶段 | 始终先运行 |
| 强制推送堆叠分支 | 使用常规推送 |
| 合并前删除工作树 | 等待合并确认 |
| 创建测试失败的PR | 确保评审阶段先通过 |
| 手动运行就绪脚本 | 使用 |
Handling Failures
故障处理
See for test failures, PR check failures, merge queue rejections, and MCP tool errors.
references/troubleshooting.md有关测试失败、PR检查失败、合并队列拒绝和MCP工具错误的处理,请参阅。
references/troubleshooting.mdPhase Transitions and Guards
阶段转换与防护
For the full transition table, consult .
@skills/checkpoint/references/phase-transitions.mdQuick reference: The → transition requires guard — set or in the same call as .
synthesizecompletedpr-url-existssynthesis.prUrlartifacts.prsetphase完整的转换表请参阅。
@skills/checkpoint/references/phase-transitions.md快速参考: → 转换需要防护——在设置的同一调用中设置或。
synthesizecompletedpr-url-existsphasesetsynthesis.prUrlartifacts.prSchema Discovery
Schema 发现
Use for
parameter schemas and
for phase transitions, guards, and playbook guidance. Use
for orchestrate action schemas.
exarchos_workflow({ action: "describe", actions: ["update", "init"] })exarchos_workflow({ action: "describe", playbook: "feature" })exarchos_orchestrate({ action: "describe", actions: ["prepare_synthesis"] })使用获取参数schema,使用获取阶段转换、防护和工作手册指南。使用获取编排操作schema。
exarchos_workflow({ action: "describe", actions: ["update", "init"] })exarchos_workflow({ action: "describe", playbook: "feature" })exarchos_orchestrate({ action: "describe", actions: ["prepare_synthesis"] })Completion Criteria
完成标准
- readiness check passed
prepare_synthesis - PR descriptions written per
references/pr-descriptions.md - PRs created and auto-merge enabled
- PR links provided to user
- State updated with PR URLs and merge order
- 就绪检查通过
prepare_synthesis - PR描述按照编写
references/pr-descriptions.md - PR已创建且自动合并已启用
- PR链接已提供给用户
- 状态已更新PR URL和合并顺序