@menghuan1918/dsh-apollo 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  # Spec Document Reviewer Prompt Template
2
2
 
3
- Use this template when dispatching a spec document reviewer via the `subagent` tool (fresh read-only child, quality tier = the strongest model this session offers; omit provider/model to inherit the parent route).
3
+ Use this template when dispatching a spec document reviewer via the `subagent` tool (fresh read-only child, quality tier).
4
4
 
5
- **Purpose:** Verify a main decomposition spec or child spec is complete, consistent, and ready for implementation.
5
+ **Purpose:** Verify a master Spec or sub-Spec is complete, consistent, and ready for implementation.
6
6
 
7
7
  **Dispatch after:** Spec document is written to the workspace's spec directory (`.workspace-docs/specs/` where that convention exists, otherwise the target repo's own specs directory).
8
8
 
@@ -11,8 +11,8 @@ subagent(
11
11
  prompt="You are a spec document reviewer. Verify this spec is complete and ready for implementation.
12
12
 
13
13
  **Spec to review:** [SPEC_FILE_PATH]
14
- **Spec type:** [main decomposition | child]
15
- **Main spec, if this is a child spec:** [MAIN_SPEC_FILE_PATH or N/A]
14
+ **Spec type:** [master | sub]
15
+ **Master Spec, if this is a sub-Spec:** [MASTER_SPEC_FILE_PATH or N/A]
16
16
 
17
17
  ## What to Check
18
18
 
@@ -22,7 +22,7 @@ subagent(
22
22
  | Completeness | TODOs, placeholders, "TBD", incomplete sections |
23
23
  | Consistency | Internal contradictions, conflicting requirements |
24
24
  | Clarity | Requirements ambiguous enough to cause someone to build the wrong thing |
25
- | Scope | Main specs decompose large work into child specs; child specs are independently implementable and do not try to implement the whole main spec |
25
+ | Scope | Master Specs decompose large work into sub-Specs; sub-Specs are independently implementable and do not try to implement the whole master Spec |
26
26
  | YAGNI | Unrequested features, over-engineering |
27
27
 
28
28
  ## Calibration
@@ -32,7 +32,7 @@ subagent(
32
32
  interpreted two different ways — those are issues. Minor wording improvements,
33
33
  stylistic preferences, and "sections less detailed than others" are not.
34
34
 
35
- Approve unless there are serious gaps that would lead to a flawed implementation. Do not reject a main decomposition spec merely because it covers multiple subsystems; reject it only if it lacks clear child specs, ordering, boundaries, or shared contracts. Do not reject a child spec merely because it does not implement the whole main spec.
35
+ Approve unless there are serious gaps that would lead to a flawed implementation. Do not reject a master Spec merely because it covers multiple subsystems; reject it only if it lacks clear sub-Specs, ordering, boundaries, or shared contracts. Do not reject a sub-Spec merely because it does not implement the whole master Spec.
36
36
 
37
37
  ## Output Format
38
38
 
@@ -57,7 +57,7 @@ Each smell reads *what it is* → *how to fix*; match it against the diff:
57
57
 
58
58
  ### 4. Spawn both sub-agents in parallel
59
59
 
60
- Send both `subagent` calls in a single message — each a fresh child (quality tier = the strongest model this session offers; omit provider/model to inherit the parent route) with a fully self-contained prompt; children see none of this conversation.
60
+ Send both `subagent` calls in a single message — each a fresh quality-tier child with a fully self-contained prompt; children see none of this conversation.
61
61
 
62
62
  **Standards sub-agent prompt** — include:
63
63
 
@@ -1,43 +1,41 @@
1
1
  ---
2
2
  name: dev
3
- description: "DSH 执行后端的节点契约:实现节点与审查节点的 prompt 要求、报告 schema 与失败语义。"
3
+ description: "Node contract for the DSH execution backend: prompt requirements, report formats, and failure semantics for implementation and review nodes."
4
4
  ---
5
5
 
6
- # 内置开发后端(节点契约)
6
+ # Built-in development backend (node contracts)
7
7
 
8
- 本技能定义执行后端的两类节点。波次编排(worktree、合并、清理、CR 循环调度)归 `/exec`;本技能不得创建、合并或删除 worktree。子代理没有独立工作目录,也看不到编排会话:节点的一切输入靠 prompt 自带(worktree 绝对路径、Spec 路径、共享契约、验证命令),bash 一律 `workdir`、文件工具一律绝对路径。
8
+ This skill defines the execution backend's two node types. Wave orchestration (worktrees, merging, cleanup, review-loop scheduling) belongs to `/exec`; this skill must not create, merge, or delete worktrees. Subagents have no independent working directory and cannot see the orchestration session: every node input must come with the prompt (absolute worktree path, Spec path, shared contracts, verification commands), with bash always using `workdir` and file tools always using absolute paths.
9
9
 
10
- 「质量档」指本会话可用的最强模型;不指定路由时子代理继承父会话的 provider/model,具体档位由调用方的会话配置决定,本技能不写死供应商。
10
+ ## Implementation node (develop)
11
11
 
12
- ## 实现节点(develop)
12
+ One brand-new subagent (quality tier) handles exactly one sub-Spec, following `main-agent-driven-development` in prebuilt-worktree mode (in an `/exec` wave, skip its internal review step — the review loop is run by `/exec`, and nodes do not dispatch reviewers themselves).
13
13
 
14
- 一个全新子代理(质量档)处理恰好一个子 Spec,以预建 worktree 模式遵循 `main-agent-driven-development`(在 `/exec` 的 workflow 波次中跳过其内部 CR 步骤——CR 循环由编排脚本承担,节点不自行派 reviewer)。
15
-
16
- 报告 schema(结构化输出):
14
+ Report format (JSON code block at the end of the closing message):
17
15
 
18
16
  ```js
19
17
  {
20
18
  status: 'complete' | 'blocked',
21
- commit: '<最终 commit SHA>',
22
- verification: '<本轮已跑的验证命令与结果>',
23
- summary: '<实现摘要,供 reviewer 与编排器使用>',
24
- blocker: '<status=blocked 时必填>'
19
+ commit: '<final commit SHA>',
20
+ verification: '<verification commands run this round and their results>',
21
+ summary: '<implementation summary for the reviewer and orchestrator>',
22
+ blocker: '<required when status=blocked>'
25
23
  }
26
24
  ```
27
25
 
28
- ## 审查节点(review-only)
26
+ ## Review node (review-only)
29
27
 
30
- 全新只读子代理(质量档)。prompt 自带:worktree 绝对路径、diff 范围、Spec 路径、实现摘要、已跑验证。四态判定 schema:
28
+ A brand-new read-only subagent (quality tier). The prompt supplies: absolute worktree path, diff range, Spec path, implementation summary, and verification already run. Four-state verdict format (JSON code block at the end of the closing message):
31
29
 
32
30
  ```js
33
31
  {
34
32
  status: 'APPROVED' | 'APPROVED_WITH_NOTES' | 'CHANGES_REQUIRED' | 'BLOCKED',
35
- findings: ['<问题,附文件与行号>']
33
+ findings: ['<issue, with file and line number>']
36
34
  }
37
35
  ```
38
36
 
39
- 严重正确性错误、Spec 缺口、集成风险、安全问题或缺失验证必须 `CHANGES_REQUIRED`。不得编辑、提交、合并。
37
+ Serious correctness errors, Spec gaps, integration risks, security issues, or missing verification must yield `CHANGES_REQUIRED`. Do not edit, commit, or merge.
40
38
 
41
- ## 失败语义
39
+ ## Failure semantics
42
40
 
43
- 子代理失败(error / 空返回)= `node-failed`;`blocked`、超时、部分回复或未提交的结果均不得视为完成。调用方决定重派,或仅在对同一子 Spec 解除阻塞时用 `send_message` 续谈。不得复用节点处理其他子 Spec。
41
+ A subagent failure (error / empty return) = `node-failed`; `blocked`, timeouts, partial replies, or uncommitted results never count as complete. The caller decides whether to redispatch, or to continue via `send_message` only when unblocking the same sub-Spec. Never reuse a node for another sub-Spec.
@@ -1,91 +1,78 @@
1
1
  ---
2
2
  name: exec
3
- description: "当用户调用 /exec 并提供已批准的主 Spec 时使用。负责编排逐 Spec worktree、波次 workflow 执行、合并、验证和最终代码审查。"
3
+ description: "Use when the user invokes /exec with an approved master Spec. Orchestrates per-Spec worktrees, wave-parallel subagent execution, merging, verification, and final review."
4
4
  ---
5
5
 
6
- # 执行多 Spec 任务
7
-
8
- 在目标仓库的 `.worktrees/` 隔离 worktree 中执行已批准的子 Spec。主工作区始终是合入目标;编排状态只保存在当前会话上下文中。
9
-
10
- ## 前置条件
11
-
12
- - 主 Spec 索引至少两个子 Spec。
13
- - 确认唯一目标仓库;主工作区位于命名分支且工作树干净。
14
- - `.worktrees/` 已被目标仓库 `.gitignore` 覆盖;没有就先提示用户加入。
15
-
16
- ## 执行
17
-
18
- 1. 读取主 Spec 和全部子 Spec,确认共享契约、依赖 DAG、验证命令。
19
- 2. 按依赖波次创建任务列表。
20
- 3. 每波:从主工作区 HEAD 建分支,在 `<repo>/.worktrees/exec-<任务>/<子任务>` 建 worktree,再派遣整波节点。前置波全部合入后才创建下一波 worktree。
21
-
22
- ## 波次执行:workflow 驱动
23
-
24
- 每波恰好一次 `workflow` 工具调用:脚本只做波内扇出与 CR 循环——worktree 创建、合并、清理全在主线程(workflow 引擎无文件系统,脚本碰不了 git)。节点契约(prompt 要素、schema、失败语义)见 `dev` skill。本波 specs 经 workflow 的 `args` 传入,每个元素带具体值:`{ id, specPath, worktree, contracts, verify }`(`worktree` 为绝对路径)。
25
-
26
- ```js
27
- const specs = args.specs
28
- // 质量档 = 本会话可用的最强模型。留空即不覆盖路由:子代理继承父会话的
29
- // provider/model,任何环境都能跑。有固定质量档时只改这一处,例如:
30
- // const quality = { provider: '<provider>', model: '<model>' }
31
- const quality = {}
32
- const implSchema = { type: 'object', required: ['status', 'commit', 'verification', 'summary'], properties: { status: { type: 'string', enum: ['complete', 'blocked'] }, commit: { type: 'string' }, verification: { type: 'string' }, summary: { type: 'string' }, blocker: { type: 'string' } }, additionalProperties: false }
33
- const verdictSchema = { type: 'object', required: ['status', 'findings'], properties: { status: { type: 'string', enum: ['APPROVED', 'APPROVED_WITH_NOTES', 'CHANGES_REQUIRED', 'BLOCKED'] }, findings: { type: 'array', items: { type: 'string' } } }, additionalProperties: false }
34
- const implPrompt = (s) => `你在隔离 worktree ${s.worktree} 中工作:bash 一律 workdir=${s.worktree},文件工具用绝对路径。以预建 worktree 模式遵循 main-agent-driven-development skill(跳过其内部 CR 步骤,CR 由本编排循环承担,节点不自行派 reviewer)。只实现 ${s.specPath} 的子 Spec,遵守共享契约:${s.contracts}。运行验证:${s.verify}。提交后按 schema 报告。不得合入或删除 worktree;阻塞时 status=blocked 并填 blocker。`
35
- const reviewPrompt = (s, impl) => `只读审查 worktree ${s.worktree} 相对基线的完整 diff(bash 一律 workdir=${s.worktree})。Spec:${s.specPath}。实现摘要:${impl.summary}。已跑验证:${impl.verification}。按严重度列出问题,每条附文件与行号;按 schema 四态判定。不得编辑、提交、合并。`
36
- const fixPrompt = (s, impl, verdict) => `你在隔离 worktree ${s.worktree} 中继续前人的实现(bash 一律 workdir=${s.worktree},文件工具用绝对路径)。此前摘要:${impl.summary}(commit ${impl.commit})。reviewer 发现:${verdict.findings.join(';')}。逐条修复真实问题,对误报在 summary 中给出理由;重跑验证:${s.verify};提交后按 schema 报告。不得合入。`
37
- log(`wave: dispatching ${specs.length} spec(s)`)
38
- return await parallel(specs.map((s) => async () => {
39
- let impl = await agent(implPrompt(s), { label: `${s.id}-impl`, schema: implSchema, ...quality })
40
- if (!impl || impl.status !== 'complete') return { spec: s.id, status: 'node-failed', impl }
41
- let verdict = await agent(reviewPrompt(s, impl), { label: `${s.id}-cr-1`, schema: verdictSchema, ...quality })
42
- let round = 1
43
- while (verdict && verdict.status === 'CHANGES_REQUIRED' && round < 5) {
44
- impl = await agent(fixPrompt(s, impl, verdict), { label: `${s.id}-fix-${round}`, schema: implSchema, ...quality })
45
- if (!impl || impl.status !== 'complete') return { spec: s.id, status: 'fix-failed', round }
46
- round += 1
47
- verdict = await agent(reviewPrompt(s, impl), { label: `${s.id}-cr-${round}`, schema: verdictSchema, ...quality })
48
- }
49
- return { spec: s.id, status: verdict ? verdict.status : 'review-failed', rounds: round, impl, verdict }
50
- }))
51
- ```
6
+ # Execute multi-Spec tasks
7
+
8
+ Run approved sub-Specs in isolated worktrees under `.worktrees/` in the target repo. The main workspace is always the merge target; orchestration state lives only in the current session context.
9
+
10
+ ## Prerequisites
11
+
12
+ - The master Spec indexes at least two sub-Specs.
13
+ - Confirm a single target repo; the main workspace is on a named branch and its working tree is clean.
14
+ - `.worktrees/` is covered by the target repo's `.gitignore`; if not, ask the user to add it first.
15
+
16
+ ## Execution
17
+
18
+ 1. Read the master Spec and all sub-Specs; confirm shared contracts, dependency DAG, and verification commands.
19
+ 2. Build the task list by dependency wave.
20
+ 3. Per wave: create a branch from the main workspace HEAD, create a worktree at `<repo>/.worktrees/exec-<task>/<subtask>`, then dispatch the whole wave of nodes. Create the next wave's worktrees only after every prior wave has merged.
21
+
22
+ ## Wave execution: subagent + wait_subagent
23
+
24
+ The main agent orchestrates each wave; node contracts (prompt elements, report format, failure semantics) are in the `dev` skill.
25
+
26
+ 1. **Dispatch**: in a single message, call `subagent` once per sub-Spec in this wave (quality tier), and record "Spec → subagent id". Implementation-node prompt template:
27
+
28
+ ```
29
+ You work in the isolated worktree <worktree absolute path>: always run bash with workdir=<worktree>, and use absolute paths for file tools.
30
+ Follow the main-agent-driven-development skill in prebuilt-worktree mode (skip its internal review step; the review loop is run by /exec).
31
+ Implement only <sub-Spec path> and obey the shared contracts: <contracts>. Run verification: <verification command>.
32
+ After committing, report in the dev skill's implementation-node format. Do not merge or delete the worktree; if blocked, set status=blocked and fill in blocker.
33
+ ```
34
+
35
+ 2. **Collect**: pass every id in this wave to `wait_subagent` in one call; reports arrive with the settlement notice. A Spec with a missing report, `blocked`, or no commit is recorded as `node-failed` and does not affect the other Specs in the wave.
36
+ 3. **Review loop** (each completed Spec advances independently; batches may be dispatched in parallel):
37
+ - Dispatch a brand-new read-only reviewer (quality tier): `Read-only review of the full diff of worktree <worktree> against the baseline (always run bash with workdir=<worktree>). Spec: <path>. Implementation summary: <summary>. Verification already run: <verification>. List issues by severity, each with file and line number; judge with the dev skill's four-state format. Do not edit, commit, or merge.`
38
+ - `CHANGES_REQUIRED` → send the findings to the original implementation subagent with `send_message` (preserving its context), and require it to fix each real issue, explain false positives, rerun verification, commit, and report again; then `wait_subagent` and dispatch a brand-new reviewer.
39
+ - At most 5 rounds; if still failing, record `review-exhausted`.
40
+ 4. Only Specs judged `APPROVED` / `APPROVED_WITH_NOTES` proceed to merge.
52
41
 
53
- 要点:
42
+ Key points:
54
43
 
55
- - CR 循环是代码不是纪律:每轮全新 reviewer(`agent()` 一次一代理)、schema 校验判定、5 轮熔断。
56
- - 子代理失败 resolve `null` → 该 Spec 记 `node-failed`,`parallel` 等整波,单个失败不拖垮其他 Spec。
57
- - 质量档(本会话最强模型)在脚本顶部一处定义,impl / review / fix 节点全部使用;留空则由子代理继承父会话路由。
58
- - 调用前台阻塞至整波结束,波内无人工交互;节点的疑问一律按 blocked 上报,由主线程处置。
59
- - 返回值是结构化波次报告:只有 `status` 为 `APPROVED` / `APPROVED_WITH_NOTES` 的 Spec 进入合并。
44
+ - Every review round uses a brand-new subagent; fixes reuse the original implementation subagent — never start another implementation node for the same Spec.
45
+ - Report any node question as blocked for the main agent to handle; do not ask the user within a wave.
46
+ - In PTC mode, a whole wave's dispatch and collection can be done in one `run_code`.
60
47
 
61
- ## 合并
48
+ ## Merge
62
49
 
63
- 对每个完成节点:确认已提交且验证通过 → 检查变更文件排除越界 → 合入主工作区 → 合并后验证 → 删除 worktree 和子分支。
50
+ For each completed node: confirm it is committed and verification passed → check the changed files for out-of-scope edits → merge into the main workspace → verify after merging → delete the worktree and sub-branch.
64
51
 
65
- 小而明确的冲突由主代理直接解决。复杂冲突用 `.worktrees/` 下新的修复 worktree 和开发节点。不得合并失败或阻塞的节点。
52
+ Small, well-defined conflicts are resolved directly by the main agent. For complex conflicts, use a new fix worktree under `.worktrees/` and a development node. Never merge failed or blocked nodes.
66
53
 
67
- ## 最终审查
54
+ ## Final review
68
55
 
69
- 所有子 Spec 合入后,运行完整集成验证,然后派遣一个全新只读 reviewer 子代理(质量档 = 本会话最强模型)审查全量集成结果:
56
+ Once all sub-Specs are merged, run the full integration verification, then dispatch a brand-new read-only reviewer subagent (quality tier) to review the whole integrated result:
70
57
 
71
58
  ```
72
59
  subagent(
73
- prompt="只读审查 <workspace> 的 <base>..HEAD diff(bash 一律 workdir=<workspace>)。
74
- 主 Spec: <path> | 全部子 Spec | 共享契约 | 变更文件 | 实现摘要 | 验证结果。
75
- 按严重度列出问题,每条附文件与行号。
76
- 返回 APPROVED / APPROVED_WITH_NOTES / CHANGES_REQUIRED / BLOCKED。不得编辑、提交、合并。"
60
+ prompt="Read-only review of the <base>..HEAD diff in <workspace> (always run bash with workdir=<workspace>).
61
+ Master Spec: <path> | all sub-Specs | shared contracts | changed files | implementation summary | verification results.
62
+ List issues by severity, each with file and line number.
63
+ Return APPROVED / APPROVED_WITH_NOTES / CHANGES_REQUIRED / BLOCKED. Do not edit, commit, or merge."
77
64
  )
78
65
  ```
79
66
 
80
- 用 `wait_subagent` 等待。`CHANGES_REQUIRED` 时不需要询问用户——主代理直接分类并修复所有真实 bug,对误报和既有行为在上下文中简述理由;修复后重新验证,再派全新 reviewer 复审。软熔断 3 轮后仍存在严重或阻塞问题则停止修复循环,如实向用户报告剩余问题。
67
+ Wait with `wait_subagent`. On `CHANGES_REQUIRED` there is no need to ask the user — the main agent classifies and fixes all real bugs directly, and briefly explains false positives and existing behavior in context; after fixing, verify again and dispatch a brand-new reviewer for re-review. If serious or blocking issues remain after a soft cap of 3 rounds, stop the fix loop and truthfully report the remaining issues to the user.
81
68
 
82
- ## 收尾
69
+ ## Wrap-up
83
70
 
84
- 运行完整验证,核对 Spec,报告分支、提交、验证结果和遗留问题,询问用户下一步。未经用户选择不得创建 PR 或删除分支。
71
+ Run the full verification, check the Specs, report branches, commits, verification results, and open issues, and ask the user what to do next. Do not create a PR or delete branches without the user's choice.
85
72
 
86
73
  ## KISS
87
74
 
88
- - 一个子 Spec、一个 worktree、一个开发节点。
89
- - 主线程只持仓库拓扑(分支/worktree/合并/清理);波内扇出交给一次 workflow 调用。
90
- - 状态只保存在会话上下文;不增加集成分支、调度脚本或状态文件。
91
- - 等待靠完成通知自动送达,需要结果才继续时再等待。不得用 `sleep` 轮询。
75
+ - One sub-Spec, one worktree, one development node.
76
+ - The main agent holds repo topology (branches/worktrees/merges/cleanup) and in-wave scheduling; implementation and review go to subagents.
77
+ - State lives only in session context; add no integration branch, scheduler scripts, or state files.
78
+ - Completion notices arrive automatically; wait only when you need results to proceed. Never poll with `sleep`.
@@ -1,23 +1,23 @@
1
1
  ---
2
2
  name: handoff
3
- description: 把当前对话压缩成一份交接文档,供下一个全新 agent 接续。
4
- argument-hint: "下一个会话将用来做什么?"
3
+ description: Compress the current conversation into a handoff document for a fresh agent to continue from.
4
+ argument-hint: "What will the next session be used for?"
5
5
  disable-model-invocation: true
6
6
  ---
7
7
 
8
- 把当前对话压缩成一份交接文档,让全新 agent 无需重读父会话即可接续工作。
8
+ Compress the current conversation into a handoff document, so a brand-new agent can pick up the work without re-reading the parent session.
9
9
 
10
- ## 存放与复用
10
+ ## Storage and reuse
11
11
 
12
- - **已有则复写**:若会话上下文中已存在交接文档(本会话早前写过,或会话开启时注入了一份),整篇重写该文件,不新建。
13
- - **否则新建**:工作区有 `.workspace-docs/` 时写 `.workspace-docs/notes/<仓库或主题>/`,交接本质上就是一篇 note;否则写目标仓库现有的文档目录。文件名带日期前缀,沿用目录内现有命名风格。
14
- - 写入 `.workspace-docs/` 时新建文件带 OKF 头(`type: Note` 及 `title`/`description`/`tags`/`status`/`repos`),不登记 `index.md`;提交/推送遵循该仓库既有纪律。目标仓库无此约定时用其现有文档格式。
15
- - 两个位置都不存在时,回退写 OS 临时目录。
12
+ - **Rewrite if one exists**: if a handoff document is already in the session context (written earlier in this session, or injected when the session started), rewrite that file in full; do not create a new one.
13
+ - **Otherwise create one**: when the workspace has `.workspace-docs/`, write to `.workspace-docs/notes/<repo-or-topic>/` — a handoff is essentially a note; otherwise write to the target repo's existing docs directory. Prefix the file name with the date and follow the naming style already used in that directory.
14
+ - When writing under `.workspace-docs/`, new files carry an OKF header (`type: Note` plus `title`/`description`/`tags`/`status`/`repos`), and are not registered in `index.md`; commit/push follows that repo's existing discipline. Where the target repo has no such convention, use its existing doc format.
15
+ - If neither location exists, fall back to the OS temp directory.
16
16
 
17
- ## 内容要求
17
+ ## Content requirements
18
18
 
19
- - 含「建议技能」一节,提示接手 agent 应调用的技能。
20
- - 不复述已落盘物(spec、plan、ADR、issue、commit、diff)的内容,只给路径或 URL。
21
- - 只写客观事实与验证证据,不写自我免责叙事。
22
- - 脱敏 API key、密码、个人身份信息等敏感内容。
23
- - 用户带参数调用时,参数即下一会话焦点,据此裁剪文档。
19
+ - Include a "Suggested skills" section pointing the receiving agent at the skills it should invoke.
20
+ - Do not restate content already on disk (spec, plan, ADR, issue, commit, diff); give paths or URLs only.
21
+ - Record only objective facts and verification evidence; no self-justifying narrative.
22
+ - Redact sensitive content such as API keys, passwords, and personal identity information.
23
+ - When the user invokes it with an argument, that argument is the next session's focus; trim the document accordingly.
@@ -1,39 +1,39 @@
1
1
  ---
2
2
  name: main-agent-driven-development
3
- description: "仅当用户或编排技能显式调用 /main-agent-driven-development 来完成一个边界明确的实现任务时使用。"
3
+ description: "Use only when the user or an orchestration skill explicitly invokes /main-agent-driven-development to complete a well-bounded implementation task."
4
4
  ---
5
5
 
6
- # 主代理驱动开发
6
+ # Main-agent-driven development
7
7
 
8
- 由当前 Agent 会话直接实现一个边界明确的 Spec。外层 `/exec` 编排器负责 worktree 和合入生命周期。
8
+ The current agent session implements a well-bounded Spec directly. The outer `/exec` orchestrator owns the worktree and merge lifecycle.
9
9
 
10
- ## Worktree 模式
10
+ ## Worktree modes
11
11
 
12
- 只选一种:
12
+ Choose exactly one:
13
13
 
14
- - **预建模式** — 调用方已提供隔离 worktree 并声明负责生命周期时,直接使用;不得创建、合并或删除 worktree。
15
- - **独立模式** — 否则识别目标仓库,要求基线位于命名分支,记录起始 SHA,在仓库 `.worktrees/` 下创建 worktree。
14
+ - **Prebuilt mode** — when the caller already provided an isolated worktree and owns its lifecycle, use it directly; do not create, merge, or delete worktrees.
15
+ - **Standalone mode** — otherwise, identify the target repo, require the baseline to be on a named branch, record the starting SHA, and create a worktree under the repo's `.worktrees/`.
16
16
 
17
- 所有操作必须在选定 worktree 内完成。隔离后不得编辑原始 checkout。
17
+ All operations must happen inside the chosen worktree. After isolation, do not edit the original checkout.
18
18
 
19
- ## 流程
19
+ ## Flow
20
20
 
21
- 1. 读取分配的 Spec 及相关仓库指令。
22
- 2. 确认任务边界、依赖、验收标准和必要验证。只有缺失决策真正阻塞实现时才提问。
23
- 3. 根据 Spec 初始化任务列表。
24
- 4. 项目初始化 + 基线验证。基线失败时先报告;仅当失败明确无关且已记录时才继续。
25
- 5. 直接实现,限定在 Spec 范围。遵循 `tdd` skill(本包已捆绑):先写失败测试,再写最小实现。
26
- 6. 每个逻辑步骤后运行聚焦验证、自审 diff,内容完整时提交。验证标准:本轮运行命令并确认输出,不得以"应该通过"代替实际运行。
27
- 7. 实现完成后运行全部必要验证。
28
- 8. 验证失败或 CR 发现 bug 时,遵循 `diagnosing-bugs` skill(本包已捆绑):先建反馈循环找根因,再修复。
29
- 9. 执行内部 CR 循环(见下文)。例外:作为 `/exec` dev 后端 workflow 波次中的实现节点时,**跳过本步**——CR 循环由编排脚本承担,节点只实现、验证、提交、报告。
30
- 10. 提交全部已批准修复,向调用方报告。
21
+ 1. Read the assigned Spec and the relevant repo instructions.
22
+ 2. Confirm task boundaries, dependencies, acceptance criteria, and required verification. Ask questions only when a missing decision truly blocks implementation.
23
+ 3. Initialize the task list from the Spec.
24
+ 4. Project setup + baseline verification. Report first if the baseline fails; continue only when the failure is clearly unrelated and documented.
25
+ 5. Implement directly, limited to the Spec's scope. Follow the `tdd` skill (bundled in this package): write a failing test first, then the minimal implementation.
26
+ 6. After each logical step, run focused verification, self-review the diff, and commit when it is complete. Verification standard: run the command this round and confirm the output; never replace it with "it should pass".
27
+ 7. After implementation, run all required verification.
28
+ 8. When verification fails or review finds a bug, follow the `diagnosing-bugs` skill (bundled in this package): build a feedback loop to find the root cause first, then fix.
29
+ 9. Run the internal review loop (see below). Exception: when acting as an implementation node in an `/exec` wave, **skip this step** — the review loop is run by `/exec`, and the node only implements, verifies, commits, and reports.
30
+ 10. Commit all approved fixes and report to the caller.
31
31
 
32
- 保持 KISS。优先复用既有模式,小而完整的修改,只做 Spec 必需的针对性重构。
32
+ Keep it KISS. Prefer reusing existing patterns, small and complete changes, and only the targeted refactoring the Spec requires.
33
33
 
34
- ## 内部 CR 循环
34
+ ## Internal review loop
35
35
 
36
- 完整验证后,派遣恰好一个全新只读 reviewer 子代理(质量档 = 本会话最强模型):
36
+ After full verification, dispatch exactly one brand-new read-only reviewer subagent (quality tier):
37
37
 
38
38
  ```
39
39
  subagent(
@@ -45,20 +45,20 @@ subagent(
45
45
  )
46
46
  ```
47
47
 
48
- 要求附文件和行号,返回一种状态:`APPROVED` / `APPROVED_WITH_NOTES` / `CHANGES_REQUIRED` / `BLOCKED`。
48
+ Require file and line numbers, and one status: `APPROVED` / `APPROVED_WITH_NOTES` / `CHANGES_REQUIRED` / `BLOCKED`.
49
49
 
50
- 用 `wait_subagent` 等待审查完成。收到结果后直接修复所有必要的正确性错误、Spec 缺口、安全问题、集成风险和验证缺口——不需要询问用户。验证并提交修复后,再用 `subagent` 派遣全新 reviewer。重复直到 `APPROVED` 或仅含非阻塞建议。
50
+ Wait for the review with `wait_subagent`. Once results arrive, fix all necessary correctness errors, Spec gaps, security issues, integration risks, and verification gaps directly — no need to ask the user. After verifying and committing the fixes, dispatch a brand-new reviewer with `subagent` again. Repeat until `APPROVED` or only non-blocking suggestions remain.
51
51
 
52
- 不得自我批准,不得复用旧 reviewer。
52
+ Never self-approve, and never reuse an old reviewer.
53
53
 
54
- ## 完成契约
54
+ ## Completion contract
55
55
 
56
- 报告完成前必须满足:
56
+ Before reporting completion, all of the following must hold:
57
57
 
58
- - 所有分配的验收标准已实现
59
- - 必要验证已在本轮运行并通过(有命令输出为证)
60
- - 没有未提交的实现修改
61
- - 内部 CR 已通过且无必要修复项
62
- - 可提供最终 commit SHA
58
+ - All assigned acceptance criteria are implemented
59
+ - Required verification ran and passed this round (backed by command output)
60
+ - No uncommitted implementation changes
61
+ - Internal review passed with no required fixes
62
+ - The final commit SHA is available
63
63
 
64
- 如实报告阻塞。不得自行合入;调用方负责集成和清理。
64
+ Report blockers truthfully. Do not merge on your own; the caller owns integration and cleanup.
@@ -16,7 +16,7 @@ export function enabledIn(config, agent) {
16
16
  const projections = agent?.ctx?.get?.('sessionProjections')
17
17
  if (projections) preset = projections.stateOf(agent.session, 'agentPreset') ?? preset
18
18
  } catch { /* Compositions without the optional preset registry use the header. */ }
19
- return scope.global || (scope.eng && ['eng', 'eng-noask'].includes(preset))
19
+ return scope.global || (scope.eng && ['eng', 'eng-ptc'].includes(preset))
20
20
  }
21
21
 
22
22
  /** Exact checks are repeated before every CLI turn, including cold resume. */