
Writing Relayflows
Use when authoring a Relayflows flow (@relayflows/surface / @relayflows/sdk, the...
Install
npx skills add AgentWorkforce/relay --skill writing-relayflows -g -a claude-code -y- Repository
- AgentWorkforce/relay1.1k
- Category
- AI and agents
- Updated
- 3d ago
- License
- Apache-2.0
- Context cost
- Mediumabout 3,000 tokens
- Runs scripts
- No, instructions only
What it does
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.
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.

