fixed-port-discipline

Enforce canonical port allocation for local development services.

1|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/jongensutrecht/demo-ai-stack --skill fixed-port-discipline
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: fixed-port-discipline
Source: https://github.com/jongensutrecht/demo-ai-stack/tree/main/lars%20skills/fixed-port-discipline
Command: npx skills add https://github.com/jongensutrecht/demo-ai-stack --skill fixed-port-discipline

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill prevents local development workflows from silently drifting to different ports when a required port is already in use, keeping behavior consistent and predictable.

Core Features & Use Cases

  • Canonical Port Enforcement: Reads the repo's config, scripts, or docs to determine the one correct port for a service.
  • Conflict Resolution: Detects which local process is listening, inspects it, and frees the port when the listener is a replaceable user-owned process.
  • Safe Restart Flow: Restarts the service on the same canonical port and verifies that the new process is actually listening there.
  • Use Case: A developer starts a local API server, finds the documented port occupied, and needs the conflict resolved without switching to an arbitrary alternate port.

Quick Start

Ask the skill to find the canonical port for your local service, free any conflicting listener if appropriate, and restart the service on that same port.

Frequently Asked Questions about fixed-port-discipline

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

FAQPage Schema
How do I free up a local development port that is already in use?

To free an occupied local development port, you must identify the active listener process, verify it is a replaceable user-owned process, safely terminate it, and then restart your required service on that same port.

Why does my local service drift to a different port when the documented port is occupied?

Local services drift to arbitrary alternate ports to avoid conflicts when the documented port is occupied. Enforcing canonical port allocation prevents this by reading repo configuration, resolving the conflict, and restarting the service on the original port.

How do I find the canonical port for a local service?

You can find the canonical port by reading the repository's configuration files, scripts, or documentation. This ensures the service restarts consistently on the one correct port specified by the project.

Can I automatically terminate any process blocking my required local port?

You can only terminate replaceable local user-owned processes blocking the port. The workflow requires inspecting the active listener to ensure it is safe to kill before freeing the port and restarting your service.

What is the best way to ensure my local API server restarts on the same port after a conflict?

The best way to ensure a consistent restart is to enforce canonical port allocation by reading repo configs, resolving port conflicts by terminating replaceable processes, and verifying the new process is actively listening on the documented port.

Does canonical port enforcement work for local test and preview processes?

Yes, canonical port enforcement applies to local dev, test, preview, API, and tunnel processes. It ensures any service declaring a specific port in repository documentation restarts on that exact port after conflict resolution.