sass-maker/saas-maker/local-ports-cleanup

Claude Code and agent skill by sass-maker/saas-maker

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Inspect, diagnose, and safely clean local listening ports and development-server processes with the installed `ports` CLI. Use when a local port is occupied, stale or orphaned dev processes should be stopped, a project's ports need clearing before restart, or an operator asks what is listening locally. Preserve healthy Docker, database, system, and unrelated project listeners unless explicitly named.

Install

npx vskill@latest install sass-maker/saas-maker/local-ports-cleanup

SKILL.md

The same SKILL.md was published earlier as sass-maker/saas-maker/local-ports-cleanup.

Local Ports Cleanup

Use ports as the process authority. Inventory first, stop the narrowest verified target, then re-scan. Do not replace it with ad hoc lsof, kill, or pkill pipelines.

1. Preflight

Verify the installed command and inspect its current surface:

bash
rtk command -v ports
rtk ports --version
rtk ports --help

If ports is missing or the required command is unavailable, stop and report the prerequisite. Do not install a replacement or fall back to raw process kills.

2. Inventory

Start with the filtered development inventory:

bash
rtk ports json

Inspect each candidate's port, pid, project, health, cwd, docker_container, docker_image, and command. Do not paste credential-like command arguments into chat or retained output.

Use the wider inventory only when an operator-named target is absent or the request explicitly includes normally hidden listeners:

bash
rtk ports json --all

When scans are slow, unexpectedly empty, or untrustworthy, diagnose without mutating:

bash
rtk ports doctor

Surface its guidance. Do not quit apps, reboot, or change tunnel/network state unless the operator separately requests that action.

3. Select the narrowest cleanup

Treat a general "clean stale ports" request as authorization for unhealthy listeners only. Treat exact port, PID, project, force, or all-server cleanup as authorized only when that scope is explicit and ownership has been shown.

IntentCommandGate
Remove orphaned or zombie dev listenersrtk ports cleanReview its candidate list and retain the built-in confirmation
Free named portsrtk ports free <port...>Verify each port's owner first; this command does not confirm
Stop one projectrtk ports kill-project <exact-project>Copy the exact project value from inventory; this command does not confirm
Stop named PIDsrtk ports kill <pid...>Verify every PID and its current owner immediately before running
Restart the current projectrtk ports run <cmd...>Use only when restart was requested and the current project root is correct

Prefer the default graceful SIGTERM path. Do not pass --force unless graceful termination failed and the operator explicitly authorizes force.

Do not use ports killall for broad runtime names such as node, python, or cargo. Do not use ports nuke unless the operator explicitly asks to stop every displayed development server after reviewing the full candidate list. Never automate a confirmation for an unreviewed list.

4. Preserve healthy dependencies

Keep a listener running when it is healthy and any of these apply:

  • it belongs to an unrelated project;
  • it is a Docker or OrbStack service;
  • it is a database, queue, cache, tunnel, or system app;
  • its ownership is empty or ambiguous;
  • age or memory use is the only evidence that it is stale.

If no unhealthy or explicitly named target exists, report that no safe cleanup candidate was found. Do not turn a vague cleanup request into a healthy-process kill.

5. Verify and report

Re-run the filtered inventory after every mutation, and use json --all for an explicit target that is normally hidden:

bash
rtk ports json

Confirm each requested port, PID, or exact project is absent. If a supervisor rebinds a port, report the new PID and listener instead of calling it free. If the scan fails or ports doctor reports an unhealthy scanner state, mark the cleanup unverified.

Return:

  • stopped ports, PIDs, and projects;
  • targets still listening or rebound;
  • healthy or unrelated listeners deliberately preserved;
  • failed, skipped, or unverified actions.

Do not claim that loading or inspecting this skill performed cleanup; only report process changes actually observed in the post-cleanup inventory.

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/sass-maker/saas-maker/local-ports-cleanup/badge)](https://verified-skill.com/skills/sass-maker/saas-maker/local-ports-cleanup)

Something wrong with this skill or its page? Tell us.