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
- Review the patterns and examples below
- Apply the relevant patterns to your implementation
- 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-Pattern | Problem | Solution |
|---|---|---|
| Sharing reviews before deliberation | Anchoring bias, groupthink | Maintain strict isolation in Stage 1 |
| Skipping anonymization | Personality bias, authority bias | Always anonymize before mediation |
| Ignoring disagreements | Unresolved conflicts, poor quality | Explicitly identify and mediate all conflicts |
| No audit trail | Cannot trace decisions, no accountability | Generate comprehensive audit logs |
| Rubber-stamp approvals | Council becomes theater, not value | Set clear blocking thresholds, enforce |
| Fixed council composition | Bias, blind spots develop | Rotate members regularly |
| Skipping chairman verdict | No final decision, ambiguity | Always have authoritative final verdict |
| Mediator also reviewing | Conflict of interest, bias | Separate mediator from reviewer roles |
| No action items from unresolved issues | Problems persist | Document 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:
- Maintain reviewer isolation in Stage 1 (no context sharing)
- Anonymize reviews before deliberation to prevent bias
- Document all disagreements and their resolutions
- Generate comprehensive audit trails for traceability
- Set clear decision thresholds (blocking issues, min consensus)
- Rotate council members to prevent institutional bias
- Separate mediator and chairman from reviewer roles
- 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