Orthogonal
Agent Team Skills

Engineering Workflow

Agent team engineering workflow overview — orchestrator, workers, handoffs, and phase lifecycle.

Human-only overview. Not a runtime contract for agents.

Canonical runtime source of truth:

  • SKILL.md
  • orchestrator/ENTRY.md
  • implementation-prompt-gen/ENTRY.md
  • implementation-agent/ENTRY.md
  • review-agent/ENTRY.md

If this README conflicts with runtime docs, runtime docs win.

Migration Note

This skill's naming history is:

  • pfccortexorchestrator

For this skill, treat any legacy pfc or cortex reference as orchestrator.

Contract Alignment

This README is aligned to:

  • .skills/.contracts/agent-identity-routing-contract.md
  • .skills/.contracts/handoff-contract.md
  • .skills/.contracts/execution-boundary-contract.md

Canonical Actors (This Skill Scope)

ClassNodeCanonical IDResponsibility
Orchestratorengineer-workflowOrchestrator::engineer-workflowOwns orchestration, gate decisions, dispositions, and phase transition control for this skill.
Workerprompt-genWorker::prompt-genGenerates sub-phase implementation prompts.
WorkerimplementationWorker::implementationProduces artifacts and code for each sub-phase.
WorkerreviewWorker::reviewPerforms gate reviews and returns structured review handoffs.
Workerpreflight-cleanup-execWorker::preflight-cleanup-execExecutes deterministic pre-flight cleanup operations (parent-repo non-submodule dirty-tree + branch readiness) and returns cleanup status.
Workerphase-planning-execWorker::phase-planning-execPrepares decomposition-input manifests during phase transition.
WorkerdecompositionWorker::decompositionProduces next-phase decomposition output.
Workersubphase-close-execWorker::subphase-close-execExecutes deterministic sub-phase close operations (commit/push/PR/merge/sync) and returns close status.
Workerphase-close-execWorker::phase-close-execExecutes deterministic phase-close Stage 1 operations and returns phase-close completion status.

Invariants Applied

  • Worker::* handoffs route only to Orchestrator::engineer-workflow.
  • Orchestrator::engineer-workflow is the only control endpoint in this skill.
  • No worker lane may bypass the orchestrator lane.
  • Repository mutation operations (cleanup/commit/push/merge) run only in dispatched worker lanes; Orchestrator governs by packeted dispatch/completion.
  • Every consumed handoff requires a disposition packet plus prose summary before the next dispatch.
  • The six-artifact sub-phase model remains mandatory:
    • Goals
    • SDS
    • Implementation Plan
    • Completion Report
    • User Documentation
    • Review

Entry Points

Entry PointModeEntry File
EP-001role_routerSKILL.md
EP-002task_orchestratororchestrator/ENTRY.md
EP-003phase_planning_execexec-agent/ENTRY.md
EP-004phase_decompositiondecomposition-agent/ENTRY.md
EP-005preflight_cleanup_execpreflight-agent/ENTRY.md
EP-006subphase_close_execclose-agent/ENTRY.md
EP-007phase_close_execphase-close-agent/ENTRY.md
EP-008implementation_prompt_genimplementation-prompt-gen/ENTRY.md
EP-009implementation_agentimplementation-agent/ENTRY.md
EP-010review_agentreview-agent/ENTRY.md

Entrypoint Step Paths

EP-001 — Role Router

StepActionPrimary SurfaceOutcome
1Read entrypoint_mode_slug and entrypoint_mode_slugs frontmatter.SKILL.mdMode context loaded
2Match requested mode to canonical role-entry mapping.SKILL.md, .skills/.contracts/skills-registry.yamlTarget lane selected
3Route execution to selected entry lane (EP-002..EP-010).SKILL.mdRouted
4Stop router lane.SKILL.mdTerminal

EP-002 — Task Orchestrator

StepActionPrimary SurfaceOutcome
1Run scope guard and admissibility checks.orchestrator/ENTRY.mdValid ingress or fail-close
2Dispatch prompt generation worker.orchestrator/templates/implementation-prompt-gen-dispatch-prompt.mdPrompt-gen dispatched
3Consume phase_prompt_generated, disposition it, validate single-packet invariants, then dispatch implementation lane with the generated plain-text prompt artifact.implementation-prompt-gen/responses/prompt-generated.md, implementation-prompt-gen/templates/phase-prompt.mdImplementation running
4For each artifact-ready handoff, dispatch review worker.orchestrator/templates/gate-review-prompt.mdReview cycle active
5Consume review_complete, emit handoff_disposition packet + prose, then emit gate_approval.orchestrator/responses/handoff-disposition.md, orchestrator/responses/gate-approval.mdGate advanced or revision requested
6If preflight blocked, dispatch preflight cleanup worker and then emit preflight resolution.orchestrator/templates/preflight-cleanup-dispatch-prompt.md, orchestrator/responses/preflight-resolution.mdPreflight resolved or blocked
7After user-documentation approval, dispatch synthesis review worker (review.mdx).orchestrator/templates/subphase-review-dispatch-prompt.mdSynthesis complete
8Dispatch sub-phase close worker and consume completion handoff.orchestrator/templates/subphase-close-dispatch-prompt.md, orchestrator/responses/subphase-close-complete.mdSub-phase closed
9If final sub-phase, execute phase-transition dispatch chain (phase-close, manifest, decomposition, decomposition review, readiness remediation loop, phase-close review).orchestrator/procedures/phase-transition.mdNext phase readiness or blocked

EP-003 — Phase Planning Exec

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::phase-planning-exec).exec-agent/ENTRY.mdValid ingress or fail-close
2Read Stage 2 planning requirements and source precedence.exec-agent/ENTRY.md, orchestrator/procedures/phase-transition.mdInputs validated
3Create/update decomposition-input-manifest.mdx with required sections.exec-agent/ENTRY.mdManifest ready
4Emit decomposition_manifest_complete.orchestrator/responses/decomposition-manifest-complete.mdHandoff sent
5Stop and wait for next ingress packet.exec-agent/ENTRY.mdTerminal

EP-004 — Phase Decomposition

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::decomposition).decomposition-agent/ENTRY.mdValid ingress or fail-close
2Consume decomposition manifest + Stage 2 constraints.decomposition-agent/ENTRY.mdInputs validated
3Produce next-phase sub-phase specs in .architecture/roadmap/phase-(X+1)/.decomposition-agent/ENTRY.mdSpecs ready
4Emit phase_decomposition_complete.orchestrator/responses/phase-decomposition-complete.mdHandoff sent
5Stop and wait for next ingress packet.decomposition-agent/ENTRY.mdTerminal

EP-005 — Preflight Cleanup Exec

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::preflight-cleanup-exec).preflight-agent/ENTRY.mdValid ingress or fail-close
2Inspect dirty scope in parent repo non-submodule paths only (submodule repos/branches/gitlink refs are ignored in pre-flight).preflight-agent/ENTRY.mdScope mapped
3Commit parent repo non-submodule updates grouped by concern.preflight-agent/ENTRY.mdParent clean
4Align/create target sub-phase branch and verify readiness.preflight-agent/ENTRY.mdBranch ready
5Confirm parent-repo non-submodule tree is clean and branch requirements are satisfied.preflight-agent/ENTRY.mdReady
6Emit preflight_cleanup_complete.orchestrator/responses/preflight-cleanup-complete.mdHandoff sent

EP-006 — Subphase Close Exec

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::subphase-close-exec).close-agent/ENTRY.mdValid ingress or fail-close
2Commit submodule changes first.close-agent/ENTRY.mdSubmodule commit phase complete
3Commit parent repo changes grouped by concern.close-agent/ENTRY.mdParent commit phase complete
4Push submodules and sub-phase branch.close-agent/ENTRY.mdRemote updated
5Open and merge PR (phase-X.Y/*phase-X).close-agent/ENTRY.mdMerge complete
6Sync/push phase-X.close-agent/ENTRY.mdPhase branch synchronized
7Emit subphase_close_complete.orchestrator/responses/subphase-close-complete.mdHandoff sent

EP-007 — Phase Close Exec

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::phase-close-exec).phase-close-agent/ENTRY.mdValid ingress or fail-close
2Generate required phase-close artifacts (subphase-merge-audit, e2e-*, acceptance-audit, roadmap-sync-record).phase-close-agent/ENTRY.mdArtifacts written
3Execute verification + dynamic E2E and reconciliation loop if needed.phase-close-agent/ENTRY.mdChecks resolved or blocked
4Merge phase-X into dev and sync dev branch.phase-close-agent/ENTRY.mdMerge/sync complete
5Perform branch cleanup under policy.phase-close-agent/ENTRY.mdCleanup complete
6Emit phase_close_complete.orchestrator/responses/phase-close-complete.mdHandoff sent

EP-008 — Implementation Prompt Gen

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::prompt-gen).implementation-prompt-gen/ENTRY.mdValid ingress or fail-close
2Read template + phase spec + previous completion/review + ADR index.implementation-prompt-gen/ENTRY.mdInputs loaded
3Fill all variables in phase prompt template and include canonical envelope.implementation-prompt-gen/templates/phase-prompt.mdPrompt complete
4Emit phase_prompt_generated packet with plain-text prompt artifact (no nested packet envelope) and stop disposable lane.implementation-prompt-gen/responses/prompt-generated.mdTerminal

EP-009 — Implementation Agent

StepActionPrimary SurfaceOutcome
1Run scope guard and branch/tree preflight checks.implementation-agent/ENTRY.mdReady or preflight_blocked
2Execute gate sequence: Goals → SDS → Plan → Implement → Verify → Ratify → Document.implementation-agent/ENTRY.mdArtifact progression
3After each artifact/revision, emit packet-only artifact_ready_for_review and wait.implementation-agent/responses/artifact-ready-for-review.mdApproval-needed state
4On implementation blockers, emit execution_blocked and wait for execution_resolution.implementation-agent/responses/execution-blocked.md, orchestrator/responses/execution-resolution.mdBlocked/resolved
5On verify blockers, emit verify_blocked and wait for verify_resolution.implementation-agent/responses/verify-blocked.md, orchestrator/responses/verify-resolution.mdBlocked/resolved
6Do not commit; do not edit .skills/; stop at valid terminal handoff states only.implementation-agent/ENTRY.mdContract-compliant terminal

EP-010 — Review Agent

StepActionPrimary SurfaceOutcome
1Run scope guard (Worker::review).review-agent/ENTRY.mdValid ingress or fail-close
2Read dispatched artifact + review template + required context only.review-agent/ENTRY.mdReview context loaded
3Write/append review file at dispatched output path.review-agent/ENTRY.mdReview artifact written
4Emit review_complete packet and stop.review-agent/responses/review-complete.mdTerminal

Detailed Path (Step + Handoff)

StepSource → TargetActionPrimary SurfaceRequired
1Role Router → Orchestrator::engineer-workflowResolve lane and route to entry pointSKILL.mdyes
2Orchestrator::engineer-workflowWorker::prompt-genDispatch phase prompt generationorchestrator/templates/implementation-prompt-gen-dispatch-prompt.mdyes
3Worker::prompt-genOrchestrator::engineer-workflowReturn phase_prompt_generated packet with filled plain-text phase promptimplementation-prompt-gen/responses/prompt-generated.mdyes
4Orchestrator::engineer-workflowWorker::implementationDispatch sub-phase executionimplementation-prompt-gen/templates/phase-prompt.mdyes
5Worker::implementationOrchestrator::engineer-workflowEmit artifact-ready packetimplementation-agent/responses/artifact-ready-for-review.mdyes
6Orchestrator::engineer-workflowWorker::reviewDispatch gate revieworchestrator/templates/gate-review-prompt.mdyes
7Worker::reviewOrchestrator::engineer-workflowReturn review completionreview-agent/responses/review-complete.mdyes
8Orchestrator::engineer-workflow → internal state machineRecord disposition decision event + prose summary (no downstream routing target)orchestrator/responses/handoff-disposition.mdyes
9Orchestrator::engineer-workflowWorker::implementationEmit gate approval/revision resultorchestrator/responses/gate-approval.mdyes
10Worker::implementationOrchestrator::engineer-workflowOptional preflight blocked packetimplementation-agent/responses/preflight/*.mdoptional
11Orchestrator::engineer-workflowWorker::preflight-cleanup-execDispatch deterministic pre-flight cleanup executionorchestrator/templates/preflight-cleanup-dispatch-prompt.mdoptional
12Worker::preflight-cleanup-execOrchestrator::engineer-workflowReturn pre-flight cleanup completion/blocked statusorchestrator/responses/preflight-cleanup-complete.mdoptional
13Orchestrator::engineer-workflowWorker::implementationOptional preflight resolutionorchestrator/responses/preflight-resolution.mdoptional
14Orchestrator::engineer-workflowWorker::reviewDispatch sub-phase synthesis review (review.mdx)orchestrator/templates/subphase-review-dispatch-prompt.mdyes
15Worker::reviewOrchestrator::engineer-workflowReturn synthesis review completionreview-agent/responses/review-complete.mdyes
16Orchestrator::engineer-workflowWorker::subphase-close-execDispatch deterministic sub-phase close executionorchestrator/templates/subphase-close-dispatch-prompt.mdyes
17Worker::subphase-close-execOrchestrator::engineer-workflowReturn sub-phase close completion/blocked statusorchestrator/responses/subphase-close-complete.mdyes
18Orchestrator::engineer-workflowWorker::phase-close-execDispatch deterministic phase-close Stage 1 executionorchestrator/templates/phase-close-dispatch-prompt.mdyes
19Worker::phase-close-execOrchestrator::engineer-workflowReturn phase-close completion/blocked statusorchestrator/responses/phase-close-complete.mdyes
20Orchestrator::engineer-workflowWorker::phase-planning-execDispatch decomposition-input manifest preparationorchestrator/templates/decomposition-manifest-dispatch-prompt.mdyes
21Worker::phase-planning-execOrchestrator::engineer-workflowReturn manifest completionorchestrator/responses/decomposition-manifest-complete.mdyes
22Orchestrator::engineer-workflowWorker::decompositionDispatch phase decompositionorchestrator/templates/phase-decomposition-dispatch-prompt.mdyes
23Worker::decompositionOrchestrator::engineer-workflowReturn decomposition completionorchestrator/responses/phase-decomposition-complete.mdyes
24Orchestrator::engineer-workflowWorker::reviewDispatch decomposition revieworchestrator/templates/decomposition-review-dispatch-prompt.mdyes
25Worker::reviewOrchestrator::engineer-workflowReturn decomposition review completionreview-agent/responses/review-complete.mdyes
26Orchestrator::engineer-workflow.worklogRecord readiness gate state transition for next phaseorchestrator/procedures/phase-transition.mdyes
27Orchestrator::engineer-workflowWorker::preflight-cleanup-execOptional readiness remediation dispatch when phase-(X+1) branch is missingorchestrator/templates/preflight-cleanup-dispatch-prompt.mdoptional
28Worker::preflight-cleanup-execOrchestrator::engineer-workflowOptional readiness remediation completion/blocked statusorchestrator/responses/preflight-cleanup-complete.mdoptional
29Orchestrator::engineer-workflowWorker::reviewDispatch phase-close review artifact generationorchestrator/templates/phase-close-review-dispatch-prompt.mdyes
30Worker::reviewOrchestrator::engineer-workflowReturn phase-close review completionreview-agent/responses/review-complete.mdyes

Flow Diagram

Sequence Diagram

Handoff Visibility Points

IDDirectionSurfacePurposeRequired
HF-DISPinternal control event in Orchestrator::engineer-workfloworchestrator/responses/handoff-disposition.mdDurable disposition/state-transition transparency per consumed handoffyes
HF-PRE-CLEANWorker::preflight-cleanup-execOrchestrator::engineer-workfloworchestrator/responses/preflight-cleanup-complete.mdDeterministic pre-flight cleanup completion handoff before implementation resumesoptional
HF-PRE-RSLVOrchestrator::engineer-workflowWorker::implementationorchestrator/responses/preflight-resolution.mdResolve preflight blockers before execution resumesoptional
HF-GATEOrchestrator::engineer-workflowWorker::implementationorchestrator/responses/gate-approval.mdGate verdict handoff to implementation laneyes
HF-REVIEW-SYNTHWorker::reviewOrchestrator::engineer-workflowreview-agent/responses/review-complete.mdFinal sub-phase review synthesis completion handoff (review.mdx)yes
HF-CLOSEWorker::subphase-close-execOrchestrator::engineer-workfloworchestrator/responses/subphase-close-complete.mdDeterministic close completion handoff before next sub-phase dispatchyes
HF-PHASE-CLOSEWorker::phase-close-execOrchestrator::engineer-workfloworchestrator/responses/phase-close-complete.mdDeterministic phase-close Stage 1 completion handoffyes
HF-MANIFESTWorker::phase-planning-execOrchestrator::engineer-workfloworchestrator/responses/decomposition-manifest-complete.mdDurable manifest completion handoffyes
HF-DECOMPWorker::decompositionOrchestrator::engineer-workfloworchestrator/responses/phase-decomposition-complete.mdDurable decomposition completion handoffyes
HF-DECOMP-REVIEWWorker::reviewOrchestrator::engineer-workflowreview-agent/responses/review-complete.mdDecomposition review completion handoffyes
HF-PHASE-CLOSE-REVIEWWorker::reviewOrchestrator::engineer-workflowreview-agent/responses/review-complete.mdPhase-close review completion handoff (Cortex-phase-close-review.mdx)yes

Example Handoff Packet

Every handoff between agents is a structured YAML-frontmatter packet followed by a body. Here's what a real handoff_disposition packet looks like — this is the Orchestrator recording its gate decision after reviewing a completion report:

---
nous:
  v: 2
  route:
    emitter:
      class: Orchestrator
      node: engineer-workflow
      id: Orchestrator::engineer-workflow
    target:
      class: Orchestrator
      node: engineer-workflow
      id: Orchestrator::engineer-workflow
  envelope:
    direction: internal
    type: response_packet
    workflow: engineer-workflow-sop
    action: handoff_disposition
  correlation:
    handoff_id: HF-DISPOSITION-001
    correlation_id: phase-1.2-completion-report-cycle-1
    cycle: 1
    emitted_at_utc: 2026-02-23T19:49:06.250Z
    emitted_at_unix_ms: 1771876146250
    sequence_in_run: 7
  payload:
    schema: handoff-disposition.v1
    artifact_type: completion-report
  retry:
    policy: value-proportional
    depth: iterative
    importance_tier: high
    expected_quality_gain: 0.25
    estimated_tokens: 1800
    estimated_compute_minutes: 1.0
    token_price_ref: .worklog/benchmarks/pricing-rates-stub.mdx
    compute_price_ref: .worklog/benchmarks/pricing-rates-stub.mdx
    decision: accept
    decision_log_ref: .worklog/phase-1/phase-1.2/reviews/completion-report.mdx
    benchmark_tier: nightly
    self_repair:
      required_on_fail_close: true
      orchestration_state: deferred
      approval_role: Cortex:System
      implementation_mode: dispatch-team
      plan_ref: .worklog/benchmarks/self-repair/full-plan-todo.mdx
---

source_handoff_id: HF-008
disposition_status: accepted
decision_ref: .worklog/phase-1/phase-1.2/reviews/completion-report.mdx
next_action: advance_to_next_gate
next_dispatch_ref: n/a

Key things to notice:

  • nous.v: 2 — protocol version for packet schema
  • route — who emitted and who receives (both Orchestrator here, since dispositions are internal state events)
  • envelope — packet type, workflow, and action name
  • correlation — links this packet to a specific artifact review cycle with timestamps and sequence number
  • payload.schema — declares which schema validates the body
  • retry — cost-aware decision metadata: token estimates, quality gain, and whether to accept/revise
  • retry.self_repair — if the gate fails closed, the system can attempt automated repair via the dispatch team
  • Body — the actual disposition: accepted, with a ref to the review log and what happens next

This packet structure is what makes the multi-agent workflow auditable — every decision, every handoff, every gate verdict is a durable, traceable record.

Optional External Boundary Packets

These templates remain available for external principal-bridge integrations, but they are outside this skill's internal orchestrator/worker lane model:

  • orchestrator/responses/principal-e2e-handoff-request.md
  • orchestrator/responses/principal-e2e-execution-report.md
  • orchestrator/responses/principal-carry-forward-approval.md
  • orchestrator/responses/principal-creative-direction-signoff.md

Maintenance

  • Update runtime contracts first (SKILL.md, role ENTRY.md, templates/procedures).
  • Keep mirrored templates synchronized with scripts/check-template-sync.ps1.
  • Re-run validators:
    • python .skills/.system/skill-creator/scripts/quick_validate.py .skills/engineer-workflow-sop
    • pwsh -File .skills/engineer-workflow-sop/scripts/check-reinforcement-contract.ps1
    • pwsh -File .skills/engineer-workflow-sop/scripts/check-template-sync.ps1
  • Refresh this README after runtime changes.

On this page