Plan and distribute a change across multiple AI agents for parallel execution.
I'll create a change with artifacts:
- proposal.md (what & why)
- specs/ (detailed specifications)
- design.md (how, with parallelism considerations)
- tasks.md (implementation steps with file ownership)
- dependencies.md (task dependency analysis)
- distribution.md (agent assignment plan)
When ready to implement, run /opsx-multiagent-apply
Input: The argument after /opsx-multiagent is the change name (kebab-case), OR a description of what the user wants to build.
Steps
If no input provided, ask what they want to build
Use the question tool (open-ended, no preset options) to ask:
"What change do you want to work on? Describe what you want to build or fix."
From their description, derive a kebab-case name (e.g., "add user authentication" → add-user-auth).
IMPORTANT: Do NOT proceed without understanding what the user wants to build.
Create the change directory
openspec new change "<name>" --schema dispec-driven
This creates a scaffolded change at openspec/changes/<name>/ with .openspec.yaml using the dispec-driven schema.
Get the artifact build order
openspec status --change "<name>" --json
Parse the JSON to get:
applyRequires: array of artifact IDs needed before implementation (e.g., ["distribution"])
artifacts: list of all artifacts with their status and dependencies
Create artifacts in sequence until apply-ready
Use your internal memory or task-tracking capabilities to log tasks and continuously update their statuses to monitor progress through the artifacts.
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
a. For each artifact that is ready (dependencies satisfied):
b. For the distribution artifact: If a detailed multi-agent plan exists with 3 recommended agents, proceed without asking.
For 1-2 agents with sequential dependencies, propose using /opsx-apply.
Only if the task is highly complex (suggesting >4 agents) use the question tool to ask:
"How many agents do you want to distribute tasks across? (Recommended: 3-5)"
With options:
- "3 agents (Recommended)" - Good balance of parallelism and coordination
- "4 agents" - More parallelism, moderate coordination
- "5+ agents" - Maximum parallelism, requires higher coordination overhead
If the user selects fewer than 3 for a complex task, suggest /opsx-multiagent-apply.
c. Continue until all applyRequires artifacts are complete
- After creating each artifact, re-run
openspec status --change "<name>" --json
- Check if every artifact ID in
applyRequires has status: "done" in the artifacts array
- Stop when all
applyRequires artifacts are done
d. If an artifact requires user input (unclear context):
- Use question tool to clarify
- Then continue with creation
Show final status
openspec status --change "<name>"
Output
After completing all artifacts, summarize:
- Change name and location
- List of artifacts created with brief descriptions
- Agent assignment summary: Which tasks go to which agent
- What's ready: "All artifacts created! Ready for multi-agent implementation."
- Prompt: "If the task is small or requires sequential execution, run /opsx-apply for a direct implementation; otherwise, run /opsx-multiagent-apply to orchestrate a team of agents for parallel execution."
Artifact Creation Guidelines
- Follow the
instruction field from openspec instructions for each artifact type
- The schema defines what each artifact should contain - follow it
- Read dependency artifacts for context before creating new ones
- Use
template as the structure for your output file - fill in its sections
- IMPORTANT:
context and rules are constraints for YOU, not content for the file
- Do NOT copy
<context>, <rules>, <project_context> blocks into the artifact
- These guide what you write, but should never appear in the output
Guardrails
- Create ALL artifacts needed for implementation (as defined by schema's
apply.requires)
- Always read dependency artifacts before creating a new one
- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum
- If a change with that name already exists, ask if user wants to continue it or create a new one
- Verify each artifact file exists after writing before proceeding to next
1---2name: openspec-multiagent3description: Plan and distribute a change across multiple AI agents for parallel execution. Use when the user wants to break down a complex change into tasks that can be worked on simultaneously by a team of agents. ONLY FOR MEDIUM AND LARGE IMPLEMENTATIONS4license: MIT5---67Plan and distribute a change across multiple AI agents for parallel execution.89I'll create a change with artifacts:10- proposal.md (what & why)11- specs/ (detailed specifications)12- design.md (how, with parallelism considerations)13- tasks.md (implementation steps with file ownership)14- dependencies.md (task dependency analysis)15- distribution.md (agent assignment plan)1617When ready to implement, run /opsx-multiagent-apply1819---2021**Input**: The argument after `/opsx-multiagent` is the change name (kebab-case), OR a description of what the user wants to build.2223**Steps**24251. **If no input provided, ask what they want to build**2627 Use the **question tool** (open-ended, no preset options) to ask:28 > "What change do you want to work on? Describe what you want to build or fix."2930 From their description, derive a kebab-case name (e.g., "add user authentication" → `add-user-auth`).3132 **IMPORTANT**: Do NOT proceed without understanding what the user wants to build.33342. **Create the change directory**35 ```bash36 openspec new change "<name>" --schema dispec-driven37 ```38 This creates a scaffolded change at `openspec/changes/<name>/` with `.openspec.yaml` using the dispec-driven schema.39403. **Get the artifact build order**41 ```bash42 openspec status --change "<name>" --json43 ```44 Parse the JSON to get:45 - `applyRequires`: array of artifact IDs needed before implementation (e.g., `["distribution"]`)46 - `artifacts`: list of all artifacts with their status and dependencies47484. **Create artifacts in sequence until apply-ready**4950 Use your internal memory or task-tracking capabilities to log tasks and continuously update their statuses to monitor progress through the artifacts.5152 Loop through artifacts in dependency order (artifacts with no pending dependencies first):5354 a. **For each artifact that is `ready` (dependencies satisfied)**:55 - Get instructions:56 ```bash57 openspec instructions <artifact-id> --change "<name>" --json58 ```59 - The instructions JSON includes:60 - `context`: Project background (constraints for you - do NOT include in output)61 - `rules`: Artifact-specific rules (constraints for you - do NOT include in output)62 - `template`: The structure to use for your output file63 - `instruction`: Schema-specific guidance for this artifact type64 - `outputPath`: Where to write the artifact65 - `dependencies`: Completed artifacts to read for context66 - Read any completed dependency files for context67 - Create the artifact file using `template` as the structure68 - Apply `context` and `rules` as constraints - but do NOT copy them into the file69 - Show brief progress: "Created <artifact-id>"7071 b. **For the distribution artifact**: If a detailed multi-agent plan exists with 3 recommended agents, proceed without asking.72 For 1-2 agents with sequential dependencies, propose using `/opsx-apply`.73 Only if the task is highly complex (suggesting >4 agents) use the **question tool** to ask:74 > "How many agents do you want to distribute tasks across? (Recommended: 3-5)"75 With options:76 - "3 agents (Recommended)" - Good balance of parallelism and coordination77 - "4 agents" - More parallelism, moderate coordination78 - "5+ agents" - Maximum parallelism, requires higher coordination overhead7980 If the user selects fewer than 3 for a complex task, suggest `/opsx-multiagent-apply`.8182 c. **Continue until all `applyRequires` artifacts are complete**83 - After creating each artifact, re-run `openspec status --change "<name>" --json`84 - Check if every artifact ID in `applyRequires` has `status: "done"` in the artifacts array85 - Stop when all `applyRequires` artifacts are done8687 d. **If an artifact requires user input** (unclear context):88 - Use **question tool** to clarify89 - Then continue with creation90916. **Show final status**92 ```bash93 openspec status --change "<name>"94 ```9596**Output**9798After completing all artifacts, summarize:99- Change name and location100- List of artifacts created with brief descriptions101- **Agent assignment summary**: Which tasks go to which agent102- What's ready: "All artifacts created! Ready for multi-agent implementation."103- Prompt: "If the task is small or requires sequential execution, run /opsx-apply for a direct implementation; otherwise, run /opsx-multiagent-apply to orchestrate a team of agents for parallel execution."104105**Artifact Creation Guidelines**106107- Follow the `instruction` field from `openspec instructions` for each artifact type108- The schema defines what each artifact should contain - follow it109- Read dependency artifacts for context before creating new ones110- Use `template` as the structure for your output file - fill in its sections111- **IMPORTANT**: `context` and `rules` are constraints for YOU, not content for the file112 - Do NOT copy `<context>`, `<rules>`, `<project_context>` blocks into the artifact113 - These guide what you write, but should never appear in the output114115**Guardrails**116- Create ALL artifacts needed for implementation (as defined by schema's `apply.requires`)117- Always read dependency artifacts before creating a new one118- If context is critically unclear, ask the user - but prefer making reasonable decisions to keep momentum119- If a change with that name already exists, ask if user wants to continue it or create a new one120- Verify each artifact file exists after writing before proceeding to next