agentsclimarketplace

Orchestrator protocol

Skill TechyShishy/code-forge/skills/orchestrator-protocol

Shared protocol reference for the load-task → implement pipeline. Defines team topology, message envelope formats, result block definitions, brief contract, review severity handling, stall detection, worktree conventions, and failure handling. Load before running /load-task or /implement.From its SKILL.md

Install
npx -y skills add TechyShishy/code-forge --skill orchestrator-protocol

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

15.5 KB, as published. Nobody here has run it

Orchestrator Protocol — load-task → implement Pipeline

This is a reference spec, not a walkthrough. It defines shared vocabulary for the /load-task → /implement pipeline. Both skills reference this document rather than repeating these definitions inline.

Contents


Team Topology

The pipeline uses a single named team, pipeline-team, with agents spawned just-in-time as each phase begins.

RoleMember nameModelPurposeSpawned by
ResearcherresearcherHaikuBacklog research, issue selection, Task Brief production/load-task or /describe-task
EditoreditorHaiku (default) or SonnetImplementation, file edits, staging, commits/implement Step 3 (upfront filter selects model)
ReviewerreviewerSonnetCode review, findings by severity/implement Step 3

Editor model selection. By default /implement spawns code-forge:editor-haiku-agent. It spawns code-forge:editor-agent (Sonnet) instead when the brief contains 2 or more upfront escalation signals: Large effort label, 4+ files in the relevant-files list, architectural scope, or design-level risks. The Haiku editor may escalate mid-task via NEEDS_STRONGER_MODEL, at which point the orchestrator spawns a Sonnet editor with hint-only handoff context.

Just-in-time spawning. /load-task and /describe-task call TeamCreate(name: "pipeline-team") to create an empty team container, then spawn the researcher via Agent(subagent_type: "code-forge:researcher-agent", team_name: "pipeline-team"). /implement spawns editor and reviewer into the existing team via two Agent calls (no TeamCreate) before dispatching work.

SendMessage uses team member names, not UUIDs. Names remain addressable when agents idle and resume.

The orchestrator routes; it does not implement, research, or review.


Coordination Rules

All state transitions are driven exclusively by the task list (TaskCreate + TaskUpdate) and synchronous result delivery via SendMessage (RESULT).

Banned in all pipeline agents (researcher, editor, reviewer): /loop, /schedule, and any pattern that calls ScheduleWakeup or arms Monitor tasks — directly or via a delegated subagent. These schedule async wakeups that race task-list transitions and leave orphaned Monitor tasks after orchestration completes. Use task-list assignment for all coordination.


Sentinel Task Pattern

The UI auto-clears the task list 5 seconds after the last task transitions to completed. In the research phase, the researcher is the only worker task — when it completes, the cleanup timer starts immediately, racing the orchestrator's attempt to read back result_block.

Fix: the orchestrator creates a sentinel task assigned to team-lead and sets it to in_progress before spawning the researcher. As long as the sentinel is in progress, the "all completed" condition never fires. The orchestrator completes the sentinel only after it has read and emitted the researcher's result.

Sentinel lifecycle

orchestrator creates sentinel → assigns to team-lead (in_progress)
  → spawns researcher → researcher completes
  → orchestrator wakes, reads result_block (sentinel still in_progress)
  → orchestrator emits brief to user
  → orchestrator completes sentinel

Sentinel task shape

TaskCreate(
  subject     = "Pipeline orchestration — <PIPELINE_RUN_ID>",
  description = "Held in_progress by the team-lead to prevent UI auto-cleanup of the task list while the orchestrator reads back researcher results.",
  metadata    = {
    pipeline_run_id: "<PIPELINE_RUN_ID>",
    role:            "team-lead",
    phase:           "orchestration",
    ...standard null/false defaults...
  }
)

The role: "team-lead" value identifies this as an orchestrator-owned task (not a teammate task). See task-list-schema.md for the full schema.


Message Envelope Formats

All assignment coordination uses the task list (TaskCreate + TaskUpdate). SendMessage is used for result delivery (RESULT). The formats below document the active format and retained historical formats.

ASSIGN_EDIT (historical — removed)

Historical reference only. This SendMessage envelope was sent by the orchestrator during the backward-compatibility period. It has been removed. Assignment now uses task-list only (TaskCreate + TaskUpdate).

ASSIGN_REVIEW (historical — removed)

Historical reference only. This SendMessage envelope was sent by the orchestrator during the backward-compatibility period. It has been removed. Assignment now uses task-list only (TaskCreate + TaskUpdate).

TASK_DONE (historical)

Historical reference only. Superseded by the unified RESULT envelope. Retained for documentation of the transition period.

TASK_DONE
task_id: <id>
result_block: <name of the result block in this message>

Followed immediately by the result block.

TASK_FAILED (historical)

Historical reference only. Superseded by the unified RESULT envelope. Retained for documentation of the transition period.

TASK_FAILED
task_id: <id>
reason: <short description>
files_modified: <list or "none">
recommended_action: <what the orchestrator or user should do next>

RESULT

Sent by teammate to orchestrator on task completion (success, failure, or escalation). Replaces the role-specific TASK_DONE formats in new implementations; TASK_DONE remains valid during the transition period (see TASK_DONE).

RESULT
task_id: <id>
agent: <researcher | editor | reviewer>
status: <success | failure | escalation>
result_type: <Task Brief | Changeset Summary | Commit Completion | HUMAN_ESCALATION | NEEDS_STRONGER_MODEL | Failure Report | Review Findings>

Followed immediately by the result body block.

Field descriptions:

  • task_id: Echoes the task_id from the originating ASSIGN_* envelope.
  • agent: Sender's role — researcher, editor, or reviewer.
  • status: success — task completed; failure — acceptance criteria cannot be met; escalation — task exceeds safe scope.
  • result_type: Names the result block that follows (see Result Block Definitions).

Dispatcher routing table (status, result_type) → orchestrator action:

statusresult_typeOrchestrator action
successTask BriefValidate fields; emit brief to user
successChangeset SummaryDispatch code-forge:reviewer-agent via task-list assignment
successCommit CompletionEmit result; call ExitWorktree(action=remove)
successReview FindingsParse severity tags; apply Review Severity Handling
failureFailure ReportEmit verbatim; call ExitWorktree(action=keep); stop
escalationHUMAN_ESCALATIONSurface to user; stop
escalationNEEDS_STRONGER_MODELSpawn Sonnet editor (code-forge:editor-agent) with hint-only handoff; re-dispatch implementation task

Full dispatcher implementation is defined in Issue 0083.


Result Block Definitions

Task Brief v1

Required fields (validated by /load-task before emitting):

  • **Issue:** — GitHub issue #N, TODO-NNNN, TODO@file:line, DESCRIBE-<slug>, or local issue NNNN (zero-padded number, no prefix)
  • **Title:** — issue title, TODO summary, or description
  • **Type:** — Bug | Chore | Enhancement
  • **Effort:** — Small | Medium | Large
  • ### Acceptance criteria — bulleted list of criteria
  • ### Risks and unknowns — section present (may be empty)

Full format defined in code-forge:researcher-protocol.

Changeset Summary

Returned by code-forge:editor-agent on successful implementation. Required fields:

  • **Issue:** — issue ID from brief
  • **Model:** — editor's model name
  • **Worktree path:** — absolute worktree path
  • ### Files changed — table of file paths and descriptions
  • ### Test results — test command and outcome
  • ### Proposed commit subject — imperative sentence, ≤50 chars
  • ### Issue reference — Fixes #N / Closes #N / Fixes TODO-NNNN

Review Findings

Returned by code-forge:reviewer-agent. Findings are tagged by severity bracket:

  • [MUST FIX] — blocking: correctness, safety, or acceptance criteria violations
  • [SHOULD FIX] — non-blocking: code quality, maintainability, style
  • [CONSIDER] — optional: suggestions without strong recommendation
  • [GOOD] — positive findings

Full findings format:

FINDINGS: [severity-bracketed findings].

HUMAN_ESCALATION

Returned by any editor when the task requires human judgment and cannot be completed by any automated agent. Required fields:

  • **Issue:** — issue ID
  • ### Why escalation is needed — concrete reason requiring human judgment
  • ### Files that would need changes — list
  • ### Files modified (if any) — list or omit

Orchestrator response: surface to user, stop. Do not proceed to review silently.

NEEDS_STRONGER_MODEL

Returned by code-forge:editor-haiku-agent when mid-implementation signals indicate the task exceeds Haiku's safe scope. Required fields:

  • **Issue:** — issue ID
  • ### Why stronger model is needed — concrete mid-task signal
  • ### Partial edits made (hints for Sonnet) — files modified and what was attempted (hints only)
  • ### Recommended entry point — where Sonnet should begin

Orchestrator response: spawn code-forge:editor-agent (Sonnet) with the NEEDS_STRONGER_MODEL block as handoff context; mark the original implementation task metadata with escalated: true before re-dispatching. Sonnet re-verifies Haiku's partial edits rather than treating them as authoritative. One model escalation per run — if the Sonnet editor returns NEEDS_STRONGER_MODEL, surface as a HUMAN_ESCALATION and stop.

Failure Report

Returned by code-forge:editor-agent when acceptance criteria cannot be met. Required fields:

  • **Issue:** — issue ID
  • **Phase:** — Implementation
  • ### What failed — description
  • ### Files modified (if any) — list or omit
  • ### Recommended next step — user-facing guidance

Orchestrator response: emit verbatim, call ExitWorktree with action=keep, stop.

Commit Completion

Returned by code-forge:editor-agent after staging, committing, and cherry-picking. Required fields:

  • **Issue:** — issue ID
  • **Commit SHA:** — short SHA
  • **Cherry-pick:** — success or failure reason
  • Details: — committed subject, files staged, cherry-pick target

Brief Contract

The brief contract has two checkpoints, each enforced by a different skill.

Required fields (enforced by /load-task)

Before emitting the Task Brief to the user, /load-task verifies:

  • **Issue:** present and non-empty
  • **Title:** present and non-empty
  • **Type:** present and one of: Bug, Chore, Enhancement
  • **Effort:** present and one of: Small, Medium, Large
  • ### Acceptance criteria section present and non-empty
  • ### Risks and unknowns section present

If any field is missing, /load-task surfaces the partial brief with a gap note and does not emit it.

Sufficiency red flags (enforced by /implement)

Before spawning the editor, /implement validates the brief for implementation sufficiency. The following are red flags:

  1. Unclear entry points — "Relevant files" section missing, file paths ambiguous, or no clear starting point
  2. Ambiguous acceptance criteria — criteria use conditional language, have multiple interpretations, or lack concrete test cases
  3. Unresolved risks — "Risks and unknowns" flags unresolved blockers
  4. Multiple valid approaches — brief lists 2+ distinct strategies without recommending one

If 2 or more red flags are present, the brief is insufficient: /implement bails out and directs the user back to /load-task.


Review Severity Handling

How the orchestrator handles each severity tag from the reviewer:

TagOrchestrator action
[GOOD]No action. Proceed.
[CONSIDER]Skip. No dispatch. Proceed.
[SHOULD FIX]Dispatch once to code-forge:editor-agent via task-list assignment (task: edit-should-fix). No re-review after. Proceed to commit.
[MUST FIX]Enter the fix loop (see Stall Detection). Loop until no MUST FIX items remain or a stall is detected.

Stall Detection

Applies to the MUST FIX fix loop (Phase 6.2 of /implement). If MUST FIX items remain unchanged across 2 consecutive fix rounds, a stall is detected. See stall-detection.md for the fingerprint definition, detection rules, loop procedure, and stall handler.


Worktree Conventions

  • Naming: run-<YYYYMMDDTHHmmss> format — e.g., run-20260531T143000. The worktree is created by the orchestrator before spawning the researcher, and the session remains in it through /implement.
  • Pipeline run ID: PIPELINE_RUN_ID is generated once by /load-task or /describe-task (format: run-<YYYYMMDDTHHmmss>) and stored in metadata.pipeline_run_id on every task they create, including the sentinel and researcher tasks. /implement reads PIPELINE_RUN_ID from the sentinel task's metadata — it does not generate a new ID. This ensures all tasks across both phases share the same ID and are found by the archiving sweep.
  • Brief storage: the researcher writes the Task Brief to brief.md in the worktree root. The orchestrator reads it back as a relative path (brief.md) since the session remains in the same worktree. task.metadata.result_block is not used for brief content.
  • Team members: agents are spawned into the worktree directory and operate in pwd. No path passing is needed — agents use their current working directory as the base for all file and git operations.
  • Fork subagents: inherit parent working directory.
  • ExitWorktree semantics:
    • action=keep — preserve worktree for inspection (use on failure or user request).
    • action=remove — clean up worktree after successful commit.
    • Prompt user before calling ExitWorktree if outcome is ambiguous.

Failure Handling

On any failure response from a teammate, emit verbatim, preserve the worktree, and stop. See failure-handling.md for per-type handling (Failure Report, HUMAN_ESCALATION, NEEDS_STRONGER_MODEL, team coordination failure).

Keep looking

Skills are one crate of 607,721. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.