Help us improve
Share bugs, ideas, or general feedback.
From orchestrate
Orchestrates complex multi-phase tasks as lionagi flow YAML specs, supporting multi-agent DAGs and parallel per-module sweeps. Use for tasks with independent subtasks or when quality benefits from multiple perspectives.
npx claudepluginhub ohdearquant/lionagi --plugin orchestrateHow this skill is triggered — by the user, by Claude, or both
Slash command
/orchestrate:flow-itThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Package a complex task as a lionagi flow YAML spec, validate it, fire it, and
Orchestrates multi-agent workflows in Claude Code: research swarms, parallel builds, sequential pipelines, and codebase audits.
Decomposes large changes, migrations, or multi-issue fixes into parallel work packages executed via independent subagents with quality gates to prevent conflicts.
Orchestrates complex tasks by decomposing into DAGs and dispatching focused sub-agents with minimal context. Invoke /orchestra run for multi-step, multi-repo coding workflows.
Share bugs, ideas, or general feedback.
Package a complex task as a lionagi flow YAML spec, validate it, fire it, and monitor execution. Covers two DAG shapes:
Both use the same lionagi flow engine. The orchestrator decides which DAG shape to use based on your intent. Your job: describe WHAT exhaustively, not HOW.
NEVER write a flow spec blind. Read the relevant files first so the spec references accurate paths, existing patterns, and real constraints.
For complex flows, deploy 3–6 parallel suggesters exploring lore from deliberately unrelated domains before writing the spec. Each suggester gets a different angle (biology, governance, rhetoric, control theory, etc.) and searches lore for cross-domain patterns applicable to the task.
suggesters (diverge, 3-6 parallel) → synthesis (converge) → inform prompt
This step produces insights that make the "What I want" section dramatically richer. A flow prompt informed by stigmergic coordination patterns, judicial review structures, or hermeneutic interpretation theory will produce better agent output than one written from software engineering intuition alone.
Skip for C < 0.5 or routine flows where the pattern is already established.
Place it at {project}/tools/flows/{name}.yaml.
meta:
name: {task-name}
version: "1.0"
description: >
One-paragraph explanation.
flow:
agent: orchestrator
max_agents: 8 # feature: 6-10; sweep: N modules + consolidator
max_concurrent: 4
timeout: 4800
save_dir_pattern: ".khive/flows/{name}"
engine: sdk
# Model routing handled by global lionagi profiles — do NOT set here.
# Policy: orchestrator=sonnet-4.6-high, critic=opus-4.7-high,
# implementer/tester=sonnet-4.6-high. Never use *-max variants.
gates:
# Artifact checks between DAG phases. Agents MUST NOT start until gates pass.
- phase: post-architect
require:
- path: artifacts/design.md
min_chars: 500
# Add per-flow gates, e.g.:
# - phase: post-implementer
# require:
# - path: artifacts/impl_summary.md
critic_scope: |
# Independent review mandate — set by spec author, not orchestrator.
# The orchestrator may NOT narrow or override this scope.
Review ALL implementation artifacts for: correctness, spec compliance,
security, error handling, and missing edge cases. Verify against the
original "Why this matters" and "Acceptance" sections, not just the
intermediate architecture.
lore:
auto: true
role: orchestrator
query: >
Keywords for domain context (60+ chars, keyword-rich).
limit: 6
max_tokens: 4000
# Parallel agents (especially suggesters) should get DELIBERATELY DIFFERENT
# compose queries. Varied lore injection produces diverse perspectives.
# Orchestrator: assign each parallel agent a distinct angle.
env:
RUSTC_WRAPPER: ""
prompt: |
## Why this matters
[Ocean's intent. What daily-driver pain this solves.]
## What I want
[EXHAUSTIVE requirements. Every behavior, edge case, acceptance
criterion. 70% of the prompt lives here. Be LONG.]
## Codebase pointers
[Starting files — where to look, not what to do with them.]
## Constraints
[Hard rules: worktree path, READ before WRITE, no new deps,
no stubs, scope boundary.]
## Acceptance
[Concrete commands + expected outcomes.]
CRITICAL: Do NOT prescribe phases, agent assignments, dependency chains, or model routing. The orchestrator designs its own DAG. Global lionagi profiles handle model routing per role.
# {base_branch}: usually 'main' or 'master'. Detect with:
# git symbolic-ref refs/remotes/origin/HEAD | sed 's|.*/||'
git worktree add -b {branch} ../{project}-{name} {base_branch}
mkdir -p ../{project}-{name}/tools/flows ../{project}-{name}/tools/rubrics
cp tools/flows/{name}.yaml ../{project}-{name}/tools/flows/
li o flow validate -f {path}
CRITICAL: Launch from the WORKTREE directory. Codex sandbox scopes file writes to the launcher's CWD.
cd /path/to/{worktree} && \
nohup li o flow run -f tools/flows/{name}.yaml \
> /tmp/flow_{name}.log 2>&1 &
echo "Flow PID: $!"
# Preferred: open http://localhost:3000/flows/{id} in the lionagi flow monitor
# for live agent state, branch timelines, and per-agent output.
tail -20 /tmp/flow_{name}.log
# Silent failure diagnosis: check .khive/flows/{name}/ for checkpoint artifacts.
.khive/flows/{name}/.
Check what committed successfully before deciding what to re-fire..khive/flows/{name}/ artifacts before abandoning.
Completed agents' work is still usable even if later phases failed.cd {worktree}
git diff --stat $(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|.*/||' || echo main)
RUSTC_WRAPPER='' cargo check --workspace
RUSTC_WRAPPER='' cargo clippy --workspace -- -D warnings
# Commit → Push → PR → Merge → git worktree remove --force
Clean stale worktrees immediately after merge.
For per-module parallel audits, the YAML prompt should describe:
The orchestrator will fan out one agent per module and consolidate results.
Set minimum_completion_quorum in your prompt's Constraints section to control
consolidation behavior. Example: "Consolidate when ≥80% of modules complete —
do not wait for stragglers beyond the timeout." Without a quorum, a single slow
or failed agent blocks the entire consolidation phase.
Include the relevant template in your YAML prompt's "What I want" section. The orchestrator will decompose into per-module agents.
panic: Find every unwrap(), expect(), panic!(), unreachable!(),
todo!() in non-test code. For each: is the invariant truly guaranteed?
Could a plausible input trigger it? Hot path or cold path?
dead-path: Code that exists but is never reached — match arms for unconstructed variants, feature-gated code that's always on/off, handlers for operations nobody dispatches.
error-swallow: let _ = result;, .unwrap_or_default() on Results,
map_err(|_| ...) discarding context, if let Ok(x) with no else branch,
.ok() converting Result to Option.
unit-confusion: Raw numeric types carrying implicit units — seconds vs millis, bytes vs megabytes, cents vs dollars. Flag arithmetic mixing units.
serde-drift: #[serde(rename_all)] inconsistent with DB columns,
renamed fields missing #[serde(alias)], #[serde(skip)] on fields
callers expect in JSON.
invariant-drift: Struct fields with implied invariants (sorted, non-empty, monotonic, normalized) where mutations don't preserve the invariant.
error-ux: User-visible error paths — does the message help fix the problem? Does it leak internals? Is there a recovery action?
api-contract: Pub types/traits/fns — provisional signatures, missing
docs, breaking-change risks (enums without #[non_exhaustive]).
observability: Critical ops with no tracing span, error branches that log nothing, ops that could take >100ms with no timing.
layer-violation: Imports from above (foundation importing platform), domain logic in wrong layer, circular deps via feature flags.
perf-cliff: N+1 queries, unbounded growth from user input, blocking I/O in async, O(n²) on growable collections.
cancel-safety: Lock acquired then await before release, partial writes before await, MutexGuard across await.
inference-opt: Unnecessary allocations per-request, clone where borrow/Arc suffices, SIMD-unfriendly layouts, missing batch opportunities.
unsafe-audit: Every unsafe block — has SAFETY comment? Is justification correct? Could it be eliminated with a safe alternative?
archive-delta: Compare archived code against live codebase. What's already ported, partially ported, or genuinely unported and valuable?
~$0.35-0.50 per module. Full khive monorepo (29 crates): ~$10-15. ~3% of weekly rate limit per full sweep. Can run 4-5 modes per day.
python or pip. Use uv run.engine: sdk — subprocess engine skips events.RUSTC_WRAPPER: "" in env to prevent sccache errors.{base_branch} before YAMLs exist.ln -s SRC DEST where DEST doesn't exist. NEVER
ln -sf where DEST is an existing directory — creates self-referential loop.tools/flows/ in any lionagi checkout — start here for real-world examples