kill-servers

Terminate stale Storybook and Vite server processes and free TCP ports 3000, 5173, and 6006.

Updated May 23, 2026
One-click install
npx skills add https://github.com/matthewharwood/dean-n-dean --skill kill-servers
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: kill-servers
Source: https://github.com/matthewharwood/dean-n-dean/tree/main/.agents/skills/kill-servers
Command: npx skills add https://github.com/matthewharwood/dean-n-dean --skill kill-servers

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Stale Storybook, Vite preview, or dev server processes can keep TCP ports bound and cause flaky “connection refused” failures during subsequent local checks and Playwright runs.

Core Features & Use Cases

  • Kills lingering server processes safely: Terminates known dean-stack dev/preview/storybook processes by command-line pattern, then escalates only if ports remain bound.
  • Verifies port availability for 3000/5173/6006: Confirms the key ports used by the local app, Vite dev, and Storybook are actually listening or not.
  • Runs idempotently as a pre-step: Uses commands designed to succeed even when nothing is running, making it safe to execute before every gate/test workflow.

Quick Start

Run the kill-servers skill to stop any previous dean-stack Storybook/Vite dev/preview processes and confirm ports 3000, 5173, and 6006 are free.

Frequently Asked Questions about kill-servers

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why does my Playwright run fail with connection refused errors on ports 3000 or 6006?

Stale Vite dev or Storybook server processes from prior sessions can keep TCP ports bound and cause flaky connection refused failures during Playwright runs. Terminating these lingering dev server processes frees the ports and resolves the binding contention.

How do I free local TCP ports occupied by stale Vite or Storybook dev servers?

You can free local TCP ports by terminating stale Vite and Storybook dev server processes using pattern-based pkill commands, then escalating with port-targeted SIGKILL if listeners remain on ports 3000, 5173, or 6006.

Can I run a port cleanup command idempotently before every gate check?

Yes, idempotent process cleanup commands are designed to succeed even when no dev servers are running, making it safe to execute as a pre-step before every gate check or test workflow without causing errors.

How do I verify that ports 3000, 5173, and 6006 are actually free before starting a dev server?

You can verify port availability by checking that no network listeners remain on ports 3000, 5173, and 6006 after running process termination commands, ensuring the key ports used by the local app, Vite dev, and Storybook are clear.

What is the best way to kill zombie Storybook processes left running from previous sessions?

The best way to kill zombie Storybook processes is to use pattern-based pkill commands to terminate known dean-stack processes by command-line pattern, then validate that no listeners remain on port 6006 to ensure complete cleanup.

What ports does a Vite dev server and Storybook typically bind to during local development?

During local development, a Vite dev server typically binds to port 5173, Storybook uses port 6006, and the local app uses port 3000, which can all experience port-binding contention if stale processes are not cleaned up.