Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

autonomous-agent-gaming

БесплатноЗапускает вложенные скриптыНе проверен

Build autonomous game-playing agents using AI and reinforcement learning. Covers game environments, agent decision-making, strategy development, and…

qodex-aiот qodex-ai★ 50 звёзд на GitHub

Об этом скилле

Autonomous Agent Gaming

Build sophisticated game-playing agents that learn strategies, adapt to opponents, and master complex games through AI and reinforcement learning.

Overview

Autonomous game agents combine:

  • Game Environment Interface: Connect to game rules and state
  • Decision-Making Systems: Choose optimal actions
  • Learning Mechanisms: Improve through experience
  • Strategy Development: Long-term planning and adaptation

Applications

  • Chess and board game masters
  • Real-time strategy (RTS) game bots
  • Video game autonomous players
  • Game theory research
  • AI testing and benchmarking
  • Entertainment and challenge systems

Quick Start

Run example agents with:

# Rule-based agent
python examples/rule_based_agent.py

# Minimax with alpha-beta pruning
python examples/minimax_agent.py

# Monte Carlo Tree Search
python examples/mcts_agent.py

# Q-Learning agent
python examples/qlearning_agent.py

# Chess engine
python examples/chess_engine.py

# Game theory analysis
python scripts/game_theory_analyzer.py

# Benchmark agents
python scripts/agent_benchmark.py

Game Agent Architectures

1. Rule-Based Agents

Use predefined rules and heuristics. See full implementation in examples/rule_based_agent.py.

Key Concepts:

  • Difficulty levels control strategy depth
  • Evaluation combines material, position, and control factors
  • Fast decision-making suitable for real-time games
  • Easy to customize and understand

Usage Example:

from examples.rule_based_agent import RuleBasedGameAgent

agent = RuleBasedGameAgent(difficulty="hard")
best_move = agent.decide_action(game_state)

2. Minimax with Alpha-Beta Pruning

Optimal decision-making for turn-based games. See examples/minimax_agent.py.

Key Concepts:

  • Exhaustive tree search up to fixed depth
  • Alpha-beta pruning eliminates impossible branches
  • Guarantees optimal play within search depth
  • Evaluation function determines move quality

Performance Characteristics:

  • Time complexity: O(b^(d/2)) with pruning vs O(b^d) without
  • Space complexity: O(b*d)
  • Adjustable depth for speed/quality tradeoff

Usage Example:

from examples.minimax_agent import MinimaxGameAgent

agent = MinimaxGameAgent(max_depth=6)
best_move = agent.get_best_move(game_state)

3. Monte Carlo Tree Search (MCTS)

Probabilistic game tree exploration. Full implementation in examples/mcts_agent.py.

Key Concepts:

  • Four-phase algorithm: Selection, Expansion, Simulation, Backpropagation
  • UCT (Upper Confidence bounds applied to Trees) balances exploration/exploitation
  • Effective for games with high branching factors
  • Anytime algorithm: more iterations = better decisions

The UCT Formula: UCT = (child_value / child_visits) + c * sqrt(ln(parent_visits) / child_visits)

Usage Example:

from examples.mcts_agent import MCTSAgent

agent = MCTSAgent(iterations=1000, exploration_constant=1.414)
best_move = agent.get_best_move(game_state)

4. Reinforcement Learning Agents

Learn through interaction with environment. See examples/qlearning_agent.py.

Key Concepts:

  • Q-learning: model-free, off-policy learning
  • Epsilon-greedy: balance exploration vs exploitation
  • Update rule: Q(s,a) += α[r + γ*max_a'Q(s',a') - Q(s,a)]
  • Q-table stores state-action value estimates

Hyperparameters:

  • α (learning_rate): How quickly to adapt to new information
  • γ (discount_factor): Importance of future rewards
  • ε (epsilon): Exploration probability

Usage Example:

from examples.qlearning_agent import QLearningAgent

agent = QLearningAgent(learning_rate=0.1, discount_factor=0.99, epsilon=0.1)
action = agent.get_action(state)
agent.update_q_value(state, action, reward, next_state)
agent.decay_epsilon()  # Reduce exploration over time

Game Environments

Standard Interfaces

Create game environments compatible with agents. See examples/game_environment.py for base classes.

Key Methods:

  • reset(): Initialize game state
  • step(action): Execute action, return (next_state, reward, done)
  • get_legal_actions(state): List valid moves
  • is_terminal(state): Check if game is over
  • render(): Display game state

OpenAI Gym Integration

Standard interface for game environments:

import gym

# Create environment
env = gym.make('CartPole-v1')

# Initialize
state = env.reset()

# Run episode
done = False
while not done:
    action = agent.get_action(state)
    next_state, reward, done, info = env.step(action)
    agent.update(state, action, reward, next_state)
    state = next_state

env.close()

Chess with python-chess

Full chess implementation in examples/chess_engine.py. Requires: pip install python-chess

Features:

  • Full game rules and move validation
  • Position evaluation based on material count
  • Move history and undo functionality
  • FEN notation support

Quick Example:

from examples.chess_engine import Ches
Полный SKILL.md на GitHub

Установить autonomous-agent-gaming в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

README.mdexamples/chess_engine.pyexamples/game_environment.pyexamples/mcts_agent.pyexamples/minimax_agent.pyexamples/qlearning_agent.pyexamples/rule_based_agent.pyexamples/strategy_modules.pyscripts/agent_benchmark.pyscripts/game_theory_analyzer.pyscripts/performance_optimizer.py

FAQ

Что делает скилл autonomous-agent-gaming?

Build autonomous game-playing agents using AI and reinforcement learning. Covers game environments, agent decision-making, strategy development, and performance optimization. Use when creating game-playing bots, testing game AI, strategic decision-making systems, or game theory applications.

Как установить скилл autonomous-agent-gaming?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл autonomous-agent-gaming запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить autonomous-agent-gaming с