PyCatan-AI / .github /copilot-instructions.md
EZTIME2025
update instructions
6887a34
# ๐ŸŽฎ PyCatan AI Agent - Project Instructions
## ๐Ÿ“‹ Overview
This project implements a Settlers of Catan game in Python. **Our current goal** is to build an **LLM-based AI agent** that can play the game autonomously.
---
## ๐ŸŽฏ Current Mission: Build AI Agent
### ๐Ÿ“– Architecture Reference
See [AI_ARCHITECTURE.md](.github/instructions/AI_ARCHITECTURE.md) for the complete system architecture.
### ๐Ÿค Agent-Game Manager Interaction
The AI agent will work in coordination with the GameManager:
**How it works:**
1. **GameManager asks:** "What action do you want to take?"
2. **GameManager provides:** List of valid options based on current game state
3. **AI Agent responds:** With a specific action choice
**Example interaction:**
```
GameManager: "Options: place starting settlement"
AI Agent: "s 14"
```
The GameManager handles:
- โœ… Game rules and validation
- โœ… Determining available actions
- โœ… Executing actions
- โœ… Managing turn flow
The AI Agent handles:
- ๐Ÿค– Analyzing current game state
- ๐Ÿค– Deciding which action to take
- ๐Ÿค– Returning action in correct format
---
## ๐Ÿ—๏ธ Development Approach
### Phase 1: Build the Agent Foundation
**Focus areas:**
- ๐Ÿง  **Memory & State Management** - Agent's ability to track and understand game state
- ๐Ÿ“Š **State Representation** - Based on JSON format from `examples/ai_testing/play_and_capture.py`
- ๐Ÿ”„ **Feedback Loop** - How agent receives state and returns decisions
- ๐ŸŽฏ **Prompt Engineering** - Crafting effective prompts for decision-making
- ๐Ÿ› **Debugging Infrastructure** - Tools to understand agent's reasoning
### Core Principles
1. โœจ **Simple & Modular** - Easy to modify and extend
2. ๐Ÿ” **Easy to Debug** - Clear visibility into agent decisions
3. ๐Ÿงฉ **Flexible Design** - Can swap components easily
**โš ๏ธ Important:** We will NOT dive into detailed agent architecture yet. Focus on establishing clean interfaces and simple implementations first.
---
## ๐Ÿ“‚ Key Files
### Game State Capture
- `examples/ai_testing/play_and_capture.py` - Captures game states during play
- `examples/ai_testing/my_games/current_state.json` - Real-time game state
- `examples/ai_testing/sample_states/captured_game.json` - Example game state
### Core Components (Already Built โœ…)
- `pycatan/core/game.py` - Game logic
- `pycatan/management/game_manager.py` - Game coordination
- `pycatan/management/actions.py` - Action definitions
- `pycatan/players/human_user.py` - Human player interface
### AI Agent (To Be Built ๐Ÿšง)
- `pycatan/players/ai_agent.py` - LLM-based AI player (coming soon)
---
## ๐Ÿ’ก Working with Copilot
When helping with this project:
1. **Refer to AI_ARCHITECTURE.md** for system design
2. **Study game state JSON** from captured games to understand data structure
3. **Keep implementations simple** - favor clarity over cleverness
4. **Make debugging easy** - add logging, state inspection, decision traces
5. **Stay modular** - each component should have clear responsibilities
---
## ๐Ÿš€ Next Steps
1. Design agent's state management system
2. Create prompt templates for decision-making
3. Build feedback loop between GameManager and AI Agent
4. Implement debugging and logging tools
5. Test with simple scenarios first