# Rival: Adversarial Second-Opinion Code Review

> Adversarial code reviews using a panel of structurally diverse models via OpenRouter or local Ollama.

Rival: Adversarial Second-Opinion Code Review is a free AI agent skill on Agensi by MAD-IT, in Code Quality & Review. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [MAD-IT](https://www.agensi.io/creators/bambushu)
- Category: [Code Quality & Review](https://www.agensi.io/skills/code-quality-review)
- Uses: 2
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/rival-adversarial-second-opinion-code-review
- Tags: code-review, openrouter, ollama, bash, adversarial-ai

## About this skill

Code reviews often suffer from "LLM optimism," where agents overlook critical bugs or security flaws. Rival forces an adversarial perspective by routing your code through structurally diverse model families (whichever free families are healthy that day, such as Nemotron, Gemma, Qwen or Llama) to find what you missed.

### What it does
- **Adversarial Review** identifies logic errors, off-by-one mistakes, and security vulnerabilities instead of giving generic praise.
- **Multi-Model Panels** chains up to three different models to build on each other's findings or provide independent blind reviews.
- **Automated Roster Discovery** ranks and caches available free-tier models by size and family diversity every 24 hours.
- **Local Compute Support** enables private reviews using local Ollama models when code cannot leave the machine.
- **Task Delegation** routes non-review requests to specific models without adversarial prompting for general implementation work.

### How it works
1. **Rival Discovery** runs a script that ranks healthy OpenRouter free models by size, one per family, and caches the roster for 24 hours (pinned paid models rank first). With --local it uses your Ollama model instead.
2. **Context Gathering** pulls the current `git diff` or specific file contents to prepare the review target.
3. **Panel Execution** calls models sequentially with built-in delays to respect free-tier rate limits, passing findings from one to the next.
4. **Consolidation** presents a severity-ranked summary (CRITICAL to LOW) alongside the raw outputs from each reviewer.

### Frameworks & tools
Uses Bash scripts, `curl`, and `jq` to interface with the OpenRouter API or local Ollama instances.

### Why this beats prompting it yourself
Manual prompting rarely forces the model to disagree with itself or its peers. Rival automates the cross-family validation logic and handles the rate-limit delays required to get deep, multi-perspective reviews for free.

### Use cases
- **Pre-merge Audit** to find edge cases in a complex PR before human review.
- **Security Check** to scan for injection or auth bypasses using diverse model logic.
- **Offline Review** to maintain productivity and code privacy using Ollama.
- **Consensus Building** to resolve technical disagreements via a three-model blind panel.

### Known limitations
Limited to one file or diff at a time; for a whole-repo audit see Crucible. Free-tier models get rate-limited: panels space calls 8-10 seconds apart, and a model that stays at HTTP 429 is skipped and the reduced panel is announced. Code under review is sent to openrouter.ai unless you use --local.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Rival: Adversarial Second-Opinion Code Review skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### How does Rival differ from a standard AI code review prompt?

A single model reviewing its own kind of code shares its own blind spots. Rival sends the code to different model families (whichever free ones are healthy that day, such as Nemotron, Gemma, Qwen or Llama, or paid models you pin) and tells each one to hunt for problems, not to praise. In a panel, each reviewer must check the original code independently and dispute earlier findings it disagrees with.

### Do I need to manually configure which models are used for the review?

No. A discovery script ranks healthy OpenRouter free models by size, one per family, and caches the roster for 24 hours. You can pin paid models in ~/.rival/pinned.txt to rank them first. With --local it uses your Ollama model (default qwen2.5-coder:32b, or name another).

### Can I use Rival if I have strict privacy requirements and cannot send code to the cloud?

Yes, Rival fully supports local execution via Ollama, allowing you to run adversarial reviews on your own hardware without your code ever leaving your machine.

### What are the technical requirements to run this skill?

Rival uses a lightweight architecture based on Bash, curl, and jq, making it compatible with any terminal-based environment or AI agent that can execute shell commands.

### How does the skill handle rate limits when using free-tier models?

Panel calls are spaced 8-10 seconds apart and each call retries with backoff. If a free model stays rate-limited after the retries, the panel skips it and tells you it ran with fewer models, as in the demo above.

### What is included in the Rival package?

SKILL.md (review prompts, panel orchestration and the report formats) plus two Bash scripts: rival-discover.sh (builds the model roster) and rival-companion.sh (calls OpenRouter or Ollama). MIT licensed.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
