workflow
Workflow
Overview
Create and execute controller-side delivery workflows that sit above agent-team.
Keep workflow templates reusable, keep run state separate, and use the Go-based
agent-team workflow helpers in this repository for template generation,
validation, and run-state persistence.
Hard Rules
- Act as the main controller only. Do not use this skill inside a worker session.
- Do not modify
agent-teamsource code, config schema, or internal protocol. - Require an approved brainstorming/design artifact before writing a new workflow file.
- Keep template files and run-state files separate at all times.
- Use existing
agent-teamcommands as the only execution backend. - Persist state after every node transition and before every pause or confirmation gate.
Default Paths
Use these defaults unless the user explicitly chooses another project-local path:
- Workflow templates:
.agents/workflow/<workflow-name>.yaml - Run-state files:
.agents/workflow/runs/<workflow-name>/<run-id>.yaml
Prefer a single reusable workflow template and one run-state file per execution.
Action Routing
Create Workflow
Use this flow when the user asks to create a workflow file.
- Verify there is an approved brainstorming/design artifact.
- If no approved design exists, stop and invoke
brainstormingfirst. - Choose the smallest preset that matches the design:
branchingfor controller dispatch with explicitdev_first/test_firstdev-firstfor a linear implement-then-verify looptest-firstfor tests-before-implementation
- Generate the template with
agent-team workflow create. - Validate it immediately with
agent-team workflow validate. - Summarize the generated roles, entry node, branches, and output path.
Example:
agent-team workflow create feature-delivery \
--preset branching \
--output .agents/workflow/feature-delivery.yaml
agent-team workflow validate .agents/workflow/feature-delivery.yaml
Run Workflow
Use this flow when the user asks to run workflow.yaml, resume a run, or inspect workflow progress.
- Validate the workflow template before execution.
- Initialize run state with
agent-team workflow state initunless resuming an existing run. - Resolve each workflow role alias to a concrete worker at runtime.
- Create or reuse workers with
agent-team worker createandagent-team worker open. - Execute the current node, then persist state with
agent-team workflow state .... - Pause on worker wait states, ambiguous outcomes, or controller confirmations.
- Resume by reading the run-state file and continuing from
current_node.
Example bootstrap:
agent-team workflow validate .agents/workflow/feature-delivery.yaml
agent-team workflow state init .agents/workflow/feature-delivery.yaml
Execution Loop
Follow this controller loop for every run:
- Read the template and current run-state.
- Start the current node with
agent-team workflow state start. - Execute the node action:
controller_task: do the task directly, then complete or confirm it.assign_role_task: assign work to the mapped worker withagent-team worker assign.wait_for_completion: inspect worker status or wait for worker feedback.decision: choose an explicit branch outcome and record it.handoff: assign the follow-up task to the next role and capture the transfer in state.verify_or_test: run verification or dispatch QA verification, then branch on outcome.merge: runagent-team worker merge <worker-id>only after explicit controller approval.
- Persist one of these outcomes:
waitwhen waiting on worker feedback or external verificationblockwhen the run cannot advance without controller interventioncompletewhen the node finishes and can auto-advanceconfirmwhen a confirmation gate is satisfied and a branch is selected
- Stop when the run state becomes
completedorblocked.
Worker Preparation
Before the first role-backed node executes:
- Confirm every referenced role exists locally or can be installed.
- If a role is missing and must be created, follow the
role-creatorcontract instead of authoring role files manually. - Confirm whether to reuse an existing worker or create a new worker for each role alias.
- Open worker sessions before assignment so replies can flow back to the controller.
agent-team commands are the bridge layer:
agent-team worker create <role-name>
agent-team worker open <worker-id>
agent-team worker assign <worker-id> "<task>"
agent-team worker status
agent-team reply <worker-id> "<answer>"
agent-team worker merge <worker-id>
Confirmation And Branching
- Treat
requires_confirmation: trueas a hard pause. - Do not auto-select a branch when worker feedback is ambiguous.
- Prefer workflow-defined branch labels such as
test_first,dev_first,passed, andfailed. - Re-run a completed node only when the controller explicitly asks for a retry.
Use agent-team workflow state confirm to resolve confirmation nodes deterministically.
References
- Read references/schema.md when you need the workflow and run-state schema.
- Read references/execution.md when you need the node-type execution contract and controller behavior.
Commands
agent-team workflow create: generate a starter workflow template from a supported preset.agent-team workflow validate: fail-fast validation for workflow structure and node references.agent-team workflow state ...: initialize, inspect, and update run-state files during execution.