Skip to content

Commit 03cc82d

Browse files
committed
docs: add strategy submission guidelines
1 parent 8408a1a commit 03cc82d

1 file changed

Lines changed: 93 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 93 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Contributing
22

3-
Welcome to **template-python**! We appreciate your interest in contributing.
3+
Welcome to **BalatroLLM**! We appreciate your interest in contributing.
44

5-
This document provides guidelines and instructions for contributing to the project. Whether you're fixing bugs, improving documentation, or proposing new features, your contributions are welcome.
5+
This document provides guidelines and instructions for contributing to the project. Whether you're fixing bugs, improving documentation, proposing new features, or submitting new strategies, your contributions are welcome.
66

77
## How to Contribute
88

@@ -16,15 +16,17 @@ This document provides guidelines and instructions for contributing to the proje
1616

1717
5. **Use Conventional Commits**: Follow the conventional commits specification for your commit messages.
1818

19+
6. **Submit Strategies**: Community members can contribute new playing strategies by following the strategy submission guidelines below.
20+
1921
## Environment Setup
2022

2123
This section describes how to set up the **recommended** development environment for this project using [uv](https://docs.astral.sh/uv/).
2224

2325
1. Download the repository:
2426

2527
```sh
26-
git clone https://github.com/S1M0N38/template-python.git
27-
cd template-python
28+
git clone https://github.com/S1M0N38/balatrollm.git
29+
cd balatrollm
2830
```
2931

3032
2. Create environment:
@@ -57,7 +59,7 @@ The project follows an automated release process using GitHub Actions:
5759
2. **Release Please PR**: The [Release Please](https://github.com/googleapis/release-please) GitHub Action automatically maintains a release PR that:
5860

5961
- Updates the version in `pyproject.toml`
60-
- Updates the version in `src/template_python/__init__.py`
62+
- Updates the version in `src/balatrollm/__init__.py`
6163
- Updates the `CHANGELOG.md` based on conventional commits
6264
- The PR is continuously updated as new commits are added to the main branch
6365

@@ -81,3 +83,89 @@ The project follows an automated release process using GitHub Actions:
8183
- This ensures dependencies are properly locked for the new version
8284

8385
This automated process ensures consistent versioning, comprehensive changelogs, reliable package distribution, and up-to-date dependency locks with minimal manual intervention.
86+
87+
## Contributing Strategies
88+
89+
Community members can contribute new playing strategies to enhance BalatroLLM's gameplay variety. Strategies define how the bot approaches decision-making during different game phases.
90+
91+
### Strategy Structure
92+
93+
Each strategy must be organized as a directory under `src/balatrollm/strategies/` containing exactly four files:
94+
95+
```
96+
src/balatrollm/strategies/your_strategy_name/
97+
├── STRATEGY.md.jinja # Strategy-specific guide and approach
98+
├── GAMESTATE.md.jinja # Game state representation template
99+
├── MEMORY.md.jinja # Response history tracking template
100+
└── TOOLS.json # Strategy-specific function definitions
101+
```
102+
103+
### Strategy Naming Requirements
104+
105+
Strategy names must follow these rules:
106+
107+
- **Lowercase letters and numbers only** (e.g., `aggressive`, `value_based`, `risky2`)
108+
- **Valid Python identifier** (cannot start with a number)
109+
- **Underscores allowed, hyphens forbidden** (e.g., `high_risk` allowed, `high-risk` forbidden)
110+
- **No spaces or special characters**
111+
112+
### Creating Your Strategy
113+
114+
1. **Study Existing Strategies**: Review `src/balatrollm/strategies/default/` and `src/balatrollm/strategies/aggressive/` to understand the template structure and content expectations.
115+
116+
2. **Create Strategy Directory**: Create a new directory following the naming requirements:
117+
118+
```bash
119+
mkdir src/balatrollm/strategies/your_strategy_name
120+
```
121+
122+
3. **Required Files**: Create all four required files using the existing strategies as templates:
123+
124+
- **STRATEGY.md.jinja**: Define your strategy's core philosophy, decision-making approach, and gameplay priorities
125+
- **GAMESTATE.md.jinja**: Template for how game state information should be presented to the LLM
126+
- **MEMORY.md.jinja**: Template for tracking and presenting response history
127+
- **TOOLS.json**: Function definitions available to the LLM during gameplay
128+
129+
4. **Template Compatibility**: Ensure your templates work with the Jinja2 templating system and provide all necessary context for LLM decision-making.
130+
131+
### Submission Process
132+
133+
1. **Fork the Repository**: Fork the BalatroLLM repository to your GitHub account
134+
135+
2. **Create Feature Branch**: Create a new branch for your strategy:
136+
137+
```bash
138+
git checkout -b feat/add-strategy-your_strategy_name
139+
```
140+
141+
3. **Implement Strategy**: Add your strategy directory with all required files
142+
143+
4. **Test Your Strategy**: Run your strategy locally to ensure it works:
144+
145+
```bash
146+
balatrollm --strategy your_strategy_name
147+
```
148+
149+
5. **Submit Pull Request**: Open a PR containing only your new strategy directory. The PR should:
150+
151+
- Have a clear title: `feat: add [strategy_name] strategy`
152+
- Include a brief description of your strategy's approach and philosophy
153+
- Follow conventional commit standards
154+
155+
### Quality Standards
156+
157+
- **Complete Implementation**: All four files must be present and functional
158+
- **Clear Documentation**: Strategy philosophy and approach should be well-documented
159+
- **Template Validation**: Ensure Jinja2 templates render correctly with game data
160+
- **Unique Approach**: Strategy should offer a meaningfully different gameplay style from existing strategies
161+
162+
### Review Process
163+
164+
Submitted strategies will be reviewed for:
165+
166+
- Compliance with naming and structure requirements
167+
- Template functionality and Jinja2 compatibility
168+
- Strategy uniqueness and gameplay value
169+
- Code quality and documentation standards
170+
171+
Once approved, your strategy will be available to all BalatroLLM users via the `--strategy` flag.

0 commit comments

Comments
 (0)