Observed since 20 Oct, 20:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Multi-stage AI evaluation system for task plans, code review, and test validation
A multi-stage AI code review system that makes your code better
Evaluate proposals, sort out ideas, and prevent "phantom work" (AI claiming to implement but not delivering) through adversarial verification using independent review stages. A battle-tested workflow from the thematic-cuts project that achieved 96.9% test pass rate improvement.
🎯 100% Standalone - No special IDE or agent system required. Works with any development workflow.
pip install --upgrade adversarial-workflow
Finally run your installed evaluators! Use the new --evaluator flag:
# Install an evaluator from the library
adversarial library install google/gemini-flash
# Run it with --evaluator flag
adversarial evaluate --evaluator gemini-flash task.md
adversarial evaluate -e gemini-flash task.md # short form
# Works with model_requirement for portable evaluators
# Automatically resolves to best available model
Key Features:
model field takes priority when specifiedmodel_requirement registry resolution when model absentSee Evaluator Library for full documentation.
--category --dry-run no longer hangs in non-TTY environmentsBrowse, install, and update evaluators from the community adversarial-evaluator-library:
# Browse available evaluators
adversarial library list
# Filter by provider or category
adversarial library list --provider google
adversarial library list --category quick-check
# Install evaluators
adversarial library install google/gemini-flash openai/fast-check
# Check for updates
adversarial library check-updates
# Update installed evaluators
adversarial library update --all
Key Features:
_meta block in installed filesSee Evaluator Library for full documentation.
timeout: 300 to evaluator YAML for slow models like Mistral Large--timeout 400 to override YAML config on-the-fly.env files are now loaded at CLI startupapi_key_env: GEMINI_API_KEY (or other keys) now work with .env filesadversarial check correctly reports the number of variables loaded from .env🔌 Custom Evaluators - Define your own evaluators without modifying the package:
# Create a custom evaluator
mkdir -p .adversarial/evaluators
cat > .adversarial/evaluators/athena.yml << 'EOF'
name: athena
description: Knowledge evaluation using Gemini 2.5 Pro
model: gemini-2.5-pro
api_key_env: GEMINI_API_KEY
prompt: |
You are Athena, a knowledge evaluation specialist...
EOF
# Use it immediately
adversarial athena docs/research-plan.md
# List all available evaluators
adversarial list-evaluators
See Custom Evaluators for full documentation, or check the CHANGELOG for complete release history.
Before installing, ensure you have:
📚 For detailed integration instructions: See docs/INTEGRATION-GUIDE.md
pip install adversarial-workflow
This installs everything you need, including LiteLLM for AI model access.
git clone https://github.com/movito/adversarial-workflow.git
pip install -e adversarial-workflow/
See docs/INTEGRATION-GUIDE.md for detailed integration strategies.
After upgrading the package, also update your local scripts:
# 1. Upgrade the package
pip install --upgrade adversarial-workflow
# 2. Update local scripts (required after major updates)
adversarial init --force
# 3. Verify everything is up-to-date
adversarial check
The adversarial check command will warn you if your local scripts are outdated compared to the installed package version.
📖 Full upgrade guide: See UPGRADE.md for detailed instructions and version-specific notes.
⚠️ New Users: Run the Prerequisites checklist above first!
# Install
pip install adversarial-workflow
# Quick start with guided setup
cd my-project/
adversarial quickstart
# Follow the interactive wizard:
# - Choose your API setup (Anthropic + OpenAI recommended)
# - Paste your API keys (validated automatically)
# - Run your first evaluation in <5 minutes!
# Install
pip install adversarial-workflow
# Initialize in your project
cd my-project/
adversarial init --interactive # Interactive wizard
# OR
adversarial init # Standard init
# Verify setup
adversarial check
# Use the workflow
adversarial evaluate tasks/feature.md # Phase 1: Plan evaluation
# ... implement your feature (any method) ...
adversarial review # Phase 3: Code review
adversarial validate "npm test" # Phase 4: Test validation
If you're using AI agents for multi-agent development workflows, adversarial-workflow includes an optional agent coordination system:
# After running adversarial init, optionally set up agent coordination
adversarial agent onboard
# Choose your agent template:
# 1. Standard (8 roles) - Recommended for complex projects [DEFAULT - press Enter]
# 2. Minimal (3 roles) - Simple projects or getting started
# 3. Custom URL - Load from your own template repository
# 4. Skip - Set up manually later
# This creates:
# - .agent-context/ # Agent coordination files
# - delegation/tasks/ # Structured task management
# - agents/ # Agent tools and scripts
What you get:
delegation/tasks/active/ and completed/agent-handoffs.json
current-state.json.agent-context/AGENT-SYSTEM-GUIDE.mdadversarial health commandWhen to use it:
Template Selection Guide:
github.com/your-org/your-template or any URL serving a JSON templateCustomizing Agents After Onboarding:
The templates provide a solid starting point, but you can easily add more specialized agents:
# After running adversarial agent onboard, edit the agent-handoffs.json
vim .agent-context/agent-handoffs.json
# Add project-specific agents:
# - code-reviewer: General code review specialist
# - performance-optimizer: Performance tuning and profiling
# - database-architect: Database design and optimization
# - devops-engineer: CI/CD, deployment, infrastructure
# - ux-designer: User experience and interface design
# ... or any role your project needs
Available agent launcher scripts (reference for creating custom agents):
agents/*.sh for examples (security-reviewer, code-reviewer, etc.)The agent coordination system extends adversarial-workflow - both work together:
See Example 11: Multi-Agent Workflows for usage patterns.
When using adversarial evaluate to review task specifications, be aware of OpenAI API rate limits:
Why? The evaluation process sends your task file to GPT-4o via Aider. OpenAI enforces Tokens Per Minute (TPM) limits based on your organization tier. Most users have Tier 1 (30,000 TPM), which supports files up to ~600 lines including system overhead.
What happens if your file is too large?
RateLimitError indicating tokens exceededSolutions for large specifications:
adversarial split to automatically split files (recommended):
adversarial split large-task.md # Split by sections
adversarial split large-task.md --dry-run # Preview first
adversarial split large-task.md --strategy phases # Split by phases
Bypassing interactive prompts (automation/CI):
# For files >700 lines, you'll be prompted to confirm
# In non-interactive environments (CI/CD, scripts), bypass the prompt:
echo "y" | adversarial evaluate delegation/tasks/large-task.md
# Or redirect from /dev/null to auto-cancel:
adversarial evaluate large-task.md < /dev/null
For more details, see OpenAI Rate Limits.
Traditional AI coding suffers from "phantom work" - where AI claims implementation is complete but only adds comments or TODOs. This workflow prevents that through multiple independent verification gates:
Evaluator (LiteLLM + GPT-4o or Claude) evaluates your implementation plan before coding begins.
Author (you, or your AI assistant) implements according to approved plan.
Evaluator (LiteLLM) analyzes actual git diff against plan.
Evaluator (LiteLLM) analyzes test results objectively.
Author (you) reviews all artifacts and commits with audit trail.
This package is completely standalone and works with any development workflow:
✅ No Claude Code required - Works with any editor/IDE ✅ No special agent system required - Just API keys ✅ Integrates into existing projects - Doesn't change your workflow ✅ Tool-agnostic - Use with your preferred development tools
You can implement using:
The adversarial workflow reviews your implementation, regardless of how you create it.
THESE ARE METAPHORS, NOT TECHNICAL COMPONENTS.
"Author": Whoever creates the work (plan or code)
"Evaluator": Independent analysis stage that evaluates the Author's work for quality and correctness
adversarial <evaluator> <task_file> via LiteLLMNo agents, no infrastructure, no special setup - just LiteLLM with different review prompts at each verification stage!
Historical note: Earlier versions used "Coordinator"/"Evaluator" (v0.1), then "Author"/"Reviewer" (v0.2-v0.3.1). We've updated to "Author"/"Evaluator" to eliminate ambiguity with agent roles like "document-reviewer".
The adversarial pattern is designed for efficient token usage:
Works with your existing task management, test framework, and workflow:
my-project/
├── tasks/current/
├── src/
├── tests/
└── README.md
adversarial initmy-project/
├── tasks/current/ # ← UNCHANGED
├── .adversarial/ # ← NEW (workflow files)
│ ├── scripts/
│ ├── config.yml
│ └── logs/
├── src/ # ← UNCHANGED
├── tests/ # ← UNCHANGED
└── README.md # ← UNCHANGED
Configuration (.adversarial/config.yml):
evaluator_model: gpt-4o # AI model for evaluators (via LiteLLM)
task_directory: tasks/current/ # Your existing tasks
test_command: npm test # Your test command
log_directory: .adversarial/logs/
# Setup
adversarial init # Initialize in current project
adversarial init --interactive # Interactive setup wizard
adversarial quickstart # Quick start with example
adversarial check # Validate setup (API keys, config)
adversarial health # Comprehensive system health check
# Agent Coordination (optional)
adversarial agent onboard # Set up agent coordination system
# Workflow
adversarial evaluate task.md # Phase 1: Evaluate plan (uses config.yml)
adversarial evaluate -e <name> task.md # Phase 1: Evaluate with installed evaluator
adversarial split task.md # Split large files into smaller parts
adversarial split task.md --dry-run # Preview split without creating files
adversarial review # Phase 3: Review implementation
adversarial validate "pytest" # Phase 4: Validate with tests
adversarial list-evaluators # List all available evaluators
Browse and install pre-configured evaluators from the community adversarial-evaluator-library.
# Browse available evaluators
adversarial library list
# Filter by provider or category
adversarial library list --provider google
adversarial library list --category quick-check
# Install an evaluator
adversarial library install google/gemini-flash
# Run it with --evaluator flag
adversarial evaluate --evaluator gemini-flash task.md
adversarial evaluate -e gemini-flash task.md # short form
| Command | Description |
|---|---|
adversarial library list | Browse available evaluators |
adversarial library install <provider>/<name> | Install evaluator to project |
adversarial library check-updates | Check for updates to installed evaluators |
adversarial library update <name> | Update an evaluator (with diff preview) |
Use the --evaluator flag to run any installed evaluator:
# Run by name
adversarial evaluate --evaluator plan-evaluator task.md
# Short form
adversarial evaluate -e security-reviewer task.md
# Evaluators with model_requirement auto-resolve to best available model
adversarial evaluate -e gemini-flash task.md
How it works:
.adversarial/evaluators/*.ymlmodel field takes priority when specifiedmodel, resolves model_requirement via registryWithout --evaluator flag: Uses existing shell script behavior (backward compatible)
Installed evaluators are copied to your project, not referenced at runtime:
Installed evaluators include metadata for tracking updates:
_meta:
source: adversarial-evaluator-library
source_path: google/gemini-flash
version: "1.2.0"
installed: "2026-02-03T10:00:00Z"
name: gemini-flash
# ... rest of evaluator config
# Bypass cache (1-hour TTL by default)
adversarial library list --no-cache
# Force overwrite existing files
adversarial library install google/gemini-flash --force
# Update all outdated evaluators
adversarial library update --all
# Preview changes without applying
adversarial library update gemini-flash --diff-only
Starting with v0.6.0, you can define project-specific evaluators without modifying the package.
Create the evaluators directory:
mkdir -p .adversarial/evaluators
Create a YAML definition:
# .adversarial/evaluators/athena.yml
name: athena
description: Knowledge evaluation using Gemini 2.5 Pro
model: gemini-2.5-pro
api_key_env: GEMINI_API_KEY
output_suffix: KNOWLEDGE-EVALUATION
prompt: |
You are Athena, a knowledge evaluation specialist...
# Optional
aliases:
- knowledge
Use it like any built-in evaluator:
adversarial athena docs/research-plan.md
| Field | Required | Description |
|---|---|---|
name | Yes | Command name |
description | Yes | Help text shown in CLI |
model | Yes | Model to use (e.g., gpt-4o, gemini-2.5-pro) |
api_key_env | Yes | Environment variable for API key |
output_suffix | Yes | Log file suffix (e.g., KNOWLEDGE-EVAL) |
prompt | Yes | The evaluation prompt |
aliases | No | Alternative command names |
log_prefix | No | CLI output prefix |
fallback_model | No | Fallback model if primary fails |
timeout | No | Timeout in seconds (default: 180, max: 600) |
version | No | Evaluator version (default: 1.0.0) |
adversarial list-evaluators
See docs/examples/athena.yml for a complete example of a knowledge-focused evaluator using Gemini 2.5 Pro.
For full documentation on custom evaluators, see docs/CUSTOM_EVALUATORS.md.
.adversarial/config.yml:
evaluator_model: gpt-4o
task_directory: tasks/
test_command: pytest tests/
log_directory: .adversarial/logs/
export ADVERSARIAL_EVALUATOR_MODEL=gpt-4-turbo
export ADVERSARIAL_TEST_COMMAND="npm run test:integration"
Precedence: Environment variables > YAML config > defaults
✅ Supported Platforms:
⚠️ Windows:
Why Unix-only? This package uses Bash scripts for workflow automation. While Python is cross-platform, the workflow scripts (.adversarial/scripts/*.sh) are designed for Unix-like shells.
If you're on Windows, install WSL for the best experience:
# Run in PowerShell (Administrator)
wsl --install
# After restart, set up Ubuntu (default)
# Then install Python and pip in WSL:
sudo apt update
sudo apt install python3 python3-pip
# Install the package in WSL
pip install adversarial-workflow
Official WSL guide: https://learn.microsoft.com/windows/wsl/install
While Git Bash may work, be aware of:
The CLI automatically detects Windows and shows an interactive warning:
adversarial init --interactive checks platform before setupadversarial quickstart checks platform before onboarding"Command not found: adversarial" (WSL)
which adversarialexport PATH="$HOME/.local/bin:$PATH"Scripts fail with "bad interpreter" (Git Bash)
dos2unix .adversarial/scripts/*.shPermission denied on scripts (macOS/Linux)
chmod +x .adversarial/scripts/*.shadversarial init again to reset permissionsNote: Aider is now bundled with adversarial-workflow (v0.4.0+). No separate installation needed.
Perfect for developers who prefer manual coding but want AI quality checks:
# 1. Create your task plan
cat > tasks/add-user-auth.md << 'EOF'
# Task: Add User Authentication
## Requirements
- JWT-based authentication
- Login/logout endpoints
- Password hashing with bcrypt
## Acceptance Criteria
- All tests pass
- No security vulnerabilities
EOF
# 2. Get plan reviewed
adversarial evaluate tasks/add-user-auth.md
# AI reviews plan, suggests improvements
# 3. Implement manually (your preferred editor)
vim src/auth.py
vim src/routes.py
vim tests/test_auth.py
# 4. Get implementation reviewed
git add -A
adversarial review
# AI reviews your git diff for issues
# 5. Validate with tests
adversarial validate "pytest tests/test_auth.py"
# AI analyzes test results
Use any AI coding tool for implementation, adversarial workflow for quality gates:
# 1. Create and evaluate plan
echo "# Task: Refactor database layer" > tasks/refactor-db.md
adversarial evaluate tasks/refactor-db.md
# 2. Implement with your preferred tool (Claude Code, Cursor, etc.)
# ... make changes ...
# 3. Review implementation
adversarial review
# Independent AI reviews your changes
# 4. Validate
adversarial validate "npm test"
Works great with any AI coding assistant:
# 1. Get plan approved
adversarial evaluate tasks/new-feature.md
# 2. Code in Cursor/VS Code with Copilot
# ... use your AI assistant as normal ...
# 3. Get adversarial review
adversarial review
# Catches issues your coding assistant might miss
# 4. Validate
adversarial validate "cargo test"
# Setup
cd my-react-app
adversarial init --interactive
# Configure for Node.js
cat > .adversarial/config.yml << 'EOF'
evaluator_model: gpt-4o
task_directory: tasks/
test_command: npm test
log_directory: .adversarial/logs/
EOF
# Use workflow
adversarial evaluate tasks/add-dark-mode.md
# ... implement feature ...
adversarial review
adversarial validate "npm test"
# Setup
cd my-python-app
adversarial quickstart # Interactive setup
# Use workflow
adversarial evaluate tasks/optimize-queries.md
# ... implement with any method ...
adversarial review
adversarial validate "pytest tests/ -v"
# Setup
cd my-go-service
adversarial init --interactive
# Configure
cat > .adversarial/config.yml << 'EOF'
evaluator_model: gpt-4o
task_directory: docs/tasks/
test_command: go test ./...
log_directory: .adversarial/logs/
EOF
# Use workflow
adversarial evaluate docs/tasks/add-grpc-endpoint.md
# ... implement ...
adversarial review
adversarial validate "go test ./..."
What to do when the reviewer requests changes:
# 1. Create and evaluate plan
adversarial evaluate tasks/add-caching.md
# Reviewer: "APPROVED - plan looks good"
# 2. Implement feature
# ... write code ...
git add -A
# 3. Review implementation
adversarial review
# Reviewer: "NEEDS_REVISION - Missing error handling in cache.get()"
# 4. Address feedback (iterate)
# ... fix the issues mentioned ...
git add -A
# 5. Review again
adversarial review
# Reviewer: "APPROVED - error handling looks good now"
# 6. Validate with tests
adversarial validate "pytest tests/"
# All checks passed - ready to commit!
Key Points:
Working with projects that don't have tests yet:
# Setup
cd legacy-project
adversarial init --interactive
# Configure without tests
cat > .adversarial/config.yml << 'EOF'
evaluator_model: gpt-4o
task_directory: tasks/
test_command: echo "No tests yet - manual verification required"
log_directory: .adversarial/logs/
EOF
# Use workflow (skip validation phase)
adversarial evaluate tasks/fix-bug-123.md
# ... implement fix ...
adversarial review # Still get code review!
# Skip test validation (no tests)
# Manually verify the fix works
# Optional: Ask reviewer to suggest tests
cat > tasks/add-tests-for-bug-123.md << 'EOF'
# Task: Add Tests for Bug Fix #123
## Goal
Add regression tests for the bug fix in src/payment.py
## Acceptance Criteria
- Test the failing case (bug reproduction)
- Test the fixed case (verify fix works)
EOF
adversarial evaluate tasks/add-tests-for-bug-123.md
Benefits Even Without Tests:
Working with monorepos or projects with multiple services:
# Setup in monorepo root
cd my-monorepo
adversarial init --interactive
# Configure for specific package
cat > .adversarial/config.yml << 'EOF'
evaluator_model: gpt-4o
task_directory: tasks/
test_command: npm run test:all # Runs tests for all packages
log_directory: .adversarial/logs/
EOF
# Workflow for specific package
adversarial evaluate tasks/api-add-endpoint.md
# Implement in specific package
cd packages/api
# ... make changes ...
cd ../..
git add packages/api/
# Review only API package changes
adversarial review
# Reviewer sees only packages/api/ in git diff
# Run all tests (monorepo-wide)
adversarial validate "npm run test:all"
# Alternative: Test only affected package
adversarial validate "npm run test --workspace=@myapp/api"
Monorepo Tips:
For large projects where full runs are expensive:
# Configure with cheaper model for reviews
cat > .adversarial/config.yml << 'EOF'
evaluator_model: gpt-4o-mini # Cheaper alternative
task_directory: tasks/
test_command: pytest tests/
log_directory: .adversarial/logs/
EOF
# Strategy 1: Review only changed files
git add src/module.py tests/test_module.py # Not "git add -A"
adversarial review
# Reviewer sees minimal diff - cheaper
# Strategy 2: Split large tasks into smaller ones
# Instead of:
# tasks/refactor-entire-app.md (huge)
# Use:
# tasks/refactor-auth-module.md (small)
# tasks/refactor-api-module.md (small)
# tasks/refactor-db-module.md (small)
# Strategy 3: Use test subsets
adversarial validate "pytest tests/test_module.py -v" # Not all tests
# Strategy 4: Only validate on final review
adversarial evaluate tasks/feature.md # Phase 1
# ... implement ...
adversarial review # Phase 3
# Skip validation during iteration
# Run full validation only when review passes
adversarial validate "pytest tests/" # Phase 4 (final)
Cost Breakdown:
From the thematic-cuts project:
See docs/ directory for comprehensive guides.
Example GitHub Actions:
name: Adversarial Code Review
on: pull_request
jobs:
review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install adversarial-workflow
- run: adversarial review
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
Contributions welcome! This package is extracted from real-world usage in thematic-cuts.
See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE
Developed by broadcaster_one and refined through months of production use on the thematic-cuts project.
Inspired by: The realization that AI needs AI to keep it honest.
Version 1.0.0
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.1 | 16 Apr 2026 | 9 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 20 Oct, 20:03 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:cb5bf92d6bf336fcfbc44ac381f90eb0b5c12b9947c7f49186f2e45d79b10e0c