detecting-port-conflicts — скилл для Claude Code: установка
Скилл находит занятые порты при ошибках вроде EADDRINUSE, вычисляет блокирующий процесс и помогает освободить порт либо сменить его в конфиге dev-сервера.
npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a claude-codeЧто делает detecting-port-conflicts
Скилл отслеживает в выводе терминала ошибки EADDRINUSE, address already in use или Errno 98. Он сразу извлекает номер порта. Скилл сразу видит проблему. Затем он ищет причину через lsof -i :<PORT> -P -n, определяя PID и имя процесса.
Для решения агент предлагает завершить процесс командами kill <PID> или kill -9 <PID>. Второй путь — переключить dev-сервер на свободный порт. Для Vite или Next.js скилл подскажет готовый флаг запуска. Если lsof пуст, сокет мог зависнуть в состоянии TIME_WAIT — тут лучше подождать 30 секунд.
Команда killall node сносит сразу всё, поэтому скилл требует подтверждения перед запуском. В macOS для портов ниже 1024 понадобятся права root.
Какие задачи решает
- найти процесс, вызвавший ошибку
EADDRINUSEв терминале - завершить зависший локальный сервер по его PID через
kill - переключить dev-сервер на свободный порт в Next.js или Vite
- проверить порты, занятые контейнерами Docker
Примеры запросов агенту
- Сервер упал с ошибкой EADDRINUSE, освободи занятый порт
- Проверь через lsof, какой процесс занял порт, и перезапусти Vite на свободном порту
- Заверши процесс, который блокирует запуск dev-сервера
Как установить detecting-port-conflicts
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a claude-code2Вручную: положить файлы
~/.claude/skills/detecting-port-conflicts/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/detecting-port-conflicts/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a codex2Вручную: положить файлы
.agents/skills/detecting-port-conflicts/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a cursor2Вручную: положить файлы
.cursor/skills/detecting-port-conflicts/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills detecting-port-conflicts2Вручную: положить файлы
.github/skills/detecting-port-conflicts/SKILL.md1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a gemini-cli2Командой платформы
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/detecting-port-conflictsВручную: положить файлы
.devin/skills/detecting-port-conflicts/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора59
Похожие
Рядом в теме «Бэкенд и API»
Всё по теме «Бэкенд и API» →Вопросы о detecting-port-conflicts
Как установить detecting-port-conflicts в Claude Code?
Выполните в терминале команду npx skills add spencerpauly/awesome-cursor-skills --skill detecting-port-conflicts -a claude-code.
Что делает скилл detecting-port-conflicts?
Он перехватывает ошибки занятых портов, находит PID мешающего процесса через lsof и предлагает снять задачу или перенести сервер на соседний порт.
Что делать, если lsof не показывает блокирующий процесс?
Порт может находиться в состоянии TIME_WAIT. Подождите 30 секунд, пока операционная система освободит сокет, либо запустите сервер на следующем свободном порту.
Исходный текст
SKILL.md · CC0-1.0
--- name: detecting-port-conflicts description: Detect EADDRINUSE and port conflicts, find what's using the port, and resolve it by killing the process or suggesting an alternative port. user-invocable: true --- # Detecting Port Conflicts When a dev server fails to start because a port is already in use, diagnose and resolve it. ## Detection Scan terminal output for these patterns: - `EADDRINUSE` - `address already in use` - `Port XXXX is already in use` - `bind: address already in use` - `OSError: [Errno 98] Address already in use` Extract the port number from the error message. ## Diagnosis Find what's using the port: ```bash lsof -i :<PORT> -P -n ``` This shows the PID, process name, and user. Common culprits: - A previous dev server that didn't shut down cleanly - Another project's dev server - A Docker container - A system service ## Resolution Options ### Option 1: Kill the blocking process ```bash kill <PID> # If it doesn't stop: kill -9 <PID> ``` Then restart the original server. ### Option 2: Use a different port Suggest the next available port: ```bash # Check if port+1 is free lsof -i :<PORT+1> -P -n ``` Update the dev server config or start command: - Next.js: `next dev -p <PORT>` - Vite: `vite --port <PORT>` - Express: set `PORT` env var - Django: `python manage.py runserver <PORT>` ### Option 3: Kill all node processes (nuclear option) ```bash killall node ``` Only suggest this if the user confirms — it kills everything. ## Tips - On macOS, ports below 1024 require root - Docker containers bind ports that persist even if the container is stopped — check `docker ps` - If `lsof` shows nothing, the port may be in TIME_WAIT state — just wait 30 seconds or use a different port
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills