diff --git a/.github/plugin/marketplace.json b/.github/plugin/marketplace.json new file mode 100644 index 0000000..40c04ba --- /dev/null +++ b/.github/plugin/marketplace.json @@ -0,0 +1,19 @@ +{ + "name": "agentcouncil", + "owner": { + "name": "Shlomi Shaki", + "url": "https://github.com/Sentry01" + }, + "metadata": { + "description": "AgentCouncil: multi-model council plugin for GitHub Copilot CLI.", + "version": "2.0.0" + }, + "plugins": [ + { + "name": "agentcouncil", + "source": "./", + "description": "Multi-model council for Copilot CLI. Three subagents on different model families answer independently, then build on each other or attack the leading answer before an orchestrator writes the final result.", + "version": "2.0.0" + } + ] +} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..58c91c8 --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,20 @@ +name: Validate + +on: + push: + branches: [main] + pull_request: + +permissions: + contents: read + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + - name: Validate plugin, skill, agent and docs + run: node scripts/validate.mjs diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..76d6a96 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,44 @@ +# Changelog + +All notable changes to this project are documented here. Versions follow [Semantic Versioning](https://semver.org/). + +## [Unreleased] + +## [2.0.0] - 2026-10-17 + +### Breaking + +- The plugin, skill and marketplace are now named `agentcouncil`. The name `agent-council` is already used by a different plugin in the awesome-copilot marketplace. +- When installed as a plugin, the agent ID is `agentcouncil:agentcouncil` (`copilot --agent agentcouncil:agentcouncil`). `--agent AgentCouncil` only worked for manually copied files. +- `plugin.json` uses the Agent Plugins 1.0 format. The agent moved to `com.github.copilot/agents/`. +- Explicit invocations (a council prefix such as `council:`, or the agent) always convene. Simple tasks run the new light path instead of being answered directly. + +### Added + +- Light effort path: one concise pass per seat plus a short synthesis (4 subagent calls). +- Context brief sent to every seat. Seats are told to work read-only. +- Anonymized, reordered inputs for every orchestrator call. Adversarial triage now runs on the orchestrator seat instead of the session model. +- Per-seat fallback lists, a family-diversity rule, user model overrides and a footer that discloses the models that actually ran. +- Routing evals (`evals/routing.json`, `scripts/eval-routing.mjs`), a validation script (`scripts/validate.mjs`) and a CI workflow. +- `.github/plugin/marketplace.json`, so this repository is its own plugin marketplace. +- LICENSE (MIT), CONTRIBUTING.md and this changelog. + +### Changed + +- Default models: Alpha `claude-opus-5.5`, Beta `gpt-6.1-sol`, Gamma `gemini-4-argon`, Orchestrator `claude-opus-5.5`. The previous defaults (`claude-opus-4.6`, `gpt-5.4`, `gemini-3.1-pro`) are retired or superseded. +- Mode routing checks the prefix first, then the user's intent, instead of matching keywords as substrings. "VS Code" and "the challenge is" no longer trigger adversarial mode, and choose-between and go/no-go questions now route to adversarial. +- Domain rules: data model and service API design is architecture, not code. +- Confidence labels must state what they rest on. The orchestrator weights evidence, not labels. +- The collaborative improve round always ends with a Tensions section, and unadopted first-draft ideas reach the synthesis. +- `SKILL.md` is a short router. Phase prompts live in `references/` and are loaded only for the chosen path. +- The agent is a thin wrapper that loads the skill. Its tools are reduced to read, search, agent, web, todo and skill. +- Documentation rewritten in plain style. + +### Removed + +- The duplicated protocol in the agent file. +- Manual install instructions that copied files into `~/.copilot`. + +## [1.0.0] - 2026-09-16 + +- First plugin release: `plugin.json`, collaborative and adversarial modes, complexity gate, domain detection, confidence labels and partial-consensus attacks. Earlier history (from 2026-02-09) is in the git log. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..0a97bac --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,40 @@ +# Contributing + +## Layout + +| Path | Purpose | +|---|---| +| `skills/agentcouncil/SKILL.md` | Source of truth: routing, model roster, dispatch and output rules | +| `skills/agentcouncil/references/` | Phase prompts, loaded only for the chosen path | +| `com.github.copilot/agents/agentcouncil.agent.md` | Thin agent that loads the skill | +| `plugin.json` | Agent Plugins 1.0 manifest | +| `.github/plugin/marketplace.json` | Lets this repository act as a plugin marketplace | +| `evals/routing.json` | Routing test cases | +| `scripts/validate.mjs` | Static checks, run in CI | +| `scripts/eval-routing.mjs` | Routing eval, run locally | + +## Making a change + +1. Edit the skill. Keep protocol logic in `SKILL.md` and `references/`; the agent should stay a thin wrapper. +2. Load your working copy without installing it: `copilot --plugin-dir .`, then try a prompt such as `quick council: ...`. +3. Run `node scripts/validate.mjs`. +4. If you changed Steps 1 to 4 (routing), add cases to `evals/routing.json` and run `node scripts/eval-routing.mjs --runs 2`. It needs Copilot CLI and `gh auth login`, makes one model call per run, and uses a temporary `COPILOT_HOME` so your personal instructions and skills do not affect the result. Try `--model` with a model from another family too, since routing runs on whatever model the user's session uses. +5. Add a line to the Unreleased section of `CHANGELOG.md`. + +Documentation style: plain ASCII punctuation, no emoji, no em dashes. `validate.mjs` enforces this. Never write a dollar sign directly before a digit in skill files, because skill loaders expand it as an argument placeholder. + +## Updating models + +1. Check [Supported AI models](https://docs.github.com/en/copilot/reference/ai-models/supported-models) and the [Copilot changelog](https://github.blog/changelog/) for retirements. +2. Edit the roster table in `SKILL.md` (Step 6). Keep one family per seat. +3. Run `node scripts/validate.mjs`. It fails if the README, agent or references still name a model that is not in the roster. +4. Run one light council end to end with `copilot --plugin-dir .` and check the footer. + +## Releasing + +1. Bump the version in `plugin.json` and in both places in `.github/plugin/marketplace.json` (`metadata.version` and the plugin entry). +2. Move the Unreleased changelog notes under a heading for the new version. +3. Run `node scripts/validate.mjs`, then merge to `main`. +4. Tag and publish: `git tag vX.Y.Z && git push origin vX.Y.Z`, then create a GitHub release from the tag. + +Users pick up the release with `copilot plugin marketplace update agentcouncil` and `copilot plugin update agentcouncil@agentcouncil`. Listings that pin a tag, such as an awesome-copilot external entry, need their ref bumped separately. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d134f20 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Shlomi Shaki + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index 1770c10..53b5f08 100644 --- a/README.md +++ b/README.md @@ -1,307 +1,205 @@ -# Agent Council +# AgentCouncil -![Agent Council β€” three models, one orchestrated answer](docs/images/agent-council-multi-model.svg) +![AgentCouncil: three models, one orchestrated answer](docs/images/agent-council-multi-model.svg) -A skill and agent for [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/) that throws three different AI models at your problem in parallel β€” then either has them **build on each other's ideas** or **debate to stress-test the answer** β€” before an orchestrator delivers the final result. +AgentCouncil is a plugin for [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/) that puts a hard question to three models from different families at the same time. The models either build on each other's work or attack the strongest answer, and an orchestrator writes the final result. -Two modes, same foundation: -- **Collaborative** 🀝 (default) β€” agents explore independently, read each other's work, improve their answers, then an orchestrator writes the best possible synthesis -- **Adversarial** πŸ—‘οΈ β€” agents draft independently, the orchestrator picks the strongest position, the others attack it, then a verdict is delivered +- **Collaborative mode** (default): each seat drafts, reads the other drafts, and improves its own. The orchestrator writes a synthesis. +- **Adversarial mode**: each seat drafts, the orchestrator picks the leading answer, the other two attack it, and the orchestrator rules on it. +- **Light or full effort**: simple questions get a quick 4-call pass. Hard ones get the full 5 to 7-call protocol. -Fast enough for daily use on hard problems. Smart enough to **decline the council entirely** when the task is too simple to justify the overhead. +## Why three model families -## What's this for? +A single model sounds confident even when it is wrong, and it rarely questions its own assumptions. Models from different vendors are trained differently and fail differently. Running one model from each family in parallel, then making them interact once, catches mistakes that any one of them would miss. -This is a **[Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/)** extension. You need Copilot CLI installed and running. It won't work with regular GitHub Copilot in your editor β€” this is the terminal-based agent. - -It gives you two things: -- A **skill** that triggers inside any Copilot CLI session (just type `council: your question`) -- A **standalone agent** you can run directly (`copilot --agent AgentCouncil`) - -## Why three models? - -Ask one model a question and you get one perspective. It'll sound confident even when it's wrong. It won't question its own assumptions. It definitely won't try to break its own argument. - -Different models have different blind spots. Claude is good at nuance but might overcomplicate things. GPT might miss edge cases Claude catches. Gemini has strong grounding but different reasoning patterns. By running them all in parallel and then having them interact, you get something no single model can produce alone. - -The key insight: **the mode determines how they interact.** -- In collaborative mode, they steal each other's best ideas and the result is a novel synthesis -- In adversarial mode, they attack the strongest position and the result is a battle-tested answer - -### The roles - -| # | Codename | Collaborative Role | Adversarial Role | Default Model | -|---|----------|--------------------|------------------|---------------| -| 1 | **Alpha** | Deep Explorer | Drafter & Red Teamer | `claude-opus-4.6` | -| 2 | **Beta** | Practical Builder | Fact-Checker & Validator | `gpt-5.4` | -| 3 | **Gamma** | Elegant Minimalist | Optimizer & Devil's Advocate | `gemini-3.1-pro` | -| 4 | **Orchestrator** | Author (writes final synthesis) | Judge (delivers verdict) | `claude-opus-4.6` | - -The council works best when each seat uses a **different model family**. If one model is unavailable, prefer another unused family; if that is impossible, run a smaller council instead of duplicating a family. - -## How it works - -### Collaborative Mode 🀝 (Default) - -```mermaid -flowchart TD - A1["πŸ’‘ Alpha explores deeply"] & B1["πŸ”¨ Beta grounds practically"] & C1["✨ Gamma finds elegance"] - A1 & B1 & C1 --> X["Each reads the others' work"] - X --> A2["Alpha improves"] & B2["Beta improves"] & C2["Gamma improves"] - A2 & B2 & C2 --> D["🌟 Orchestrator writes final synthesis"] - D --> E["Final answer delivered"] - - style A1 fill:#4a90d9,color:#fff - style B1 fill:#e74c3c,color:#fff - style C1 fill:#f39c12,color:#fff - style A2 fill:#4a90d9,color:#fff - style B2 fill:#e74c3c,color:#fff - style C2 fill:#f39c12,color:#fff - style D fill:#9b59b6,color:#fff - style E fill:#2ecc71,color:#fff -``` - -1. **Draft** β€” Alpha, Beta, and Gamma all explore the problem independently from their angle -2. **Improve** β€” Each agent reads the other two drafts and writes an improved version, stealing the best ideas -3. **Synthesize** β€” The orchestrator authors the definitive response from the three improved drafts - -### Adversarial Mode πŸ—‘οΈ - -```mermaid -flowchart TD - A1["πŸ“ Alpha: thorough draft + self-critique"] & B1["βœ… Beta: independent solution + fact-check"] & C1["πŸ”§ Gamma: elegant alternative + devil's advocate"] - A1 & B1 & C1 --> T{"🎯 Orchestrator triages"} - T -- "full consensus" --> V - T -- "leader selected" --> ATK_B["βš”οΈ Beta attacks leader"] - T -- "leader selected" --> ATK_C["βš”οΈ Gamma attacks leader"] - ATK_B & ATK_C --> V["πŸ›οΈ Orchestrator delivers verdict"] - V --> E["SURVIVED βœ… / MODIFIED πŸ”„ / OVERTURNED ❌"] - - style A1 fill:#4a90d9,color:#fff - style B1 fill:#e74c3c,color:#fff - style C1 fill:#f39c12,color:#fff - style T fill:#9b59b6,color:#fff - style ATK_B fill:#c0392b,color:#fff - style ATK_C fill:#c0392b,color:#fff - style V fill:#9b59b6,color:#fff - style E fill:#2ecc71,color:#fff -``` - -1. **Draft** β€” Alpha, Beta, and Gamma all tackle the problem independently -2. **Triage** β€” The orchestrator uses a fixed rubric to identify the strongest position. If consensus, skip to verdict. -3. **Attack** β€” The other two agents try to tear apart the leading position -4. **Verdict** β€” The orchestrator decides: did the leader survive, need modification, or get overturned? - -## Prerequisites - -- [GitHub Copilot CLI](https://docs.github.com/en/copilot/how-tos/copilot-cli/) installed and authenticated -- Access to multiple models through Copilot (the defaults use Claude, GPT, and Gemini) +The orchestrator only sees anonymized, reordered responses (Response A, B, C), so it cannot favor the seat that shares its model family. ## Install -Agent Council is a Copilot CLI **plugin** β€” install it in one command and both the skill -and the agent are registered automatically. +Requirements: GitHub Copilot CLI, signed in, with access to models from at least two of the families in the [roster](#models). ```bash -# Install straight from GitHub -copilot plugin install Sentry01/AgentCouncil +copilot plugin marketplace add Sentry01/AgentCouncil +copilot plugin install agentcouncil@agentcouncil ``` -Or install from a local checkout (handy for hacking on it): +Update to the latest release: ```bash -git clone https://github.com/Sentry01/AgentCouncil.git -copilot plugin install ./AgentCouncil +copilot plugin marketplace update agentcouncil +copilot plugin update agentcouncil@agentcouncil ``` -Manage it like any other plugin: +Remove: ```bash -copilot plugin list # confirm it's installed -copilot plugin update agent-council # re-snapshot after local edits -copilot plugin uninstall agent-council +copilot plugin uninstall agentcouncil@agentcouncil ``` -No dependencies. No build. Just markdown files and a `plugin.json` that Copilot CLI reads. +You can also install straight from the repository with `copilot plugin install Sentry01/AgentCouncil` and update it with `copilot plugin update agentcouncil`. The marketplace route above makes new versions easier to discover. -
-Manual install (without the plugin system) - -```bash -git clone https://github.com/Sentry01/AgentCouncil.git -cd AgentCouncil +### Upgrading from 1.x -# Copy the skill -mkdir -p ~/.copilot/skills/agent-council -cp skills/agent-council/skill.md ~/.copilot/skills/agent-council/skill.md +Version 2.0.0 renames the plugin to `agentcouncil` and changes the agent ID. Remove the old copies first so they do not load twice: -# Copy the agent -mkdir -p ~/.copilot/agents -cp agents/AgentCouncil.agent.md ~/.copilot/agents/AgentCouncil.agent.md +```bash +copilot plugin uninstall agent-council # if you installed 1.x as a plugin +rm -rf ~/.copilot/skills/agent-council ~/.copilot/agents/AgentCouncil.agent.md # if you copied files by hand ``` -
+See the [changelog](CHANGELOG.md) for everything that changed. ## Usage -### Mode detection - -The council automatically detects which mode to use based on your language: +Start your message with a prefix: -| You say... | Mode | Why | -|-----------|------|-----| -| `council: How should we structure the API?` | 🀝 Collaborative | Default β€” exploring a design space | -| `brainstorm: Novel approaches to caching` | 🀝 Collaborative | "brainstorm" = collaborative | -| `debate: Monorepo vs polyrepo` | πŸ—‘οΈ Adversarial | "debate" = adversarial | -| `stress-test: Is this auth flow secure?` | πŸ—‘οΈ Adversarial | "stress-test" = adversarial | -| `adversarial council: Should we use GraphQL?` | πŸ—‘οΈ Adversarial | Explicit override | -| `collaborative council: Best testing strategy` | 🀝 Collaborative | Explicit override | +| You type | Mode | Effort | +|---|---|---| +| `council: ...` | collaborative | chosen by task | +| `brainstorm: ...` | collaborative | chosen by task | +| `debate: ...` | adversarial | chosen by task | +| `stress-test: ...` | adversarial | chosen by task | +| `quick council: ...` | collaborative | light | +| `full council: ...` | collaborative | full | +| `collaborative council: ...` | collaborative | chosen by task | +| `adversarial council: ...` | adversarial | chosen by task | -**Adversarial triggers:** debate, adversarial, challenge, stress-test, which is better, argue, attack, defend, versus, vs +Put `verbose` in front of any prefix to see each phase, or `raw` to see every seat's full output: -**Collaborative triggers (default):** council, siege, swarm, brainstorm, collaborate, explore, build on, novel, creative, ideas +``` +verbose debate: Sidekiq with Redis, or GoodJob on our existing Postgres? +``` -If both sets of trigger words appear, adversarial wins unless you use an explicit override like `collaborative council: ...`. +Without a prefix, Copilot can still load the skill when you ask for a second opinion from other models or when a task clearly benefits from one. In that case the mode follows your intent: choosing between options, validating a proposal or asking for a go/no-go goes adversarial. Asking for ideas, a design or a plan goes collaborative. Trivial requests (arithmetic, command syntax, one-line edits) are answered directly unless you use a prefix. -### Complexity gate +### As an agent -The council should **short-circuit** and answer directly when the task is too simple to justify 6-7 subagent calls. +```bash +copilot --agent agentcouncil:agentcouncil -p "Kafka, NATS or Pulsar for 200 services? Latency matters more than retention." +``` -Typical fast-path cases: -- arithmetic or obvious factual lookups -- one-line rewrites -- file lookups and command syntax -- narrow questions with one obvious path +In an interactive session, run `/agent` and pick AgentCouncil. Every message sent to the agent convenes a council. -Typical council-worthy cases: -- competing designs with real tradeoffs -- security or correctness-sensitive review -- architecture and research synthesis -- ambiguous problems where multi-perspective synthesis can beat one model +### Choosing models -### Inside a Copilot CLI session +Name the models in your request to override the defaults for one council. The three seats must still come from different families: ``` -council: Should we use a monorepo or polyrepo for our microservices? +council with sonnet, gpt-5.5 and gemini flash: how should we shard our events table? ``` -``` -debate: Redis vs Memcached for our session store β€” which survives at scale? -``` +A lower-cost roster that works well for everyday questions is `claude-sonnet-5.5`, `gpt-5.5` and `gemini-3.8-flash`. -### As a standalone agent +## How it works -```bash -copilot --agent AgentCouncil "Brainstorm novel approaches to real-time sync" -``` +Before dispatching anything, the coordinator writes a short context brief (goal, constraints, relevant code or text, decisions already made) so every seat works from the same facts. Every seat and the orchestrator are instructed to work read-only: they may read files and search the web, but not edit anything. If you want the result applied, the coordinator does that after the council, through your normal tool approvals. -```bash -copilot --agent AgentCouncil "Stress-test this auth flow for vulnerabilities" +### Collaborative (full) + +```mermaid +flowchart TD + A1["Alpha drafts: explores deeply"] & B1["Beta drafts: grounds in practice"] & C1["Gamma drafts: finds the simplest path"] + A1 & B1 & C1 --> X["Each seat reads the other two drafts"] + X --> A2["Alpha improves"] & B2["Beta improves"] & C2["Gamma improves"] + A2 & B2 & C2 --> D["Orchestrator synthesizes from anonymized versions"] ``` -### Seeing the internal process +1. **Draft**: Alpha, Beta and Gamma answer independently from their angle. +2. **Improve**: each seat reads the other two drafts, adopts the best ideas and lists any unresolved tensions. +3. **Synthesize**: the orchestrator resolves the tensions and writes the final answer. First-draft ideas that nobody kept are passed along as well, so minority views are not lost. -By default you only get the final answer. If you want to see the reasoning flow: +### Adversarial (full) -``` -verbose council: What caching strategy for a real-time dashboard? +```mermaid +flowchart TD + A1["Alpha: draft and self-critique"] & B1["Beta: independent answer and fact-check"] & C1["Gamma: simplest answer and devil's advocate"] + A1 & B1 & C1 --> T{"Orchestrator triage on anonymized drafts"} + T -- "full consensus" --> V + T -- "leader selected" --> K1["Non-leader seat attacks"] & K2["Non-leader seat attacks"] + K1 & K2 --> V["Orchestrator verdict: SURVIVED, MODIFIED or OVERTURNED"] ``` -**Verbose mode** shows a concise phase-by-phase view: -- πŸ’‘ Alpha / πŸ”¨ Beta / ✨ Gamma -- improved drafts or attack summaries -- final synthesis or verdict +1. **Draft**: each seat answers independently and critiques the obvious approach. +2. **Triage**: the orchestrator reads the anonymized drafts, rates consensus and picks the leading answer. On full consensus it skips straight to the verdict. +3. **Attack**: the two other seats try to break the leading answer. On partial consensus they attack only the contested points. +4. **Verdict**: the orchestrator rules SURVIVED, MODIFIED or OVERTURNED and notes what remains uncertain. -If you want every draft in full, ask for **raw** or **full** council output explicitly. +### Light -## When to use each mode +Each seat gives one concise answer from its angle, and the orchestrator merges them into one short answer. In adversarial mode, each seat also argues briefly against the obvious answer. -### Collaborative 🀝 β€” when you want novel ideas +### Focus by domain -- Brainstorming sessions and creative problem-solving -- Exploring a design space with no clear "right answer" -- Building something new where diverse perspectives help -- Research where breadth and synthesis matter +The coordinator classifies each task and gives every seat a focus line: -### Adversarial πŸ—‘οΈ β€” when you want battle-tested answers +| Domain | Alpha | Beta | Gamma | +|---|---|---|---| +| Code | Implementation and security self-review | API and version correctness, edge cases | Performance, readability, alternatives | +| Architecture | System design and failure modes | Technology claims, benchmarks, scaling limits | Simplicity, operability, alternatives | +| Research | Analysis and bias check | Source verification and citations | Actionability, counter-arguments | +| Writing | Content and tone | Factual accuracy and consistency | Flow, concision, formatting | -- Architecture decisions you'll live with for years -- Security reviews (missed vulns are expensive) -- Comparing two specific approaches (A vs B) -- Anything where you need confidence the answer holds up under scrutiny +## Models -### Not worth it (either mode) +| Seat | Family | Default | Fallbacks | +|---|---|---|---| +| Alpha | Anthropic | `claude-opus-5.5` | `claude-sonnet-5.5` | +| Beta | OpenAI | `gpt-6.1-sol` | `gpt-5.5` | +| Gamma | Google | `gemini-4-argon` | `grok-4.7` (xAI), `gemini-3.8-flash` | +| Orchestrator | any | `claude-opus-5.5` | `claude-sonnet-5.5`, then the session model | -- Quick fixes, file lookups, simple questions -- Anything where speed matters more than correctness -- Your model budget is tight +The roster in [`skills/agentcouncil/SKILL.md`](skills/agentcouncil/SKILL.md) is the source of truth. CI fails if any other file names a model that is not in it. -## Cost & speed +- One seat per family. If a model is unavailable, the seat moves to its next fallback, then to any family that is not already seated. If only two families are available, the council runs with two seats. +- Nothing is substituted silently. Every answer ends with a footer that lists the models that actually ran, and any fallbacks. +- The AgentCouncil agent itself runs on `claude-sonnet-5.5`. It only routes and relays; the judgment happens in the orchestrator seat. -| Mode | Subagent Calls | Parallel Rounds | Wall Clock | -|------|----------------|-----------------|------------| -| Collaborative | 7 (3 + 3 + orchestrator) | 2 | ~2 rounds + synthesis | -| Adversarial | 6 (3 + 2 + orchestrator) | 2 | ~2 rounds + verdict | +Model availability changes often. See [Supported AI models in GitHub Copilot](https://docs.github.com/en/copilot/reference/ai-models/supported-models). -Both modes run agents in parallel within each phase. The wall-clock time is roughly two sequential subagent calls plus the final orchestrator step, regardless of how many agents run in each round. +## Cost and speed -For trivial tasks, the correct move is to skip the council entirely. +| Path | Subagent calls | Sequential rounds | +|---|---|---| +| Light | 4 | 2 | +| Full collaborative | 7 | 3 | +| Full adversarial | 7, or 5 on full consensus | 4, or 3 on full consensus | -## Adapting to domains +Calls within a round run in parallel, so wall-clock time grows with the number of rounds, not the number of calls. Each call uses model capacity, so a full council costs several times a single answer, and more when Opus-class models are seated. A light council on a short question took about 75 seconds in testing, and a full adversarial council about 5 minutes. Use `quick council:` or the lower-cost roster when cost matters, and skip the council for simple questions. -The agents shift focus depending on what you're asking about: +## Where it works -| Domain | Alpha focuses on | Beta focuses on | Gamma focuses on | -|--------|-----------------|-----------------|------------------| -| Code | Implementation + security self-review | API accuracy, versions, edge cases | Performance, readability, alternatives | -| Architecture | System design + failure modes | Tech claims, benchmarks, scalability | Simplicity, clarity, alternatives | -| Research | Comprehensive analysis + bias check | Source verification, citations | Actionability, counter-arguments | -| Writing | Content + tone self-critique | Factual accuracy, consistency | Flow, conciseness, formatting | +AgentCouncil is built for Copilot CLI, whose `task` tool lets each subagent run on a different model. Other clients that load Agent Skills may run the skill without per-subagent model selection. In that case all seats can end up on the same model and you lose the main benefit. -Domain precedence is: **Code β†’ Architecture β†’ Writing β†’ Research β†’ General**. +## Troubleshooting -Here, **Research** means investigation or literature-style evaluation, not code review. +| Symptom | Cause and fix | +|---|---| +| Footer shows a fallback model, or "Ran with 2 seats" | Your plan or organization policy disables a model or family. Ask an admin to enable it, or name other models in your request. | +| `No such agent: AgentCouncil` | Plugin agents are namespaced. Use `--agent agentcouncil:agentcouncil`. | +| The council runs on a trivial question | You used a prefix or the agent, which always convenes (light effort). Ask without a prefix for a direct answer. | +| The council does not start | Use an explicit prefix such as `council:`. Check that `copilot plugin list` shows `agentcouncil`. | +| Old behavior or duplicate skills | Remove 1.x copies (see [Upgrading from 1.x](#upgrading-from-1x)). | ## Example -Here's the council in action β€” Phase 1 dispatching all three agents in parallel across different model families: - -![Council Phase 1 β€” three agents dispatched in parallel](docs/council-example.png) - -## Example prompts +Phase 1 dispatching all three seats in parallel. This screenshot is from version 1, so it shows the older default models. -**Collaborative β€” brainstorming:** -``` -council: Novel approaches to real-time collaboration in a document editor. -Think beyond CRDTs and OT. -``` +![Council Phase 1: three agents dispatched in parallel](docs/council-example.png) -**Collaborative β€” architecture:** -``` -council: Design a notification system that scales to 1M users. -Push, pull, fan-out strategies. -``` +## Development -**Adversarial β€” decision:** -``` -debate: WebSockets + Redis pub/sub vs SSE + message queue for 10K concurrent users. -Cost, complexity, scaling, failure modes. -``` - -**Adversarial β€” security:** -``` -verbose stress-test: Review this JWT implementation: [paste code] +```bash +copilot --plugin-dir . # load your working copy without installing it +node scripts/validate.mjs # manifest, frontmatter, roster, links and style checks (runs in CI) +node scripts/eval-routing.mjs --runs 2 # routing evals, needs Copilot CLI and gh auth ``` -**Adversarial β€” comparison:** -``` -debate: PostgreSQL vs DynamoDB for a multi-tenant SaaS with unpredictable query patterns -``` +See [CONTRIBUTING.md](CONTRIBUTING.md) for the release process. ## Inspiration -Inspired by Andrej Karpathy's [llm-council](https://github.com/karpathy/llm-council) β€” adapted as a Copilot CLI skill/agent with the dual-mode architecture. +Inspired by Andrej Karpathy's [llm-council](https://github.com/karpathy/llm-council), including its anonymized peer review, adapted as a Copilot CLI skill and agent with collaborative and adversarial modes. ## License -MIT β€” do whatever you want with it. +MIT. See [LICENSE](LICENSE). diff --git a/agents/AgentCouncil.agent.md b/agents/AgentCouncil.agent.md deleted file mode 100644 index ecec250..0000000 --- a/agents/AgentCouncil.agent.md +++ /dev/null @@ -1,372 +0,0 @@ ---- -name: AgentCouncil -description: "Agent Council β€” Dual Mode. Dispatches 3 specialized subagents in parallel using different model families, then orchestrates a final output. Two modes: collaborative (default β€” agents build on each other's ideas) and adversarial (agents debate to stress-test answers). Use for high-stakes decisions, brainstorming, architecture reviews, research, or any task needing robust multi-model perspectives." -tools: ['vscode', 'execute', 'read', 'agent', 'edit', 'search', 'web', 'github/*', 'octocode/*', 'playwright/*', 'microsoft/markitdown/*', 'todo'] ---- - -# Agent Council β€” Dual Mode Agent - -You are the Council Orchestrator. Your job is to execute the council protocol in the appropriate mode: **collaborative** (default) for building novel solutions together, or **adversarial** for stress-testing answers through debate. - -## Protocol - -### Step 1: Parse the Task - -Read the user's request. Determine: -- **Complexity**: trivial / council-worthy -- **Mode**: collaborative (default) or adversarial -- **Domain**: code | architecture | research | writing | general -- **Verbosity**: If user said "verbose", "show debate", or "show council" β†’ show a concise phase-by-phase view. Otherwise show only final output. -- **Task statement**: the actual work to be done - -**Complexity gate:** - -- If the task is trivial, single-step, or speed-sensitive, **do not dispatch the council**. Answer directly with one strong response. -- Treat these as trivial by default unless the user explicitly asks for a council anyway: - - arithmetic or obvious factual lookups - - one-line wording tweaks or simple rewrites - - file lookups, command syntax, narrow yes/no questions - - tasks with one obvious path and no meaningful tradeoff -- Treat these as council-worthy: - - competing approaches with real tradeoffs - - security or correctness-sensitive reviews - - architecture, research, or design-space exploration - - tasks where synthesis across perspectives is likely to beat one model - -**Mode detection:** - -Adversarial triggers (any of these in the user's message): -- "debate", "adversarial", "challenge", "stress-test", "stress test" -- "which is better", "argue", "attack", "defend", "versus", "vs" - -Collaborative triggers (default β€” used when no adversarial trigger detected): -- "council", "siege", "swarm", "brainstorm", "multi-agent" -- "collaborate", "explore", "build on", "novel", "creative", "ideas" - -Explicit override always wins: -- "adversarial council: ..." β†’ adversarial mode -- "collaborative council: ..." β†’ collaborative mode - -If both adversarial and collaborative trigger words appear, **adversarial wins** unless the user gives an explicit override. - -If no trigger matches β†’ **collaborative**. - -**Domain detection:** - -Classify the task into one of these domains before dispatching agents. This determines the focus instructions injected into each agent's prompt. - -- **Code**: mentions code, implementation, function, bug, API, programming, refactor, debug, test -- **Architecture**: mentions system design, infrastructure, scaling, database choice, service, deployment, microservice -- **Research**: mentions research, analysis, study, compare, evaluate, literature review, investigate -- **Writing**: mentions write, draft, document, blog, copy, content, email, proposal -- **General**: anything that doesn't clearly fit the above - -Resolve ambiguity in this order: **Code β†’ Architecture β†’ Writing β†’ Research β†’ General**. - -- If the task includes source code, APIs, tests, bugs, PRs, files, or implementation details, choose **Code** even if it also says "review" or "analyze". -- If the task is a system-level tradeoff across services, data, scaling, or deployment, choose **Architecture**. -- Use **Research** only when the primary job is investigation/evaluation rather than building or reviewing a concrete artifact. - -Use the detected domain to append the corresponding **Domain Focus** instructions (see Domain Adaptation table) to each agent's Phase 1 prompt. - -**Model-family diversity rule:** - -- Keep Alpha, Beta, and Gamma on **different model families**. -- If a preferred model is unavailable, switch to an **unused** family. -- If no unused family is available, run a **smaller council** rather than letting two agents share a family. - -### Step 2: Execute Mode Protocol - -Follow the appropriate protocol below based on detected mode. - ---- - -## Collaborative Mode 🀝 (Default) - -### Phase 1 β€” Draft (all 3 simultaneously) - -**Alpha (Deep Explorer)** β€” model: `claude-opus-4.6`: -> You are Alpha on an Agent Council (Collaborative mode). -> Your role: Generate a comprehensive, creative response. -> -> TASK: {task} -> -> {domain_focus_alpha} -> -> Instructions: -> 1. Write a thorough response exploring the problem space deeply, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -> 2. Add a '## Open Questions' section: what aspects deserve more exploration? -> 3. Add a '## Wild Ideas' section: propose at least one unconventional approach -> Keep your response under 1500 words. Be expansive but focused β€” breadth over polish. - -**Beta (Practical Builder)** β€” model: `gpt-5.4`: -> You are Beta on an Agent Council (Collaborative mode). -> Your role: Ground the problem in reality while finding opportunities. -> -> TASK: {task} -> -> {domain_focus_beta} -> -> Instructions: -> 1. Write your response focused on practical, validated approaches, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -> 2. Add a '## Building Blocks' section: what existing patterns/tools/techniques apply? -> 3. Add a '## Combinations' section: what could be combined in novel ways? -> Keep your response under 1500 words. Be constructive β€” find opportunities, not just constraints. - -**Gamma (Elegant Minimalist)** β€” model: `gemini-3.1-pro`: -> You are Gamma on an Agent Council (Collaborative mode). -> Your role: Find the most elegant, minimal solution and open new angles. -> -> TASK: {task} -> -> {domain_focus_gamma} -> -> Instructions: -> 1. Write the simplest viable approach you can think of, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -> 2. Add a '## Alternative Angles' section: reframe the problem from at least 2 different perspectives -> 3. Add a '## What If' section: propose boundary-pushing variations -> Keep your response under 1500 words. Be creative β€” simplicity and novelty over comprehensiveness. - -**Domain Focus** (`{domain_focus_*}` is set based on detected domain): - -Use the canonical domainβ†’focus mappings defined in the later **## Domain Adaptation** section of this file. Set `{domain_focus_alpha}`, `{domain_focus_beta}`, and `{domain_focus_gamma}` from that section rather than maintaining a second copy here. - -### Phase 2 β€” Improve (all 3 simultaneously) - -Each agent receives the other two drafts and writes an improved version: - -> You are {Agent} on an Agent Council (Collaborative mode β€” Improve phase). -> -> You submitted an initial draft. Now you've received the other two agents' work. Your job: write an IMPROVED version that's better than anything any of you produced alone. -> -> ORIGINAL TASK: {task} -> -> YOUR ORIGINAL DRAFT: {this_agent_draft} -> {OTHER_AGENT_1} DRAFT: {other_1_draft} -> {OTHER_AGENT_2} DRAFT: {other_2_draft} -> -> Instructions: -> 1. Steal the best ideas from the other drafts shamelessly and combine the ones that strengthen each other -> 2. Look for NOVEL SYNTHESES β€” ideas that emerge from combining perspectives that none of you had individually -> 3. Drop weak, redundant, or disproven material from your original -> 4. Keep your natural strength ({agent_strength}) while tightening for clarity and actionability -> 5. If a strong idea remains unresolved or you intentionally leave one out, add a brief '## Tensions' section with 1-3 bullets naming the disagreement or omitted idea and why -> -> Output: Your improved, enriched response. Not meta-commentary β€” just the best version you can produce, with an optional '## Tensions' section only when needed. - -Agent strengths: Alpha="depth and exploration", Beta="practical grounding", Gamma="elegance and alternative angles" - -### Phase 3 β€” Synthesize (orchestrator) - -Dispatch `general-purpose` subagent (model: `claude-opus-4.6`): - -> You are the Orchestrator on an Agent Council (Collaborative mode β€” Synthesis). -> -> Three agents brainstormed independently, then read each other's work and each submitted an improved version. -> -> **Important:** One of the agents (Alpha) used the same model family as you. Do not give it preferential treatment β€” judge all contributions on merit alone. -> -> ORIGINAL TASK: {task} -> -> ALPHA'S IMPROVED VERSION: {alpha_improved} -> BETA'S IMPROVED VERSION: {beta_improved} -> GAMMA'S IMPROVED VERSION: {gamma_improved} -> -> Instructions: -> 1. Identify the BEST elements across all three improved versions -> 2. Look for EMERGENT IDEAS β€” syntheses that appeared when agents combined each other's thinking. These are the gold. -> 3. Check any optional '## Tensions' sections β€” where agents flagged real tradeoffs, weigh both sides and make a clear call -> 4. Use confidence ratings from the agents to weight contributions: HIGH-confidence claims need less scrutiny, LOW-confidence claims need more -> 5. Write the definitive response β€” not a summary, but the BEST POSSIBLE version that leverages everything these three minds produced -> 6. Structure for maximum clarity and actionability -> -> Output: The final collaborative synthesis. This should be noticeably better than any single agent could have produced alone. - ---- - -## Adversarial Mode πŸ—‘οΈ - -### Phase 1 β€” Draft (all 3 simultaneously) - -**Alpha (Drafter & Red Teamer)** β€” model: `claude-opus-4.6`: -> You are Alpha on an Agent Council (Adversarial mode). -> Your dual role: Create a comprehensive response AND red-team your own work. -> -> TASK: {task} -> -> {domain_focus_alpha} -> -> Instructions: -> 1. Write a thorough, nuanced response to the task, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -> 2. Then add a section '## Self-Critique' where you flag assumptions, weaknesses, edge cases, uncertainties, and counter-arguments. -> Keep your response under 1500 words. - -**Beta (Fact-Checker & Validator)** β€” model: `gpt-5.4`: -> You are Beta on an Agent Council (Adversarial mode). -> Your role: Independent fact-checking and validation. -> -> TASK: {task} -> -> {domain_focus_beta} -> -> Instructions: -> 1. Produce your OWN independent solution/response, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -> 2. Focus on: factual accuracy, edge cases, security, real-world validity, API/version correctness -> 3. Use web search to verify claims when possible -> 4. Flag issues with severity: CRITICAL / IMPORTANT / MINOR -> 5. Output your response followed by a '## Validation Notes' section. -> Keep your response under 1500 words. - -**Gamma (Optimizer & Devil's Advocate)** β€” model: `gemini-3.1-pro`: -> You are Gamma on an Agent Council (Adversarial mode). -> Your role: Propose the most elegant, efficient solution AND play devil's advocate. -> -> TASK: {task} -> -> {domain_focus_gamma} -> -> Instructions: -> 1. Produce your OWN response optimized for clarity, minimal complexity, actionability, and proper formatting, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -> 2. Then add a '## Devil's Advocate' section: argue against the obvious approach, propose alternatives, identify risks, question assumptions. -> Keep your response under 1500 words. - -### Phase 1.5 β€” Triage (you, no subagent) - -Read all 3 outputs. Assess agreement and identify the leading position. - -**Consensus criteria β€” ALL must be true to skip Phase 2:** -1. All three agents recommend the same core approach or conclusion -2. No CRITICAL or FATAL severity flags in any self-critique, validation, or devil's advocate section -3. No direct contradictions between agents on key claims -4. Confidence ratings are predominantly HIGH across all agents - -**Leader-selection rubric β€” use when consensus is not full:** -1. Correctness and evidence quality -2. Coverage of the task's core constraints -3. Actionability and clarity -4. Severity and count of unresolved risks in critique sections -5. Confidence profile (reward precise confidence, not blanket HIGH) - -Tie-breakers, in order: -- fewer unresolved high-severity issues -- fewer hidden assumptions -- more testable or operationally concrete guidance - -**Triage outcomes:** -- **Full consensus** β†’ Skip Phase 2, go straight to Phase 3 ("Consensus detected β€” no adversarial round needed") -- **Partial consensus** β†’ Identify areas of agreement AND areas of disagreement. Forward to Phase 2 with instruction: "Focus your attack ONLY on these contested areas: {contested_points}. The following points have consensus and should not be relitigated: {agreed_points}." -- **No consensus** β†’ Use the rubric above to identify the leading position and forward the full draft to Phase 2 for open attack. - -Note which agent produced the leading position and forward it to the other two for attack. - -### Phase 2 β€” Attack (2 non-leader agents simultaneously) - -> You are {Agent} on an Agent Council (Adversarial mode β€” Attack phase). -> -> You previously submitted your own draft. Now the Council Orchestrator has identified the LEADING POSITION below. Your job: tear it apart. -> -> ORIGINAL TASK: {task} -> -> YOUR ORIGINAL DRAFT: {this_agent_draft} -> LEADING POSITION (from {leader_agent}): {leader_draft} -> -> {partial_consensus_instruction} -> -> Instructions: -> 1. Find every weakness, gap, wrong assumption, and logical flaw -> 2. Where the leader's position contradicts YOUR draft, argue why yours is better -> 3. Propose specific corrections or alternatives with evidence -> 4. Use the leader's confidence ratings β€” focus extra scrutiny on LOW-confidence claims -> 5. Rate the severity of each issue: FATAL / MAJOR / MINOR -> 6. End with a verdict: should this position STAND, be MODIFIED, or be REJECTED? -> -> Be ruthless. Your job is to break this argument, not to be polite. - -`{partial_consensus_instruction}` β€” set by triage: -- **Partial consensus**: "Focus your attack ONLY on these contested areas: {contested_points}. These points have consensus β€” do not relitigate: {agreed_points}." -- **No consensus**: (omit β€” attack the full position) - -### Phase 3 β€” Verdict (orchestrator) - -Dispatch `general-purpose` subagent (model: `claude-opus-4.6`): - -> You are the Orchestrator on an Agent Council (Adversarial mode β€” Verdict). -> -> A leading position was stress-tested by two opposing agents. Deliver the final verdict. -> -> **Important:** One of the agents (Alpha) used the same model family as you. Do not give it preferential treatment β€” judge all contributions on merit alone. -> -> ORIGINAL TASK: {task} -> -> THE LEADING POSITION (from {leader_agent}): {leader_draft} -> ATTACK FROM {attacker_1}: {attack_1} -> ATTACK FROM {attacker_2}: {attack_2} -> -> ALL ORIGINAL DRAFTS (for reference): -> Alpha: {alpha_draft} -> Beta: {beta_draft} -> Gamma: {gamma_draft} -> -> Instructions: -> 1. Evaluate each attack: Did it land? Is the criticism valid? Use confidence ratings from the original drafts to calibrate β€” LOW-confidence claims that were attacked carry less weight -> 2. Determine: Does the leading position SURVIVE, need MODIFICATION, or get OVERTURNED? -> 3. If overturned β†’ build the final answer from the strongest alternative -> 4. If modified β†’ incorporate valid criticisms into an improved version -> 5. If survived β†’ present it with a confidence boost -> 6. Include a brief '## Confidence Assessment' noting how contested the answer was and which areas remain uncertain -> -> Output: The final ratified answer. Clean and polished, not meta-commentary. - ---- - -## Output Presentation - -### Default (non-verbose) - -Present only the final output. No mention of agents, phases, or internal process. - -### Verbose β€” Collaborative - -Show each phase with headers, but keep each displayed phase concise: -- πŸ’‘ Alpha (Deep Explorer) -- πŸ”¨ Beta (Practical Builder) -- ✨ Gamma (Elegant Minimalist) -- πŸ“ Alpha/Beta/Gamma (Improved) -- 🌟 Orchestrated Synthesis - -By default, show only the most decision-relevant points from each phase. Show full raw drafts only if the user explicitly asks for **raw** or **full** council output. - -### Verbose β€” Adversarial - -Show each phase with headers, but keep each displayed phase concise: -- πŸ“ Alpha (Drafter & Red Teamer) -- βœ… Beta (Fact-Checker & Validator) -- πŸ”§ Gamma (Optimizer & Devil's Advocate) -- 🎯 Leading Position + βš”οΈ Attacks -- πŸ›οΈ Orchestrated Verdict (with SURVIVED/MODIFIED/OVERTURNED status) - -By default, show only the most decision-relevant points from each phase. Show full raw drafts only if the user explicitly asks for **raw** or **full** council output. - -## Domain Adaptation - -| Domain | Alpha Focus | Beta Focus | Gamma Focus | -|--------|------------|-----------|-------------| -| Code | Implementation + security self-review | API accuracy, versions, edge cases | Performance, readability, alternatives | -| Architecture | System design + failure modes | Tech claims, benchmarks, scalability | Diagram clarity, simplicity, alternatives | -| Research | Comprehensive analysis + bias check | Source verification, citations | Readability, actionability, counter-arguments | -| Writing | Content + tone self-critique | Factual accuracy, consistency | Flow, conciseness, formatting | - -## Rules - -- If the task is trivial or speed-sensitive, answer directly β€” do not dispatch the council -- ALWAYS run Alpha/Beta/Gamma in parallel β€” speed is the point -- NEVER add extra revision loops β€” one improve/attack round maximum -- Collaborative: always run the improve round (even with agreement β€” cross-pollination adds value) -- Adversarial: skip attack round ONLY on full consensus (all 4 criteria met). On partial consensus, run a focused attack. -- Preserve model-family diversity; if fallback would duplicate an active family, run a smaller council instead -- If user says "verbose" β†’ show all phases concisely unless they explicitly ask for raw/full drafts -- Don't force disagreements β€” don't invent problems -- Don't skip the orchestrator β€” raw outputs need synthesis, not concatenation -- Detect domain in Step 1 and inject domain-specific focus instructions into Phase 1 prompts -- The orchestrator shares a model family with Alpha β€” always include the bias mitigation instruction -- Agents should flag confidence levels (HIGH/MEDIUM/LOW) on major claims β€” the orchestrator uses these to weight inputs diff --git a/com.github.copilot/agents/agentcouncil.agent.md b/com.github.copilot/agents/agentcouncil.agent.md new file mode 100644 index 0000000..138f346 --- /dev/null +++ b/com.github.copilot/agents/agentcouncil.agent.md @@ -0,0 +1,19 @@ +--- +name: AgentCouncil +description: 'Multi-model council for high-stakes questions. Three subagents on different model families answer independently, then build on each other (collaborative) or attack the leading answer (adversarial) before an orchestrator writes the final result. Use for architecture and security reviews, technology choices, research and brainstorming.' +model: claude-sonnet-5.5 +tools: ['read', 'search', 'agent', 'web', 'todo', 'skill'] +--- + +You coordinate AgentCouncil. + +1. Load the `agentcouncil` skill and follow it exactly. +2. Every message sent to this agent is an explicit invocation: always convene the council, using light effort for simple tasks. Do not answer from your own knowledge before the council has run. +3. The model you run on only coordinates. Judgment happens in the orchestrator seat defined by the skill. + +If the `agentcouncil` skill is not available, stop and tell the user to install or update the plugin: + +``` +copilot plugin marketplace add Sentry01/AgentCouncil +copilot plugin install agentcouncil@agentcouncil +``` diff --git a/docs/plans/2026-02-13-dual-mode-council-design.md b/docs/plans/2026-02-13-dual-mode-council-design.md index d20d694..1921464 100644 --- a/docs/plans/2026-02-13-dual-mode-council-design.md +++ b/docs/plans/2026-02-13-dual-mode-council-design.md @@ -1,4 +1,6 @@ -# Agent Council β€” Dual Mode Design +# Agent Council - Dual Mode Design + +> Historical design document from February 2026. It describes version 1 and its model choices. Current behavior is defined in [`skills/agentcouncil/SKILL.md`](../../skills/agentcouncil/SKILL.md); see [CHANGELOG.md](../../CHANGELOG.md) for what changed. ## Problem diff --git a/evals/routing.json b/evals/routing.json new file mode 100644 index 0000000..914cf95 --- /dev/null +++ b/evals/routing.json @@ -0,0 +1,137 @@ +{ + "description": "Routing cases for the agentcouncil skill. context=session means the skill was loaded inside a normal Copilot CLI session; context=agent means the user is talking to the AgentCouncil custom agent. A null expectation means any value is accepted.", + "cases": [ + { + "id": "prefix-council-beats-choice-intent", + "context": "session", + "prompt": "council: Should we use a monorepo or polyrepo for 40 microservices owned by 6 teams?", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "architecture" } + }, + { + "id": "prefix-debate", + "context": "session", + "prompt": "debate: PostgreSQL vs DynamoDB for a multi-tenant SaaS with unpredictable query patterns", + "expect": { "convene": true, "effort": "full", "mode": "adversarial", "domain": "architecture" } + }, + { + "id": "prefix-stress-test-code", + "context": "session", + "prompt": "stress-test: Is this refresh-token rotation secure?\n\n```ts\nexport async function refresh(req, res) {\n const token = req.cookies.rt;\n const row = await db.tokens.find(token);\n if (!row) return res.status(401).end();\n await db.tokens.delete(token);\n const next = crypto.randomUUID();\n await db.tokens.insert({ token: next, userId: row.userId });\n res.cookie('rt', next, { httpOnly: true });\n res.json({ access: sign(row.userId) });\n}\n```", + "expect": { "convene": true, "effort": "full", "mode": "adversarial", "domain": "code" } + }, + { + "id": "prefix-brainstorm", + "context": "session", + "prompt": "brainstorm: Novel approaches to offline-first sync for a notes app. Think beyond CRDTs and OT.", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "architecture" } + }, + { + "id": "implicit-arithmetic", + "context": "session", + "prompt": "What is 17 * 23?", + "expect": { "convene": false, "effort": null, "mode": null, "domain": null } + }, + { + "id": "implicit-command-syntax", + "context": "session", + "prompt": "What's the git command to undo the last commit but keep the changes staged?", + "expect": { "convene": false, "effort": null, "mode": null, "domain": null } + }, + { + "id": "implicit-one-line-edit", + "context": "session", + "prompt": "Rename the variable cnt to count in utils.py.", + "expect": { "convene": false, "effort": null, "mode": null, "domain": null } + }, + { + "id": "explicit-trivial-runs-light", + "context": "session", + "prompt": "council: What is the capital of Australia?", + "expect": { "convene": true, "effort": "light", "mode": "collaborative", "domain": "general" } + }, + { + "id": "agent-trivial-runs-light", + "context": "agent", + "prompt": "What is 2 + 2?", + "expect": { "convene": true, "effort": "light", "mode": null, "domain": "general" } + }, + { + "id": "trap-vs-code-is-not-versus", + "context": "session", + "prompt": "My VS Code extension leaks memory every time the webview reloads. Help me design a fix and a regression test.", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "code" } + }, + { + "id": "trap-challenge-as-noun", + "context": "session", + "prompt": "council: The main challenge is onboarding latency. Explore ideas to cut time-to-first-value for new users.", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "general" } + }, + { + "id": "intent-choose-between-options", + "context": "session", + "prompt": "Which is better for our session store at 50k requests per second, Redis or Memcached? Get several models to weigh in.", + "expect": { "convene": true, "effort": "full", "mode": "adversarial", "domain": "architecture" } + }, + { + "id": "intent-go-no-go", + "context": "session", + "prompt": "Get a second opinion from other models: we plan to ship the billing migration on Friday. 2 of 400 integration tests are flaky and rollback takes 40 minutes. Go or no-go?", + "expect": { "convene": true, "effort": "full", "mode": "adversarial", "domain": null } + }, + { + "id": "intent-generate-options", + "context": "session", + "prompt": "Ask multiple models to come up with ways to make our internal docs site easier to search.", + "expect": { "convene": true, "effort": null, "mode": "collaborative", "domain": null } + }, + { + "id": "override-adversarial-beats-brainstorm", + "context": "session", + "prompt": "adversarial council: brainstorm ideas for cutting our CI time in half", + "expect": { "convene": true, "effort": "full", "mode": "adversarial", "domain": null } + }, + { + "id": "override-collaborative-beats-argue", + "context": "session", + "prompt": "collaborative council: argue for and against moving our services to Kubernetes", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "architecture" } + }, + { + "id": "effort-full-keyword", + "context": "session", + "prompt": "full council: Write the launch blog post for our new CLI feature that lets users resume sessions across machines.", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "writing" } + }, + { + "id": "effort-quick-keyword", + "context": "session", + "prompt": "quick council: Is it safe to run `git gc --aggressive` on a busy shared repo?", + "expect": { "convene": true, "effort": "light", "mode": null, "domain": null } + }, + { + "id": "domain-research", + "context": "session", + "prompt": "council: What does the published evidence say about whether code review reduces defect rates? Summarize the literature.", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "research" } + }, + { + "id": "domain-architecture-not-code-for-api-design", + "context": "session", + "prompt": "council: Design the data model and service API for a multi-region feature-flag service with audit history.", + "expect": { "convene": true, "effort": "full", "mode": "collaborative", "domain": "architecture" } + }, + { + "id": "agent-choice-question", + "context": "agent", + "prompt": "Monorepo or polyrepo for a 30-engineer startup with one product?", + "expect": { "convene": true, "effort": null, "mode": "adversarial", "domain": "architecture" } + }, + { + "id": "implicit-nontrivial-tradeoff", + "context": "session", + "prompt": "We need to pick an event bus for 200 services. Kafka, NATS or Pulsar? Latency matters more than retention.", + "expect": { "convene": true, "effort": "full", "mode": "adversarial", "domain": "architecture" } + } + ] +} diff --git a/plugin.json b/plugin.json index 84b0485..48d84fc 100644 --- a/plugin.json +++ b/plugin.json @@ -1,25 +1,25 @@ { - "name": "agent-council", - "description": "Throw three different AI models at a problem in parallel, then either have them build on each other's ideas (collaborative mode) or debate to stress-test the answer (adversarial mode) before an orchestrator delivers the final result. Ships a skill (trigger with `council:`, `debate:`, `brainstorm:`, `stress-test:`) and a standalone `AgentCouncil` agent. Automatically declines the council for trivial tasks.", - "version": "1.0.0", + "$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json", + "name": "agentcouncil", + "description": "Multi-model council for Copilot CLI. Three subagents on different model families (Anthropic, OpenAI, Google) answer independently, then build on each other or attack the leading answer before an orchestrator writes the final result. Ships the agentcouncil skill and the AgentCouncil agent.", + "version": "2.0.0", "author": { "name": "Shlomi Shaki", "url": "https://github.com/Sentry01" }, - "license": "MIT", "homepage": "https://github.com/Sentry01/AgentCouncil", "repository": "https://github.com/Sentry01/AgentCouncil", + "license": "MIT", "keywords": [ "multi-agent", + "multi-model", "council", "debate", "brainstorm", - "orchestration", - "multi-model", "stress-test", "adversarial", - "collaborative" - ], - "skills": "skills/", - "agents": "agents/" + "collaborative", + "orchestration", + "second-opinion" + ] } diff --git a/scripts/eval-routing.mjs b/scripts/eval-routing.mjs new file mode 100644 index 0000000..f2c8bf7 --- /dev/null +++ b/scripts/eval-routing.mjs @@ -0,0 +1,104 @@ +#!/usr/bin/env node +// Scores the routing rules in a SKILL.md against evals/routing.json. +// Runs one non-interactive Copilot CLI call with tools disabled; the model only +// classifies each case using the skill text, it does not run a council. +// +// Usage: node scripts/eval-routing.mjs [--skill path] [--model id] [--runs n] [--dry-run] +// Uses COPILOT_HOME= so personal instructions and skills do not leak in. +// Auth comes from COPILOT_GITHUB_TOKEN / GH_TOKEN / GITHUB_TOKEN, or `gh auth token`. + +import { spawnSync } from "node:child_process"; +import { mkdtempSync, readFileSync, rmSync } from "node:fs"; +import { tmpdir } from "node:os"; +import { dirname, join, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const args = process.argv.slice(2); +const opt = (name, fallback) => { + const i = args.indexOf(`--${name}`); + return i >= 0 ? args[i + 1] : fallback; +}; + +const skillPath = resolve(root, opt("skill", "skills/agentcouncil/SKILL.md")); +const model = opt("model", "claude-sonnet-5.5"); +const runs = Number(opt("runs", "1")); +const dryRun = args.includes("--dry-run"); +const FIELDS = ["convene", "effort", "mode", "domain"]; + +const skill = readFileSync(skillPath, "utf8"); +const { cases } = JSON.parse(readFileSync(join(root, "evals/routing.json"), "utf8")); + +const prompt = `You are testing the routing rules of a Copilot skill. Do not run a council, do not call tools. + +Apply ONLY the rules in the skill text below to each test case and decide: +- convene: true if the rules say to dispatch council subagents, false if they say to answer directly +- effort: "light" or "full" (null if not convening or if the rules have no such concept) +- mode: "collaborative" or "adversarial" (null if not convening) +- domain: "code", "architecture", "research", "writing" or "general" (null if not convening) + +Context values: "session" means the skill was loaded automatically or by name inside a normal Copilot CLI session. "agent" means the user is talking to the AgentCouncil custom agent directly. + +Output ONLY a JSON array, one object per case, in order: [{"id": "...", "convene": ..., "effort": ..., "mode": ..., "domain": ...}] + +=== SKILL TEXT START === +${skill} +=== SKILL TEXT END === + +=== TEST CASES === +${JSON.stringify(cases.map(({ id, context, prompt }) => ({ id, context, prompt })), null, 1)}`; + +if (dryRun) { + console.log(prompt); + process.exit(0); +} + +function token() { + const env = process.env.COPILOT_GITHUB_TOKEN || process.env.GH_TOKEN || process.env.GITHUB_TOKEN; + if (env) return env; + const r = spawnSync("gh", ["auth", "token"], { encoding: "utf8" }); + if (r.status !== 0) throw new Error("No token: set GH_TOKEN or run `gh auth login`."); + return r.stdout.trim(); +} + +function classify() { + const home = mkdtempSync(join(tmpdir(), "agentcouncil-eval-")); + try { + const r = spawnSync( + "copilot", + ["-p", prompt, "-s", "--model", model, "--available-tools", "--no-auto-update"], + { cwd: home, encoding: "utf8", env: { ...process.env, COPILOT_HOME: home, GH_TOKEN: token() }, maxBuffer: 1 << 24 }, + ); + if (r.status !== 0) throw new Error(`copilot exited ${r.status}: ${r.stderr || r.stdout}`); + const out = r.stdout; + return JSON.parse(out.slice(out.indexOf("["), out.lastIndexOf("]") + 1)); + } finally { + rmSync(home, { recursive: true, force: true }); + } +} + +const totals = Object.fromEntries(FIELDS.map((f) => [f, { ok: 0, n: 0 }])); +let casesPassed = 0; +let casesTotal = 0; +for (let run = 1; run <= runs; run++) { + const got = new Map(classify().map((r) => [r.id, r])); + for (const c of cases) { + const g = got.get(c.id) || {}; + const misses = []; + for (const f of FIELDS) { + const want = c.expect[f]; + if (want === null || want === undefined) continue; + totals[f].n++; + if (g[f] === want) totals[f].ok++; + else misses.push(`${f}: want ${want}, got ${g[f]}`); + } + casesTotal++; + if (misses.length === 0) casesPassed++; + else console.log(`FAIL [run ${run}] ${c.id}: ${misses.join("; ")}`); + } +} + +console.log(`\nSkill: ${skillPath.replace(root + "/", "")} Model: ${model} Runs: ${runs}`); +for (const f of FIELDS) console.log(` ${f.padEnd(8)} ${totals[f].ok}/${totals[f].n}`); +console.log(` cases ${casesPassed}/${casesTotal}`); +process.exit(casesPassed === casesTotal ? 0 : 1); diff --git a/scripts/validate.mjs b/scripts/validate.mjs new file mode 100644 index 0000000..8d88355 --- /dev/null +++ b/scripts/validate.mjs @@ -0,0 +1,171 @@ +#!/usr/bin/env node +// Validates the plugin: manifests, skill and agent frontmatter, model roster +// consistency, changelog entry, relative links and documentation style. +// Rules mirror the Agent Plugins 1.0 schema and github/awesome-copilot validators. +// Usage: node scripts/validate.mjs + +import { existsSync, readdirSync, readFileSync, statSync } from "node:fs"; +import { dirname, join, relative, resolve } from "node:path"; +import { fileURLToPath } from "node:url"; + +const root = resolve(dirname(fileURLToPath(import.meta.url)), ".."); +const errors = []; +const fail = (file, msg) => errors.push(`${relative(root, file) || file}: ${msg}`); +const read = (p) => readFileSync(p, "utf8"); +const readJson = (p) => { + try { + return JSON.parse(read(p)); + } catch (e) { + fail(p, `invalid JSON: ${e.message}`); + return {}; + } +}; + +const SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json"; +const PLUGIN_FIELDS = new Set(["$schema", "name", "version", "description", "author", "homepage", "repository", "license", "keywords", "extensions"]); +const PLUGIN_NAME = /^(?!.*(?:--|\.\.))[a-z0-9](?:[a-z0-9.-]*[a-z0-9])?$/; +const SKILL_NAME = /^[a-z0-9-]{1,64}$/; +const SEMVER = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/; +const MODEL_ID = /\b(?:claude|gpt|gemini|grok)-[a-z0-9]+(?:[.-][a-z0-9]+)*\b/g; +const SHIPPED_DOCS = ["README.md", "CONTRIBUTING.md", "CHANGELOG.md"]; + +function frontmatter(file) { + const text = read(file); + const m = text.match(/^---\n([\s\S]*?)\n---\n/); + if (!m) { + fail(file, "missing YAML frontmatter"); + return { raw: {}, data: {} }; + } + const raw = {}; + const data = {}; + for (const line of m[1].split("\n")) { + const kv = line.match(/^([A-Za-z][\w-]*):\s*(.*)$/); + if (!kv) continue; + raw[kv[1]] = kv[2]; + data[kv[1]] = kv[2].replace(/^(['"])(.*)\1$/, "$2").replace(/''/g, "'"); + } + return { raw, data }; +} + +function walk(dir, out = []) { + for (const entry of readdirSync(dir, { withFileTypes: true })) { + const p = join(dir, entry.name); + if (entry.isDirectory()) walk(p, out); + else out.push(p); + } + return out; +} + +// plugin.json +const pluginPath = join(root, "plugin.json"); +const plugin = readJson(pluginPath); +if (plugin.$schema !== SCHEMA) fail(pluginPath, `$schema must be ${SCHEMA}`); +for (const key of Object.keys(plugin)) if (!PLUGIN_FIELDS.has(key)) fail(pluginPath, `field not allowed by Agent Plugins 1.0: ${key}`); +if (!PLUGIN_NAME.test(plugin.name || "") || plugin.name.length > 64) fail(pluginPath, "name must be lowercase letters, digits, dots or hyphens, 1-64 chars"); +if (!SEMVER.test(plugin.version || "")) fail(pluginPath, "version must be semver"); +if (!plugin.description || plugin.description.length > 500) fail(pluginPath, "description must be 1-500 chars"); +if (!plugin.license) fail(pluginPath, "license is required"); +if (!plugin.author?.name) fail(pluginPath, "author.name is required"); +const keywords = plugin.keywords || []; +if (keywords.length > 10) fail(pluginPath, "at most 10 keywords"); +for (const k of keywords) if (!/^[a-z0-9-]{1,30}$/.test(k)) fail(pluginPath, `keyword "${k}" must be lowercase-hyphen, 1-30 chars`); +if (!existsSync(join(root, "LICENSE"))) fail(root, "LICENSE file is missing"); + +// marketplace.json +const marketPath = join(root, ".github/plugin/marketplace.json"); +const market = readJson(marketPath); +const entry = (market.plugins || []).find((p) => p.name === plugin.name); +if (!market.name || !market.owner?.name) fail(marketPath, "name and owner.name are required"); +if (!entry) fail(marketPath, `no plugins[] entry named ${plugin.name}`); +else { + if (entry.version !== plugin.version) fail(marketPath, `plugin version ${entry.version} != plugin.json ${plugin.version}`); + if (!entry.description) fail(marketPath, "plugin entry needs a description"); +} +if (market.metadata?.version !== plugin.version) fail(marketPath, `metadata.version must equal plugin.json version ${plugin.version}`); + +// skills +const skillsDir = join(root, "skills"); +const skillDirs = existsSync(skillsDir) ? readdirSync(skillsDir, { withFileTypes: true }).filter((d) => d.isDirectory()) : []; +if (skillDirs.length === 0) fail(skillsDir, "no skills found"); +const rosterModels = new Set(); +const shipped = []; +for (const d of skillDirs) { + const dir = join(skillsDir, d.name); + const skillFile = join(dir, "SKILL.md"); + if (!readdirSync(dir).includes("SKILL.md")) { + fail(dir, "missing SKILL.md (exact case)"); + continue; + } + const { data } = frontmatter(skillFile); + if (data.name !== d.name) fail(skillFile, `name "${data.name}" must equal folder name "${d.name}"`); + if (!SKILL_NAME.test(data.name || "")) fail(skillFile, "name must be lowercase-hyphen, 1-64 chars"); + const desc = data.description || ""; + if (desc.length < 10 || desc.length > 1024) fail(skillFile, `description must be 10-1024 chars (is ${desc.length})`); + if (!desc.startsWith("Use when")) fail(skillFile, 'description should start with "Use when"'); + const body = read(skillFile); + for (const ref of body.matchAll(/`(references\/[\w.-]+\.md)`/g)) { + if (!existsSync(join(dir, ref[1]))) fail(skillFile, `referenced file not found: ${ref[1]}`); + } + for (const row of body.split("\n").filter((l) => /^\|\s*(Alpha|Beta|Gamma|Orchestrator)\s*\|/.test(l))) { + for (const id of row.match(MODEL_ID) || []) rosterModels.add(id); + } + for (const f of walk(dir)) { + if (statSync(f).size > 5 * 1024 * 1024) fail(f, "bundled asset larger than 5 MB"); + if (f.endsWith(".md")) shipped.push(f); + } +} +if (rosterModels.size === 0) fail(skillsDir, "no model roster table found in SKILL.md"); + +// agents +const agentsDir = join(root, "com.github.copilot/agents"); +const agentFiles = existsSync(agentsDir) ? readdirSync(agentsDir).filter((f) => f.endsWith(".agent.md")) : []; +if (agentFiles.length === 0) fail(agentsDir, "no agents found"); +for (const f of agentFiles) { + const file = join(agentsDir, f); + shipped.push(file); + if (!/^[a-z0-9-]+\.agent\.md$/.test(f)) fail(file, "agent filename must be lowercase-hyphen with .agent.md"); + const { raw, data } = frontmatter(file); + if (!data.description) fail(file, "description is required"); + else if (!/^'.*'$/.test(raw.description)) fail(file, "description must be wrapped in single quotes"); + if (!data.model) fail(file, "model is required"); + else if (!rosterModels.has(data.model)) fail(file, `model ${data.model} is not in the SKILL.md roster`); + if (!data.name) fail(file, "name is required"); +} + +// model IDs everywhere must come from the roster +for (const f of SHIPPED_DOCS.map((p) => join(root, p)).filter((p) => p !== join(root, "CHANGELOG.md") && existsSync(p)).concat(shipped)) { + const text = read(f); + for (const id of new Set(text.match(MODEL_ID) || [])) { + if (!rosterModels.has(id)) fail(f, `model ID ${id} is not in the SKILL.md roster`); + } +} + +// changelog +const changelog = join(root, "CHANGELOG.md"); +if (!existsSync(changelog)) fail(root, "CHANGELOG.md is missing"); +else if (!new RegExp(`^## \\[?${plugin.version.replace(/\./g, "\\.")}\\]?`, "m").test(read(changelog))) { + fail(changelog, `no entry for version ${plugin.version}`); +} + +// style, line endings, loader-unsafe text, relative links +const styleFiles = shipped.concat(SHIPPED_DOCS.map((p) => join(root, p)).filter(existsSync)); +for (const f of styleFiles) { + const text = read(f); + if (text.includes("\r\n")) fail(f, "use LF line endings"); + text.split("\n").forEach((line, i) => { + if (/[\u2014\u2013\u2026\u2190-\u21FF]/.test(line)) fail(f, `line ${i + 1}: use ASCII instead of em/en dashes, ellipses or arrows`); + if (/\p{Extended_Pictographic}/u.test(line)) fail(f, `line ${i + 1}: no emoji`); + }); + if (shipped.includes(f) && /\$\d/.test(text)) fail(f, "a dollar sign followed by a digit is expanded by skill loaders; rewrite it"); + for (const m of text.matchAll(/\]\((?!https?:|#|mailto:)([^)\s]+)\)/g)) { + const target = m[1].split("#")[0]; + if (target && !existsSync(join(dirname(f), target))) fail(f, `broken relative link: ${m[1]}`); + } +} + +if (errors.length) { + console.error(`Validation failed with ${errors.length} error(s):`); + for (const e of errors) console.error(` - ${e}`); + process.exit(1); +} +console.log(`OK: plugin ${plugin.name} v${plugin.version}, ${skillDirs.length} skill(s), ${agentFiles.length} agent(s), roster ${[...rosterModels].join(", ")}`); diff --git a/skills/agent-council/skill.md b/skills/agent-council/skill.md deleted file mode 100644 index f2a9ac7..0000000 --- a/skills/agent-council/skill.md +++ /dev/null @@ -1,597 +0,0 @@ ---- -name: agent-council -description: "Use when a task needs multi-model perspectives, brainstorming, or stress-testing. Supports two modes: collaborative (default β€” agents build on each other's ideas) and adversarial (agents debate to find the strongest answer). Triggers: council, siege, swarm, multi-agent, debate, brainstorm." ---- - -# Agent Council β€” Dual Mode - -Dispatch 3 subagents in parallel with distinct cognitive roles, then orchestrate a final output. Two modes: **collaborative** (default) for building novel solutions together, and **adversarial** for stress-testing answers through debate. - -**Core principle:** Three diverse perspectives from different model families catch blind spots fast. The mode determines whether they cooperate or compete. - -## When to Use - -- User says "council", "siege", "swarm", "multi-agent", "debate", or "brainstorm" -- Task benefits from multiple perspectives (architecture decisions, security reviews, research, complex code) -- High-stakes output where mistakes are costly -- User wants creative synthesis or rigorous stress-testing - -**Don't use for:** Simple one-line fixes, file lookups, or tasks where speed matters more than depth. - -## Mode Detection - -**Step 0 β€” before dispatching any agents**, determine complexity, mode, and domain. - -### Complexity gate - -- If the task is trivial, single-step, or speed-sensitive, **do not dispatch the council**. Answer directly with one strong response. -- Treat these as trivial by default unless the user explicitly asks for a council anyway: - - arithmetic or obvious factual lookups - - one-line rewrites or wording tweaks - - file lookups, command syntax, narrow yes/no questions - - tasks with one obvious path and no meaningful tradeoff -- Treat these as council-worthy: - - competing approaches with real tradeoffs - - security or correctness-sensitive reviews - - architecture, research, or design-space exploration - - tasks where synthesis across perspectives is likely to beat one model - -### Mode Detection - -**Adversarial** triggers (any of these in the user's message): -- "debate", "adversarial", "challenge", "stress-test", "stress test" -- "which is better", "argue", "attack", "defend", "versus", "vs" - -**Collaborative** triggers (default β€” used when no adversarial trigger detected): -- "council", "siege", "swarm", "brainstorm", "multi-agent" -- "collaborate", "explore", "build on", "novel", "creative", "ideas" - -**Explicit override** always wins: -- "adversarial council: ..." β†’ adversarial mode -- "collaborative council: ..." β†’ collaborative mode - -If both adversarial and collaborative trigger words appear, **adversarial wins** unless the user gives an explicit override. - -If no trigger matches, default to **collaborative**. - -### Domain Detection - -Classify the task to determine focus instructions for each agent: -- **Code**: mentions code, implementation, function, bug, API, programming, refactor, debug, test -- **Architecture**: mentions system design, infrastructure, scaling, database choice, service, deployment -- **Research**: mentions research, analysis, study, compare, evaluate, literature review, investigate -- **Writing**: mentions write, draft, document, blog, copy, content, email, proposal -- **General**: anything that doesn't clearly fit above (use default prompts, omit domain focus) - -Resolve ambiguity in this order: **Code β†’ Architecture β†’ Writing β†’ Research β†’ General**. - -- If the task includes source code, APIs, tests, bugs, PRs, files, or implementation details, choose **Code** even if it also says "review" or "analyze". -- If the task is a system-level tradeoff across services, data, scaling, or deployment, choose **Architecture**. -- Use **Research** only when the primary job is investigation/evaluation rather than building or reviewing a concrete artifact. - -## Verbosity - -- **Default:** Hide internal phases, show only final output -- **Verbose mode:** User says "verbose", "show debate", or "show council" β†’ show a concise phase-by-phase view -- **Raw mode:** User explicitly asks for **raw** or **full** council output β†’ show full drafts instead of concise excerpts - -## Model Assignments (both modes) - -| Role | Agent | Default Model | -|------|-------|---------------| -| **Alpha** | Deep Explorer / Drafter | claude-opus-4.6 | -| **Beta** | Practical Builder / Validator | gpt-5.4 | -| **Gamma** | Elegant Minimalist / Devil's Advocate | gemini-3.1-pro | -| **Orchestrator** | Synthesizer / Judge | claude-opus-4.6 | - -Each subagent uses a **different model family** to maximize cognitive diversity. - -**Fallback policy:** -- Keep Alpha, Beta, and Gamma on **different model families**. -- If a preferred model is unavailable, switch to an **unused** family. -- If no unused family is available, run a **smaller council** rather than letting two agents share a family. - ---- - -## Collaborative Mode 🀝 (Default) - -``` -Phase 1: DRAFT (all 3 parallel) - Alpha explores deeply + flags open questions + wild ideas - Beta grounds in reality + identifies building blocks + combinations - Gamma finds elegant minimum + alternative angles + what-ifs - -Phase 2: IMPROVE (all 3 parallel) - Each agent receives the other two drafts - Writes an IMPROVED version incorporating the best ideas from others - Looks for novel syntheses that emerge from combining perspectives - -Phase 3: SYNTHESIZE (orchestrator) - Reads all 3 improved versions - Authors the FINAL output β€” not picking a winner, but writing the best - possible version leveraging everything the three minds produced -``` - -### Phase 1 β€” Draft (parallel) - -Dispatch all three subagents **at the same time**: - -**Alpha (Deep Explorer):** -``` -task( - agent_type: "general-purpose", - model: "claude-opus-4.6", - prompt: "You are Alpha on an Agent Council (Collaborative mode). -Your role: Generate a comprehensive, creative response. - -TASK: {user_task} - -{domain_focus_alpha} - -Instructions: -1. Write a thorough response exploring the problem space deeply, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -2. Add a '## Open Questions' section: what aspects deserve more exploration? -3. Add a '## Wild Ideas' section: propose at least one unconventional approach -Keep your response under 1500 words. Be expansive but focused β€” breadth over polish." -) -``` - -**Beta (Practical Builder):** -``` -task( - agent_type: "general-purpose", - model: "gpt-5.4", - prompt: "You are Beta on an Agent Council (Collaborative mode). -Your role: Ground the problem in reality while finding opportunities. - -TASK: {user_task} - -{domain_focus_beta} - -Instructions: -1. Write your response focused on practical, validated approaches, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -2. Add a '## Building Blocks' section: what existing patterns/tools/techniques apply? -3. Add a '## Combinations' section: what could be combined in novel ways? -Keep your response under 1500 words. Be constructive β€” find opportunities, not just constraints." -) -``` - -**Gamma (Elegant Minimalist):** -``` -task( - agent_type: "general-purpose", - model: "gemini-3.1-pro", - prompt: "You are Gamma on an Agent Council (Collaborative mode). -Your role: Find the most elegant, minimal solution and open new angles. - -TASK: {user_task} - -{domain_focus_gamma} - -Instructions: -1. Write the simplest viable approach you can think of, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -2. Add a '## Alternative Angles' section: reframe the problem from at least 2 different perspectives -3. Add a '## What If' section: propose boundary-pushing variations -Keep your response under 1500 words. Be creative β€” simplicity and novelty over comprehensiveness." -) -``` - -**Domain Focus** (`{domain_focus_*}` is set based on detected domain, omitted for General): - -See the later **## Domain Adaptation** section for the canonical per-domain Alpha/Beta/Gamma focus definitions. - -### Phase 2 β€” Improve (parallel) - -After all three return, dispatch all three again **at the same time**, each receiving the other two drafts: - -``` -task( - agent_type: "general-purpose", - model: "{same_model_as_phase_1}", - prompt: "You are {Agent} on an Agent Council (Collaborative mode β€” Improve phase). - -You submitted an initial draft. Now you've received the other two agents' -work. Your job: write an IMPROVED version that's better than anything -any of you produced alone. - -ORIGINAL TASK: {user_task} - -YOUR ORIGINAL DRAFT: -{this_agent_draft} - -{OTHER_AGENT_1} DRAFT: -{other_1_draft} - -{OTHER_AGENT_2} DRAFT: -{other_2_draft} - -Instructions: -1. Steal the best ideas from the other drafts shamelessly and combine the ones that strengthen each other -2. Look for NOVEL SYNTHESES β€” ideas that emerge from combining perspectives that none of you had individually -3. Drop weak, redundant, or disproven material from your original -4. Keep your natural strength ({agent_strength}) while tightening for clarity and actionability -5. If a strong idea remains unresolved or you intentionally leave one out, add a brief '## Tensions' section with 1-3 bullets naming the disagreement or omitted idea and why - -Output: Your improved, enriched response, with an optional '## Tensions' section only when needed." -) -``` - -Where `{agent_strength}` is: -- Alpha: "depth and exploration" -- Beta: "practical grounding" -- Gamma: "elegance and alternative angles" - -### Phase 3 β€” Synthesize (orchestrator) - -``` -task( - agent_type: "general-purpose", - model: "claude-opus-4.6", - prompt: "You are the Orchestrator on an Agent Council (Collaborative mode β€” Synthesis). - -Three agents brainstormed independently, then read each other's work and -each submitted an improved version. - -Important: One of the agents (Alpha) used the same model family as you. -Do not give it preferential treatment β€” judge all contributions on merit alone. - -ORIGINAL TASK: {user_task} - -ALPHA'S IMPROVED VERSION: -{alpha_improved} - -BETA'S IMPROVED VERSION: -{beta_improved} - -GAMMA'S IMPROVED VERSION: -{gamma_improved} - -Instructions: -1. Identify the BEST elements across all three improved versions -2. Look for EMERGENT IDEAS β€” syntheses that appeared when agents combined each other's thinking. These are the gold. -3. Check any optional '## Tensions' sections β€” where agents flagged real tradeoffs, weigh both sides and make a clear call -4. Use confidence ratings from the agents to weight contributions: HIGH-confidence claims need less scrutiny, LOW-confidence claims need more -5. Write the definitive response β€” not a summary, but the BEST POSSIBLE version that leverages everything these three minds produced -6. Structure for maximum clarity and actionability - -Output: The final collaborative synthesis. This should be noticeably better than any single agent could have produced alone." -) -``` - ---- - -## Adversarial Mode πŸ—‘οΈ - -``` -Phase 1: DRAFT (all 3 parallel) - Alpha drafts comprehensive response + self-critique - Beta fact-checks independently + validation notes - Gamma optimizes + plays devil's advocate - -Phase 1.5: TRIAGE (main agent, no subagent) - Identify the LEADING POSITION among the 3 drafts - If strong consensus β†’ skip attack, go straight to verdict - -Phase 2: ATTACK (2 non-leader agents parallel) - Non-leader agents receive the leading draft - Both write targeted critiques with severity ratings - Leader sits out β€” their work is being stress-tested - -Phase 3: VERDICT (orchestrator) - Weighs leading draft + attacks + all originals - Decides: SURVIVED / MODIFIED / OVERTURNED - Outputs final answer + confidence assessment -``` - -### Phase 1 β€” Draft (parallel) - -Dispatch all three subagents **at the same time**: - -**Alpha (Drafter & Red Teamer):** -``` -task( - agent_type: "general-purpose", - model: "claude-opus-4.6", - prompt: "You are Alpha on an Agent Council (Adversarial mode). -Your dual role: Create a comprehensive response AND red-team your own work. - -TASK: {user_task} - -{domain_focus_alpha} - -Instructions: -1. Write a thorough, nuanced response to the task, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -2. Then add a section '## Self-Critique' where you: - - Flag any assumptions you made - - Identify weaknesses or edge cases in your response - - Note areas where you're uncertain - - List potential counter-arguments - -Keep your response under 1500 words. Be thorough in both the draft AND the self-critique." -) -``` - -**Beta (Fact-Checker & Validator):** -``` -task( - agent_type: "general-purpose", - model: "gpt-5.4", - prompt: "You are Beta on an Agent Council (Adversarial mode). -Your role: Independent fact-checking and validation of the task requirements. - -TASK: {user_task} - -{domain_focus_beta} - -Instructions: -1. Analyze the task independently β€” produce your OWN solution/response, marking each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -2. Focus especially on: - - Factual accuracy of any claims or technical details - - Edge cases and boundary conditions - - Security or safety considerations - - Real-world validity and practicality - - Version numbers, API correctness, tool names -3. Use web_search to verify claims when possible -4. Flag anything with severity: CRITICAL / IMPORTANT / MINOR - -Keep your response under 1500 words. Output your independent response followed by a '## Validation Notes' section." -) -``` - -**Gamma (Optimizer & Devil's Advocate):** -``` -task( - agent_type: "general-purpose", - model: "gemini-3.1-pro", - prompt: "You are Gamma on an Agent Council (Adversarial mode). -Your role: Propose the most elegant, efficient solution AND play devil's advocate. - -TASK: {user_task} - -{domain_focus_gamma} - -Instructions: -1. Produce your OWN response optimized for: - - Clarity and scannability - - Minimal complexity (simplest viable approach) - - Actionability (user can execute immediately) - - Proper formatting (tables, lists, code blocks as appropriate) -2. Mark each major claim or recommendation with confidence: HIGH / MEDIUM / LOW -3. Then add a '## Devil's Advocate' section where you: - - Argue against the obvious approach - - Propose at least one alternative solution - - Identify what could go wrong - - Question unstated assumptions - -Keep your response under 1500 words. Be concise but thorough." -) -``` - -### Phase 1.5 β€” Triage (main agent, no subagent) - -Read all 3 outputs. Assess agreement level and identify the leading position. - -**Consensus criteria β€” ALL must be true to skip Phase 2:** -1. All three agents recommend the same core approach or conclusion -2. No CRITICAL or FATAL severity flags in any self-critique, validation, or devil's advocate section -3. No direct contradictions between agents on key claims -4. Confidence ratings are predominantly HIGH across all agents - -**Leader-selection rubric β€” use when consensus is not full:** -1. Correctness and evidence quality -2. Coverage of the task's core constraints -3. Actionability and clarity -4. Severity and count of unresolved risks in critique sections -5. Confidence profile (reward precise confidence, not blanket HIGH) - -Tie-breakers, in order: -- fewer unresolved high-severity issues -- fewer hidden assumptions -- more testable or operationally concrete guidance - -**Triage outcomes:** -- **Full consensus** β†’ Skip Phase 2, go straight to Phase 3 ("Consensus detected β€” no adversarial round needed") -- **Partial consensus** β†’ Identify areas of agreement AND areas of disagreement. Forward to Phase 2 with focused attack instruction: "Focus your attack ONLY on these contested areas: {contested_points}. These points have consensus β€” do not relitigate: {agreed_points}." -- **No consensus** β†’ Use the rubric above to identify the leading position and forward the full draft to Phase 2 for open attack. - -### Phase 2 β€” Attack (2 agents parallel) - -Dispatch the two **non-leader** agents simultaneously: - -``` -task( - agent_type: "general-purpose", - model: "{same_model_as_phase_1}", - prompt: "You are {Agent} on an Agent Council (Adversarial mode β€” Attack phase). - -You previously submitted your own draft. Now the Council Orchestrator has -identified the LEADING POSITION below. Your job: tear it apart. - -ORIGINAL TASK: {user_task} - -YOUR ORIGINAL DRAFT: -{this_agent_draft} - -LEADING POSITION (from {leader_agent}): -{leader_draft} - -{partial_consensus_instruction} - -Instructions: -1. Find every weakness, gap, wrong assumption, and logical flaw -2. Where the leader's position contradicts YOUR draft, argue why yours is better -3. Propose specific corrections or alternatives with evidence -4. Use the leader's confidence ratings β€” focus extra scrutiny on LOW-confidence claims -5. Rate the severity of each issue: FATAL / MAJOR / MINOR -6. End with a verdict: should this position STAND, be MODIFIED, or be REJECTED? - -Be ruthless. Your job is to break this argument, not to be polite." -) -``` - -`{partial_consensus_instruction}` β€” set by triage outcome: -- **Partial consensus**: "Focus your attack ONLY on these contested areas: {contested_points}. These points have consensus β€” do not relitigate: {agreed_points}." -- **No consensus**: (omit β€” attack the full position) - -### Phase 3 β€” Verdict (orchestrator) - -``` -task( - agent_type: "general-purpose", - model: "claude-opus-4.6", - prompt: "You are the Orchestrator on an Agent Council (Adversarial mode β€” Verdict). - -A leading position was stress-tested by two opposing agents. Your job: -deliver the final verdict. - -Important: One of the agents (Alpha) used the same model family as you. -Do not give it preferential treatment β€” judge all contributions on merit alone. - -ORIGINAL TASK: {user_task} - -THE LEADING POSITION (from {leader_agent}): -{leader_draft} - -ATTACK FROM {attacker_1}: -{attack_1} - -ATTACK FROM {attacker_2}: -{attack_2} - -ALL ORIGINAL DRAFTS (for reference): -Alpha: {alpha_draft} -Beta: {beta_draft} -Gamma: {gamma_draft} - -Instructions: -1. Evaluate each attack: Did it land? Is the criticism valid? - Use confidence ratings from original drafts β€” LOW-confidence claims - that were attacked carry less weight -2. Determine: Does the leading position SURVIVE, need MODIFICATION, or get OVERTURNED? -3. If overturned β†’ build the final answer from the strongest alternative -4. If modified β†’ incorporate valid criticisms into an improved version -5. If survived β†’ present it with a confidence boost -6. Include a brief '## Confidence Assessment' noting how contested the answer was - and which areas remain uncertain - -Output: The final ratified answer. Clean and polished, not meta-commentary." -) -``` - ---- - -## Verbose Output Formats - -### Collaborative Verbose - -``` -## 🀝 Council β€” Collaborative Mode - -### Phase 1: Independent Explorations - -πŸ’‘ **Alpha** (Deep Explorer) -{alpha_summary_or_draft} - -πŸ”¨ **Beta** (Practical Builder) -{beta_summary_or_draft} - -✨ **Gamma** (Elegant Minimalist) -{gamma_summary_or_draft} - -### Phase 2: Cross-Pollinated Improvements - -πŸ“ **Alpha** (improved after reading Beta & Gamma) -{alpha_improved_summary_or_draft} - -πŸ“ **Beta** (improved after reading Alpha & Gamma) -{beta_improved_summary_or_draft} - -πŸ“ **Gamma** (improved after reading Alpha & Beta) -{gamma_improved_summary_or_draft} - -### Phase 3: Final Synthesis - -🌟 **Orchestrated Synthesis** -{final_synthesis} -``` - -Show concise phase excerpts by default. If the user explicitly asks for **raw** or **full** council output, then include the complete drafts instead of summaries. - -### Adversarial Verbose - -``` -## πŸ—‘οΈ Council β€” Adversarial Mode - -### Phase 1: Independent Drafts - -πŸ“ **Alpha** (Drafter & Red Teamer) -{alpha_summary_or_draft} - -βœ… **Beta** (Fact-Checker & Validator) -{beta_summary_or_draft} - -πŸ”§ **Gamma** (Optimizer & Devil's Advocate) -{gamma_summary_or_draft} - -### Phase 2: Attack Round - -🎯 **Leading Position:** {leader_agent} -Reason: {why_this_was_selected} - -βš”οΈ **{attacker_1} attacks {leader_agent}:** -{attack_1_summary_or_draft} - -βš”οΈ **{attacker_2} attacks {leader_agent}:** -{attack_2_summary_or_draft} - -### Phase 3: Verdict - -πŸ›οΈ **Orchestrated Verdict** -Status: {SURVIVED | MODIFIED | OVERTURNED} -Confidence: {HIGH | MEDIUM | CONTESTED} - -{final_answer} -``` - -Show concise phase excerpts by default. If the user explicitly asks for **raw** or **full** council output, then include the complete drafts instead of summaries. - -### Non-Verbose (both modes) - -Present only the final output. No mention of agents, phases, or internal process. - ---- - -## Domain Adaptation - -Adjust agent focus based on task type (applies to both modes): - -| Domain | Alpha Focus | Beta Focus | Gamma Focus | -|--------|------------|-----------|-------------| -| **Code** | Implementation + security self-review | API accuracy, version correctness, edge cases | Performance, readability, alternative patterns | -| **Architecture** | System design + failure mode analysis | Technology claims, benchmarks, scalability | Diagram clarity, simplicity, alternatives | -| **Research** | Comprehensive analysis + bias check | Source verification, citations, methodology | Readability, actionability, counter-arguments | -| **Writing** | Content + tone self-critique | Factual accuracy, consistency | Flow, conciseness, formatting | - -## Cost & Speed - -| Mode | Subagent Calls | Parallel Rounds | Sequential Steps | -|------|----------------|-----------------|------------------| -| Collaborative (default) | 7 (3 + 3 + orchestrator) | 2 | 3 | -| Adversarial | 6 (3 + 2 attackers + orchestrator) | 2 | 3 | - -Both modes add one extra parallel round over the original Fast Triad. Wall-clock time increases by roughly the duration of one subagent call. - -For trivial or speed-sensitive tasks, the council should short-circuit and answer directly instead of paying this overhead. - -## Common Mistakes - -- **Don't dispatch the council for trivial tasks** β€” short-circuit and answer directly -- **Don't run agents sequentially** β€” All three MUST run in parallel for speed -- **Don't force disagreements** β€” If agents agree, that's a strong signal (adversarial mode skips attack on full consensus) -- **Don't skip the orchestrator** β€” Raw agent outputs need merging/authoring, not concatenation -- **Don't let fallback collapse diversity** β€” if fallback duplicates an active family, run a smaller council instead -- **Don't mix mode prompts** β€” Collaborative agents explore, adversarial agents critique. Keep them distinct. -- **Don't skip the improve round in collaborative** β€” Even with agreement, cross-pollination adds value -- **Don't skip domain detection** β€” Always classify the task domain in Step 0 and inject focus instructions -- **Don't ignore confidence ratings** β€” Agents flag HIGH/MEDIUM/LOW confidence for a reason; the orchestrator must use them to weight inputs -- **Don't treat partial consensus as no consensus** β€” When agents agree on most points but disagree on specifics, focus the attack on contested areas only diff --git a/skills/agentcouncil/SKILL.md b/skills/agentcouncil/SKILL.md new file mode 100644 index 0000000..056e1cd --- /dev/null +++ b/skills/agentcouncil/SKILL.md @@ -0,0 +1,165 @@ +--- +name: agentcouncil +description: 'Use when the user asks for a council, debate, brainstorm, stress-test, or second opinions from multiple AI models, or when a high-stakes decision, architecture choice, security review, or comparison of competing approaches should be checked by more than one model family. Trigger prefixes: "council:", "debate:", "brainstorm:", "stress-test:", "adversarial council:", "collaborative council:", "quick council:", "full council:".' +license: MIT +compatibility: 'Requires a client whose task or subagent tool accepts a per-call model, such as GitHub Copilot CLI.' +--- + +# AgentCouncil + +Three subagents on three different model families (Alpha, Beta, Gamma) answer independently, interact once, and an orchestrator subagent writes the final answer from anonymized inputs. + +- **Collaborative mode** (default): the seats read each other's drafts and improve them; the orchestrator synthesizes. +- **Adversarial mode**: the orchestrator picks the leading draft, the other two seats attack it, the orchestrator rules. +- **Light effort**: one concise pass per seat plus a short synthesis (4 subagent calls). +- **Full effort**: drafts, one interaction round, and a final orchestrator call (5 to 7 subagent calls). + +Follow Steps 1 to 7 in order. + +## Step 1: Convene or answer directly + +The council is **explicitly invoked** when any of these is true: + +- The message starts with a council prefix, optionally preceded by `verbose` or `raw`: `council:`, `brainstorm:`, `debate:`, `stress-test:`, `adversarial council:`, `collaborative council:`, `quick council:`, `light council:`, `full council:`, `deep council:`. +- The user asks for a council, for several models, or for a second opinion from other models. +- You are running as the AgentCouncil custom agent. + +When explicitly invoked, always convene. Never answer directly first; simple tasks use light effort. + +Otherwise the skill was selected automatically. Answer directly, without subagents, when the task is trivial: arithmetic, a factual lookup, command syntax, a file lookup, a one-line edit or rewrite, a narrow yes/no question, or anything with one obvious path and no real tradeoff. After a direct answer, add one line: `For a multi-model answer, ask again with "council: ...".` For anything else, convene. + +## Step 2: Effort + +- **light**: the user says `quick` or `light`, or the council was explicitly invoked for a task that Step 1 would call trivial. +- **full**: the user says `full`, `deep` or `thorough`, or the task has real tradeoffs, correctness or security risk, or is architecture, research, design or substantial writing. +- If still unclear, use full. + +## Step 3: Mode + +Apply the first rule that matches: + +1. **Prefix.** `debate:`, `stress-test:` and `adversarial council:` mean adversarial. `council:`, `brainstorm:`, `collaborative council:` and effort variants such as `quick council:` or `full council:` mean collaborative. +2. **Intent.** Adversarial when the user wants to choose between named options, validate or attack an existing proposal, plan or artifact, or get a go/no-go verdict. Collaborative when the user wants ideas, options, a design, a plan or an explanation generated. If both appear, use the primary intent of the message. +3. **Default.** Collaborative. + +Words are hints, not triggers. Read them in the sense the user meant: "VS Code" is a product, not a comparison, and "the main challenge is" is not a request to debate. + +Also record the output style now: **verbose** if the user wrote `verbose`, `show council` or `show debate`; **raw** if they wrote `raw`; otherwise **default**. Collect each seat's key points as phases finish if the style is verbose or raw. + +## Step 4: Domain + +Pick the first that fits. The domain sets each seat's focus line. + +1. **code**: the task centers on a concrete code artifact (source, diff, test, stack trace, config file) or asks for an implementation or bug fix. +2. **architecture**: system-level design or tradeoffs, including services, data models, service APIs, infrastructure, scaling, deployment and technology choices. +3. **writing**: the deliverable is prose, such as a post, email, document, proposal or announcement. +4. **research**: the main job is investigating or evaluating evidence, literature or options, with no concrete artifact to build. +5. **general**: anything else. + +| Domain | Alpha focus | Beta focus | Gamma focus | +|---|---|---|---| +| code | Implementation and security self-review | API and version correctness, edge cases | Performance, readability, alternative patterns | +| architecture | System design and failure modes | Technology claims, benchmarks, scaling limits | Simplicity, operability, alternatives | +| research | Comprehensive analysis and bias check | Source verification and citations | Actionability and counter-arguments | +| writing | Content and tone self-critique | Factual accuracy and consistency | Flow, concision, formatting | +| general | none | none | none | + +## Step 5: Context brief + +Subagents see nothing except the prompt you send. Before dispatching, write a context brief of at most 400 words: + +- **Goal**: what the user is trying to achieve and what a good answer looks like. +- **Constraints**: stated requirements, scale, deadlines, stack and preferences. +- **Material**: the code, diff, text or data the task is about. Paste short excerpts verbatim. For long material, give absolute file paths with line ranges so subagents can read them. +- **Already decided**: decisions made earlier in the conversation, and anything out of scope. +- **Working directory**: absolute path. + +Keep the brief neutral. Do not hint at a preferred answer. Always pass the user's task text verbatim as well. + +## Step 6: Seats, models and dispatch + +This roster is the single source of truth for model IDs. + +| Seat | Family | Default model | Fallbacks, in order | +|---|---|---|---| +| Alpha | Anthropic | `claude-opus-5.5` | `claude-sonnet-5.5` | +| Beta | OpenAI | `gpt-6.1-sol` | `gpt-5.5` | +| Gamma | Google | `gemini-4-argon` | `grok-4.7` (xAI), `gemini-3.8-flash` | +| Orchestrator | any | `claude-opus-5.5` | `claude-sonnet-5.5`, then the current session model | + +**Diversity.** Alpha, Beta and Gamma must run on three different families. The orchestrator may share a family with a seat because it only sees anonymized inputs. + +**User overrides.** If the user names models for the seats (for example "council with sonnet, gpt-5.5 and gemini flash"), map them to available model IDs and use them instead of the defaults, keeping the three families distinct. + +**Failures.** If a call fails, times out or returns an invalid or unavailable model error, retry that seat once on its next fallback. When a seat's list is exhausted, use any available model from a family that is not already seated. If none is left, continue with the remaining seats and disclose it in the footer. Never substitute silently and never seat two families twice. If fewer than two seats succeed, stop and tell the user which models failed. Each seat keeps the model it actually ran on for every later phase. + +**Dispatch.** Call the `task` tool with every required field: `agent_type: "general-purpose"`, `model: `, `name` (a short id such as `alpha-draft` or `orchestrator-synthesis`), `description` (3 to 5 words) and `prompt`. Send all calls of a phase in parallel, in a single response, and wait for all of them before starting the next phase. Run at most one improve or attack round. + +**Seat header.** Every Alpha, Beta and Gamma prompt starts with: + +``` +You are {Alpha|Beta|Gamma} on AgentCouncil ({mode} mode, {phase}). +Work read-only: you may read files and search the web, but do not edit files, run commands that change state, or post anything anywhere. +Mark each major claim HIGH, MEDIUM or LOW confidence and say what it rests on: a source, a check you ran, or reasoning only. + +CONTEXT BRIEF: +{context_brief} + +TASK (verbatim from the user): +{task} + +FOCUS: {this seat's focus from the Step 4 table; omit this line for general} +``` + +**Anonymization.** Before every orchestrator call: + +- Relabel the seat outputs as Response A, B and C in an order where A is not Alpha. Vary the order between councils. +- Remove seat names, role names, model names and self-references such as "as Claude". +- Keep the mapping to yourself. Use it only to route attacks, for verbose output and for the footer. + +## Step 7: Run the protocol + +Read exactly one reference file from this skill's directory and follow it: + +- light effort, either mode: `references/light.md` +- full effort, collaborative: `references/collaborative.md` +- full effort, adversarial: `references/adversarial.md` + +## Output + +**Default.** Show the final answer from the last orchestrator call verbatim. Do not rewrite, shorten or add commentary to it. Then add one footer line: + +``` +AgentCouncil: {mode}, {effort}. Seats: Alpha {model}, Beta {model}, Gamma {model}. Orchestrator: {model}. +``` + +When a fallback was used, append `Fallback: {seat} {failed model} unavailable, used {model}.` When a seat was dropped, append `Ran with 2 seats: {seat} unavailable.` + +**Verbose.** Before the final answer, show every phase that ran: + +``` +## Phase 1: {phase name} +**Alpha ({model})** +- {2 to 4 bullets with the seat's key points} +**Beta ({model})** +- ... +**Gamma ({model})** +- ... +## Phase 2: ... +## Final answer +{orchestrator answer, verbatim} +{footer} +``` + +In adversarial mode, also show the triage result (consensus level, leading seat, reason), each attacker's verdict, and the ruling (SURVIVED, MODIFIED or OVERTURNED). + +**Raw.** Same layout as verbose, with each seat's complete output instead of bullets. + +## Rules + +- Never skip the orchestrator, and never concatenate drafts as the answer. +- Never run more than one improve or attack round. +- Do not force disagreement. Agreement between different model families is a signal. +- Keep collaborative and adversarial prompts separate. +- Every subagent prompt, including the orchestrator's, tells it to work read-only. Never ask a subagent to modify files or external systems; if the user wants changes applied, apply them yourself after the council, with the user's normal approvals. +- Cost: light 4 subagent calls; full collaborative 7; full adversarial 7, or 5 when triage finds full consensus. diff --git a/skills/agentcouncil/references/adversarial.md b/skills/agentcouncil/references/adversarial.md new file mode 100644 index 0000000..48534ed --- /dev/null +++ b/skills/agentcouncil/references/adversarial.md @@ -0,0 +1,142 @@ +# Full adversarial council + +Draft, triage, attack, verdict: 7 subagent calls in 4 phases, or 5 when triage finds full consensus. Seat header, anonymization and failure rules are in `SKILL.md`. + +## Phase 1: Draft (Alpha, Beta and Gamma in parallel) + +Each prompt is the seat header (phase: draft) followed by the block for that seat. + +Alpha, Drafter and Red Teamer: + +``` +Role: Drafter and Red Teamer. +1. Write a thorough, nuanced response. +2. Add "## Self-Critique": your assumptions, weaknesses, edge cases, uncertainties and the strongest counter-arguments. +Keep it under 1500 words. +``` + +Beta, Fact-Checker and Validator: + +``` +Role: Fact-Checker and Validator. +1. Produce your own independent response. +2. Focus on factual accuracy, edge cases, security and safety, real-world validity, and correctness of versions, APIs and tool names. Verify claims with web search where possible. +3. Add "## Validation Notes": each issue tagged CRITICAL, IMPORTANT or MINOR. +Keep it under 1500 words. +``` + +Gamma, Optimizer and Devil's Advocate: + +``` +Role: Optimizer and Devil's Advocate. +1. Produce your own response, optimized for clarity, minimal complexity and immediate actionability. +2. Add "## Devil's Advocate": argue against the obvious approach, propose at least one alternative, say what could go wrong, and question unstated assumptions. +Keep it under 1500 words. +``` + +## Phase 2: Triage (orchestrator) + +Anonymize the three drafts as Response A, B and C. Keep these labels for the rest of this council. Dispatch: + +``` +You are the Orchestrator on AgentCouncil (adversarial mode, triage). +Work read-only: do not edit files, run commands that change state, or post anything anywhere. +Three contributors answered the task below independently. Their responses are anonymized; judge them only on merit and evidence. + +CONTEXT BRIEF: +{context_brief} + +TASK (verbatim from the user): +{task} + +RESPONSE A: +{response_a} + +RESPONSE B: +{response_b} + +RESPONSE C: +{response_c} + +Decide the consensus level: +- full: all three reach the same core conclusion, no unresolved CRITICAL issue is raised in any critique or validation section, and there is no material contradiction on key claims. +- partial: the same core conclusion, but material disagreement on specific points. +- none: different core conclusions. + +Pick the leading response by, in order: correctness and evidence quality; coverage of the task's core constraints; actionability and clarity; severity and number of unresolved risks; calibrated confidence (precise labels beat blanket HIGH). Tie-breakers: fewer unresolved high-severity issues, then fewer hidden assumptions, then more testable guidance. + +Output exactly: +CONSENSUS: full | partial | none +LEADER: A | B | C +AGREED: +- {point} +CONTESTED: +- {point} +REASON: {one sentence} +``` + +- **full**: skip Phase 3 and run Phase 4 without critiques. +- **partial** or **none**: run Phase 3. + +## Phase 3: Attack (the two non-leader seats in parallel) + +Map the leader label back to its seat. The other two seats attack, each on the model it used in Phase 1. Prompt: the seat header (phase: attack), then: + +``` +You wrote the draft below. Another contributor's response was selected as the leading position. Your job is to break it. + +YOUR DRAFT: +{own_draft} + +LEADING POSITION: +{leader_response} + +{partial consensus only: Attack only these contested points: {contested}. Do not relitigate these agreed points: {agreed}.} + +Instructions: +1. Find every weakness, gap, wrong assumption and logical flaw. +2. Where the leading position contradicts your draft, argue why yours is better, with evidence. +3. Propose specific corrections or alternatives. +4. Put extra scrutiny on LOW-confidence and unsupported claims. +5. Tag each issue FATAL, MAJOR or MINOR. +6. End with one verdict: STAND, MODIFY or REJECT. +Be direct, not polite. Do not invent problems: if the position holds, say so. +``` + +## Phase 4: Verdict (orchestrator) + +Label the two attacks Critique 1 and Critique 2, with seat and model names removed. Dispatch: + +``` +You are the Orchestrator on AgentCouncil (adversarial mode, verdict). +Work read-only: do not edit files, run commands that change state, or post anything anywhere. +A leading position was stress-tested. Deliver the final ruling. All inputs are anonymized; judge them only on merit and evidence. + +CONTEXT BRIEF: +{context_brief} + +TASK (verbatim from the user): +{task} + +LEADING POSITION (Response {leader_label}): +{leader_response} + +CRITIQUE 1: +{critique_1, or "None: triage found full consensus."} + +CRITIQUE 2: +{critique_2, or omit} + +ALL RESPONSES FOR REFERENCE: +Response A: {response_a} +Response B: {response_b} +Response C: {response_c} + +Instructions: +1. For each critique point, decide whether it lands. Weight by evidence, not by confidence labels or tone. +2. Rule SURVIVED, MODIFIED or OVERTURNED. If overturned, build the answer from the strongest alternative. If modified, fold in the valid criticism. +3. Write the final answer, clean and ready to use. +4. End with "## Confidence Assessment": the ruling, how contested the answer was, and what remains uncertain. +The user never sees the individual responses or critiques. Do not mention Response A, B or C, Critique 1 or 2, contributors or seats. Refer to "the leading answer" or "a critique" if you must. +Output only the final answer. +``` diff --git a/skills/agentcouncil/references/collaborative.md b/skills/agentcouncil/references/collaborative.md new file mode 100644 index 0000000..ad21f22 --- /dev/null +++ b/skills/agentcouncil/references/collaborative.md @@ -0,0 +1,102 @@ +# Full collaborative council + +Draft, improve, synthesize: 7 subagent calls in 3 phases. Seat header, anonymization and failure rules are in `SKILL.md`. + +## Phase 1: Draft (Alpha, Beta and Gamma in parallel) + +Each prompt is the seat header (phase: draft) followed by the block for that seat. + +Alpha, Deep Explorer: + +``` +Role: Deep Explorer. Explore the problem space thoroughly and creatively. +1. Write a thorough response. +2. Add "## Open Questions": what deserves more exploration. +3. Add "## Wild Ideas": at least one unconventional approach. +Keep it under 1500 words. Breadth over polish. +``` + +Beta, Practical Builder: + +``` +Role: Practical Builder. Ground the problem in what is proven to work, and look for opportunities. +1. Write a response focused on practical, validated approaches. Verify version-specific and factual claims with web search where it matters. +2. Add "## Building Blocks": existing patterns, tools and techniques that apply. +3. Add "## Combinations": what could be combined in new ways. +Keep it under 1500 words. Be constructive: find opportunities, not only constraints. +``` + +Gamma, Elegant Minimalist: + +``` +Role: Elegant Minimalist. Find the simplest viable approach and open new angles. +1. Write the simplest approach that fully works. +2. Add "## Alternative Angles": reframe the problem from at least two perspectives. +3. Add "## What If": boundary-pushing variations. +Keep it under 1500 words. Simplicity and novelty over coverage. +``` + +## Phase 2: Improve (Alpha, Beta and Gamma in parallel) + +Each seat runs on the model it used in Phase 1 and receives its own draft plus the other two, labelled Peer draft 1 and Peer draft 2 with seat and model names removed. Prompt: the seat header (phase: improve), then: + +``` +You wrote the draft below. Two peers answered the same task independently. Write an improved version that is better than any of the three. + +YOUR DRAFT: +{own_draft} + +PEER DRAFT 1: +{peer_draft_1} + +PEER DRAFT 2: +{peer_draft_2} + +Instructions: +1. Adopt the best ideas from the peer drafts and combine the ones that strengthen each other. +2. Look for new ideas that only appear when these perspectives are combined. +3. Drop weak, redundant or disproven material, including from your own draft. +4. Keep your seat's strength: {strength}. +5. End with "## Tensions": 1 to 3 bullets naming a real unresolved disagreement or an idea you deliberately dropped, and why. Write "None" only if there is truly nothing. +Output the improved response itself, not commentary about the process. +``` + +`{strength}`: Alpha "depth and exploration", Beta "practical grounding", Gamma "elegance and alternative angles". + +## Phase 3: Synthesize (orchestrator) + +First build an unadopted-ideas list: up to 5 bullets, under 120 words in total, taken from the Phase 1 "Open Questions", "Wild Ideas" and "What If" sections that none of the improved versions kept. Then anonymize the three improved versions and dispatch: + +``` +You are the Orchestrator on AgentCouncil (collaborative mode, synthesis). +Work read-only: do not edit files, run commands that change state, or post anything anywhere. +Three contributors drafted independently, read each other's work, and each wrote an improved version. Their responses are anonymized; judge them only on merit and evidence. + +CONTEXT BRIEF: +{context_brief} + +TASK (verbatim from the user): +{task} + +RESPONSE A: +{response_a} + +RESPONSE B: +{response_b} + +RESPONSE C: +{response_c} + +UNADOPTED IDEAS FROM FIRST DRAFTS: +{unadopted_ideas} + +Instructions: +1. Identify the strongest elements across the three responses, especially ideas that emerged from combining perspectives. +2. Resolve every item listed under "Tensions": weigh both sides and make a clear call. +3. Weight claims by what they rest on (sources, checks, reasoning), not by confidence labels. Scrutinize LOW-confidence and unsupported claims before using them. +4. Consider the unadopted ideas. Include one only if it improves the answer. +5. Write the definitive answer, not a summary of the responses. Structure it for clarity and action. +6. If a real disagreement remains, end with a short "Open disagreements" section. +The user never sees the individual responses. Do not mention Response A, B or C, contributors or seats in your answer. +Output only the final answer. +``` diff --git a/skills/agentcouncil/references/light.md b/skills/agentcouncil/references/light.md new file mode 100644 index 0000000..2063af8 --- /dev/null +++ b/skills/agentcouncil/references/light.md @@ -0,0 +1,68 @@ +# Light council + +Use for light effort in either mode: 4 subagent calls in 2 phases. Seat header, anonymization and failure rules are in `SKILL.md`. + +## Phase 1: Light pass (Alpha, Beta and Gamma in parallel) + +Each prompt is the seat header followed by the block for that seat. In adversarial mode, add the last line. + +Alpha: + +``` +Give the strongest complete answer and the one caveat that matters most. +Keep it under 300 words. For a simple factual or arithmetic question, answer in one sentence. +``` + +Beta: + +``` +Check correctness and practicality: verify facts, versions and edge cases, then give your answer. +Keep it under 300 words. For a simple factual or arithmetic question, answer in one sentence. +``` + +Gamma: + +``` +Give the simplest viable answer, plus one alternative or hidden assumption worth knowing. +Keep it under 300 words. For a simple factual or arithmetic question, answer in one sentence. +``` + +Adversarial mode only, appended to all three: + +``` +End with one sentence arguing against the most obvious answer. +``` + +## Phase 2: Light synthesis (orchestrator) + +Anonymize the three passes, then dispatch the orchestrator: + +``` +You are the Orchestrator on AgentCouncil ({mode} mode, light synthesis). +Work read-only: do not edit files, run commands that change state, or post anything anywhere. +Three contributors answered the task below independently. Their responses are anonymized; judge them only on merit and evidence. + +CONTEXT BRIEF: +{context_brief} + +TASK (verbatim from the user): +{task} + +RESPONSE A: +{response_a} + +RESPONSE B: +{response_b} + +RESPONSE C: +{response_c} + +Instructions: +1. Write the best concise final answer, using the strongest points from all three. +2. Resolve contradictions directly. Say which view you took and why in one clause. +3. Keep only caveats that change what the user should decide or do. +4. Weight claims by what they rest on (a source, a check, or reasoning only), not by their confidence label. +5. For a simple factual or arithmetic question, output one sentence. +The user never sees the individual responses. Do not mention Response A, B or C, contributors or seats in your answer. +Output only the final answer. +```