Consensus delegation

From fritzprix/libr-agent · View interactive version

Consensus delegation is an AI agent skill from the GitHub repository fritzprix/libr-agent. Use when the user needs to evaluate the same question from different perspectives by orchestrating multiple specialized child sessions, collecting their independent conclusions, and reconciling disagreements through parent-mediated follow-ups. Suitable for code review triangulation, architecture or

How to use this skill

Skill file

Consensus via Delegation

Use this skill when one parent session should compare independent expert opinions on the same scoped question, then synthesize a final answer.

This is parent-mediated orchestration: child sessions do not talk to each other. The parent spawns specialists, collects results, detects disagreement, and sends targeted follow-ups.

For general spawn/monitor mechanics and workspace isolation rules, follow delegate first. Read this skill when you need the multi-reviewer workflow, not a single child task.

Core Rules

  1. Same question, same scope. Every child must receive the same objective, boundaries, and output shape. Change only the perspective or assistant specialization.
  2. Shared evidence when code matters. If reviewers must inspect the same repo, use workspaceOverride with the parent's effective workspace path—or paste critical excerpts into every handoff. Children do not inherit parent workspace or agents.md automatically.
  3. Parent is the hub. Only the parent can agent__checkSession or agent__messageToSession its descendants. Sibling sessions cannot see or message each other.
  4. Structured handoffs, human synthesis. Ask each child for a fixed section layout (verdict, findings, risks, confidence). The parent compares text results; there is no built-in vote or merge algorithm.
  5. Do not blindly trust children. Verify file paths, claims, and scope before presenting a final answer.

Workflow

1. Frame the decision

Define before spawning anything:

2. Pick specialists (reuse first)

Default: reuse existing assistant configurations and suitable child sessions and put the review lens in the handoff task. Do not agent__createAgent just to bake a perspective into the system prompt when a capable generalist already exists.

3. Prepare identical handoffs

Each task should differ only in review lens, not in scope or deliverable format.

Include:

When all reviewers need the same codebase, start each child with the same workspaceOverride.

4. Spawn and run

Default pattern:

  1. Inspect existing sessions and reuse a suitable Idle matching-role child with agent__messageToSession(sessionId, complexity="...", message="..."); use agent__spawnSession(configId="...", complexity="...", task="...", waitForResult=false, workspaceOverride="...") only when no suitable child exists, a different role/workspace is needed, or parallel capacity requires another session
  2. Use the session inventory for child IDs and status—agent__listAgents does not return review results
  3. Collect with agent__checkSession(sessionId) or agent__checkSession(sessionId, wait=true) for actual conclusions

Notes:

5. Compare results

For each child result, extract:

Flag material disagreement when verdicts conflict or findings contradict on the same fact. Minor wording differences are not disagreement.

6. Reconcile (only when needed)

When perspectives conflict:

  1. State the specific conflict (fact, tradeoff, or recommendation)
  2. agent__compactSessionContext(sessionId) on children with long histories before large follow-ups
  3. agent__messageToSession(sessionId, complexity="...", message="...") each relevant child with the opposing finding and ask for a focused re-check
  4. agent__checkSession(..., wait=true) again after follow-ups
  5. Stop after 1-2 reconciliation rounds unless new blocking facts appear

Read references/reconciliation.md for round templates and stop conditions.

7. Synthesize in the parent

Produce the final answer yourself:

Do not present a single child's output as the final answer without comparison.

Builtin Tools

| Step | Tool |

| --- | --- |

| Discover assistants | agent__listAgents(type="configs", query="...") or verbose=true |

| Create specialist | agent__createAgent(...) — when no usable existing config; not one config per lens |

| Assign reviewer | agent__messageToSession(sessionId, complexity, message, reset=true) when a matching Idle child exists; otherwise agent__spawnSession(configId, complexity, task, waitForResult=false) |

| Inspect children | agent__listAgents(type="sessions") — IDs and status only |

| Poll or wait | agent__checkSession(sessionId) / agent__checkSession(sessionId, wait=true) — results |

| Reconcile | agent__messageToSession(sessionId, complexity, message) |

| Stop stuck work | agent__checkSession(sessionId) then agent__stopSession(sessionId) when the child is confirmed stuck |

| Long histories | agent__compactSessionContext(sessionId) |

Common Mistakes

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.