Loading...
Loading...
Compare original and translation side by side
create_prmerge_prghglabazfeatureideate → plan → plan-review → delegate → review → synthesize → completedimplementingRead this first if you have never run a oneshot: the workflow has a choice state at the end of. Whether you land onimplementing(direct commit) or transition throughcompleted(PR) is decided by two inputs: thesynthesizeset at init, and whether the user emitted asynthesisPolicyevent during implementing. Both inputs are persisted; the decision is replay-safe.synthesize.requested
create_prmerge_prghglabazfeatureideate → plan → plan-review → delegate → review → synthesize → completedimplementing如果您从未运行过oneshot,请先阅读此内容: 该工作流在阶段结束时存在一个选择状态。最终进入implementing(直接提交)还是过渡到completed(PR),由两个输入决定:初始化时设置的synthesize,以及用户在implementing阶段是否触发了synthesisPolicy事件。这两个输入都会被持久化,决策结果可安全重放。synthesize.requested
feature/ideate/cancel/ideatefeature/ideate/cancel/ideatesynthesisPolicystate.oneshot.synthesisPolicy| Policy | Behavior | When to use |
|---|---|---|
| Always transition | The user wants a paper trail / review for every change in this workflow, even small ones. |
| Always transition | The user is iterating on personal/scratch work and explicitly opts out of PRs. |
| Direct-commit by default. The user can opt in to a PR mid-implementing by calling | The common case: start with the assumption of direct-commit, but leave the door open for the user to change their mind once they see the diff. |
on-requestsynthesisPolicy: 'never'synthesize.requestedon-requestcompletedsynthesisPolicystate.oneshot.synthesisPolicy| 策略 | 行为 | 使用场景 |
|---|---|---|
| 在最终阶段始终从 | 用户希望此工作流中的每一项变更,即使是微小变更,都有书面记录/评审环节。 |
| 在最终阶段始终从 | 用户正在进行个人/临时工作迭代,明确选择不使用PR。 |
| 默认直接提交。用户可在implementing阶段通过调用 | 常见场景:默认采用直接提交方式,但允许用户在看到差异后改变主意,选择PR流程。 |
on-requestsynthesisPolicy: 'never'synthesize.requestedon-requestcompleted plan ──────► implementing ──┬── [synthesisOptedOut] ──► completed
│
└── [synthesisOptedIn] ──► synthesize ──► completedimplementingstate.oneshot.synthesisPolicysynthesize.requested| Phase | What happens | Exit criteria |
|---|---|---|
| Lightweight one-page plan: goal, approach, files to touch, tests to add. No design doc. No subagent dispatch. | |
| In-session TDD loop. Write a failing test, make it pass, refactor. Commit as you go. The TDD iron law applies — no production code without a failing test first. | Tests pass + typecheck clean + finalize_oneshot called |
| Reached only when | PR merged → |
| Terminal. For direct-commit path, commits are already on the branch — there's nothing more to do. For synthesize path, the PR merge event terminates the workflow. | — |
cancelled plan ──────► implementing ──┬── [synthesisOptedOut] ──► completed
│
└── [synthesisOptedIn] ──► synthesize ──► completedimplementingstate.oneshot.synthesisPolicysynthesize.requested| 阶段 | 操作内容 | 退出条件 |
|---|---|---|
| 制定轻量的一页纸规划:目标、实现方案、涉及文件、需添加的测试。无需设计文档,无需调度子Agent。 | 设置 |
| 会话内的TDD循环。编写失败的测试,让测试通过,重构代码。边开发边提交。TDD铁律适用——未编写失败测试,不得编写生产代码。 | 测试通过 + 类型检查无问题 + 调用finalize_oneshot |
| 仅当 | PR合并 → |
| 终端阶段。如果是直接提交路径,提交已推送到分支——无需额外操作。如果是synthesize路径,PR合并事件会终止工作流。 | — |
cancelledexarchos_workflowaction: 'init'workflowType: 'oneshot'synthesisPolicymcp__exarchos__exarchos_workflow({
action: "init",
featureId: "fix-readme-typo",
workflowType: "oneshot",
synthesisPolicy: "on-request" // optional — defaults to 'on-request'
})synthesisPolicy: "always"synthesisPolicy: "never"on-requestplanexarchos_workflowaction: 'init'workflowType: 'oneshot'synthesisPolicymcp__exarchos__exarchos_workflow({
action: "init",
featureId: "fix-readme-typo",
workflowType: "oneshot",
synthesisPolicy: "on-request" // 可选——默认值为'on-request'
})synthesisPolicy: "always"synthesisPolicy: "never"on-requestplanimplementingphasesetupdatesmcp__exarchos__exarchos_workflow({
action: "set",
featureId: "fix-readme-typo",
phase: "implementing",
updates: {
"artifacts.plan": "<plan text>",
"oneshot.planSummary": "<one-line summary>"
}
})artifacts.planfeatureoneshot.planSummaryartifacts.planoneshot-plan-setplanSummaryimplementingphasesetupdatesmcp__exarchos__exarchos_workflow({
action: "set",
featureId: "fix-readme-typo",
phase: "implementing",
updates: {
"artifacts.plan": "<plan text>",
"oneshot.planSummary": "<one-line summary>"
}
})artifacts.planfeatureoneshot.planSummaryartifacts.planoneshot-plan-setplanSummaryNO PRODUCTION CODE WITHOUT A FAILING TEST FIRST
未编写失败测试,不得编写生产代码
planimplementingon-requestrequest_synthesizemcp__exarchos__exarchos_orchestrate({
action: "request_synthesize",
featureId: "fix-readme-typo",
reason: "user requested review of the parser changes"
})request_synthesizesynthesize.requestedsynthesisOptedInrequest_synthesizeplanimplementingimplementingsynthesizecompletedcancelledsynthesize.requestedrequest_synthesizefinalize_oneshotplanimplementingon-requestrequest_synthesizemcp__exarchos__exarchos_orchestrate({
action: "request_synthesize",
featureId: "fix-readme-typo",
reason: "user requested review of the parser changes"
})request_synthesizesynthesize.requestedsynthesisOptedInrequest_synthesizeplanimplementingimplementingsynthesizecompletedcancelledsynthesize.requestedrequest_synthesizefinalize_oneshotfinalize_oneshotmcp__exarchos__exarchos_orchestrate({
action: "finalize_oneshot",
featureId: "fix-readme-typo"
})workflowType === 'oneshot'phase === 'implementing'_eventsguards.synthesisOptedInstate.oneshot.synthesisPolicy_eventshandleSetsynthesizecompleted | | Resolved target | Path |
|---|---|---|---|
| (any) | | PR path |
| (any) | | direct-commit path |
| yes | | PR path |
| no | | direct-commit path |
finalize_oneshotmcp__exarchos__exarchos_orchestrate({
action: "finalize_oneshot",
featureId: "fix-readme-typo"
})workflowType === 'oneshot'phase === 'implementing'_eventsguards.synthesisOptedInstate.oneshot.synthesisPolicy_eventssynthesizecompletedhandleSet | 是否存在 | 解析后的目标阶段 | 路径 |
|---|---|---|---|
| 任意 | | PR路径 |
| 任意 | | 直接提交路径 |
| 是 | | PR路径 |
| 否 | | 直接提交路径 |
completedgit pushcompletedcompletedgit pushcompletedsynthesize@skills/synthesis/SKILL.mdprepare_synthesisvalidate_pr_bodycreate_prfeaturesynthesize → completedmergeVerified/delegate/reviewsynthesize@skills/synthesis/SKILL.mdfeatureprepare_synthesisvalidate_pr_bodycreate_prmergeVerifiedsynthesizecompleted/delegate/reviewon-requeston-requestUser: "Quick fix — there's a typo in the README, 'recieve' should be 'receive'.
Use oneshot."
Agent:
1. exarchos_workflow init { featureId: "fix-readme-typo", workflowType: "oneshot" }
→ workflow created in 'plan' phase, synthesisPolicy defaults to 'on-request'
2. Produces a 4-line plan: goal=fix typo, approach=sed, files=[README.md],
tests=[readme has no occurrence of 'recieve']
3. exarchos_workflow set {
featureId: "fix-readme-typo",
phase: "implementing", // top-level
updates: {
"artifacts.plan": "...",
"oneshot.planSummary": "..."
}
}
4. [RED] writes test that greps README for 'recieve' and expects 0 matches
— fails (1 match exists)
5. [GREEN] edits README, fixes typo
— test passes
6. git commit -m "docs: fix 'recieve' typo in README"
7. exarchos_orchestrate finalize_oneshot { featureId: "fix-readme-typo" }
→ guard sees policy='on-request' + no synthesize.requested event
→ resolves to 'completed'
8. git push
"Done. Workflow completed via direct-commit path."用户:“快速修复——README里有个拼写错误,'recieve'应该改成'receive'。用Oneshot。”
Agent:
1. 调用exarchos_workflow init { featureId: "fix-readme-typo", workflowType: "oneshot" }
→ 创建工作流并进入'plan'阶段,synthesisPolicy默认值为'on-request'
2. 生成4行规划:目标=修复拼写错误,方案=使用sed命令,文件=[README.md],测试=[README中不存在'recieve']
3. 调用exarchos_workflow set {
featureId: "fix-readme-typo",
phase: "implementing", // 顶级参数
updates: {
"artifacts.plan": "...",
"oneshot.planSummary": "..."
}
}
4. [RED] 编写测试脚本,在README中查找'recieve'并期望匹配数为0
——测试失败(存在1个匹配项)
5. [GREEN] 编辑README,修复拼写错误
——测试通过
6. 执行git commit -m "docs: fix 'recieve' typo in README"
7. 调用exarchos_orchestrate finalize_oneshot { featureId: "fix-readme-typo" }
→ 守卫机制检测到策略为'on-request'且无synthesize.requested事件
→ 解析为'completed'
8. 执行git push
“完成。工作流通过直接提交路径结束。”on-requeston-requestUser: "Add input validation to the parseConfig helper. Oneshot."
Agent:
1. exarchos_workflow init { workflowType: "oneshot" }
→ 'plan' phase, default 'on-request'
2. plans (goal: validate input, files: [parser.ts, parser.test.ts])
3. transitions to 'implementing'
4. [RED] writes test for null-input case
5. [GREEN] adds null check
6. [REFACTOR] extracts validateInput helper
7. commits
User: "Actually, this is touching the parser — I want a review on it before
it lands."
Agent:
8. exarchos_orchestrate request_synthesize {
featureId, reason: "user requested review of parser changes"
}
→ appends synthesize.requested event
9. exarchos_orchestrate finalize_oneshot { featureId }
→ guard sees policy='on-request' + 1 synthesize.requested event
→ resolves to 'synthesize'
10. hands off to @skills/synthesis/SKILL.md → prepare_synthesis →
validate_pr_body → create_pr → merge用户:“给parseConfig辅助函数添加输入验证。用Oneshot。”
Agent:
1. 调用exarchos_workflow init { workflowType: "oneshot" }
→ 进入'plan'阶段,默认策略为'on-request'
2. 制定规划(目标:验证输入,文件:[parser.ts, parser.test.ts])
3. 过渡到'implementing'阶段
4. [RED] 编写空输入场景的测试
5. [GREEN] 添加空值检查
6. [REFACTOR] 提取validateInput辅助函数
7. 提交代码
用户:“实际上,这修改了解析器——我希望在落地前对此进行评审。”
Agent:
8. 调用exarchos_orchestrate request_synthesize {
featureId, reason: "user requested review of parser changes"
}
→ 追加synthesize.requested事件
9. 调用exarchos_orchestrate finalize_oneshot { featureId }
→ 守卫机制检测到策略为'on-request'且存在1个synthesize.requested事件
→ 解析为'synthesize'
10. 移交至@skills/synthesis/SKILL.md → prepare_synthesis →
validate_pr_body → create_pr → mergesynthesisPolicy: 'always'synthesisPolicy: 'always'User: "I want a PR for any change to the auth module, even small ones.
Use oneshot but always make a PR."
Agent:
1. exarchos_workflow init {
workflowType: "oneshot",
synthesisPolicy: "always"
}
2-7. plan + TDD + commits, identical to Example A
8. exarchos_orchestrate finalize_oneshot { featureId }
→ guard sees policy='always' (short-circuits — no event check needed)
→ resolves to 'synthesize'
9. synthesis flow → PR用户:“对auth模块的任何变更,即使是微小变更,我都要创建PR。用Oneshot但始终生成PR。”
Agent:
1. 调用exarchos_workflow init {
workflowType: "oneshot",
synthesisPolicy: "always"
}
2-7. 规划 + TDD + 提交,与示例A完全相同
8. 调用exarchos_orchestrate finalize_oneshot { featureId }
→ 守卫机制检测到策略为'always'(直接短路——无需检查事件)
→ 解析为'synthesize'
9. 进入synthesize流程 → 创建PRoneshotmcp__exarchos__exarchos_workflow({
action: "set",
featureId: "<id>",
updates: {
"oneshot": {
"synthesisPolicy": "on-request",
"planSummary": "Fix off-by-one in pagination helper"
}
}
})synthesisPolicy'on-request'servers/exarchos-mcp/src/workflow/schemas.tsoneshotmcp__exarchos__exarchos_workflow({
action: "set",
featureId: "<id>",
updates: {
"oneshot": {
"synthesisPolicy": "on-request",
"planSummary": "Fix off-by-one in pagination helper"
}
}
})servers/exarchos-mcp/src/workflow/schemas.tssynthesisPolicy'on-request'@skills/workflow-state/references/phase-transitions.mdNote: The engine'soutput and the HSM definitions inexarchos_workflow describe playbook="oneshot"are the canonical sources for transition behavior.hsm-definitions.tsis a prose reference that can drift — when discrepancies arise, prefer enginephase-transitions.mdoutput.describe
| From | To | Guard |
|---|---|---|
| | |
| | |
| | |
| | |
| (any) | | universal — always allowed |
synthesisOptedInsynthesisOptedOutstate.oneshot.synthesisPolicystate._eventsalwaysneveron-requestsynthesize.requested@skills/workflow-state/references/phase-transitions.md注意: 引擎的输出以及exarchos_workflow describe playbook="oneshot"中的HSM定义是转换行为的权威来源。hsm-definitions.ts是文字参考文档,可能会出现偏差——当出现不一致时,以引擎的phase-transitions.md输出为准。describe
| 来源阶段 | 目标阶段 | 守卫机制 |
|---|---|---|
| | |
| | |
| | |
| | |
| 任意阶段 | | 通用守卫——始终允许 |
synthesisOptedInsynthesisOptedOutstate.oneshot.synthesisPolicystate._eventsalwaysneveron-requestsynthesize.requestedexarchos_workflow({ action: "describe", actions: ["init", "set"] })synthesisPolicyexarchos_workflow({ action: "describe", playbook: "oneshot" })exarchos_orchestrate({ action: "describe", actions: ["request_synthesize", "finalize_oneshot"] })exarchos_workflow({ action: "describe", actions: ["init", "set"] })synthesisPolicyexarchos_workflow({ action: "describe", playbook: "oneshot" })exarchos_orchestrate({ action: "describe", actions: ["request_synthesize", "finalize_oneshot"] })@rules/tdd.md@rules/tdd.md| Don't | Do Instead |
|---|---|
| Skip the plan phase ("it's obvious") | Write the four-line plan anyway — it's the artifact future-you reads |
| Skip the TDD loop in implementing | Always RED → GREEN → REFACTOR, even for one-liners |
| Use oneshot for multi-file refactors | Use |
| Try to grow a oneshot into a feature workflow mid-stream | Cancel and restart with |
Call | Wait for the user to ask for a PR, then call it |
| Bundle unrelated changes into one commit "since it's a oneshot" | Keep commits atomic — there's no review phase to catch bundling |
Forget to call | The workflow stays in |
| 请勿做 | 正确做法 |
|---|---|
| 跳过规划阶段(“这很明显”) | 无论如何都要编写四行规划——这是未来的您会查阅的工件 |
| 在实现阶段跳过TDD循环 | 始终遵循RED → GREEN → REFACTOR流程,即使是一行代码的变更 |
| 将Oneshot用于多文件重构 | 使用 |
| 尝试在中途将Oneshot扩展为feature工作流 | 取消并使用 |
未倾听用户意图就调用 | 等待用户要求创建PR后再调用 |
| 因为“这是Oneshot”就将无关变更捆绑到一个提交中 | 保持提交原子性——Oneshot没有评审阶段来发现捆绑的变更 |
结束时忘记调用 | 否则工作流会永远停留在 |
exarchos_workflow initworkflowType: "oneshot"artifacts.planimplementingfinalize_oneshotcompletedsynthesize@skills/synthesis/SKILL.mdexarchos_workflow initworkflowType: "oneshot"artifacts.planimplementingfinalize_oneshotcompletedsynthesize@skills/synthesis/SKILL.md