ai-duel

ai-duel is a skill for Claude Code, Codex from phase-rs/phase. It costs 41 tokens per session (2,807 once invoked), scanned A, original, Apache-2.0.

A command-line tool for running simulated games between two computer-controlled players. It can run individual games, batches, registered matchup suites, and commander seat measurements.

In plain words
What is it for?
Use it to test AI matchups, inspect combat and spellcasting, compare simulation reports, and measure commander candidate seats with chosen difficulty and seeds.
Why use it?
It helps reveal poor decisions and gameplay regressions without requiring a person to play every test game.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/phase-rs/phase/ai-duel
Any agent
npx skills add phase-rs/phase --skill ai-duel
Clone the repo
git clone --depth 1 https://github.com/phase-rs/phase

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for ai-duel

README.md
[![agentmods](https://agentmods.dev/badge/skills/phase-rs/phase/ai-duel.svg)](https://agentmods.dev/skills/phase-rs/phase/ai-duel)
Your own site
<a href="https://agentmods.dev/skills/phase-rs/phase/ai-duel"><img src="https://agentmods.dev/badge/skills/phase-rs/phase/ai-duel.svg" alt="Measured on agentmods" height="20"></a>
Per session 41 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,807 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00041 $0.02807
Opus 5 $0.00020 $0.01404
Sonnet 5 $0.00008 $0.00561
Haiku 4.5 $0.00004 $0.00281

Measured 5d ago against content hash 4fb47d2df963, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ai-duel scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/ai-duel/SKILL.md · 239 lines

How it starts

The opening of the file, as written. The whole thing — 239 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AI Duel Simulation

Run AI-vs-AI game simulations to test decision quality, validate matchups, and catch regressions.

Quick Start

# Default: Red Aggro vs Green Midrange, 5 games, Medium difficulty
rtk cargo run --release --bin ai-duel -- client/public --batch 5

# Single verbose game (see every combat action and spell cast)
rtk cargo run --release --bin ai-duel -- client/public --seed 42 --difficulty VeryHard

# Batch with specific seed for reproducibility
rtk cargo run --release --bin ai-duel -- client/public --batch 20 --seed 1000 --difficulty Medium

# Full registered matchup suite in measurement mode
rtk cargo run --release --bin ai-duel -- client/public --suite --games 10 --seed 42 \
  --output target/duel-suite-results.json

# Compare two suite reports with paired-seed sign-test status
rtk cargo run --release --bin ai-duel -- compare crates/phase-ai/baselines/duel-suite.json \
  target/duel-suite-results.json

# Commander candidate-seat measurement
rtk cargo run --release --bin ai-duel -- client/public --commander-suite --games 8 --seed 42 \
  --difficulty Hard --baseline-difficulty Medium \
  --output target/commander-suite-results.json

CLI Options

Flag Description Default
--batch N Run N games, print summary only 1 (verbose)
--seed S RNG seed for reproducibility time-based
--difficulty LEVEL VeryEasy|Easy|Medium|Hard|VeryHard Medium
--matchup NAME Deck matchup preset red-vs-green
--list-matchups Show available matchups -
--verbose Print every action (full trace) off
--suite Run every registered MatchupSpec in measurement mode off
--games N Games per matchup/suite cell 10 for suite, 4 for commander suite
--output PATH JSON report path target/duel-suite-results.json
--suite-filter STR Run only suite matchups whose id contains STR all
--show-attribution Capture phase_ai::decision_trace policy attribution off
--commander-suite Run 4-player Commander candidate-seat rotations off
--baseline-difficulty LEVEL Baseline seats for --commander-suite Medium
--feed PATH Commander feed under data root feeds/mtggoldfish-commander.json

Read the full file on GitHub · 239 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 239 lines · 41 tokens per session scan A 4fb47d2df963

Subscribe to this mod's changes

ai-duel is a skill published in the GitHub repository phase-rs/phase (268 stars, last pushed yesterday), licensed Apache-2.0. It adds 41 tokens to every session and 2,807 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

add-card

Implements new Magic: The Gathering cards for the Argentum Engine. Use when adding a new card, the user provides one or more card names to implement, or asks to implement a specific MTG card. Several cards that reuse existing primitives can be implemented together into one PR.

wingedsheep/argentum-engine · 0 tokens

add-feature

Adds a new feature or mechanic to the Argentum Engine (SDK primitive, effect, trigger, condition, static/replacement ability, server/client capability) following the project's architecture and SDK-elegance principles. Use when implementing engine/SDK/server/client functionality that isn't a single card — e.g. "add an…

wingedsheep/argentum-engine · 87 tokens

verify-set

Prove a Magic set is actually finished — card-for-card complete, field-for-field faithful to Scryfall, scripts that match their oracle text, tokens that resolve the set's own art, behaviourally sound — then archive its backlog. Builds the Scryfall dump and CardFieldVerificationTest, fans the per-card DSL and token…

wingedsheep/argentum-engine · 152 tokens

assay-ready-sweep

Implement every "Assay-ready" card for a Magic set — the cards Argentum Assay reads whole that the set hasn't authored yet — placing each canonical in its earliest real printing and giving the sweep's own set a Printing row when the card is a reprint. Computes the four-way split first, authors to assay compile's JSON…

wingedsheep/argentum-engine · 156 tokens

review-changes

Review pending changes (a branch, PR, or working tree) for the Argentum Engine. Optimizes for an elegant, reusable SDK — flags one-off effects/abilities that should compose existing primitives — and checks correctness, projection use, tests, and architectural fit. Use when the user says "review this PR", "review this…

wingedsheep/argentum-engine · 87 tokens

create-backlog-for-set

Create the backlog/sets/ / entry for a Magic set — download the whole set from Scryfall (cached alongside Assay's cache), write cards.md as a per-colour checklist with the already-implemented cards ticked, scaffold the set's definitions/ / module if it doesn't exist, and write mechanics.md ordering every mechanic the…

wingedsheep/argentum-engine · 150 tokens