CouncilMode
A democratic orchestration engine where multiple specialized agents nominate, vote, and execute tasks in a collaborative loop.
{
"council": [
"ProjectManager",
"AgileDeveloper",
"CreativeWriter"
],
"maxTasksPerIteration": 3,
"maxIterations": 10
}
RunLinterTask
UpdateReadmeTaskExecuting: RunLinterTask...
Collaborative Reasoning Flow
| Phase | Description |
|---|---|
| Nomination | Each council member uses its specific strategy to propose tasks based on the current state. |
| Voting | Members review all nominations and vote for the best path forward. Ties are resolved by priority. |
| Reflection | After execution, every member updates its internal state independently, allowing for diverse perspectives. |
Built-in Council Strategies
CouncilMode ships with three primary personas that balance technical rigor with project velocity.
Prioritizes high-level goals, roadmap alignment, and documentation.
Focuses on TDD, linting, implementation details, and refactoring.
Ensures user-facing outputs, comments, and commit messages are professional.
class CouncilMode(config: CouncilModeConfig) : CognitiveMode() {
override fun handleUserMessage(userMessage: String, task: SessionTask) {
// 1. Initialize Council Members
config.council.forEach { strategy ->
reasoningStates[strategy.name] = strategy.initialize(...)
}
// 2. The Iteration Loop
while (iteration++ < maxIterations) {
val nominations = config.council.flatMap { it.getNominations(...) }
val selectedTasks = voteOnTasks(nominations)
// 3. Parallel Execution
val results = selectedTasks.map { runTask(it) }
// 4. Multi-Agent Reflection
config.council.forEach { it.update(results) }
}
}
}
Integration Guide
To enable CouncilMode, update your OrchestrationConfig. This mode is ideal for complex
refactoring or architectural changes where a single agent might miss edge cases.
val config = OrchestrationConfig(
mode = CognitiveModeType.Council,
council = listOf(
CognitiveSchemaStrategy.ProjectManager,
CognitiveSchemaStrategy.AgileDeveloper
),
autoFix = true // Allow council to execute plans without manual approval
)