writing-relayflows
Skill1.1k starsChanged 53 days agoApache-2.0View on GitHub
Use when authoring a Relayflows flow (@relayflows/surface / @relayflows/sdk, the journal-based v2 engine — the CLI is `flows`, package versions 2.0.x) in TypeScript or YAML/JSON. Covers the three-rung ladder (run/llm/agent), the resident verbs (human/dispatch/done), verification gates, TypeScript vs YAML authoring, per-step cli/model selection and its resolution order, flows.json, and `flows check`/`run`/`resume` with their real refusal shapes and exit codes. Not for the older, unrelated `@relayflows/core` WorkflowBuilder engine (`.pattern('dag')`/.agent()/.step() chains) that `writing-agent-relay-workflows` and `migrating-persona-to-relayflow` cover — that's a different product despite the similar name.
1 other project uses a version of this, 1 of them edited.
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Most recently taken up by
- AgentWorkforce/skillsedited, first seen Mar 19, 2026
Who's talking about AgentWorkforce/relay
- AgentWorkforce/relaycast“fix(sdk): preserve rich blocks in realtime message events”GitHub · Nov 8, 2026 · 2 reactions
- AgentWorkforce/agentrelay.com“Add QR card redirect for AI Engineer World Fair event”GitHub · Jul 2, 2026 · 2 reactions
- A Hacker News story“Show HN: Simple SDK for agent-to-agent communication”Hacker News · Apr 28, 2026 · 2 points
- JoeElder21/Joeyyy“deps(relay): bump agent-relay from 11.2.0 to 11.11.0 in /connectors/relay in the relay group across 1 …”GitHub · Aug 10, 2026 · 1 reactions
- AgentWorkforce/relayfile“feat: add relayfile control-plane client”GitHub · Jun 29, 2026 · 1 reactions
The biggest 5 of 21 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 21
Talked about on GitHub and Hacker News (21 times).
On GitHub · 20
- Nov 8, 2026fix(sdk): preserve rich blocks in realtime message events — AgentWorkforce/relaycast2 reactions · 3 comments
- Jul 2, 2026Add QR card redirect for AI Engineer World Fair event — AgentWorkforce/agentrelay.com2 reactions · 2 comments
- Aug 10, 2026deps(relay): bump agent-relay from 11.2.0 to 11.11.0 in /connectors/relay in the relay group across 1 directory — JoeElder21/Joeyyy1 reaction
- Jun 29, 2026feat: add relayfile control-plane client — AgentWorkforce/relayfile1 reaction · 4 comments
- Nov 3, 2026Ledger: task outcomes and expected evidence, not only done — solutionscay/skiff0 reactions
15 more on GitHub
- Nov 3, 2026Ledger: delivery records and receipts for sends and hand-offs — solutionscay/skiff0 reactions
- Oct 27, 2026Talk: Agent Led Development — milstan/sisw0 reactions · 1 comment
- Sep 28, 2026[Candidate] agentworkforce/relay/plugins/codex-relay-skill - agent-relay — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 28, 2026[Candidate] agentworkforce/relay/.openskills/writing-relayflows - writing-relayflows — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 27, 2026[Candidate] agentworkforce/relay/.agents/skills/review-fix-signoff-loop - review-fix-signoff-loop — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] agentworkforce/relay/.agents/skills/review-animations - review-animations — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 27, 2026[Candidate] agentworkforce/relay/.agents/skills/relay-80-100-workflow - relay-80-100-workflow — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 26, 2026[Candidate] agentworkforce/relay/.agents/skills/emil-design-eng - emil-design-eng — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] agentworkforce/relay/.agents/skills/creating-agent-skills-skill - creating-agent-skills — ProSkillsMD/proskills0 reactions · 2 comments
- Sep 26, 2026[Candidate] agentworkforce/relay/.agents/skills/choosing-swarm-patterns - choosing-swarm-patterns — ProSkillsMD/proskills0 reactions · 1 comment
- Sep 14, 2026Relay agent transport returns spawn metadata before task completion — AgentWorkforce/flows0 reactions
- Sep 11, 2026mount daemon can miss notify-flush SIGUSR1 acknowledgement in clean RelayFlow sandbox — AgentWorkforce/relayfile0 reactions
- Sep 10, 2026mount --once can exhaust its timeout on a 429 WebSocket dial before cursor resolution — AgentWorkforce/relayfile0 reactions
- Sep 6, 2026Rust SDK erases repeated 5xx registration diagnostics as Max retries exceeded — AgentWorkforce/relaycast0 reactions · 2 comments
- Aug 15, 2026factory dispatch exits 0 on hard failure — refusals are indistinguishable from success — AgentWorkforce/software-garden0 reactions
On Hacker News · 1
- Apr 28, 2026Show HN: Simple SDK for agent-to-agent communication2 points
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 1
- AgentWorkforce/skills★ 516% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository27 other files it gives its agents.
- AGENTS.mdAGENTS.md
- choosing-swarm-patternsSkill
- creating-agent-skillsSkill
- emil-design-engSkill
- orchestrating-agent-relaySkill
- relay-80-100-workflowSkill
- review-animationsSkill
- review-fix-signoff-loopSkill
- setting-up-relayfileSkill
- using-agent-relaySkill
- browser-testing-with-screenshotsSkill
- choosing-swarm-patternsSkill
- creating-claude-agentsSkill
- creating-claude-hooksSkill
- creating-claude-rulesSkill
- creating-skillsSkill
- debugging-websocket-issuesSkill
- deploying-to-staging-environmentSkill
- frontend-designSkill
- github-oauth-nango-integrationSkill
- implementing-command-palettesSkill
- orchestrating-agent-relaySkill
- prpm-json-best-practicesSkill
- relay-80-100-workflowSkill
- review-fix-signoff-loopSkill
- setting-up-relayfileSkill
- using-agent-relaySkill
The file
Files
Overview
Relayflows turns a coding-agent task into steps a journal can inspect, verify, and resume. A flow is data (YAML/JSON) or code (TypeScript) that compiles to the same journal-backed kernel spec. Every effect is journaled before it's treated as real — a journal write that fails fails the step, with no silent fallback.
Name collision warning. This repo also has skills for an older, unrelated engine that is also casually called "Relayflow" (singular) — @relayflows/core's WorkflowBuilder, a chained builder (workflow('name').pattern('dag').agent(...).step(...).run()). That's writing-agent-relay-workflows and migrating-persona-to-relayflow's territory. This skill is the v2 engine: @relayflows/surface's flow() function and the YAML/JSON dialect compiled by @relayflows/sdk. If you see .pattern(, .agent( as a chained builder call, or ctx.workflow.run(), you're in the other engine — stop and use one of those skills instead.
When to use this skill
- Writing a new
.flow.tsor.flow.yaml/.flow.jsonfor theflowsCLI (package@relayflows/sdk, binary nameflows). - Deciding whether a step needs
run(shell),llm(bare model call), oragent(harnessed coding agent in a workspace). - Wiring up
cli/modelfor anagentorllmstep, in either language. - Debugging a
REFUSED [...]message fromflows checkorflows run. - Choosing between TypeScript and YAML for a given flow.
The ladder
Three step verbs, one per rung — never more (packages/sdk/src/spec.ts, export type StepType = 'deterministic' | 'llm' | 'agent';):
run/deterministic— a shell command. No model. Implicit gate isexit_code == 0.llm/llm— a bare model call. Prompt in, verified output out. No workspace, no tool use.agent/agent— a harnessed coding agent in a workspace. Returns{ summary, artifacts }, not raw text.
Plus four resident verbs that aren't ladder rungs: human (durable approval), dispatch (hand off to a child flow), done (typed finish), and in YAML, on/triggers (event entry points — out of scope for this skill).
Most flows only need run and llm. Climb to agent once a step needs hands on a real workspace.
Two ways to author the same thing
TypeScript
import { flow } from '@relayflows/surface';
export default flow('hello', async (f) => {
const greeting = await f.run('echo "Hello from Relayflows"');
console.log(greeting.trim());
const answer = await f.agent('greeter', {
task: 'Reply with one short hello sentence. Do not use tools or modify files.',
cli: 'claude',
model: 'claude-sonnet-4-6',
});
console.log(answer.summary);
f.done('success');
});YAML
version: '0.1.0'
name: hello
steps:
- id: greeting
type: deterministic
command: 'echo "Hello from Relayflows"'
- id: greeter
type: agent
dependsOn: [greeting]
instruction: 'Reply with one short hello sentence. Do not use tools or modify files.'
cli: claude
model: claude-sonnet-4-6The real Ctx contract (TypeScript)
packages/surface/src/context.ts, current as of origin/main@86a2ec2:
export interface AgentResult {
summary: string;
artifacts: string[];
}
export interface AgentOptions {
task: string;
workspace?: string;
cli?: string;
model?: string;
}
export interface Ctx {
run(command: string): Step<string>;
llm(strings: TemplateStringsArray, ...values: unknown[]): Step<string>;
llm(
prompt: string,
options: { output: Record<string, unknown>; cli?: string; model?: string }
): Step<unknown>;
agent(name: string, options: AgentOptions): Step<AgentResult>;
human(question: string, options: { to: string }): Promise<boolean>;
dispatch<T>(flow: string, input: unknown): Promise<T>;
done(reason: RunCompletionReason): void;
cloud: CloudHelper;
slack: SlackHelper;
}The real step shapes (YAML/JSON, packages/sdk/src/spec.ts)
```ts
interface DeterministicStepSpec {
type: 'deterministic';
id: string;
command: string;
dependsOn?: string[];
timeoutMs?: number;
verification?: VerificationSpec; // omit for implicit exit_code
}
interface LlmStepSpec {
type: 'llm';
id: string;
prompt: string;
dependsOn?: string[];
verification?: OutputVerificationSpec;
model?: string;
cli?: string;
}
interface AgentStepSpec {
type: 'agent';
id: string;
instruction: string;
dependsOn?: string[];
verification?: OutputVerificationSpec;
agent?: string; // selects a named FlowSpec.agents entry
cli?: string;
model?: string;
surfaces?: { workspace?: { surface: string }[]; streams?: { stream: string }[]; external?: string[] };
recoveryMode?: 'reset' | 'inspect' | 'manual'; // default 'reset'
permissions?: {
fileGlobs?: string[];
networkAllowlist?: string[];
accessPreset?: 'readonly' | 'readwrite';
};
}
interface FlowSpec {
version: string; // required, e.g. '0.1.0' — not optional
name?: string;
cli?: string; // flow-level CLI default
agents?: Record<string, { cli: string; model: string }>; // both fields required
steps: StepSpec[];
budget?: { maxTokensIn?: number; maxTokensOut?: number; maxDollars?: string };
}Verification gates
Verification is control flow, not decoration — a gate decides whether a step actually completed, not just whether the process exited cleanly (packages/sdk/src/spec.ts, VerificationGateType):
- id: classify
type: llm
prompt: 'Classify this ticket as bug, feature, or question: "the export button does nothing"'
cli: claude
model: claude-sonnet-4-6
verification:
type: output_contains
value: bugcli / model: what a step actually runs on
Both YAML and TypeScript agent/llm steps can set cli and model directly (TypeScript since flows#310, AgentOptions.cli?/.model?). Resolution order for cli — checked once per step by preflight.ts's resolveCli (packages/sdk/src/preflight.ts:265-282), identical regardless of authoring language because both compile to the same StepSpec:
$ flows check hello.flow.yaml # agent step, no cli anywhere
REFUSED [cli_unresolved] Step "greeter" has no CLI at step, flow, or project level. No flows.json was found from "..." to the filesystem root.flows.json
{ "cli": "claude", "executors": ["cron"], "models": ["claude-sonnet-4-6"] }Human approval and dispatch (TypeScript resident verbs)
```ts
import { flow } from '@relayflows/surface';
export default flow('ship-feature', async (f) => {
const plan = await f.agent('planner', {
task: 'Research and plan: add OAuth2 support',
workspace: 'acme/api: readonly', // compiles to relayauth path scopes
});
const ok = await f.human(`Ship this?\n${plan.summary}`, { to: 'khaliq' });
if (!ok) return f.done('canceled');
const pr = await f.dispatch('garden/implement', plan); // hands off to a child flow
f.done('success');
});Running it: flows check / run / resume
Real usage (packages/sdk/src/cli.ts):
flows check [--json] <flow.yaml|spec.json>
flows run [--json] [--no-spawn] [--no-observer-link] [--data-dir <dir>] [--local-agent] <flow.yaml|spec.json>
flows run [--json] [--no-spawn] [--no-observer-link] [--data-dir <dir>] [--local-agent] <flow.ts> --input <inline-json-or-file>
flows resume [--json] [--no-spawn] [--no-observer-link] [--data-dir <dir>] <run-id>Common mistakes
- Forgetting
versionin a YAML/JSONFlowSpec. It's required, not optional —flows checkrefuses a spec without it. - Adding
agents:to a TypeScriptflow()header.FlowHeaderhas no such field; it throwsTypeError: flow header has unknown fields: agentsat authoring time. Named-agent maps +agent:selector are YAML/JSON-only (flows#300 tracks TypeScript composition viause:, not yet shipped). - Assuming
flows.json'smodelssets a default model. It only validates models already declared elsewhere; it never selects one. - Not awaiting a step, or manually
.then()-chaining one. Both are refused (unawaited_step/unsupported_verb) rather than silently ignored — the executor closes every root operation's lifecycle explicitly. - Running a
.flow.tswithout--input. Required even for flows that don't use their input argument. - Expecting a fifth
done()reason. The set is closed:success | step_failed | canceled | budget_exceeded. Don't inventpartialorskipped.
What this skill does NOT cover
- Named-agent maps in TypeScript (
agents: { reviewer: { cli, model } }+ reuse across steps by name) — YAML/JSON only today. Tracked for TS composition viause:at flows#300. recoveryMode,permissions,surfaces,budget,memoryon agent steps — real YAML/JSON fields with no TypeScript equivalent. Author that step in YAML and reach it from TypeScript withf.dispatchif you need them.- Cloud execution (
flows run --cloud), triggers/webhooks, memory retrieval, and thef.mcp/f.slackhelper namespaces — each is its own surface with its own gotchas; see the Relayflows product docs for what's shipped versus designed-but-not-yet-implemented. - The older
@relayflows/coreWorkflowBuilderengine — seewriting-agent-relay-workflowsandmigrating-persona-to-relayflowin this repo.
Quick reference
| Verb / field | Language | Notes |
f.run(command) / type: deterministic | both | shell command, implicit exit_code gate |
f.llm(...) / type: llm | both | bare model call, no workspace |
f.agent(name, opts) / type: agent | both | harnessed coding agent, returns {summary, artifacts} |
f.human(question, {to}) | TS only | durable approval; YAML has no equivalent yet |
f.dispatch(flow, input) | TS only | hand off to a named child flow |
f.done(reason) / — | TS / kernel | one of success | step_failed | canceled | budget_exceeded |
options.cli / step.cli | both | per-call/step CLI override (TS: flows#310) |
options.model / step.model | both | per-call/step model; no flow/project default |
agent: <name> + agents: {...} | YAML/JSON only | named cli/model pair, reused by selector |
flows check <file> | CLI | pure validate + preflight, no daemon |
flows run <file> [--input ...] | CLI | actually executes; .flow.ts needs --input |
flows resume <run-id> | CLI | resume a parked/crashed run |
Verified against
AgentWorkforce/flows@86a2ec2 (origin/main). Built packages/surface and packages/sdk from source in a clean worktree (published npm @relayflows/surface@2.0.8 is stale — it predates flows#310 and lacks cli/model on AgentOptions; local build was symlinked in instead), then ran the real CLI:
$ flows check hello.flow.yaml # this skill's YAML example, cli/model added, flows.json models allowlist set
CHECK PASSED hello.flow.yaml # exit 0
$ flows check hello.flow.ts # this skill's TypeScript example
CHECK PASSED hello.flow.ts # exit 0
$ flows check extract.flow.yaml # this skill's output_contains example
CHECK PASSED extract.flow.yaml # exit 0
$ flows check hello.flow.yaml # same YAML, no flows.json anywhere
REFUSED [cli_unresolved] Step "greeter" has no CLI at step, flow, or project level. ... # exit 2
$ flows check hello.flow.yaml # step model not in flows.json's models[]
REFUSED [model_unknown] Step "greeter" declares model "claude-sonnet-4-6" ... not listed in project model registry ... # exit 2Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

