# autonomous-agent-gaming

autonomous-agent-gaming is a skill with runnable examples of rule-based, minimax, MCTS and Q-learning bots, plus a chess engine for agents choosing game moves.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 274 installs · ★ 50 repo stars
- Author: qodex-ai
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/qodex-ai/ai-agent-skills/tree/HEAD/skills/autonomous-agent-gaming/SKILL.md
- Updated: 2026-01-05
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/autonomous-agent-gaming

## What it does

Under `examples/` sit four strategies: a rule-based player, minimax with alpha-beta pruning, Monte Carlo Tree Search, and tabular Q-learning. There is also a chess engine in `examples/chess_engine.py`, plus `scripts/game_theory_analyzer.py` for game-theory analysis and `scripts/agent_benchmark.py` for pitting agents against each other.

Environments follow one contract: `reset()`, `step(action)`, `get_legal_actions(state)`, `is_terminal(state)`, `render()`. Gym environments plug in directly, and `PygameGameEnvironment` is the base class when you draw your own board. Strategy pieces live in `examples/strategy_modules.py`: an opening book that hashes positions for fast lookup and endgame tablebases.

The chess example needs `pip install python-chess` before it runs, and drawing a custom game takes pygame. Put those in place first.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill autonomous-agent-gaming -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/autonomous-agent-gaming/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/autonomous-agent-gaming/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill autonomous-agent-gaming -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/autonomous-agent-gaming/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill autonomous-agent-gaming -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/autonomous-agent-gaming/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install qodex-ai/ai-agent-skills skills/autonomous-agent-gaming
```

2. **Manually: put the files in place**
- File: `.github/skills/autonomous-agent-gaming/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill autonomous-agent-gaming -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/qodex-ai/ai-agent-skills --path skills/autonomous-agent-gaming
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/autonomous-agent-gaming/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add qodex-ai/ai-agent-skills --skill autonomous-agent-gaming -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/qodex-ai/ai-agent-skills/tree/HEAD/skills/autonomous-agent-gaming/SKILL.md

## When to use it
- Build a turn-based bot that searches the move tree
- Train a Q-learning agent on your own state space
- Validate chess moves and play a full game
- Wrap a homemade game in the shared environment interface
- Benchmark several agents over the same matches

## Example prompts
- Write a minimax agent with alpha-beta pruning for tic-tac-toe
- Run `examples/qlearning_agent.py` and explain how epsilon decay works
- Build a pygame environment for my card game based on `examples/game_environment.py`

## Similar
- [pentest-r1-autonomous-penetration-testing](https://affpapa.org/en/nevibecode/skills/pentest-r1-autonomous-penetration-testing.md) — skill · 271 installs
- [game-ai](https://affpapa.org/en/nevibecode/skills/game-ai.md) — skill · 14100 installs
- [autoresearchclaw-autonomous-research](https://affpapa.org/en/nevibecode/skills/autoresearchclaw-autonomous-research.md) — skill · 1600 installs
- [autonomous-agents](https://affpapa.org/en/nevibecode/skills/sickn33-autonomous-agents.md) — skill · 1300 installs
- [roblox-npc-ai](https://affpapa.org/en/nevibecode/skills/el4cteo-roblox-npc-ai.md) — skill · 1200 installs
- [pufferlib](https://affpapa.org/en/nevibecode/skills/pufferlib.md) — skill · 2100 installs

From the same set: [qodex-ai/ai-agent-skills](https://affpapa.org/en/nevibecode/by/qodex-ai/ai-agent-skills.md) — 42 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
