managing-portslisted
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`