Skip to content

Commit 1157c7e

Browse files
committed
docs: update CLAUDE.md for strategy system
- Update architecture section to reflect StrategyManager - Update command examples to use --strategy instead of --template - Update environment variable documentation (base_url, strategy) - Document strategy system with built-in and custom path support - Update project structure to show strategies/ directory - Add comprehensive strategy system documentation section
1 parent 91e0d69 commit 1157c7e

1 file changed

Lines changed: 28 additions & 12 deletions

File tree

โ€ŽCLAUDE.mdโ€Ž

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,12 @@ litellm --config config/litellm.yaml
2424
```bash
2525
balatrollm # Default settings (cerebras-qwen3-235b)
2626
balatrollm --model groq-qwen3-32b # Specific model
27-
balatrollm --template aggressive # Specific strategy
27+
balatrollm --strategy aggressive # Built-in strategy
28+
balatrollm --strategy /path/to/custom/strategy # External strategy directory
29+
balatrollm --strategy ../my-strategies/experimental # Relative path to strategy
2830
balatrollm --list-models # List available models
2931
balatrollm --verbose # Enable verbose logging
30-
balatrollm --proxy-url http://localhost:4000 --api-key your-key
32+
balatrollm --base-url http://localhost:4000 --api-key your-key
3133
```
3234

3335
### Development
@@ -42,18 +44,18 @@ make start # Kill previous instances and start LiteLLM + Balatro
4244

4345
## Architecture
4446

45-
**LLMBot (`src/balatrollm/bot.py`)**: Main bot class with Config integration, TemplateManager, LLM decision-making, response history tracking, BalatroClient integration, proxy validation, model validation, and project version management.
47+
**LLMBot (`src/balatrollm/bot.py`)**: Main bot class with Config integration, StrategyManager, LLM decision-making, response history tracking, BalatroClient integration, proxy validation, model validation, and project version management.
4648

4749
**CLI Entry Point (`src/balatrollm/__init__.py`)**: Command-line interface with argument parsing, environment variable support, configuration validation, and async game execution.
4850

4951
**Configuration (`src/balatrollm/config.py`)**: Config dataclass handling model settings, proxy URLs, bot parameters, and environment variable loading.
5052

51-
**Template System (`src/balatrollm/templates.py`)**: TemplateManager class for Jinja2-based strategy templates and tool loading.
53+
**Strategy System (`src/balatrollm/strategies.py`)**: StrategyManager class for Jinja2-based strategy templates and tool loading.
5254

5355
**Data Collection (`src/balatrollm/data_collection.py`)**: RunDataCollector for game execution logging, performance tracking, and run data organization.
5456

5557

56-
**Template Strategies (`src/balatrollm/templates/`)**: Strategy-based organization:
58+
**Strategies (`src/balatrollm/strategies/`)**: Strategy-based organization:
5759
- `default/`: Conservative strategy (financial discipline)
5860
- `aggressive/`: High-risk, high-reward strategy
5961

@@ -67,7 +69,7 @@ Each strategy contains:
6769

6870
**Game Flow**:
6971
1. Validate proxy connection and model availability
70-
2. Game loop: Get state โ†’ Render templates โ†’ Send to LLM โ†’ Parse response โ†’ Execute action
72+
2. Game loop: Get state โ†’ Render strategy templates โ†’ Send to LLM โ†’ Parse response โ†’ Execute action
7173
3. Handle different states: BLIND_SELECT, SELECTING_HAND, SHOP, ROUND_EVAL
7274

7375
**Available Models** (`config/litellm.yaml`):
@@ -78,9 +80,9 @@ Each strategy contains:
7880
**Environment Variables**:
7981
- `CEREBRAS_API_KEY`, `GROQ_API_KEY`
8082
- `LITELLM_MODEL` (default: cerebras-qwen3-235b)
81-
- `LITELLM_PROXY_URL` (default: http://localhost:4000)
83+
- `LITELLM_BASE_URL` (default: http://localhost:4000)
8284
- `LITELLM_API_KEY` (default: sk-balatrollm-proxy-key)
83-
- `BALATROLLM_TEMPLATE` (default: default)
85+
- `BALATROLLM_STRATEGY` (default: default)
8486

8587
## Code Quality
8688

@@ -93,9 +95,9 @@ src/balatrollm/
9395
โ”œโ”€โ”€ __init__.py # CLI entry point with argument parsing
9496
โ”œโ”€โ”€ bot.py # Main LLMBot class with game logic
9597
โ”œโ”€โ”€ config.py # Configuration dataclass
96-
โ”œโ”€โ”€ templates.py # TemplateManager for Jinja2 templates
98+
โ”œโ”€โ”€ strategies.py # StrategyManager for Jinja2 templates
9799
โ”œโ”€โ”€ data_collection.py # RunDataCollector for game logging
98-
โ””โ”€โ”€ templates/ # Strategy-based templates
100+
โ””โ”€โ”€ strategies/ # Strategy-based templates
99101
โ”œโ”€โ”€ default/ # Conservative strategy
100102
โ””โ”€โ”€ aggressive/ # High-risk strategy
101103
โ”œโ”€โ”€ STRATEGY.md.jinja # Strategy guide
@@ -120,5 +122,19 @@ tests/test_llm.py # Test suite
120122

121123
## Strategy System
122124

123-
**Default** (`--template default`): Conservative, financially disciplined approach
124-
**Aggressive** (`--template aggressive`): High-risk, high-reward approach with aggressive spending
125+
The `--strategy` flag accepts either built-in strategy names or paths to custom strategy directories:
126+
127+
**Built-in Strategies**:
128+
- **Default** (`--strategy default`): Conservative, financially disciplined approach
129+
- **Aggressive** (`--strategy aggressive`): High-risk, high-reward approach with aggressive spending
130+
131+
**Custom Strategy Paths**:
132+
- Absolute paths: `--strategy /path/to/my/custom/strategy`
133+
- Relative paths: `--strategy ../custom-strategies/experimental`
134+
- The system will automatically resolve built-in strategy names first, then fall back to path resolution
135+
136+
Each strategy directory must contain:
137+
- `STRATEGY.md.jinja`: Strategy-specific guide
138+
- `GAMESTATE.md.jinja`: Game state representation
139+
- `MEMORY.md.jinja`: Response history tracking
140+
- `TOOLS.json`: Strategy-specific function definitions

0 commit comments

Comments
ย (0)
โšก