Build a self-improving agent loop in one sentence:
Build me a workflow that loops over each project in my GitHub and
saves a summary of its open issues. After the loop is done, the
workflow runs self-improve on itself.
Or don't do that โ just ask Claude or Codex for any one-off task of any size, like you normally would. Every request autoroutes to the smallest subagent-driven workflow that can prove it's done: a one-line answer stays a one-line answer; a product-sized build gets a frozen spec, tickets, parallel subagents, and a verification gate. 37 composable skills. Claude Code and Codex, Windows and POSIX. By default the planner/reviewer subagent is Fable 5 on high effort on Claude Code and GPT-5.6 Sol on ultra on Codex; workers are Sonnet 5 on xhigh and GPT-5.6 Sol on high. Think of it as an upgraded, cross-harness Dynamic Workflows.
Skill libraries break the same four ways:
Overly specific, handcrafted prompts. As models get smarter, overprescription degrades output quality.Manual chaining by the user. First run/brainstorm
, then run/to-prd
, then run... blah blah blah.Domain-specific. The workflow for writing a blog is basically the workflow for shipping a feature: outline the goal, build each section in parallel, review the output for cohesion and consistency. You don't need a/write-blog
skill and a/build-feature
skill.Static. Run 100 hits the same snags as run 1.
orchflows answers each in structure:
Tiny, composable skills. Every word of every skill has to fight for its life. Heavily avoids context rot.Workflows, not prompts. Every request autoroutes to the smallest workflow. No more memorizing skill names or chains.Domain-blind. Smart model outlines the task โ cheaper parallel subagents deliver โ smart model reviews. The same shape works for blogs, code, or research.Self-improving.orch-self-improve
can run at any time to mine the logs for friction points in agent behavior and reasoning, and improve the workflows over time.orch-evolve
is its sibling: a tournament-style improvement loop over any artifact, runnable or static.
One brick, one job.orch-deliver
ships,orch-critique
attacks,orch-judge
scores blind,orch-loop
iterates,orch-fix
proves the cause before repairing it.One stud pattern. Six frozen contracts โ spec, work-item, delegation, verdict, worklog, pack-signature โ are the only interfaces. Anything that emits one plugs into anything that takes one.Swappable baseplates. Workflows are domain-blind; a pack (code | content | research | design) is pure data that retargets the whole tower. The pipeline that ships a feature also ships a research report โ swap one pack, change zero control flow.
You snap bricks by naming them; the agent snaps them by routing. Same bricks either way.
git clone https://github.com/DanMcInerney/orchflows
cd orchflows
./install.sh # install.cmd on Windows
The wrapper resolves an interpreter (uv โ python3 โ python; any
Python 3 works) and
auto-detects your harnesses โ Claude Code (~/.claude
), Codex
(~/.codex
) โ configuring whichever exists. Update: git pull
,
rerun. Committable per-project routing block: python install.py --project PATH
. Uninstall: python install.py --user --uninstall
removes only what it generated; --dry-run
previews either.
Just talk. Routing reads the request and picks the smallest shape:
> fix the flaky login test
> why did memory double last release?
> ship dark mode
> build me a custom workflow that reads all the documentation, then
researches similar projects, then builds a spec doc to copy their
best features and implements them
Or name the bricks yourself:
> orch-loop orch-deliver until `pytest -q` exits 0
> orch-panel these three cache designs โ blind judges, pick one
> orch-critique src/auth under the security lens
Or build your own custom workflow:
> build me a workflow that does spec > deliver, then always updates
the documentation afterwards (favoring edits and deletions over
additions), and automatically PRs and merges it
Custom workflows are project-local. In the example above, if you were
working in my-personal-site/
you'd get a workflow named something
like /site-work-and-merge
, callable only when you're working in
my-personal-site/
.
Routing too eager? orch-off
stands it down for the session. The
routing law is rules/topology.md
ยง2, installed as
~/.orchflows/host-block.md
.
Chain any bricks and put orch-self-improve
last:
> my release workflow: orch-investigate what merged since the last
tag โ orch-deliver the release notes under the content pack โ
orch-self-improve
Every run auto-logs its friction โ retries, missing inputs,
workarounds โ under an always-on law, and trace.py
logs every
session's agent reasoning and secret-redacted tool calls.
orch-self-improve
mines the logs into single-owner proposals you accept or reject. Proposals I've seen in my own usage:
- Offload a repeated piece of agent reasoning to a deterministic script
- A tiny AGENTS.md addition telling agents to use the packaged Python
interpreter instead of whatever
python
is on$PATH
- Remove overlapping
orch-verify
steps from a workflow to speed it up - Add a documentation-update step to a workflow because the user kept asking for it manually
The coolest part of orch-self-improve
is that you can run it on
itself. I run orch-self-improve
across all sessions in a project,
then point a second orch-self-improve
run at the first one.
orch-visualize
renders anything you hand it as a verified Mermaid diagram โ a workflow, your session trace, a codebase, a website, a process from a doc. Every diagram is syntax-verified against a real Mermaid renderer before it comes back, and on request it emits a self-contained HTML page. This is its drawing of the delivery pipeline that ships every orchflows run:
flowchart TD
spec["orch-spec โ freeze exactly what should be made"] --> pack{"pack: code | content | research | design"}
pack --> ws["orch-workspace โ clean, isolated working area"]
ws --> dec["orch-decompose โ cut the spec into ordered tickets"]
dec --> frontier["orch-frontier โ dispatch every ready ticket"]
frontier --> task["orch-task"]
task --> del["orch-delegate โ hand the ticket to the right agent"]
del --> exec["executor: orch-tdd | orch-draft / orch-edit | orch-investigate / orch-synthesize | orch-render"]
exec -.-> chk["orch-check โ fresh agent double-checks (when needed)"]
exec --> integ["orch-integrate โ accept or reject the returned work"]
chk --> integ
integ -.->|rejected| frontier
integ --> ver1["orch-verify โ run any remaining checks"]
ver1 --> frontier
frontier --> gate["orch-review-fix โ critique, repair confirmed defects, re-verify"]
gate --> final["orch-verify โ final result matches the original request"]
orchflows
โ
โโโ Layer 0 ยท contracts/ โ Shared forms that keep every part of the system speaking the same language
โ โโโ delegation โ Says what another agent should do, use, avoid, and return
โ โโโ pack-signature โ Lists what every project-type setup must provide
โ โโโ spec โ Records exactly what the user wants made
โ โโโ verdict โ Records whether a check passed and what proves it
โ โโโ work-item โ Describes and tracks one piece of work
โ โโโ worklog โ Records the progress and current state of a larger job
โ
โโโ Layer 1 ยท skills/ โ Things the agents know how to do
โ โ
โ โโโ kernel/ โ Basic building blocks used by the rest of the system
โ โ โโโ orch-check โ Has a fresh agent double-check the work and correct problems
โ โ โโโ orch-critique โ Reviews something and lists the most important problems
โ โ โโโ orch-decompose โ Breaks a large job into smaller pieces in the right order
โ โ โโโ orch-delegate โ Hands one clearly defined task to another agent
โ โ โโโ orch-elicit โ Asks the user when a decision cannot safely be made for them
โ โ โโโ orch-integrate โ Decides whether returned work is acceptable and can be used
โ โ โโโ orch-investigate โ Researches one focused question using reliable evidence
โ โ โโโ orch-judge โ Rates one option using standards agreed on beforehand
โ โ โโโ orch-mechanize โ Turns a repeatedly performed step into a reusable script
โ โ โโโ orch-synthesize โ Combines findings from several sources into one answer
โ โ โโโ orch-verify โ Runs the agreed checks to see whether the work passes
โ โ โโโ orch-worklog โ Updates the job's progress record
โ โ โโโ orch-workspace โ Prepares a clean and safe place in which to work
โ โ
โ โโโ engines/ โ Reusable ways of organizing work
โ โ โโโ orch-task โ Takes one ready piece of work from start to acceptance
โ โ โโโ orch-frontier โ Starts each piece of work as soon as the work it needs is finished
โ โ โโโ orch-loop โ Repeats work until an agreed check says it is done
โ โ โโโ orch-panel โ Uses several independent reviewers to compare choices fairly
โ โ
โ โโโ workflows/ โ Complete processes made from the smaller building blocks
โ โ โโโ orch-spec โ Turns a request into a clear, agreed plan
โ โ โโโ orch-deliver โ Runs a project from the agreed plan to a checked final result
โ โ โโโ orch-goal โ Runs the delivery process again to improve the result further
โ โ โโโ orch-bench โ Sets the rules and tests before different options are compared
โ โ โโโ orch-evolve โ Creates and compares improved versions over several rounds
โ โ โโโ orch-diagnose โ Reproduces a problem and finds what is actually causing it
โ โ โโโ orch-fix โ Finds the cause of a problem, repairs it, and proves it stays fixed
โ โ โโโ orch-repair โ Applies the smallest change that fixes a known problem
โ โ โโโ orch-review-fix โ Reviews the result once, fixes valid problems, and checks it again
โ โ โโโ orch-build โ Creates or changes a reusable part of the orchflows library
โ โ โโโ orch-fixture โ Saves a finished task as an example that can be run again later
โ โ โโโ orch-self-improve โ Studies past difficulties and proposes improvements to the system
โ โ โโโ orch-triage โ Sorts a list of work into what is ready, blocked, or needs a person
โ โ
โ โโโ instances/ โ Skills that perform a particular kind of hands-on work
โ โ โโโ orch-tdd โ Writes software in small steps and checks each step with tests
โ โ โโโ orch-resolve-conflicts โ Decides how to combine two sets of changes that clash
โ โ โโโ orch-draft โ Writes one section using only the supplied information
โ โ โโโ orch-edit โ Combines separate sections into one consistent document
โ โ โโโ orch-render โ Builds a screen and checks how it actually looks and behaves
โ โ
โ โโโ utilities/ โ Small optional helpers
โ โโโ orch-visualize โ Turns supplied information into a diagram
โ โโโ orch-off โ Stops orchflows from automatically choosing skills
โ
โโโ Layer 2 ยท packs/ โ Setups for different kinds of projects
โ โโโ orch-code-pack โ Tells the system how to organize, save, and check software work
โ โโโ orch-content-pack โ Tells the system how to organize and review written documents
โ โโโ orch-research-pack โ Tells the system how to answer questions using trustworthy sources
โ โโโ orch-design-pack โ Tells the system how to build and visually check interfaces
โ
โโโ Layer 3 ยท compositions/ โ Example playbooks showing how the parts can be combined
โโโ delivery-loop โ Repeats delivery until a chosen measurement says to stop
โโโ drift-canary โ Reruns known examples to detect changes in agent behavior
โโโ evidence-to-document โ Researches a subject first, then turns the findings into a document
โโโ evolve โ Produces several versions and selects the strongest one
โโโ feature-plus-docs โ Builds a software feature and then documents what was built
โโโ improvement-delivery โ Turns an approved process improvement into a tested change
โโโ renovate โ Reviews an existing project and completes selected improvements
โโโ skill-tournament โ Tests competing versions of a skill to see which works best
Four layers, dependencies pointing one way. contracts/
is the narrow
waist: six hash-pinned data shapes that are the only interfaces between
skills. skills/
is everything callable โ kernel primitives that call
no other skill, engines that add control flow, workflows assembled from
both, instances that do the domain's hands-on work, and a couple of
utilities. packs/
is per-domain data, never control flow.
compositions/
is non-normative worked examples, free to churn.
UNITS OF WORK โ the orchflows ladder
โ
โโโ (floor) Tested script
โ no model, no ticket โ a unit of certainty, not of work
โ orch-mechanize keeps pushing repetition down here
โ
โโโ U0 โ Direct answer
โ question answered from context already in hand
โ no deliverable change โ no record, no ticket
โ
โโโ U1 โ Verified ad-hoc ticket
โ one ticket + one execution + one external verdict
โ U1รN: a small ticket graph with edges, run on the frontier
โ
โโโ U2 โ The run (spec โ delivery)
โ a frozen spec governs a ticket graph โ rolling frontier โ
โ one review gate โ final verification
โ
โโโ U3 โ Composition
control flow OVER units: chained runs, goal loops
Every request lands on the cheapest rung that can still prove it's done. A question you can answer from context costs nothing; a small fix gets one ticket and one external verdict; only work that genuinely needs a frozen spec pays for one; and repetition keeps getting pushed below the floor into tested scripts that need no model at all.
packs/
โโโ orch-code-pack โ delivers code ยท deterministic oracles ยท executor orch-tdd
โ workspace: git, one worktree per work item
โโโ orch-content-pack โ delivers documents ยท judged oracles ยท executor orch-draft, assembly orch-edit
โ workspace: document tree with outline slots
โโโ orch-design-pack โ delivers rendered UI ยท capture oracles ยท executor orch-render
โ workspace: git plus render (view ร breakpoint ร state)
โโโ orch-research-pack โ delivers answers ยท evidence oracles ยท executor orch-investigate, assembly orch-synthesize
workspace: evidence store of lane packets
A pack is pure data โ no control flow. It supplies the domain's vocabulary, oracle classes, executors, workspace rules, and design principles, all satisfying one frozen pack-signature, so everything the library builds inside a domain stays cohesive. Stamp a different pack on the spec and the identical pipeline ships code, documents, research, or UI.
Cross-harness. One library drives both Claude Code and Codex, on Windows and POSIX.Workflows persist. A custom workflow is admitted as a project-local skill โ versioned, callable by name, improvable โ not regenerated from scratch each session.Verification is structural. Named oracles, fresh-context checkers, and one review gate stand between an executor's claim and "done" โ the agent never grades its own homework.Self-improving. Friction and full session traces are always logged;orch-self-improve
mines them into concrete fixes to the workflows themselves โ including to itself.Survives session death. Specs, tickets, and worklogs are files in.orch/
, so any fresh context can resume a run mid-flight.Smallest-first routing. One intake for everything: a one-line question never pays workflow ceremony, and a launch never gets typo-fix rigor.