openspec-parallel-agents
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpenSpec Parallel Agents
OpenSpec Parallel Agents
概述
Overview
该技能用于 OpenSpec 的并发子代理编排,兼容三类入口:
- OPSX 新命令()
/opsx:* - 旧版命令()
/openspec:* - Codex CLI 提示词命令()
/prompts:*
目标是同时覆盖新旧命令语义,并在多 change 场景下安全并发、受控汇总、避免写冲突。
This skill is used for orchestrating parallel subagents in OpenSpec, and is compatible with three types of entry points:
- New OPSX commands ()
/opsx:* - Legacy commands ()
/openspec:* - Codex CLI prompt commands ()
/prompts:*
The goal is to simultaneously support both new and old command semantics, while ensuring safe concurrency, controlled aggregation, and prevention of write conflicts in multi-change scenarios.
命令兼容矩阵(必须识别)
Command Compatibility Matrix (Mandatory Recognition)
| 场景 | 命令形态 | 说明 |
|---|---|---|
| OPSX 新版 | | 当前主流程 |
| Legacy 旧版 | | 兼容旧工作流 |
| Codex CLI(新) | | 对应 |
| Codex CLI(旧) | | 历史提示词写法,需兼容 |
| Scenario | Command Format | Description |
|---|---|---|
| OPSX New Version | | Current main workflow |
| Legacy Version | | Compatible with legacy workflows |
| Codex CLI (New) | | Corresponding to |
| Codex CLI (Legacy) | | Historical prompt syntax, requires compatibility |
旧命令到新流程映射
Legacy Command to New Workflow Mapping
- 或
/openspec:proposal/prompts:openspec-proposal
- 等价到“创建规划产物”语义。
- 推荐映射为:+
/opsx:new(或按需/opsx:ff逐步创建)。/opsx:continue
- 或
/openspec:apply/prompts:openspec-apply
- 直接映射到 。
/opsx:apply
- 或
/openspec:archive/prompts:openspec-archive
- 直接映射到 。
/opsx:archive
- or
/openspec:proposal/prompts:openspec-proposal
- Equivalent to the semantics of "create planning artifacts".
- Recommended mapping: +
/opsx:new(or/opsx:fffor step-by-step creation as needed)./opsx:continue
- or
/openspec:apply/prompts:openspec-apply
- Directly mapped to .
/opsx:apply
- or
/openspec:archive/prompts:openspec-archive
- Directly mapped to .
/opsx:archive
Codex CLI 特殊处理
Codex CLI Special Handling
- Prompt 文件目录优先识别 ,否则使用
$CODEX_HOME/prompts。~/.codex/prompts - 若同义命令同时存在新旧别名,优先采用 OPSX 语义执行,并在汇总中注明“兼容入口触发”。
- 对 入口,参数可能以整串形式传入;无法唯一定位 change 时必须先做 change 选择,不得猜测。
/prompts:*
- The prompt file directory prioritizes ; if not available,
$CODEX_HOME/promptsis used.~/.codex/prompts - If both new and old aliases for synonymous commands exist, OPSX semantics are prioritized for execution, and "triggered via compatible entry point" is noted in the summary.
- For entry points, parameters may be passed as a whole string; when the change cannot be uniquely identified, a change selection must be performed first, and guessing is not allowed.
/prompts:*
触发条件
Trigger Conditions
满足任一条件即启用:
- 同时处理 2 个及以上 change,且部分任务可独立执行。
- 需要批量归档或归档前检查(尤其 )。
/opsx:bulk-archive - 任务中同时存在可并行节点与强依赖链。
- 用户使用上表中的任一新旧命令,并明确要求并行子代理执行。
Enable if any of the following conditions are met:
- Processing 2 or more changes simultaneously, with some tasks that can be executed independently.
- Need for bulk archiving or pre-archiving checks (especially ).
/opsx:bulk-archive - Tasks contain both parallelizable nodes and strong dependency chains.
- The user uses any of the new or old commands listed in the table above, and explicitly requests parallel subagent execution.
并发执行规则
Concurrent Execution Rules
- 每轮默认拆分 3-6 个子任务;不足 3 个必须说明改串行原因。
- 仅并发无前置依赖节点;强依赖链必须串行。
- 禁止并发写同一文件重叠区域;发现冲突风险立即降级串行。
- 归档与规格合并涉及共享索引时,最终提交必须串行。
- 一轮并发必须全量返回后统一汇总,不允许边返回边跨轮推进。
- Default split into 3-6 subtasks per round; if fewer than 3, the reason for switching to serial execution must be explained.
- Only nodes without pre-dependencies are executed concurrently; strong dependency chains must be executed serially.
- Concurrent writes to overlapping areas of the same file are prohibited; if a conflict risk is detected, immediately downgrade to serial execution.
- When archiving and specification merging involve shared indexes, the final submission must be done serially.
- All results from a round of concurrent execution must be returned in full before unified aggregation; it is not allowed to proceed across rounds while returning results incrementally.
命令级策略
Command-Level Strategies
新命令(/opsx:*
)
/opsx:*New Commands (/opsx:*
)
/opsx:*- :可并发创建互不依赖 change。
/opsx:new - :按 change 分组并发生成规划产物。
/opsx:ff - :按模块边界并发实现。
/opsx:apply - :可并发验证各 change,再统一裁决。
/opsx:verify - :归档前检查可并发,最终归档串行提交。
/opsx:archive - :先并发做健康检查,再按冲突顺序串行归档。
/opsx:bulk-archive
- : Can concurrently create independent changes.
/opsx:new - : Group by changes and generate planning artifacts concurrently.
/opsx:ff - : Implement concurrently by module boundaries.
/opsx:apply - : Can verify each change concurrently, then make a unified decision.
/opsx:verify - : Pre-archiving checks can be done concurrently, while the final archiving submission must be serial.
/opsx:archive - : First perform health checks concurrently, then archive serially in conflict order.
/opsx:bulk-archive
旧命令(/openspec:*
)
/openspec:*Legacy Commands (/openspec:*
)
/openspec:*- 保留用户入口,不强制要求用户改命令。
- 执行时按“旧到新映射”转换为 OPSX 语义并应用同一并发规则。
- Keep the user entry point; do not force users to change commands.
- Convert to OPSX semantics according to "Legacy to New Mapping" during execution and apply the same concurrency rules.
Codex CLI(/prompts:*
)
/prompts:*Codex CLI (/prompts:*
)
/prompts:*- 新旧 prompt 名称均识别。
- 调度规则与 一致,仅入口别名不同。
/opsx:*
- Recognize both new and old prompt names.
- Scheduling rules are consistent with , only the entry aliases are different.
/opsx:*
标准循环
Standard Cycle
- 识别入口类型(OPSX / Legacy / Codex Prompt)。
- 标准化为 OPSX 语义(必要时做旧命令映射)。
- 依赖分析并拆分 3-6 个无冲突任务卡。
- 并发执行可并行节点。
- 汇总冲突、阻塞、风险,决定下一轮并行或转串行。
- Identify the entry type (OPSX / Legacy / Codex Prompt).
- Standardize to OPSX semantics (perform legacy command mapping if necessary).
- Analyze dependencies and split into 3-6 conflict-free task cards.
- Execute parallelizable nodes concurrently.
- Aggregate conflicts, blocks, and risks, then decide whether to proceed with parallel execution or switch to serial execution in the next round.
轮次汇总模板
Round Summary Template
markdown
undefinedmarkdown
undefined第 {N} 轮汇总
Round {N} Summary
触发入口
Trigger Entry
- 原始命令: {如 /openspec:proposal 或 /prompts:opsx-apply}
- 规范化语义: {对应 /opsx:*}
- Original Command: {e.g., /openspec:proposal or /prompts:opsx-apply}
- Normalized Semantics: {corresponding /opsx:*}
本轮目标
Round Goal
- {一句话目标}
- {One-sentence goal}
子任务状态(3-6)
Subtask Status (3-6)
- {任务A} | {完成/阻塞/失败} | 产出: {文件或结果}
- {任务B} | {完成/阻塞/失败} | 产出: {文件或结果}
- {任务C} | {完成/阻塞/失败} | 产出: {文件或结果}
- {Task A} | {Completed/Blocked/Failed} | Output: {File or Result}
- {Task B} | {Completed/Blocked/Failed} | Output: {File or Result}
- {Task C} | {Completed/Blocked/Failed} | Output: {File or Result}
冲突与处理
Conflicts and Handling
- 写冲突检查: {无/有,位置}
- 处理动作: {重排并发/改串行/拆分边界}
- Write Conflict Check: {None/Exists, Location}
- Handling Action: {Rearrange Concurrency/Switch to Serial/Split Boundaries}
依赖链状态
Dependency Chain Status
- 串行链: {A -> B -> C}
- 当前推进: {节点}
- Serial Chain: {A -> B -> C}
- Current Progress: {Node}
下一轮计划
Next Round Plan
- 并行任务: {列表}
- 串行任务: {列表}
- 归档准备状态: {可归档/不可归档 + 原因}
undefined- Parallel Tasks: {List}
- Serial Tasks: {List}
- Archiving Preparation Status: {Ready for Archiving/Not Ready + Reason}
undefined