orchy
Agent flows, with rules

Run agent work as a flow you can check.

Orchy runs steps you define in a file. A step can run a command, ask an agent, or wait for a person.

Orchy checks the flow, starts each step when its needs pass, and records what each step did.

The first-run guide starts with one step and needs no model.

run / code-and-review cycle 1 of 3
01
codeAgent writes a change.
done
02
reviewAgent returns approved: false.
send back
↳
code runs againThe cycle has a limit.
1 / 3
$ orchy run examples/code-review/flow.yaml
How it works

Define. Check. Run.

Start with one step. Add more when the work needs them. The same flow runs from the command line or the local page.

01 / Define

Write the flow.

Each step names its work and the value it must return.

02 / Check

Find a bad flow early.

orchy check reads the flow before a step starts.

03 / Run

Keep the record.

Orchy checks each result and writes the run state to disk.

One example

Review can send the work back.

The code step writes a change. The review step reads it and returns a value. A failed review sends the work back.

examples/code-review/flow.yaml complete flow
# The same flow as flow.ts. A test keeps the two the same, because the API, a
# file, and a graphical editor must all produce one flow.
name: code-and-review
harness: claude
model: sonnet

steps:
  - id: code
    kind: agent
    prompt: prompts/code.md
    tools: [read, write, edit, grep, find, ls]
    returns:
      type: object
      required: [summary, files]
      properties:
        summary: { type: string }
        files:
          type: array
          items: { type: string }

  - id: review
    kind: agent
    needs: [code]
    prompt: prompts/review.md
    tools: [read, grep, find, ls]
    returns:
      type: object
      required: [approved, findings]
      properties:
        approved: { type: boolean }
        findings:
          type: array
          items: { type: string }
    cycle:
      to: code
      when: { approved: false }
      limit: 3
      policy: escalate

What happens on a failed review?

code → review → code again

Review waits for code. If review returns approved: false, the cycle sends the work back. The limit is three cycles. At the limit, a gate asks a person.

This flow needs the Claude command and a code workspace. Start with the model-free guide if you are new.

Open this flow on GitHub →
Keep going

Build one step at a time.

The guide adds an agent, a gate, and links to the next features.

Open the guide →