Imported from fakoli/fakoli-claw (
skills/flow-execute/SKILL.md). Install upstream withnpx skills add fakoli/fakoli-claw --skill flow-execute. Copyright stays with the author.
flow:execute — Execute Phase (OpenClaw)
Load an intent-driven plan, group tasks into dependency-ordered waves, dispatch
specialist sub-agents in parallel within each wave via sessions_spawn, run a mandatory
critic gate between waves, then dispatch the sentinel for an evidence-based final
sign-off. This is the OpenClaw port of fakoli-flow execute; the canonical driver is the
fakoli-orchestrator agent.
OpenClaw mapping (how this differs from the Claude Code original)
| Claude Code | OpenClaw |
|---|---|
Agent(subagent_type="fakoli-crew:welder", prompt=…) |
sessions_spawn(agentId="fakoli-welder", task=…) then sessions_yield |
claude plugin list | grep fakoli-crew |
openclaw agents list | grep '^- fakoli-' |
| model tier picked per dispatch | tiers are config-routed already: welder/smith/scout/herald/keeper → sglang/qwen3.6-35b-a3b-local; guido/critic/sentinel/orchestrator → openai/gpt-5.5 |
| each agent has fresh context | same — each spawned session is isolated; pass only the scoped packet |
Spawn depth: the human/main agent spawns fakoli-orchestrator (depth 1); the orchestrator
spawns specialists (depth 2). agents.defaults.subagents.maxSpawnDepth must be ≥ 2 (it is).
Async yield (important): sessions_spawn is non-blocking; children announce results back
to the parent session, and sessions_yield awaits them. A single CLI turn returns after the
first yield resolves — the orchestrator session then continues across turns as later children
announce. When driving from a script, poll the scratch dir for the terminal artifact
(the sentinel scorecard) rather than assuming one CLI turn finishes the whole wave.
Process
-
Load the plan. Read it fully. Extract each task's Intent, Acceptance, Scope, Agent, Verify, and
Depends on:. If the file is missing, ask for the path. -
Derive the run id + scratch root.
run-id = <plan-basename>-<YYYYMMDDHHmm UTC>. Scratch root (gitignored, outside VCS — fakoli-style P10):<project>/.fakoli/runs/<run-id>/. Use ABSOLUTE paths; inject each agent's own status-file path into its packet. Log it once. -
Detect specialists.
openclaw agents list. If thefakoli-*crew is present, dispatch tofakoli-<role>. If not, fall back to themainagent /generalfor every role (the pipeline still runs; you lose specialization). Log which mode you're in. -
Group into waves from
Depends on:— no deps → Wave 1; deps all in Wave N → Wave N+1. Same-wave tasks are independent and must target non-overlapping files. -
For each wave:
- Dispatch in parallel: one
sessions_spawnper task, each carrying ONLY its scoped packet (Intent, Acceptance verbatim, Scope = exact files, Upstream context = prior waves' Decisions, Verify command, and the absolute status-file path to write). Thensessions_yield. - Collect status files from the scratch root. Confirm each is
done/COMPLETE. Surface anyBLOCKED/NEEDS_REVIEWto the user — never swallow them. - Language verification before the gate: TypeScript
npx tsc --noEmit; Pythonruff check . && mypy .; Rustcargo check. On failure, dispatch welder to fix, re-run. - Critic gate (non-negotiable):
sessions_spawn(agentId="fakoli-critic", …)with the wave's modified-file list + the relevant acceptance criteria. The critic re-runs the verify commands itself (evidence over claim) and returns MUST FIX / SHOULD FIX / CONSIDER / NIT.- No MUST FIX → proceed.
- MUST FIX → fix cycle: spawn the owning specialist with the exact findings, re-spawn critic, max 3 cycles, then escalate to the user.
- Dispatch in parallel: one
-
After the final wave: sentinel.
sessions_spawn(agentId="fakoli-sentinel", …). Sentinel runs EVERY plan Verify command, quotes exit codes + output, and writes a pass/fail scorecard to<scratch>/sentinel-final.status. Confirm the prior wave's edits are on disk before dispatching sentinel (avoid the read-before-write race). Sentinel does not trust prior claims. -
Report. Waves run, tasks completed, files modified, critic findings (MUST FIX resolved / SHOULD FIX logged), sentinel verdict. End with
WAVE-OKonly if the sentinel scorecard passes all acceptance criteria, elseWAVE-BLOCKED: <reason>.
Packet template (per spawned task)
Task: <name>
Intent: <one sentence, from plan>
Acceptance criteria: <verbatim from plan>
Scope: <exact files>
Upstream context: <Decisions extracted from prior-wave status files>
Verify: <exact command from plan>
Write your status file to: <abs scratch>/<role>-<task>.status (status: IN_PROGRESS at start, done when all criteria met + Verify passes)
Notes
- Status-file format + reading/writing rules: see
references/status-protocol.md. - Wave-assignment DSL + capability matrix:
references/wave-engine-ref.md. - Keep packets tight and tool surface minimal (Fakoli: intent over recipe, specialist over generalist, evidence over claim, durability over chat).