Enforces project standards for p6-craps-py: Python 3.14.2, TDD approach, immutable dataclasses, comprehensive quality gates, and craps domain rules
Configure Aider AI pair programming tool for a Python craps simulation project with strict code quality standards, TDD workflow, and domain-specific rules.
This configuration is for **p6-craps-py**, a Python craps simulator built with Python 3.14.2, uv package manager, and comprehensive quality gates. The project emphasizes immutable dataclasses, type safety, test-driven development, and craps game mechanics.
When working on this project, you MUST follow these rules in order:
Example type hint pattern:
```python
from __future__ import annotations
def calculate_bet(bankroll: int, min_bet: int) -> int:
"""Calculate next bet amount.
Args:
bankroll: Current player bankroll in dollars.
min_bet: Minimum allowed bet.
Returns:
Bet amount in dollars.
Raises:
ValueError: If bankroll is negative.
"""
```
Example dataclass pattern:
```python
from dataclasses import dataclass
@dataclass(slots=True, frozen=True)
class Strategy:
"""Betting strategy configuration.
Attributes:
min_bet: Minimum bet amount in dollars.
max_bet: Maximum bet amount in dollars.
"""
min_bet: int
max_bet: int
```
Run before committing: `uv run pre-commit run --all-files`
Required checks:
**COME_OUT Phase Rules**:
**POINT_ON Phase Rules**:
**ALWAYS**:
**NEVER**:
Always include these files for project context:
- `feat:` New feature
- `fix:` Bug fix
- `docs:` Documentation
- `test:` Test changes
- `refactor:` Code refactoring
- `style:` Formatting
- `perf:` Performance
- `chore:` Maintenance
Example: `feat: add Martingale betting strategy`
```bash
PYTHONPATH=. uv run pytest -v --no-cov
uv run pre-commit run --all-files
uv run black . && uv run isort .
uv run bandit -r p6_craps
uv add <package>
uv add --dev <package>
```
```python
"""Module for betting strategies in craps simulation."""
from __future__ import annotations
from dataclasses import dataclass
from typing import Optional
@dataclass(slots=True, frozen=True)
class MartingaleStrategy:
"""Martingale betting strategy (double after loss).
Attributes:
base_bet: Starting bet amount in dollars.
max_bet: Maximum bet amount in dollars.
"""
base_bet: int
max_bet: int
def calculate_bet(self, bankroll: int, previous_loss: bool) -> int:
"""Calculate next bet using Martingale progression.
Args:
bankroll: Current player bankroll in dollars.
previous_loss: True if previous bet was lost.
Returns:
Bet amount in dollars.
Raises:
ValueError: If bankroll is negative.
"""
if bankroll < 0:
raise ValueError("Bankroll cannot be negative")
if not previous_loss:
return min(self.base_bet, bankroll)
doubled_bet = self.base_bet * 2
return min(doubled_bet, self.max_bet, bankroll)
```
Code is ready when:
1. All tests pass with 90%+ coverage
2. All pre-commit hooks pass
3. Bandit security scan shows no issues
4. Code follows immutable dataclass pattern
5. Type hints present on all functions
6. Google-style docstrings present
7. Craps domain rules correctly implemented
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/aider-configuration-for-python-craps-simulator/raw