From cff7f5fe7f500d96d112f41bea2c9fba4ef0c402 Mon Sep 17 00:00:00 2001 From: Dave Date: Fri, 20 Feb 2026 11:37:29 +0000 Subject: [PATCH] Add worktree port configuration docs to STACK.md Documents STORYKIT_PORT env var for running multiple instances in parallel worktrees without port conflicts. Co-Authored-By: Claude Opus 4.6 --- .story_kit/specs/tech/STACK.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.story_kit/specs/tech/STACK.md b/.story_kit/specs/tech/STACK.md index dd19f82..3673abe 100644 --- a/.story_kit/specs/tech/STACK.md +++ b/.story_kit/specs/tech/STACK.md @@ -110,6 +110,15 @@ To support both Remote and Local models, the system implements a `ModelProvider` * `vitest`: Unit/component testing. * `playwright`: End-to-end testing. +## Running the App (Worktrees & Ports) + +Multiple instances can run simultaneously in different worktrees. To avoid port conflicts: + +- **Backend:** Set `STORYKIT_PORT` to a unique port (default is 3001). Example: `STORYKIT_PORT=3002 cargo run` +- **Frontend:** Run `pnpm dev` from `frontend/`. It auto-selects the next unused port. It reads `STORYKIT_PORT` to know which backend to talk to, so export it before running: `export STORYKIT_PORT=3002 && cd frontend && pnpm dev` + +When running in a worktree, use a port that won't conflict with the main instance (3001). Ports 3002+ are good choices. + ## Safety & Sandbox 1. **Project Scope:** The application must strictly enforce that it does not read/write outside the `project_root` selected by the user. 2. **Human in the Loop:**