Contributing¶
Reporting Issues¶
Open an issue at github.com/bamr87/bashcrawl/issues with steps to reproduce.
Development Setup¶
git clone https://github.com/bamr87/bashcrawl.git
cd bashcrawl
bash setup.sh
python3 -m pip install -e ".[dev]"
Canonical local workflow:
Playtest harness (MCP server for AI agents, plus scoring):
Static web workflow:
The static web app lives in web/ and is rebuilt from entrance/ plus src/help/data/*.yaml; do not hand-edit generated files under web/data/.
Adding Game Content¶
New Room¶
- Create directory:
mkdir -p entrance/path/to/.newroom - Add
scrollfile matching the format standard - Add encounters (treasure, potion, etc.) with
chmod +x - Wire unlock in a prerequisite treasure:
mv ../../.newroom ../../newroom 2>/dev/null - Add reset logic in
lib/reset.sh
New Encounter¶
Follow the executable template:
- #!/usr/bin/env bash shebang
- 14-line "wandered out of bounds" boilerplate
- Story via cat << EOF heredocs (plain text, no ANSI)
- Game state via export instructions, grep checks, file flags
- Never use rm, mv, or perl -i on tracked game files
Scroll Content¶
See .github/instructions/scrolls.instructions.md for the full standard. Key rules:
- 80-character width, readable with cat
- Level 1 (entrance): Pure ASCII with === dividers
- Level 2 (intermediate): Unicode box-drawing, emoji, #### headers
- Level 3 (advanced): Full formatting
- Every room on the main path needs a scroll with 50+ lines
Code Standards¶
Shell Scripts¶
- Shebang:
#!/usr/bin/env bash - Infrastructure scripts:
set -euo pipefail, sourcelib/colors.sh - Game executables: No strict mode, plain text output
- macOS compatibility:
sed -i.baknotsed -i, detectlscolor flags - Source colors from
lib/colors.shinstead of defining inline
Linting¶
CI runs ShellCheck, yamllint, markdownlint, and game content validation on every PR.
Runtime Boundary Checklist¶
When implementing a feature, confirm these before opening a PR:
- Owner surface chosen first (bash game content under
entrance/, static web trainer inweb/, playtest harness insrc/playtest/, or the terminal framework intermforge/— framework changes go intermforge/core/, never in the vendoredweb/assets/js/vendor/termforge/mirror). - Boundary tests updated at the layer where behavior changed (unit/integration for Python,
make test-jssuites for the framework; a golden-fixture diff is a claimed behavior change). - Contract data checked by running:
python3 scripts/validate_content_contracts.pypython3 scripts/validate_walkthrough_fs.py- Data contracts kept in sync (
src/help/data/*.yaml,test/datasets/walkthrough.json), and the web bundle rebuilt (make web-build) when game content ortermforge/core/changes — the rebuild also refreshes the vendored framework mirror, whichmake web-testverifies byte-for-byte.
Pull Request Process¶
- Fork the repo and create a feature branch
- Run
bash lib/reset.shand play through your changes - Run
shellcheckon modified shell scripts - Submit PR against
mainwith a description of changes - CI must pass before merge