opencompletion.com/CLAUDE.md
Russell Ballestrini d4d697db59 Implement per-prompt metadata filtering and fix battleship feedback system
Major improvements to battleship game feedback accuracy and user experience:

## New Multi-Prompt Feedback System
- Replaced single feedback with 3 specialized prompts: Shot Report, Ship Status, Game Over
- Each prompt has individual metadata filtering to see only relevant data
- Shot Report only sees hit/miss data, Ship Status only sees ship destruction data
- Added STFU token system to suppress empty messages (filtered out automatically)

## Technical Implementation
- Added per-prompt metadata_filter support in YAML structure
- Updated app.py and guarded_ai.py to handle prompt-specific filtering
- Legacy single-prompt system still works with transition-level filtering
- Added comprehensive test suite for feedback system validation

## User Experience Fixes
- Fixed TTS queue blocking JavaScript execution (async promises instead of await)
- Ship Status now correctly reports who destroyed which ship (role confusion fixed)
- Game Over only appears when game actually ends (no more random messages)
- Maintained dramatic storytelling while ensuring factual accuracy

## Battleship-Specific Improvements
- Ship destruction messages only appear when ships actually sink
- Clear separation of concerns: hits/misses vs ship destruction vs game over
- Eliminated false positive ship destruction reports
- Fixed role reversal where wrong player got credit for destruction

The battleship narrator now provides accurate, contextual feedback while preserving the dramatic naval warfare atmosphere.
2025-08-11 11:39:49 -04:00

1.3 KiB

Claude Instructions

Commit Messages

  • NEVER add Claude attributions like "🤖 Generated with Claude Code" to commit messages
  • NEVER add "Co-Authored-By: Claude noreply@anthropic.com" to commit messages
  • Keep commit messages focused on the actual changes and their purpose
  • Use conventional commit format when appropriate
  • Be concise but descriptive about what was changed and why

Code Style

  • Follow existing code conventions in the project
  • Use appropriate linting tools (black, ruff, etc.) when available
  • Maintain consistent naming and formatting

Testing

  • Run existing tests before committing when available
  • Write tests for new functionality when appropriate
  • Verify changes work as expected

Documentation

  • Update relevant documentation when making significant changes
  • Keep README files current with new features or setup changes
  • Document any new environment variables or configuration options

Python/Matplotlib Best Practices

  • Always add matplotlib.use("Agg") before importing matplotlib.pyplot to prevent runtime errors in headless environments

Makefile Best Practices

  • Avoid variable substitutions - don't be afraid to be unDRY in the Makefile so engineers can copy and paste
  • Use tabs not spaces, and for fuck sake be happy about it