agenteam
v0.5.2
Published
OpenCode plugin: orchestrate ephemeral adversarial agent teams for software development
Maintainers
Readme
AgenTeam
Adversarial agent team orchestration for OpenCode.
The orchestrator coordinates a planner, tiered coders, and a hostile code reviewer through a strictly enforced workflow: triage → plan → execute → adversarial review → done.
Every task is reviewed by an adversary agent before it can be marked complete. The reviewer is designed to find problems, not confirm correctness. This catches bugs, missing tests, and security holes that the coding agent misses.
Quick Start
Run inside your project directory. AgenTeam creates project-scoped config and state. It detects common project markers (
package.json,pyproject.toml,Cargo.toml,.git) and warns if none are found.
cd your-project
npx agenteam initThe setup wizard will:
- Read your configured models from OpenCode
- Ask which to use for smart and cheap tiers
- Ask whether to enable semantic memory
- Create
agenteam.config.jsonand.agenteam/state - Register the plugin globally
Then start OpenCode and press Tab to switch to the orchestrator agent.
Reconfigure
npx agenteam configRe-runs the model selection wizard on an existing project. Restart OpenCode to apply.
Uninstall
cd your-project
npx agenteam uninstallRemoves all AgenTeam artifacts from the current project:
.agenteam/directory (state, logs, memory index)agenteam.config.json.agenteam/entry from.gitignore- Plugin registration from
~/.config/opencode/opencode.json
How It Works
Workflow
Request → Triage → Plan → Execute → Adversary Review → Done- Triage — Deterministic scoring (0 tokens). Analyzes file count, LOC, imports, risk keywords. Classifies as simple/complex.
- Plan — Complex tasks get a DAG of tasks from the planner. You confirm before execution starts.
- Execute — Tasks run in parallel when possible. Coder agents implement, run lint, write tests.
- Adversary Review — A hostile reviewer checks every task for bugs, missing tests, and correctness. The review gate is mechanically enforced — tasks cannot complete without passing.
- Done — All tasks pass review, state is finalized.
Agents
| Agent | Tier | Role | |-------|------|------| | orchestrator | smart | Coordinates workflow. Never writes code. | | planner | smart | Generates task DAGs from complex requests. | | coder | cheap | Simple tasks: scaffolding, boilerplate, tests. | | coder-hard | smart | Complex tasks: architecture, integrations, algorithms. | | adversary | smart | Hostile code review. Finds bugs, missing tests, security holes. |
Two-Tier Model System
AgenTeam uses two model tiers to balance cost and quality:
- Smart — Used for the orchestrator, planner, complex coding, and adversary review. Needs strong reasoning.
- Cheap — Used for simple coding tasks. Fast and cheap.
The wizard picks the right model for each tier from your OpenCode providers.
Adversarial Review
Every task goes through adversarial review before completion. This is enforced mechanically by the review gate — the orchestrator cannot mark a task as done until the adversary passes it.
The adversary agent:
- Reviews the git diff of changes
- Checks for bugs, missing error handling, type issues, security holes
- Verifies tests exist and actually test the right thing
- Defaults to failing — only passes if it genuinely finds no issues
Memory (optional)
When enabled, AgenTeam stores product and technical decisions across sessions using local vector search. No external APIs — everything stays in .agenteam/memory/.
- Relevant past decisions are auto-injected after triage
- Query manually with
agenteam_memory(query)for detailed lookups
First run downloads the embedding model (~22MB, cached after).
Configuration
Config lives in agenteam.config.json at your project root. Created by the wizard, but you can edit it directly:
{
"models": {
"cheap": "groq/llama-3.1-8b",
"smart": "anthropic/claude-sonnet-4-20250514"
},
"limits": {
"max_review_retries": 3,
"escalation": "smart"
},
"triage": {
"simple_max_files": 2,
"risk_keywords": ["refactor", "migrate", "security", "auth", "database", "schema", "deploy", "infrastructure"]
},
"review": {
"lint_command": null,
"always_adversary": true
},
"adversary_model": "smart",
"memory": {
"enabled": true,
"embedding_model": "Xenova/all-MiniLM-L6-v2",
"max_auto_results": 5,
"max_auto_tokens": 100,
"similarity_threshold": 0.7,
"auto_inject_on_triage": true
}
}Key Settings
| Setting | Default | Description |
|---------|---------|-------------|
| models.cheap | — | Model for simple tasks (coder). Set by wizard. |
| models.smart | — | Model for complex tasks. Set by wizard. |
| review.always_adversary | true | Require adversary review for all tasks |
| adversary_model | "smart" | Which model tier the adversary uses |
| memory.enabled | false | Enable semantic memory across sessions |
| limits.max_review_retries | 3 | Max retry attempts before escalation |
| triage.risk_keywords | [...] | Keywords that trigger risk: "high" |
Model Requirements
- Smart model needs strong reasoning for planning, complex coding, and code review
- Cheap model should be fast for straightforward tasks
- Both must be configured as
provider/modelformat in OpenCode (e.g.anthropic/claude-sonnet-4-20250514)
CLI Commands
npx agenteam init Setup wizard (run in project directory)
npx agenteam config Re-run model configuration
npx agenteam uninstall Remove all AgenTeam files from this project
npx agenteam enable Register plugin globally
npx agenteam disable Remove plugin globallyProject Files
your-project/
├── agenteam.config.json # Project config (created by wizard)
├── .agenteam/ # Runtime state (gitignored)
│ ├── state.json # Current workflow state
│ ├── log.jsonl # Event log
│ ├── debug.jsonl # Verbose debug trace
│ └── memory/ # Vector index + content (if enabled)Development
git clone https://github.com/aitorch/agenteam.git
cd agenteam
npm install
npm run typecheckTest with: ocx oc -p agenteam
License
MIT
