Files
claude-skills-reference/engineering/git-worktree-manager/references/port-allocation-strategy.md
Alireza Rezvani 3d9d1d2d92 Dev (#249)
* docs: restructure README.md — 2,539 → 209 lines (#247)

- Cut from 2,539 lines / 73 sections to 209 lines / 18 sections
- Consolidated 4 install methods into one unified section
- Moved all skill details to domain-level READMEs (linked from table)
- Front-loaded value prop and keywords for SEO
- Added POWERFUL tier highlight section
- Added skill-security-auditor showcase section
- Removed stale Q4 2025 roadmap, outdated ROI claims, duplicate content
- Fixed all internal links
- Clean heading hierarchy (H2 for main sections only)

Closes #233

Co-authored-by: Leo <leo@openclaw.ai>

* fix: enhance 5 skills with scripts, references, and Anthropic best practices (#248)

* fix(skill): enhance git-worktree-manager with scripts, references, and Anthropic best practices

* fix(skill): enhance mcp-server-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance changelog-generator with scripts, references, and Anthropic best practices

* fix(skill): enhance ci-cd-pipeline-builder with scripts, references, and Anthropic best practices

* fix(skill): enhance prompt-engineer-toolkit with scripts, references, and Anthropic best practices

* docs: update README, CHANGELOG, and plugin metadata

* fix: correct marketing plugin count, expand thin references

---------

Co-authored-by: Leo <leo@openclaw.ai>

---------

Co-authored-by: Leo <leo@openclaw.ai>
2026-03-04 08:38:06 +01:00

1.0 KiB

Port Allocation Strategy

Objective

Allocate deterministic, non-overlapping local ports for each worktree to avoid collisions across concurrent development sessions.

Default Mapping

  • App HTTP: 3000
  • Postgres: 5432
  • Redis: 6379
  • Stride per worktree: 10

Formula by slot index n:

  • app = 3000 + (10 * n)
  • db = 5432 + (10 * n)
  • redis = 6379 + (10 * n)

Examples:

  • Slot 0: 3000/5432/6379
  • Slot 1: 3010/5442/6389
  • Slot 2: 3020/5452/6399

Collision Avoidance

  1. Read .worktree-ports.json from existing worktrees.
  2. Skip any slot where one or more ports are already assigned.
  3. Persist selected mapping in the new worktree.

Operational Notes

  • Keep stride >= number of services to avoid accidental overlaps when adding ports later.
  • For custom service sets, reserve a contiguous block per worktree.
  • If you also run local infra outside worktrees, offset bases to avoid global collisions.
{
  "app": 3010,
  "db": 5442,
  "redis": 6389
}