What problem does it solve?
Running multiple git worktrees of the same monorepo causes port collisions between local dev servers, forcing developers to guess or hardcode ports. This Skill assigns deterministic, slot-based ports per app so every worktree gets its own non-conflicting localhost URLs.
Core Features & Use Cases
- Deterministic Port Assignment: Computes each app's port from a worktree slot, a base port, and a per-app offset defined in
.worktree-env.json.
- Environment Variable Injection: Wraps dev commands to export
PORT, app URLs, and cross-app URL templates like {apps.chat.url} before the app starts.
- Runtime Discovery: The
bun dev:info --json command reports the active slot and every app's resolved URL so agents never assume a port.
- Use Case: You have three worktrees of a monorepo with chat, site, and electron apps. Set the slot variable in each worktree's env file, start apps via the root
bun dev* scripts, and each worktree serves its apps on its own port range without conflicts.
Quick Start
Ask the agent to run bun dev:info --json and then start the chat app using the resolved worktree URL and port.