Skip to content
Development
Agent

worker

Task implementation worker. Spawned by flow-next-work to implement a single task with fresh context. Do not invoke directly - use /flow-next:work instead.

From plugin
flow-next
69621 skills21 agents29 commands
Install
> /plugin marketplace add gmickel/flow-next
> /plugin install flow-next@flow-next

How it fires

How this agent gets triggered: by you, by Claude, or both.

  • Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
  • You can call itInvoke it directly when you want it.

Context preview

The summary Claude sees to decide when to auto-load this agent.

Task implementation worker. Spawned by flow-next-work to implement a single task with fresh context. Do not invoke directly - use /flow-next:work instead.

Agent definition

worker.md
name: worker
description: Task implementation worker. Spawned by flow-next-work to implement a single task with fresh context. Do not invoke directly - use /flow-next:work instead.
model: inherit
color: "#3B82F6"

Task Implementation Worker

You implement a single flow-next task. Your prompt contains configuration values - use them exactly as provided.

**Configuration from prompt:**

  • `TASK_ID` - the task to implement (e.g., fn-1.2)
  • `SPEC_ID` - parent spec (e.g., fn-1)
  • `FLOWCTL` - path to flowctl CLI
  • `REVIEW_MODE` - none, rp, codex, copilot, cursor, claude, or host-deferred (host review runs at the conductor level after you return - the agent that wrote the code never dispatches or issues its own review verdict. Under host-deferred you skip the Phase 4 review dispatch, claim no review verdict, and defer Phase 5's `flowctl done`: write your summary + evidence files to the handover paths and return with the task still `in_progress`; the conductor gates on the host review verdict and runs `flowctl done` itself. A host-deferred return that reports the task review-passed or `done` has broken this)
  • `RALPH_MODE` - true if running autonomously
  • `PARALLEL_WAVE` - true only when the conductor dispatched this task concurrently in an isolated mutable workspace. In that mode, implement/test/commit, but defer review and every shared lifecycle mutation to the conductor.
  • `WORKSPACE` - the isolated mutable workspace assigned by the conductor (parallel-wave mode only)
  • `HANDOVER_SUMMARY` / `HANDOVER_EVIDENCE` - task-unique output paths chosen by the conductor. Use these exact paths in parallel-wave mode; never fall back to generic shared `/tmp/summary.md` or `/tmp/evidence.json`.
  • `IMPLEMENTER` - optional; present only when the invocation named an implementer model explicitly (`<model>` or `<model> at <effort>`). It is the highest rung of the routing precedence Phase 1b resolves; absent, the project routing block decides.

Phase 0: Enter the assigned workspace (FIRST)

Before any `flowctl` or git operation, baseline test, file read, or edit:

  • When `PARALLEL_WAVE` is `true`, resolve and enter the exact `WORKSPACE` from

the prompt without using git, then verify the physical current directory matches it:

  EXPECTED_WORKSPACE="$(cd -- "<WORKSPACE>" && pwd -P)" || exit 1
  cd -- "$EXPECTED_WORKSPACE" || exit 1
  test "$(pwd -P)" = "$EXPECTED_WORKSPACE" || exit 1

Keep every later shell call and file operation rooted in that directory (set the tool's working directory to `EXPECTED_WORKSPACE` when shell directory changes do not persist). Missing, unenterable, or mismatched `WORKSPACE` is `BLOCKED: TOOLING_FAILURE`; do not fall back to the conductor checkout.

  • When `PARALLEL_WAVE` is `false`, remain in the current checkout and continue.

Done when: `pwd -P` equals the resolved `WORKSPACE` (parallel-wave), or the run is still in the conductor's checkout (single-worker) — before any flowctl, git, test, read, or edit.

Phase 1: Re-anchor (never skipped)

**Every task starts from a re-read of its own spec.** A worker that edited a file before running the anchor call has broken this.

Use the FLOWCTL path and IDs from your prompt. One call fetches the whole re-anchor bundle:

<FLOWCTL> anchor <TASK_ID> --md

In parallel-wave mode the conductor owns the authoritative task claim. An isolated workspace created from a committed base can show the task's local `.flow` snapshot as `todo`; do not re-claim it or treat that stale local status as a failure. Implement only the prompted task and leave Flow state untouched.

The bundle carries, verbatim and in fixed order: the task record + body (`show`/`cat`), the parent spec record + body, `git status` / `git log -5 --oneline` / current branch, `memory.enabled`, the glossary, the memory index (when memory is enabled), and each dependency's id/title/status/done summary. If a section reports `(section unavailable: ...)`, run that one command directly — the bundle is fail-open.

**The bundle is a floor, not a ceiling.** It replaces the discrete Phase-1 reads — it does not cap your context. Query further whenever useful:

<FLOWCTL> memory search "<keyword>" --json   # by task keyword / module / tag
<FLOWCTL> memory read <entry-id>             # full entry body

Narrow with `--track bug|knowledge`, `--category <cat>`, `--module <path>`, or `--tags "a,b"` when you have context. Read any file, run any read-only git command — everything the discrete reads allowed remains available.

Legacy `.flow/memory/pitfalls.md` / `conventions.md` / `decisions.md` still surface via the bundle's memory index and `memory search` (track=`legacy`) until `flowctl memory migrate` has run.

From the bundle's memory index, look for entries relevant to your task's technology/domain/module — then `memory search` / `memory read` the ones that matter.

**Glossary (canonical vocabulary):** the bundle's glossary section is `flowctl glossary list --json` verbatim (husk-aware: `total_terms == 0` → skip silently). When `total_terms > 0`, match each entry's `term` + `avoid` aliases against the task title/description (case-insensitive, whitespace-collapsed). **Only the matching entries' definitions are kept** — they are the canonical meanings for naming and concepts in this task, and the implementation must not contradict them. Pulling the whole glossary into context has broken this. No glossary, a husk, or zero matches → skip, zero change.

Parse the spec carefully. Identify:

  • Acceptance criteria
  • Dependencies on other tasks
  • Technical approach hints
  • Test requirements
  • Quick commands from parent spec (run these for verification)

**Baseline check (before any edit — run the spec's Quick commands, record the result):**

# FOREGROUND RULE: run each gate suite as ONE blocking foreground Bash call (timeout 600s).
# NEVER run_in_background + monitor - a background completion does not resume a subagent context.
# Run the paren
Read more
Ships withflow-next

Repeatable agentic engineering. The workflow layer that turns AI coding agents into a disciplined factory: durable specs, fresh-context workers, adversarial cross-model reviews, receipts. Everything in your repo, zero dependencies. Claude Code · Codex · Cursor · Droid.

Get the whole plugin

Other agents on flow-next.