Skip to main content

Council Orchestration Patterns

Council Orchestration Patterns

When to Use This Skill

Use this skill when implementing council orchestration patterns patterns in your codebase.

How to Use This Skill

  1. Review the patterns and examples below
  2. Apply the relevant patterns to your implementation
  3. Follow the best practices outlined in this skill

Level 1: Quick Reference (Under 500 tokens)

3-Stage Council Pattern

interface CouncilStage {
name: 'independent' | 'deliberation' | 'verdict';
agents: Agent[];
timeout: number;
}

const councilPipeline: CouncilStage[] = [
{
name: 'independent',
agents: ['reviewer-1', 'reviewer-2', 'reviewer-3'],
timeout: 30000,
},
{
name: 'deliberation',
agents: ['mediator'],
timeout: 15000,
},
{
name: 'verdict',
agents: ['chairman'],
timeout: 10000,
},
];

Quick Council Call

const result = await council.review({
artifact: 'src/auth.ts',
criteria: ['security', 'performance', 'maintainability'],
});

console.log(result.verdict); // 'approve' | 'revise' | 'reject'

Level 2: Implementation Details (Under 2000 tokens)

Stage 1: Independent Review

async function collectIndependentReviews(
artifact: string,
agents: Agent[]
): Promise<Review[]> {
// Run reviews in parallel, isolated from each other
const reviews = await Promise.all(
agents.map(agent =>
agent.review(artifact, {
isolated: true,
noContext: true, // Prevent bias from seeing other reviews
})
)
);

return reviews;
}

Stage 2: Deliberation

async function deliberate(
reviews: Review[],
mediator: Agent
): Promise<DeliberationResult> {
// Identify disagreements
const disagreements = findDisagreements(reviews);

// Mediator synthesizes perspectives
const synthesis = await mediator.analyze({
reviews: anonymize(reviews),
disagreements,
task: 'Reconcile differences and identify common ground',
});

return {
synthesis,
resolvedIssues: synthesis.resolved,
unresolvedIssues: synthesis.unresolved,
};
}

function findDisagreements(reviews: Review[]): Disagreement[] {
const issues = new Map<string, Review[]>();

for (const review of reviews) {
for (const issue of review.issues) {
const key = issue.location;
if (!issues.has(key)) issues.set(key, []);
issues.get(key)!.push(review);
}
}

return Array.from(issues.entries())
.filter(([_, reviews]) => {
const severities = reviews.map(r =>
r.issues.find(i => i.location === _)?.severity
);
return new Set(severities).size > 1; // Disagreement if different severities
})
.map(([location, reviews]) => ({ location, reviews }));
}

Stage 3: Final Verdict

async function renderVerdict(
deliberation: DeliberationResult,
chairman: Agent
): Promise<Verdict> {
const verdict = await chairman.decide({
synthesis: deliberation.synthesis,
unresolvedIssues: deliberation.unresolvedIssues,
decisionCriteria: {
blockingThreshold: 'any-security-issue',
minConsensus: 0.66,
},
});

return {
decision: verdict.decision,
confidence: verdict.confidence,
rationale: verdict.rationale,
actionItems: verdict.actionItems,
auditTrail: generateAuditTrail(deliberation, verdict),
};
}

Level 3: Complete Reference (Full tokens)

Complete Council Orchestration

class CouncilOrchestrator {
private reviewers: Agent[];
private mediator: Agent;
private chairman: Agent;

async runCouncil(artifact: string): Promise<CouncilResult> {
const startTime = Date.now();

// Stage 1: Independent Reviews
const reviews = await this.collectIndependentReviews(artifact);

// Stage 2: Deliberation
const deliberation = await this.deliberate(reviews);

// Stage 3: Verdict
const verdict = await this.renderVerdict(deliberation);

return {
artifact,
duration: Date.now() - startTime,
stages: {
independent: { reviews, duration: reviews[0].duration },
deliberation: { result: deliberation },
verdict: { result: verdict },
},
finalVerdict: verdict,
auditTrail: this.generateAuditTrail(reviews, deliberation, verdict),
};
}

private generateAuditTrail(
reviews: Review[],
deliberation: DeliberationResult,
verdict: Verdict
): AuditTrail {
return {
timestamp: new Date(),
reviewerCount: reviews.length,
consensusScore: calculateConsensus(reviews),
disagreementsResolved: deliberation.resolvedIssues.length,
disagreementsUnresolved: deliberation.unresolvedIssues.length,
finalDecision: verdict.decision,
confidence: verdict.confidence,
};
}
}

Best Practices:

  • Maintain reviewer isolation in Stage 1
  • Anonymize reviews before deliberation
  • Document all disagreements and resolutions
  • Generate comprehensive audit trails
  • Set clear decision thresholds
  • Rotate council members to prevent bias

Success Output

When successful, this skill MUST output:

✅ SKILL COMPLETE: council-orchestration-patterns

Council Review Summary:
- Artifact reviewed: {artifact_path}
- Council members: {N} reviewers, 1 mediator, 1 chairman
- Stages completed: Independent → Deliberation → Verdict
- Final decision: {approve|revise|reject}
- Confidence: {percentage}%
- Consensus score: {score}

Completed:
- [x] Stage 1: Independent reviews collected (isolated, unbiased)
- [x] Stage 2: Deliberation completed (disagreements resolved: {N})
- [x] Stage 3: Final verdict rendered with rationale
- [x] Audit trail generated
- [x] Action items documented

Outputs:
- Reviews: {N} independent assessments
- Disagreements identified: {N}
- Disagreements resolved: {N}
- Unresolved issues: {N}
- Audit trail: {path/to/audit-trail.json}
- Verdict confidence: {HIGH|MEDIUM|LOW}

Completion Checklist

Before marking this skill as complete, verify:

  • All reviewers completed independent reviews (isolated, no context sharing)
  • Reviews anonymized before deliberation
  • Mediator identified and reconciled disagreements
  • Chairman rendered final verdict with rationale
  • Audit trail generated with timestamps and decisions
  • Consensus score calculated and documented
  • Action items created from unresolved issues
  • Verdict meets decision criteria (blocking threshold, min consensus)
  • All council stages completed (3-stage pipeline)

Failure Indicators

This skill has FAILED if:

  • ❌ Reviewer isolation compromised (saw other reviews before completing)
  • ❌ Reviews not anonymized during deliberation (bias introduced)
  • ❌ Disagreements not identified or documented
  • ❌ No mediation performed for conflicts
  • ❌ Verdict lacks clear rationale
  • ❌ Audit trail incomplete or missing
  • ❌ Consensus score below minimum threshold without justification
  • ❌ Security issues found but verdict still "approve"
  • ❌ Council member rotation not implemented (bias risk)

When NOT to Use

Do NOT use this skill when:

  • Single reviewer sufficient (low-stakes, non-critical code)
  • Fast iteration needed (council overhead too high)
  • No disagreement expected (unanimous consensus obvious)
  • Artifact too small to warrant multi-reviewer process
  • Team lacks enough reviewers for council composition
  • Time constraints prevent 3-stage process
  • Automated checks can provide sufficient validation

Use alternatives instead:

  • Standard PR review for routine code changes
  • Automated linting and testing for style/correctness
  • Single senior reviewer for low-complexity changes
  • Pair programming for real-time collaboration

Anti-Patterns (Avoid)

Anti-PatternProblemSolution
Sharing reviews before deliberationAnchoring bias, groupthinkMaintain strict isolation in Stage 1
Skipping anonymizationPersonality bias, authority biasAlways anonymize before mediation
Ignoring disagreementsUnresolved conflicts, poor qualityExplicitly identify and mediate all conflicts
No audit trailCannot trace decisions, no accountabilityGenerate comprehensive audit logs
Rubber-stamp approvalsCouncil becomes theater, not valueSet clear blocking thresholds, enforce
Fixed council compositionBias, blind spots developRotate members regularly
Skipping chairman verdictNo final decision, ambiguityAlways have authoritative final verdict
Mediator also reviewingConflict of interest, biasSeparate mediator from reviewer roles
No action items from unresolved issuesProblems persistDocument and assign action items

Principles

This skill embodies:

  • #4 Separation of Concerns - Clear roles: reviewers, mediator, chairman
  • #5 Eliminate Ambiguity - Explicit verdict with rationale, not vague feedback
  • #6 Clear, Understandable, Explainable - Comprehensive audit trails, documented reasoning
  • #8 No Assumptions - Verify consensus, don't assume agreement
  • #10 Measure → Learn → Improve - Track consensus scores, disagreement patterns

Council Orchestration Principles:

  1. Maintain reviewer isolation in Stage 1 (no context sharing)
  2. Anonymize reviews before deliberation to prevent bias
  3. Document all disagreements and their resolutions
  4. Generate comprehensive audit trails for traceability
  5. Set clear decision thresholds (blocking issues, min consensus)
  6. Rotate council members to prevent institutional bias
  7. Separate mediator and chairman from reviewer roles
  8. Always render authoritative final verdict with rationale

3-Stage Pipeline:

  • Stage 1: Independent Review - Isolated, parallel, unbiased assessments
  • Stage 2: Deliberation - Mediation, conflict resolution, synthesis
  • Stage 3: Verdict - Authoritative decision with confidence and rationale

Full Standard: CODITECT-STANDARD-AUTOMATION.md