openspec-parallel-agents

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenSpec Parallel Agents

OpenSpec Parallel Agents

概述

Overview

该技能用于 OpenSpec 的并发子代理编排,兼容三类入口:
  1. OPSX 新命令(
    /opsx:*
  2. 旧版命令(
    /openspec:*
  3. Codex CLI 提示词命令(
    /prompts:*
目标是同时覆盖新旧命令语义,并在多 change 场景下安全并发、受控汇总、避免写冲突。
This skill is used for orchestrating parallel subagents in OpenSpec, and is compatible with three types of entry points:
  1. New OPSX commands (
    /opsx:*
    )
  2. Legacy commands (
    /openspec:*
    )
  3. 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 新版
/opsx:explore
/opsx:new
/opsx:continue
/opsx:ff
/opsx:apply
/opsx:verify
/opsx:sync
/opsx:archive
/opsx:bulk-archive
/opsx:onboard
当前主流程
Legacy 旧版
/openspec:proposal
/openspec:apply
/openspec:archive
兼容旧工作流
Codex CLI(新)
/prompts:opsx-explore
/prompts:opsx-new
/prompts:opsx-continue
/prompts:opsx-ff
/prompts:opsx-apply
/prompts:opsx-verify
/prompts:opsx-sync
/prompts:opsx-archive
/prompts:opsx-bulk-archive
/prompts:opsx-onboard
对应
~/.codex/prompts/opsx-<id>.md
Codex CLI(旧)
/prompts:openspec-proposal
/prompts:openspec-apply
/prompts:openspec-archive
历史提示词写法,需兼容
ScenarioCommand FormatDescription
OPSX New Version
/opsx:explore
/opsx:new
/opsx:continue
/opsx:ff
/opsx:apply
/opsx:verify
/opsx:sync
/opsx:archive
/opsx:bulk-archive
/opsx:onboard
Current main workflow
Legacy Version
/openspec:proposal
/openspec:apply
/openspec:archive
Compatible with legacy workflows
Codex CLI (New)
/prompts:opsx-explore
/prompts:opsx-new
/prompts:opsx-continue
/prompts:opsx-ff
/prompts:opsx-apply
/prompts:opsx-verify
/prompts:opsx-sync
/prompts:opsx-archive
/prompts:opsx-bulk-archive
/prompts:opsx-onboard
Corresponding to
~/.codex/prompts/opsx-<id>.md
Codex CLI (Legacy)
/prompts:openspec-proposal
/prompts:openspec-apply
/prompts:openspec-archive
Historical prompt syntax, requires compatibility

旧命令到新流程映射

Legacy Command to New Workflow Mapping

  1. /openspec:proposal
    /prompts:openspec-proposal
  • 等价到“创建规划产物”语义。
  • 推荐映射为:
    /opsx:new
    +
    /opsx:ff
    (或按需
    /opsx:continue
    逐步创建)。
  1. /openspec:apply
    /prompts:openspec-apply
  • 直接映射到
    /opsx:apply
  1. /openspec:archive
    /prompts:openspec-archive
  • 直接映射到
    /opsx:archive
  1. /openspec:proposal
    or
    /prompts:openspec-proposal
  • Equivalent to the semantics of "create planning artifacts".
  • Recommended mapping:
    /opsx:new
    +
    /opsx:ff
    (or
    /opsx:continue
    for step-by-step creation as needed).
  1. /openspec:apply
    or
    /prompts:openspec-apply
  • Directly mapped to
    /opsx:apply
    .
  1. /openspec:archive
    or
    /prompts:openspec-archive
  • Directly mapped to
    /opsx:archive
    .

Codex CLI 特殊处理

Codex CLI Special Handling

  1. Prompt 文件目录优先识别
    $CODEX_HOME/prompts
    ,否则使用
    ~/.codex/prompts
  2. 若同义命令同时存在新旧别名,优先采用 OPSX 语义执行,并在汇总中注明“兼容入口触发”。
  3. /prompts:*
    入口,参数可能以整串形式传入;无法唯一定位 change 时必须先做 change 选择,不得猜测。
  1. The prompt file directory prioritizes
    $CODEX_HOME/prompts
    ; if not available,
    ~/.codex/prompts
    is used.
  2. 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.
  3. For
    /prompts:*
    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.

触发条件

Trigger Conditions

满足任一条件即启用:
  1. 同时处理 2 个及以上 change,且部分任务可独立执行。
  2. 需要批量归档或归档前检查(尤其
    /opsx:bulk-archive
    )。
  3. 任务中同时存在可并行节点与强依赖链。
  4. 用户使用上表中的任一新旧命令,并明确要求并行子代理执行。
Enable if any of the following conditions are met:
  1. Processing 2 or more changes simultaneously, with some tasks that can be executed independently.
  2. Need for bulk archiving or pre-archiving checks (especially
    /opsx:bulk-archive
    ).
  3. Tasks contain both parallelizable nodes and strong dependency chains.
  4. The user uses any of the new or old commands listed in the table above, and explicitly requests parallel subagent execution.

并发执行规则

Concurrent Execution Rules

  1. 每轮默认拆分 3-6 个子任务;不足 3 个必须说明改串行原因。
  2. 仅并发无前置依赖节点;强依赖链必须串行。
  3. 禁止并发写同一文件重叠区域;发现冲突风险立即降级串行。
  4. 归档与规格合并涉及共享索引时,最终提交必须串行。
  5. 一轮并发必须全量返回后统一汇总,不允许边返回边跨轮推进。
  1. Default split into 3-6 subtasks per round; if fewer than 3, the reason for switching to serial execution must be explained.
  2. Only nodes without pre-dependencies are executed concurrently; strong dependency chains must be executed serially.
  3. Concurrent writes to overlapping areas of the same file are prohibited; if a conflict risk is detected, immediately downgrade to serial execution.
  4. When archiving and specification merging involve shared indexes, the final submission must be done serially.
  5. 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:*

New Commands (
/opsx:*
)

  • /opsx:new
    :可并发创建互不依赖 change。
  • /opsx:ff
    :按 change 分组并发生成规划产物。
  • /opsx:apply
    :按模块边界并发实现。
  • /opsx:verify
    :可并发验证各 change,再统一裁决。
  • /opsx:archive
    :归档前检查可并发,最终归档串行提交。
  • /opsx:bulk-archive
    :先并发做健康检查,再按冲突顺序串行归档。
  • /opsx:new
    : Can concurrently create independent changes.
  • /opsx:ff
    : Group by changes and generate planning artifacts concurrently.
  • /opsx:apply
    : Implement concurrently by module boundaries.
  • /opsx:verify
    : Can verify each change concurrently, then make a unified decision.
  • /opsx:archive
    : Pre-archiving checks can be done concurrently, while the final archiving submission must be serial.
  • /opsx:bulk-archive
    : First perform health checks concurrently, then archive serially in conflict order.

旧命令(
/openspec:*

Legacy Commands (
/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:*

Codex CLI (
/prompts:*
)

  • 新旧 prompt 名称均识别。
  • 调度规则与
    /opsx:*
    一致,仅入口别名不同。
  • Recognize both new and old prompt names.
  • Scheduling rules are consistent with
    /opsx:*
    , only the entry aliases are different.

标准循环

Standard Cycle

  1. 识别入口类型(OPSX / Legacy / Codex Prompt)。
  2. 标准化为 OPSX 语义(必要时做旧命令映射)。
  3. 依赖分析并拆分 3-6 个无冲突任务卡。
  4. 并发执行可并行节点。
  5. 汇总冲突、阻塞、风险,决定下一轮并行或转串行。
  1. Identify the entry type (OPSX / Legacy / Codex Prompt).
  2. Standardize to OPSX semantics (perform legacy command mapping if necessary).
  3. Analyze dependencies and split into 3-6 conflict-free task cards.
  4. Execute parallelizable nodes concurrently.
  5. 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
undefined
markdown
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)

  1. {任务A} | {完成/阻塞/失败} | 产出: {文件或结果}
  2. {任务B} | {完成/阻塞/失败} | 产出: {文件或结果}
  3. {任务C} | {完成/阻塞/失败} | 产出: {文件或结果}
  1. {Task A} | {Completed/Blocked/Failed} | Output: {File or Result}
  2. {Task B} | {Completed/Blocked/Failed} | Output: {File or Result}
  3. {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