Skill: zedit42/xeonen-arena (version 1.0.0)

--- name: arena-system description: Adversarial self-improvement for AI agents. Reduces hallucinations through Agent vs Anti-Agent debate loops. --- # Arena System Adversarial self-improvement framework for AI agents. ## What it does Give one agent two personas: - **Agent** - Does the work, writes reports - **Anti-Agent** - Questions everything, writes counter-reports They take turns critiquing each other until you stop them. ## Why use it AI agents are overconfident. They hallucinate. Arena forces them to question their own outputs by arguing with themselves. ## Setup ```bash ./setup.sh ~/my-arena ``` Creates: ``` my-arena/ ├── state.json ├── prompts/agent.md ├── prompts/anti-agent.md └── outputs/ ``` ## Usage Add to HEARTBEAT.md: 1. Read `state.json` → whose turn? 2. Run that persona 3. Write to `outputs/{role}/iteration_N.md` 4. Switch turns, save state ## Config `state.json`: ```json { "current_turn": "agent", "iteration": 0, "topic": "my-project", "active": true, "max_iterations": 10 } ``` ## Results Prevents premature deployments, catches bugs, forces proper validation before going live.

path: README.md
content: # 🎭 Arena System

Adversarial self-improvement framework for AI agents. Reduces hallucinations by making the same agent argue with itself.

## Concept

Give one agent two roles:
- **Agent** - Does the work, writes reports
- **Anti-Agent** - Questions everything, writes counter-reports

When one writes a report, the other critiques it. The loop continues until you say stop.

## Why?

AI agents are overconfident. They'll say "this strategy has 80% win rate" without questioning their own assumptions. Arena forces them to ask "but is that really true?"

## Installation

```bash
./setup.sh ~/my-arena
```

This creates:
```
my-arena/
├── state.json           # Loop state
├── prompts/
│   ├── agent.md         # Main agent prompt
│   └── anti-agent.md    # Critic prompt
└── outputs/             # Reports go here
```

## Usage

Add to your `HEARTBEAT.md`:
```markdown
## Arena Loop
1. Read state.json → whose turn?
2. Run that persona's prompt
3. Write output to outputs/{role}/iteration_N.md
4. Switch turns, increment iteration
5. Save state
```

## Configuration

`state.json`:
```json
{
  "current_turn": "agent",
  "iteration": 0,
  "topic": "my-trading-bot",
  "active": true,
  "max_iterations": 10
}
```

## Use Cases

- Trading strategy development
- Code review
- Risk assessment
- Any task where self-critique helps

## Limitations

- 2x token cost (two personas = two LLM calls)
- Same model = same biases (not a true second opinion)
- Can lead to analysis paralysis if anti-agent is too aggressive

## Results

In testing: prevented 2 premature live deployments, caught 3 bugs, saved money by forcing proper paper trading first.


path: package.json
content: {
  "name": "arena-system",
  "version": "1.0.0",
  "description": "Adversarial self-improvement for AI agents. Reduces hallucinations through Agent vs Anti-Agent debate loops.",
  "author": "Zedit42",
  "keywords": ["ai", "agent", "self-improvement", "hallucination", "adversarial", "clawdbot"],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/Zedit42/arena-system"
  }
}


path: setup.sh
content: #!/bin/bash
# Arena System Setup

ARENA_DIR="${1:-$HOME/clawd/arena}"

echo "🎭 Arena System Kurulumu"
echo "========================"
echo "Hedef klasör: $ARENA_DIR"

# Klasörleri oluştur
mkdir -p "$ARENA_DIR"/{outputs/agent,outputs/anti-agent,prompts}

# State dosyası
cat > "$ARENA_DIR/state.json" << 'EOF'
{
  "current_turn": "agent",
  "iteration": 0,
  "topic": "default",
  "active": true,
  "max_iterations": 10,
  "last_update": null
}
EOF

# Agent promptu
cat > "$ARENA_DIR/prompts/agent.md" << 'EOF'
# Agent Rolü

Sen geliştirici rolündesin. Görevin:

1. Anti-Agent'ın son raporunu oku (varsa)
2. Eleştirileri değerlendir
3. Konuyu geliştir/düzelt
4. Detaylı rapor yaz

## Kurallar
- Somut ol, belirsiz ifadelerden kaçın
- Eleştirileri ciddiye al
- Her raporda bir öncekinden ilerleme göster

## Çıktı Formatı
Raporunu `outputs/agent/iteration_N.md` olarak yaz.
EOF

# Anti-Agent promptu
cat > "$ARENA_DIR/prompts/anti-agent.md" << 'EOF'
# Anti-Agent Rolü

Sen denetçi/eleştirmen rolündesin. Görevin:

1. Agent'ın son raporunu oku
2. Zayıf noktaları bul
3. Sorgulanması gereken varsayımları belirle
4. Anti-rapor yaz

## Sorulacak Sorular
- Bu gerçekten doğru mu?
- Kanıt var mı?
- Alternatifler düşünüldü mü?
- Risk analizi yapıldı mı?
- Gözden kaçan bir şey var mı?

## Kurallar
- Yapıcı eleştiri yap, sadece yıkma
- Somut öneriler sun
- Overconfidence'ı sorgula

## Çıktı Formatı
Raporunu `outputs/anti-agent/iteration_N.md` olarak yaz.
EOF

# Heartbeat snippet
cat > "$ARENA_DIR/heartbeat-snippet.md" << 'EOF'
## 🎭 Arena Döngüsü

State dosyası: `~/clawd/arena/state.json`

### Her Heartbeat'te:
1. `state.json` oku → `active: true` mi?
2. Eğer aktifse:
   - `current_turn` kimde?
   - O rolün promptunu oku (`prompts/agent.md` veya `prompts/anti-agent.md`)
   - Karşı tarafın son raporunu oku
   - Yeni rapor yaz → `outputs/{role}/iteration_N.md`
   - `current_turn` değiştir, `iteration++`, state kaydet
3. `max_iterations`'a ulaşıldıysa `active: false` yap
EOF

echo ""
echo "✅ Kurulum tamamlandı!"
echo ""
echo "Sonraki adımlar:"
echo "1. prompts/ klasöründeki promptları düzenle"
echo "2. heartbeat-snippet.md içeriğini HEARTBEAT.md'ye ekle"
echo "3. state.json'da topic'i belirle"
echo ""


Security scan verdicts — ClawScan: clean | static analysis:  | VirusTotal: clean | SkillSpector: clean (LOW)