Multi-Agent Production Pipeline
Use this skill when the task is large enough to benefit from explicit staging
instead of ad hoc implementation.
The local agent is the orchestrator. It owns user communication, artifact
persistence, tree-grading aggregation, merge decisions, and final integration.
Subagents own bounded stage work.
Progressive Disclosure
This file is the routing layer. Keep it short enough for OpenCode and Codex to
load cheaply, then read only the files needed for the current stage.
- First read this file to decide whether the pipeline applies.
- For Codex execution rules, read
references/codex-execution-model.md.
- For OpenCode expert-mode setup, read
references/opencode-expert-mode.md.
- For the phase-by-phase pipeline, read
references/pipeline-stages.md.
- For workspace layout and pet events, read
references/workspace-and-events.md.
- For orchestration, artifact, grading, merge, and cleanup rules, read
references/orchestration-rules.md.
- For bundled brainstorming/planning/frontend-design methodology, read only the
needed file under
references/methodologies/.
- For subagent prompts, read only the current
agents/<stage>.md.
- For artifact shapes, read
references/contracts.md.
- For nearby JSON skeletons, read only the current
templates/artifacts/<artifact>.json.
- For legacy PRE review scoring, read
references/pre-rubric.md only when
explicitly using the deprecated Review stage.
- For runnable prompt scaffolds, read
references/orchestrator-prompts.md.
- For a full example, read
references/example-run.md only when debugging or
explaining a complete run.
Do not preload every reference file just because this skill was selected.
When To Use
Use this pipeline for:
- New features spanning multiple files or subsystems
- Refactors with meaningful behavior, API, runtime, or documentation impact
- Tasks that need explicit implementation, validation, tree grading, QA, and
docs
- User requests mentioning
multi-agent, pipeline, production workflow,
full implementation, staged delivery, or strict grading
Skip this pipeline for:
- Tiny one-file edits
- Pure Q&A or design discussion
- Tasks where the user explicitly wants a quick direct patch
If the user explicitly invokes this skill, treat that as authorization for
subagent delegation and safe parallel work within the current host constraints.
Ask only for blocking ambiguities.
Pipeline Map
Brainstorming -> Spec -> Plan -> Architecture -> Dispatch
-> Execution -> Complexity Hook -> Merge -> Validation
-> Tree Classification -> Tree Rubric Generation -> Tree Rubric Verification
-> Tree Rubric Refinement -> Tree Grading -> QA
-> Documentation -> Final Assessment -> Cleanup
Local-only stages:
- Brainstorming
- Merge
- Final output file collection for grading
- Tree grading aggregation
- Cleanup
Subagent stages:
- Spec
- Plan
- Architecture
- Dispatch
- Execution
- Validation
- Tree Classification
- Tree Rubric Generation
- Tree Rubric Verification
- Tree Rubric Refinement
- Tree Grading
- QA
- Documentation
- Final Assessment
The legacy Review stage and PRE rubric remain as compatibility artifacts, but
the active quality gate is Tree Rubrics plus Tree Grading.
Non-Negotiable Rules
- The orchestrator is the source of truth for
.pipeline-workspace/ artifacts.
- Merge, final output collection, grading aggregation, and Cleanup are
orchestrator-local.
- Use conservative three-way merge semantics and pause for human resolution when
automatic merge safety is ambiguous.
- Do not revert user edits or unrelated worktree changes.
- Dispatch owns skill routing. Later stages must not re-infer required skills.
- Spec and Plan use the bundled methodology references under
references/methodologies/ and must not attach external methodology skills.
- Execution applies the bundled frontend-design guidance when Dispatch routes
ce-frontend-design.
- Validation must run before Tree Rubrics for every merged worker group unless
it is explicitly skipped with evidence.
- Tree Grading uses 3 independent graders by default. Do not downgrade the
grader count unless the user explicitly asks for a cheaper/faster pass.
- Tree Grading must judge only
spec, tree_rubrics_refined.json, and
final-output-files.json; do not grade process logs or agent behavior.
- QA must pass before Documentation and Final Assessment.
- Accepted runs write
.pipeline-last-run-summary.json and remove
.pipeline-workspace/; rejected or paused runs keep the workspace.
- Git publication is opt-in and orchestrator-local; subagents must not commit
or push.
Stage Files
Read the current stage prompt just before spawning or running that stage:
| Stage |
File |
Required extra reference |
Template |
| Spec |
agents/spec.md |
references/contracts.md |
templates/artifacts/spec.json |
| Plan |
agents/plan.md |
references/contracts.md |
templates/artifacts/plan.json |
| Architecture |
agents/architecture.md |
references/contracts.md |
templates/artifacts/architecture.json |
| Dispatch |
agents/dispatch.md |
references/contracts.md |
templates/artifacts/dispatch.json |
| Execution |
agents/execution.md |
references/contracts.md |
templates/artifacts/execution-report.json |
| Validation |
agents/validation.md |
references/contracts.md |
templates/artifacts/validation-report.json |
| Tree Classification |
agents/tree-classification.md |
references/contracts.md |
templates/artifacts/tree-classification.json |
| Tree Rubric Generation |
agents/tree-rubric-generation.md |
references/contracts.md |
templates/artifacts/tree-rubrics.json |
| Tree Rubric Verification |
agents/tree-rubric-verification.md |
references/contracts.md |
templates/artifacts/tree-rubric-verification.json |
| Tree Rubric Refinement |
agents/tree-rubric-refinement.md |
references/contracts.md |
templates/artifacts/tree-rubrics-refined.json |
| Tree Grading |
agents/tree-grading.md |
references/contracts.md |
templates/artifacts/tree-grading-individual.json |
| QA |
agents/qa.md |
references/contracts.md |
templates/artifacts/qa-report.json |
| Documentation |
agents/doc.md |
references/contracts.md |
templates/artifacts/doc-report.json |
| Final Assessment |
agents/final-assessment.md |
references/contracts.md |
templates/artifacts/final-assessment.json |
| Legacy Review |
agents/review.md |
references/contracts.md, references/pre-rubric.md |
templates/artifacts/review-individual.json |
Host Notes
Codex
Codex can use the runtime and stage catalog in src/ plus the prompt templates
in references/orchestrator-prompts.md. Keep detailed Codex tool behavior in
references/codex-execution-model.md.
OpenCode
OpenCode discovers name and description first, then loads this file through
the native skill tool only when needed. This entrypoint is intentionally short
and points to references on demand.
Install the skill into one of OpenCode's skill search paths, for example:
.opencode/skills/multi-agent-pipeline/SKILL.md
~/.config/opencode/skills/multi-agent-pipeline/SKILL.md
For a copy-ready expert primary agent, use
templates/opencode-expert-agent.md with the guidance in
references/opencode-expert-mode.md.
Runtime
The Node runtime under src/runtime/ implements the documented contracts for
artifact storage, stage catalogs, merge, complexity analysis, validation flow,
Tree Rubrics, Tree Grading, final assessment, cleanup summaries, token/context
optimization, cache observability, research harnesses, agent traces, state
snapshots, governance reports, protocol sandboxes, and Codex pet events.
Optional Git publication uses gitmoji plus Conventional Commits style Chinese
messages. Run tests from the skill package root with:
npm test
1---2name: multi-agent-pipeline3description: Run a Codex-compatible production pipeline for non-trivial implementation work: Brainstorming, Spec, Plan, Architecture, Dispatch, Execution, Complexity, Merge, Validation, Tree Rubrics, Tree Grading, QA, Documentation, Final Assessment, and Cleanup. Use when the user asks for multi-agent, pipeline, staged delivery, full implementation, substantial refactor, or strict validation/grading. The entrypoint is OpenCode-compatible and progressively discloses detailed rules through agents/, references/, scripts/, src/, and test/ files.4---56# Multi-Agent Production Pipeline78Use this skill when the task is large enough to benefit from explicit staging9instead of ad hoc implementation.1011The local agent is the orchestrator. It owns user communication, artifact12persistence, tree-grading aggregation, merge decisions, and final integration.13Subagents own bounded stage work.1415## Progressive Disclosure1617This file is the routing layer. Keep it short enough for OpenCode and Codex to18load cheaply, then read only the files needed for the current stage.1920- First read this file to decide whether the pipeline applies.21- For Codex execution rules, read `references/codex-execution-model.md`.22- For OpenCode expert-mode setup, read `references/opencode-expert-mode.md`.23- For the phase-by-phase pipeline, read `references/pipeline-stages.md`.24- For workspace layout and pet events, read `references/workspace-and-events.md`.25- For orchestration, artifact, grading, merge, and cleanup rules, read26 `references/orchestration-rules.md`.27- For bundled brainstorming/planning/frontend-design methodology, read only the28 needed file under `references/methodologies/`.29- For subagent prompts, read only the current `agents/<stage>.md`.30- For artifact shapes, read `references/contracts.md`.31- For nearby JSON skeletons, read only the current32 `templates/artifacts/<artifact>.json`.33- For legacy PRE review scoring, read `references/pre-rubric.md` only when34 explicitly using the deprecated Review stage.35- For runnable prompt scaffolds, read `references/orchestrator-prompts.md`.36- For a full example, read `references/example-run.md` only when debugging or37 explaining a complete run.3839Do not preload every reference file just because this skill was selected.4041## When To Use4243Use this pipeline for:4445- New features spanning multiple files or subsystems46- Refactors with meaningful behavior, API, runtime, or documentation impact47- Tasks that need explicit implementation, validation, tree grading, QA, and48 docs49- User requests mentioning `multi-agent`, `pipeline`, `production workflow`,50 `full implementation`, staged delivery, or strict grading5152Skip this pipeline for:5354- Tiny one-file edits55- Pure Q&A or design discussion56- Tasks where the user explicitly wants a quick direct patch5758If the user explicitly invokes this skill, treat that as authorization for59subagent delegation and safe parallel work within the current host constraints.60Ask only for blocking ambiguities.6162## Pipeline Map6364```text65Brainstorming -> Spec -> Plan -> Architecture -> Dispatch66-> Execution -> Complexity Hook -> Merge -> Validation67-> Tree Classification -> Tree Rubric Generation -> Tree Rubric Verification68-> Tree Rubric Refinement -> Tree Grading -> QA69-> Documentation -> Final Assessment -> Cleanup70```7172Local-only stages:7374- Brainstorming75- Merge76- Final output file collection for grading77- Tree grading aggregation78- Cleanup7980Subagent stages:8182- Spec83- Plan84- Architecture85- Dispatch86- Execution87- Validation88- Tree Classification89- Tree Rubric Generation90- Tree Rubric Verification91- Tree Rubric Refinement92- Tree Grading93- QA94- Documentation95- Final Assessment9697The legacy `Review` stage and PRE rubric remain as compatibility artifacts, but98the active quality gate is Tree Rubrics plus Tree Grading.99100## Non-Negotiable Rules101102- The orchestrator is the source of truth for `.pipeline-workspace/` artifacts.103- Merge, final output collection, grading aggregation, and Cleanup are104 orchestrator-local.105- Use conservative three-way merge semantics and pause for human resolution when106 automatic merge safety is ambiguous.107- Do not revert user edits or unrelated worktree changes.108- Dispatch owns skill routing. Later stages must not re-infer required skills.109- Spec and Plan use the bundled methodology references under110 `references/methodologies/` and must not attach external methodology skills.111- Execution applies the bundled frontend-design guidance when Dispatch routes112 `ce-frontend-design`.113- Validation must run before Tree Rubrics for every merged worker group unless114 it is explicitly skipped with evidence.115- Tree Grading uses 3 independent graders by default. Do not downgrade the116 grader count unless the user explicitly asks for a cheaper/faster pass.117- Tree Grading must judge only `spec`, `tree_rubrics_refined.json`, and118 `final-output-files.json`; do not grade process logs or agent behavior.119- QA must pass before Documentation and Final Assessment.120- Accepted runs write `.pipeline-last-run-summary.json` and remove121 `.pipeline-workspace/`; rejected or paused runs keep the workspace.122- Git publication is opt-in and orchestrator-local; subagents must not commit123 or push.124125## Stage Files126127Read the current stage prompt just before spawning or running that stage:128129| Stage | File | Required extra reference | Template |130|---|---|---|---|131| Spec | `agents/spec.md` | `references/contracts.md` | `templates/artifacts/spec.json` |132| Plan | `agents/plan.md` | `references/contracts.md` | `templates/artifacts/plan.json` |133| Architecture | `agents/architecture.md` | `references/contracts.md` | `templates/artifacts/architecture.json` |134| Dispatch | `agents/dispatch.md` | `references/contracts.md` | `templates/artifacts/dispatch.json` |135| Execution | `agents/execution.md` | `references/contracts.md` | `templates/artifacts/execution-report.json` |136| Validation | `agents/validation.md` | `references/contracts.md` | `templates/artifacts/validation-report.json` |137| Tree Classification | `agents/tree-classification.md` | `references/contracts.md` | `templates/artifacts/tree-classification.json` |138| Tree Rubric Generation | `agents/tree-rubric-generation.md` | `references/contracts.md` | `templates/artifacts/tree-rubrics.json` |139| Tree Rubric Verification | `agents/tree-rubric-verification.md` | `references/contracts.md` | `templates/artifacts/tree-rubric-verification.json` |140| Tree Rubric Refinement | `agents/tree-rubric-refinement.md` | `references/contracts.md` | `templates/artifacts/tree-rubrics-refined.json` |141| Tree Grading | `agents/tree-grading.md` | `references/contracts.md` | `templates/artifacts/tree-grading-individual.json` |142| QA | `agents/qa.md` | `references/contracts.md` | `templates/artifacts/qa-report.json` |143| Documentation | `agents/doc.md` | `references/contracts.md` | `templates/artifacts/doc-report.json` |144| Final Assessment | `agents/final-assessment.md` | `references/contracts.md` | `templates/artifacts/final-assessment.json` |145| Legacy Review | `agents/review.md` | `references/contracts.md`, `references/pre-rubric.md` | `templates/artifacts/review-individual.json` |146147## Host Notes148149### Codex150151Codex can use the runtime and stage catalog in `src/` plus the prompt templates152in `references/orchestrator-prompts.md`. Keep detailed Codex tool behavior in153`references/codex-execution-model.md`.154155### OpenCode156157OpenCode discovers `name` and `description` first, then loads this file through158the native `skill` tool only when needed. This entrypoint is intentionally short159and points to references on demand.160161Install the skill into one of OpenCode's skill search paths, for example:162163```text164.opencode/skills/multi-agent-pipeline/SKILL.md165~/.config/opencode/skills/multi-agent-pipeline/SKILL.md166```167168For a copy-ready expert primary agent, use169`templates/opencode-expert-agent.md` with the guidance in170`references/opencode-expert-mode.md`.171172## Runtime173174The Node runtime under `src/runtime/` implements the documented contracts for175artifact storage, stage catalogs, merge, complexity analysis, validation flow,176Tree Rubrics, Tree Grading, final assessment, cleanup summaries, token/context177optimization, cache observability, research harnesses, agent traces, state178snapshots, governance reports, protocol sandboxes, and Codex pet events.179Optional Git publication uses gitmoji plus Conventional Commits style Chinese180messages. Run tests from the skill package root with:181182```text183npm test184```