# Codebase Conventions (`CONVENTIONS.md`)

## Code Style & Scripts
- **Shell / Bash**: Ensure standard `$?` exit evaluation handling with `if [ $? -ne 0 ]; then exit 1; fi`.
- **Batch Scripting**: Ensure `%errorlevel%` mapping with `if %errorlevel% neq 0 ( exit /b %errorlevel% )`. Uses `chcp 65001 >nul` for cross-platform UTF-8 emoji support.
- **Node.js Scripts**: Typically wrapped recursively checking properties (`fs.existsSync`, `fs.readdirSync`), enforcing zero-pollution (ignoring flattened dependencies via explicit `fs.writeFileSync`).

## Architectural Patterns
- **Zero-Pollution Rule**: Never install global node_modules (`-g`) or system modifications. Path routing is managed securely using execution strings formatted like `path/to/local/bin` instead of relying on `$PATH`.
- **Idempotency Rule**: The bootstrap processes (`bootstrap.sh`, `bootstrap.bat`) are designed to be run hundreds of times safely, using `if not exist` checks before taking any structural action.

## Error Handling
- Terminal outputs are robust, mapping explicit phases like `[1/5]`, `[2/5]` to terminal stdout.
- Execution halts strictly on critical dependency update failures.
