@klein-kit/orchestrate
v0.1.1
Published
Cross-agent orchestration for klein-kit: task handoffs, DAG dependencies, reviewer loops, retries, and subagents across local coding agents.
Maintainers
Readme
@klein-kit/orchestrate
Cross-agent workflows for local coding agents. Chain the agents on your machine — Claude plans, Codex implements, an independent agent reviews — with dependencies, retries, and automatic state handoff. Built on @klein-kit/core.
import { workflow, runWorkflow } from "@klein-kit/orchestrate";
const def = workflow("dark-mode", "Add a dark-mode toggle to settings")
.plan("plan", { agent: { provider: "claude" } })
.implement("impl", { agent: { provider: "codex" }, dependsOn: ["plan"] })
.verify("tests", "pnpm test", { retries: 2 }) // failing tests → repair agent → re-run
.review("review", "impl", { agent: "auto", retries: 1 })
.build(); // plain JSON — serialize, persist, ship
const result = await runWorkflow(def, { onEvent: (e) => render(e) });- Task-state handoffs — a structured document (goal, plan, todos, decisions, files touched, per-agent history with resumable session ids) kept current from native events and injected at each handoff.
- Reviewer loops —
VERDICT: REVISEre-runs the target with the reviewer's notes; exhausted reviews fail the workflow. - Verify/repair — a failing command sends its output to a repair agent, then re-runs (CI repair).
- Auto agent selection — picks from installed providers per role; reviewers are always a different provider than the implementer.
- Conflict reconciliation — concurrent steps touching the same files are detected and reconciled by an agent.
- Subagents on every provider —
runSubagent()gives scoped child sessions even where the backend has none.
Full docs: github.com/yvescomputer/klein-kit · MIT © Yves Computer Company
