These rules apply to scripts/**. Follow the repo-root AGENTS.md first, then use this file for automation and workflow helpers.
- Keep scripts non-interactive and idempotent. Print the command, URL, branch, or path being acted on so failures are diagnosable.
- Use repo-relative paths and environment variables instead of user-specific absolute paths.
- For dev-server helpers, default to
https://bitsocial.localhost, but allow a branch-scoped*.bitsocial.localhostroute when the launcher is avoiding a Portless name collision. Respect the existingPORTLESS=0fallback instead of hard-coding alternate ports. For USB Android preview,scripts/start-android-usb.mjsusesadb reverseplus Vite on127.0.0.1, thenam startVIEW to open the default browser when the port is listening (disable withANDROID_USB_OPEN_BROWSER=0). - Keep shell helpers thin. When logic becomes stateful or cross-platform, prefer a JS script run by Node.js.
- Git and worktree helpers must validate input and default to safe operations.
- If a helper deletes local branches automatically, document the exact eligibility checks and keep the behavior conservative.