This is something i vibecoded a few weeks ago. just a static prototype and doesn't work yet, but i keep thinking about it and might actually implement
Idea is that I would define a javascript DSL for coding agent state machines (e.g. "create 4 agents to all implement this task, then launch 2 reviewer, then have the reviewers argue, then choose one branch and make a pr"). maybe it would just be xstate (
https://stately.ai/docs/xstate).
User would explain workflow they want in natural languages and a state machine workflow would be generated automatically. they could inspect it -- should be short like 100 LOC or less. Could ask for changes in natural language. They see a nice mermaid style diagram. Then they could launch it and the state machine runtime would orchestrate this workflow.
The state machine templates could be easily shared since they're just short text snippets