Workflows

A workflow is the orchestration layer: an ordered, declarative plan that routes one request through several agents — some in sequence, some in parallel — and defines what "done" means. Workflows are the core differentiator: the engine produces a deterministic execution plan from YAML, with no model calls and no orchestration server.

Workflow reference

yaml
name: feature-development # required, kebab-case
description: Full feature implementation workflow # required, <= 500 chars
version: 1 # required, positive integer
tags: # optional, defaults to []
  - feature
steps: # optional, defaults to []
  - agent: tech-lead # sequential step
  - parallel: # concurrent group (never empty)
      - agent: backend-architect
        skills: # optional per-step skills
          - postgres
      - agent: frontend-specialist
  - agent: test-automator
  - agent: security-auditor
  - agent: code-reviewer
  - agent: shipper

Step shapes (a step is exactly one of these, and the loader says so in its error):

  • Agent step: { agent: <name>, skills?: [<skill>, ...] } — runs next in order; the named skills are preserved into the plan for that step.
  • Parallel group: { parallel: [agent step, ...] } — at least one agent; all members run concurrently after the previous step.

Validation happens in layers:

  1. Schema (load time): shapes, names, unknown keys.
  2. Loader (cross-artifact): every referenced agent and skill must exist — unknown workflow agents/skills are errors, as are duplicate artifact names.
  3. Quality (agentkrew validate): circular references in the kit reference graph are reported deterministically, and any workflow starting with tech-lead fails with spec-first-gate unless the tech-lead body carries the approval gate (.agentkit/runs/, spec.md, status: approved).

From YAML to an execution plan

The engine compiles steps into a plan whose JSON form mirrors the YAML structure:

json
{
  "workflow": "feature-development",
  "steps": [
    { "agent": "tech-lead" },
    {
      "parallel": [
        "backend-architect",
        "frontend-specialist",
        "database-specialist"
      ]
    },
    { "agent": "test-automator" },
    { "agent": "security-auditor" },
    { "agent": "code-reviewer" },
    { "agent": "shipper" }
  ]
}

Same kit version + same configuration → same plan, byte for byte. Per-step skills travel with their step rather than being flattened away.

How workflows run in a runtime

No supported runtime has a native "workflow" object, so the adapter renders the plan where the runtime can execute it:

  • The plan is embedded verbatim in every generated command and workflow file ("Step 1: tech-lead / Step 2 (parallel): …"), so the session executes it as ordinary agent delegation — sequential steps in order, parallel groups spawned together.
  • Each workflow also renders as a standalone invocable entry: .claude/skills/workflow-<name>/SKILL.md (/workflow-<name>), .opencode/commands/workflow-<name>.md (/workflow-<name>), or .agents/skills/workflow-<name>/SKILL.md on Codex ($workflow-<name>).
  • The engine itself never calls a model — orchestration happens inside your runtime session, driven by the embedded plan.

Approval gates

feature-development is spec-first: tech-lead writes .agentkit/runs/<id>/spec.md with status: draft and the turn ends at the approval question; implementation starts on the next user message once the line reads status: approved (implementers check the file and refuse otherwise). bug-fix carries a lighter diagnosis gate (.agentkit/runs/<id>/diagnosis.md). Both gates accept --auto for small tasks. review is ungated.

Where outputs land

Workflows that write code leave their output in the repo: the implementation, tests, and diff are the record. Workflows that write documents persist them as files, so nothing lives only in the chat transcript:

  • Marketing campaigns (marketing-campaign, plus the marketing steps of product-launch and feature-launch) write one file per step plus a compiled campaign overview to docs/marketing/. The chat reply names the paths with the key verdicts; detail lives on disk.
  • Reviews (review) write one file per reviewer plus a compiled report to docs/reviews/.

Agents never overwrite an existing output file — a rerun versions it (-v2, -v3, …).

Inspecting workflows

bash
agentkrew list workflows --installed
agentkrew info feature-development --installed        # step count
agentkrew info feature-development --installed --json # full steps

--json prints the parsed steps structure exactly as the engine sees it.

Shipped workflows

Engineer Kit (5):

Workflow Shape
feature-development tech-lead → (backend ∥ frontend ∥ database) → test → security → review → ship
bug-fix debugger → test-automator → code-reviewer → shipper
review (code-reviewer ∥ security-auditor ∥ test-automator) — parallel over the same changes
saas-bootstrap requirements-analyst → system-architect → tech-lead → parallel build → deploy → e2e → audit → review → ship
add-payments security-auditor (threat model) → payments-specialist → e2e tests → security-auditor → review → ship

Cross-kit workflows (3, in the cross-kit bundle): product-launch, feature-launch, and marketing-campaign sequence Engineer and Marketing agents in one plan (for example: plan → competitive analysis → brand → parallel build → verify → content → SEO → launch). The bundle covers both kits, so installing it pulls both; both teams read the same AGENTKREW.md.

agentkrew list workflows --installed is the live source of truth.

Creating a custom workflow

Workflows are a source-level concept; in an installed project, add the equivalent plan as a command or workflow-shaped prompt file for your runtime (see commands), then verify with agentkrew validate --installed.

Keep workflows deterministic: name the steps, do not embed prompts, and let agents own the thinking. See customization for the full authoring workflow.