← ClaudeAtlas

managing-portslisted

Detects framework, finds available ports, and starts dev servers with correct port flags. Resolves port conflicts when multiple projects compete for the same default port (common with git worktrees). Scans running processes, identifies frameworks from config files, and uses the right CLI flag per framework. Use when starting dev server, port conflict, port in use, address already in use, EADDRINUSE, npm run dev, pnpm dev, yarn dev, listen EADDRINUSE, port 3000 taken, or managing multiple local servers.
Saturate/agents · ★ 0 · Code & Development · score 66
Install: claude install-skill Saturate/agents
# Port Management Detect framework, find a free port, and start the dev server with the correct port flag. Resolves port conflicts automatically. For OS-specific commands (macOS/Linux/Windows), see [references/platform-commands.md](references/platform-commands.md). ## Progress Checklist ``` Port Management Progress: - [ ] Step 1: Parsed arguments (mode, preferred port) - [ ] Step 2: Scanned ports for current usage - [ ] Step 3: Detected framework from project files - [ ] Step 4: Found available port - [ ] Step 5: Started server with correct flag ``` ## Step 1: Parse Arguments **Modes:** - *(default)* — detect framework, find free port, start server - `--scan` — show what's running on ports 3000–3100 - `--find` — just report next free port (no server start) - `--kill <port>` — kill the process occupying a specific port (with safety checks, see Step 2) **Optional arguments:** - `--port <number>` — preferred starting port (overrides framework default) ## Step 2: Scan Port Usage Show what's occupying ports in the project's default range using `lsof` (macOS/Linux) or `Get-NetTCPConnection` (Windows). See [references/platform-commands.md](references/platform-commands.md) for exact commands. **If mode is `--scan`:** Display results and stop. **If mode is `--kill <port>`:** First identify the process on the port. **Protected processes — never kill these:** - Browsers: `firefox`, `chrome`, `safari`, `msedge`, `brave`, `arc`, `opera` - System services: `launchd`, `systemd`