Examples
Every curated example in examples/ is checked in CI and has
a stable .ir snapshot. The point of this catalog is not volume: each example
exists because it demonstrates a distinct language capability or a useful
coordination pattern.
Examples tagged @service intentionally idle or recur instead of completing.
All examples below check with no credentials. Agent turns use the built-in
owned brokered harness by default — whip runs the tool-use loop itself, and
a credential-free fixture model client drives dev/CI. Two examples instead
exhibit the optional delegating providers: multi-agent-bounded-concurrency
(Codex + Claude) and incident-router (Codex/Claude/Pi routing). The catalog
commands are verified by scripts/check-docs-examples.sh.
Start Here
| Example |
Check command |
Why it exists |
minimal-noop.whip |
whip check examples/minimal-noop.whip |
Smallest complete workflow: started, record, complete, and an output contract. |
human-review.whip |
whip check examples/human-review.whip |
Minimal human gate: askHuman choices [...], inbox creation, when human answered .... |
triage-flow.whip |
whip check examples/triage-flow.whip |
Sequential flow: agent step, human signoff, timeout handler, branch, terminal output/failure. |
Core Language Patterns
| Example |
Check command |
Why it exists |
coerce-branch.whip |
whip check examples/coerce-branch.whip |
Named typed model decision with a success fact and human fallback on failure. |
terminal-output-union.whip |
whip check examples/terminal-output-union.whip |
Exhaustive case over an effect terminal union: completed, failed, timed out, cancelled. |
incident-router.whip |
whip check examples/incident-router.whip |
Rich guards and dynamic routing: arrays, maps, optionals, exists, in, assertions, AgentRef. Optional-provider exhibit: routes across Codex/Claude/Pi. |
scheduled-escalation.whip |
whip check examples/scheduled-escalation.whip |
Time as effects: timeout, timer until, cancel, and terminal-union handling. |
exec-json-ingest.whip |
whip check examples/exec-json-ingest.whip |
Gated local commands with typed JSON output: exec -> Type and exec -> each Type. |
event-bridge.whip |
whip check examples/event-bridge.whip |
External signal ingress (whip signal) and directed signal injection: emit signal ... to <instance> relays an acknowledgement into a live peer instance, which reacts via typed when. A missing target fails the effect with target instance <id> not found. |
reusable-review-pattern.whip |
whip check examples/reusable-review-pattern.whip |
Compile-time reuse with pattern and apply; no hidden runtime subroutine. |
messaging-demo.whip |
whip check examples/messaging-demo.whip |
std.messaging: a channel, inbound when message from <channel> (binds the generic Message), and outbound send via <channel>. Inject inbound with whip message. |
file-store-demo.whip |
whip check examples/file-store-demo.whip |
std.files: a file store policy boundary with allow read/allow write globs; durable write text ... mode upsert then read text ... as f round-trip, completing with f.content. |
owned-harness-demo.whip |
whip check examples/owned-harness-demo.whip |
The built-in owned brokered harness (DR-0024): whip runs the agent tool-use loop itself; when <agent> completed turn settles to the same agent.turn.<status> fact as the delegating providers. Run with --provider owned. |
Coordination Recipes
| Example |
Check command |
Why it exists |
queue-worker-with-review.whip |
whip check examples/queue-worker-with-review.whip |
Canonical work loop: claim queue item, run agent, typed review, finish/release/escalate. |
multi-agent-bounded-concurrency.whip |
whip check examples/multi-agent-bounded-concurrency.whip |
Two agents with different capacities and a reviewer handoff. Optional-provider exhibit: binds Codex + Claude. |
circuit-breaker.whip |
whip check examples/circuit-breaker.whip |
Resilience pattern expressed as facts, a bounded counter, and explicit failure policy. |
ralph.whip |
whip check examples/ralph.whip |
Tiny recurring service: agent completion feeds the next turn, guarded by capacity. |
Showcase Workflows
| Example |
Check command |
Why it exists |
openclaw-lite.whip |
whip check examples/openclaw-lite.whip --package-lock examples/openclaw-lite.lock.json |
Scheduled operations composition: heartbeat, memory.query recall before the planning turn, queue filing, memory.write save, human review. Imports the external memory package, so it needs the committed whip.lock. |
autoresearch-lite.whip |
whip check examples/autoresearch-lite.whip |
Objective research loop: budgeted experiment, typed metric ingestion, keep/stop decision. |
gastown-lite.whip |
whip check examples/gastown-lite.whip |
Coding-agent coordination: queue filing, workspace lease, agent work, typed review, ledger record. |
Runtime Operations
| Example |
Check command |
Why it exists |
revision-ticket-v1.whip / revision-ticket-v2.whip |
whip check examples/revision-ticket-v1.whip / whip check examples/revision-ticket-v2.whip |
Paired source files for whip revise: compatible in-flight workflow evolution. |
revision-parent-child.whip |
whip check examples/revision-parent-child.whip --root ParentRevisionExample |
Parent/child workflow invocation and explicit success/failure payload mapping. |
revision-validation-approval.whip |
whip check examples/revision-validation-approval.whip --root RevisionValidation |
Operator-safe revision proposal: child drafts candidate, human reviews, activation stays outside source. |
revision-running-cancel.whip |
whip check examples/revision-running-cancel.whip |
Revision behavior around already-running provider work. |
revision-repair-planner.whip |
whip check examples/revision-repair-planner.whip |
Agent-drafted repair proposal that returns a dry-run command rather than self-activating. |
Test Fixtures
These remain in examples/ because runtime/report tests use them, but they are
not part of the learning path:
Running Them
whip check examples/triage-flow.whip
whip --store .whipplescript/examples.sqlite \
dev examples/triage-flow.whip \
--provider fixture --until idle --json
Useful variations:
# stream progress as NDJSON (openclaw-lite uses the `memory` package, so pass its lock)
whip --store .whipplescript/examples.sqlite \
dev examples/openclaw-lite.whip \
--provider fixture --until idle --stream ndjson \
--package-lock examples/openclaw-lite.lock.json
# run an acceptance fixture end to end
whip --store .whipplescript/accept.sqlite --json \
accept examples/provider-language-e2e.accept.json
# inspect the lowered rules for a flow or pattern expansion
whip check examples/reusable-review-pattern.whip
Reading Order
minimal-noop.whip
human-review.whip
triage-flow.whip
queue-worker-with-review.whip
incident-router.whip
scheduled-escalation.whip
openclaw-lite.whip
autoresearch-lite.whip or gastown-lite.whip