synthesis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSynthesis Skill
Synthesis 技能
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. This skill callsmerge_orchestrateto land a user-facing PR onmerge_prvia the VCS provider — a remote operation.main(merge_orchestrate) is the upstream sibling: a local@skills/merge-orchestrator/SKILL.mdof a subagent worktree branch onto the integration branch during thegit mergeHSM loop. Synthesize never invokesdelegate → merge-pending → delegate; merge-pending never invokesmerge_orchestrate.merge_pr
本技能通过Exarchos MCP操作(、、、等)执行VCS操作。这些操作会自动检测并路由到正确的VCS提供商(GitHub、GitLab、Azure DevOps)。无需使用//命令——MCP服务器会处理提供商的调度。
create_prmerge_prlist_prscheck_cighglabaz请勿与混淆。本技能调用merge_orchestrate通过VCS提供商将面向用户的PR合并到merge_pr分支——这是一个远程操作。main(merge_orchestrate)是上游关联技能:在@skills/merge-orchestrator/SKILL.md的HSM循环中,将子代理工作树分支本地delegate → merge-pending → delegate到集成分支。Synthesize技能绝不会调用git 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-workflow/SKILL.mdsynthesisPolicy在评审阶段完成后提交堆叠PR。复合操作将就绪检查、堆栈验证、测试验证和质量信号分析整合为一次调用——消除了过去导致合成失败的多脚本协调问题。
prepare_synthesis前置条件:
- 所有委托任务已完成且评审通过(规范+质量)
- 集成分支已在委托阶段创建
- 任务分支已存在并推送到远程仓库
请勿在评审未完成或失败的情况下继续——先返回阶段。
/review入口点:Synthesis通常从功能/调试/重构工作流的阶段进入。也可通过可选路径从工作流进入——当用户在或阶段表示“let's open a PR for this”时,会追加事件,随后会解析选择状态并将工作流转换到阶段。有关可选机制和语义,请参阅。
reviewoneshotplanimplementingrequest_synthesizefinalize_oneshotsynthesizesynthesisPolicy@skills/oneshot-workflow/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
- Oneshot工作流通过解析为
finalize_oneshotsynthesize
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
mcp__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 - 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 .
/review/delegateIf any quality hint has , present the to the user before proceeding.
confidenceLevel: 'actionable'suggestedAction调用复合操作,通过一次操作验证所有前置条件:
prepare_synthesistypescript
mcp__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。
失败时:响应会指出哪项检查失败并提供补救指导。遵循指导操作——通常是返回或阶段。
/review/delegate如果任何质量提示的,在继续之前向用户呈现。
confidenceLevel: 'actionable'suggestedActionStep 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,按照编写结构化描述。必填部分:Summary、Changes、Test Plan,以及页脚。项目可通过覆盖必填部分。
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
mcp__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
mcp__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
mcp__exarchos__exarchos_workflow({
action: "set", 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
mcp__exarchos__exarchos_workflow({
action: "set", featureId: "<id>", updates: {
"artifacts": { "pr": ["<url1>", "<url2>"] },
"synthesis": { "mergeOrder": ["<branch1>", ...], "prUrl": ["<url1>", ...], "prFeedback": [] }
}
})有关合并排序策略,请参阅。
references/merge-ordering.md人工检查点:输出“Stacked PRs enqueued: [URLs]. Waiting for CI/merge queue.”然后暂停等待用户输入:“Merge stack? (yes/no/feedback)”
- 'yes'——PR合并;通过转换到完成阶段
/cleanup - 'feedback'——路由到处理评论,然后返回此处
/shepherd [PR_URL] - 'no'——暂停工作流;之后通过恢复
/rehydrate
Event Emissions (REQUIRED)
事件发送(必填)
After PRs are created and auto-merge is enabled, emit the event:
stack.submittedtypescript
mcp__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
mcp__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
mcp__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
mcp__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
mcp__exarchos__exarchos_workflow({
action: "cleanup", featureId: "<id>", mergeVerified: true,
prUrl: ["<url>", ...], mergedBranches: ["<branch>", ...]
})Then sync: and remove worktrees.
git fetch --prunePR合并后,调用清理操作:
typescript
mcp__exarchos__exarchos_workflow({
action: "cleanup", featureId: "<id>", mergeVerified: true,
prUrl: ["<url>", ...], mergedBranches: ["<branch>", ...]
})然后同步:并移除工作树。
git fetch --pruneAnti-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/workflow-state/references/phase-transitions.mdQuick reference: The → transition requires guard — set or in the same call as .
synthesizecompletedpr-url-existssynthesis.prUrlartifacts.prsetphase完整的转换表请参阅。
@skills/workflow-state/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: ["set", "init"] })exarchos_workflow({ action: "describe", playbook: "feature" })exarchos_orchestrate({ action: "describe", actions: ["prepare_synthesis"] })使用获取参数schema,使用获取阶段转换、防护条件和工作手册指导。使用获取编排操作的schema。
exarchos_workflow({ action: "describe", actions: ["set", "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和合并顺序",