portman
Port management for local development with git worktrees. Use when setting up local development environments, booking ports for services to avoid collisions between parallel worktrees, or configuring docker-compose with dynamic ports.
What this skill does
# Portman Skill
This skill provides patterns for managing port allocations in local development environments using portman. It enables running multiple worktrees of the same project in parallel without port conflicts.
## Why Portman?
When working with git worktrees or multiple project instances:
- Each worktree needs unique ports for services (postgres, redis, web server, etc.)
- Manual port management is error-prone and tedious
- Docker-compose files hardcode ports causing conflicts
Portman automatically assigns unique ports per worktree context.
## Core Workflow
### 1. Initial Setup (Once per machine)
```bash
# Initialize portman and show shell integration
portman init
# For direnv users (recommended)
portman init --direnv
```
### 2. Setting Up a New Worktree
When cloning or creating a new worktree, book ports for all services:
```bash
# Auto-discover services from docker-compose.yml
portman book --auto
# Or book specific services
portman book postgres
portman book redis
portman book frontend --port 3000
```
### 3. Using Ports in Your Environment
```bash
# Export as environment variables (add to .envrc for direnv)
eval "$(portman export --auto)"
# Get a specific port
PGPORT=$(portman get postgres -q)
```
## Command Reference
| Command | Description | Example |
|---------|-------------|---------|
| `portman book` | Reserve ports for services | `portman book --auto` |
| `portman get` | Get port for a service | `portman get postgres -q` |
| `portman export` | Export as env vars | `eval "$(portman export)"` |
| `portman status` | Show current allocations | `portman status --all` |
| `portman release` | Free port allocations | `portman release --all` |
| `portman context` | Show current context | `portman context` |
| `portman discover` | Preview auto-discovery | `portman discover` |
| `portman prune` | Clean orphaned allocations | `portman prune --dry-run` |
## Integration with Docker Compose
### Dynamic Port Configuration
Use environment variables in `docker-compose.yml`:
```yaml
services:
postgres:
image: postgres:16
ports:
- "${POSTGRES_PORT:-5432}:5432"
environment:
POSTGRES_PASSWORD: dev
redis:
image: redis:7
ports:
- "${REDIS_PORT:-6379}:6379"
web:
build: .
ports:
- "${WEB_PORT:-8000}:8000"
environment:
DATABASE_URL: postgres://localhost:${POSTGRES_PORT:-5432}/app
```
### Direnv Integration (.envrc)
```bash
# .envrc - Automatically set ports when entering directory
eval "$(portman export --auto)"
# Or with fallbacks
export POSTGRES_PORT=$(portman get postgres -q 2>/dev/null || echo 5432)
export REDIS_PORT=$(portman get redis -q 2>/dev/null || echo 6379)
export WEB_PORT=$(portman get web -q 2>/dev/null || echo 8000)
```
## Context-Aware Port Allocation
Portman uses the current directory and git remote to create a unique context:
```bash
# View your current context
portman context
# Output:
# Context: abc123
# Path: /home/user/projects/myapp-feature-x
# Git Remote: github.com/org/myapp
# Git Branch: feature-x
```
Each worktree gets its own context, ensuring port isolation.
## Port Ranges Configuration
Configure port ranges per service:
```bash
# Set custom range for postgres
portman config --set-range postgres:5500-5599
# View current configuration
portman config --show
```
## Maintenance Commands
### View All Allocations
```bash
# Show current context only
portman status
# Show all contexts
portman status --all
# Check if ports are actually listening
portman status --all --live
```
### Cleanup Orphaned Allocations
```bash
# Preview what would be removed
portman prune --dry-run
# Remove allocations for deleted worktrees
portman prune
# Also remove stale allocations (not accessed in 30 days)
portman prune --stale 30
```
## Common Patterns
### Setup Script for New Developers
```bash
#!/bin/bash
# scripts/dev-setup.sh
# Book ports for all services
portman book --auto
# Show allocated ports
portman status
# Export for current shell
eval "$(portman export --auto)"
echo "Development environment ready!"
echo "PostgreSQL: localhost:$POSTGRES_PORT"
echo "Redis: localhost:$REDIS_PORT"
```
### Makefile Integration
```makefile
.PHONY: setup ports
setup:
portman book --auto
@echo "Ports allocated. Run 'make ports' to see them."
ports:
@portman status
start:
eval "$$(portman export --auto)" && docker-compose up
```
### CI/CD Considerations
In CI environments, portman context is unique per workspace, allowing parallel CI jobs:
```yaml
# GitHub Actions
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup ports
run: |
portman book --auto
eval "$(portman export --auto)"
- name: Run tests
run: docker-compose up -d && pytest
```
## Troubleshooting
### Port Already in Use
```bash
# Check what's using a port
portman status --all --live
# Release and rebook
portman release postgres
portman book postgres
```
### Reset All Allocations
```bash
# Release all for current context
portman release --all
# Rebook
portman book --auto
```
Related in Cloud & DevOps
appbuilder-action-scaffolder
IncludedCreate, implement, deploy, and debug Adobe Runtime actions with consistent layout, validation, and error handling. Use this skill whenever the user needs to add actions to an App Builder project, understand action structure (params, response format, web/raw actions), configure actions in the manifest, use App Builder SDKs (State, Files, Events, database), deploy and invoke actions via CLI, debug action issues, or implement patterns such as webhook receivers, custom event providers, journaling consumers, large payload redirects, action sequence pipelines, and Asset Compute workers. Also trigger when users mention serverless functions in Adobe context, action logging, IMS authentication for actions, or cron-style scheduled actions.
orchestrating-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. Use this skill when the user needs a multi-step Data Cloud pipeline, cross-phase troubleshooting, or data space and data kit management. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase sf data360 workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching phase-specific skill), the task is STDM/session tracing/parquet telemetry (use observing-agentforce), standard CRM SOQL (use querying-soql), or Apex implementation (use generating-apex).
github-project-automation
IncludedAutomate GitHub repository setup with CI/CD workflows, issue templates, Dependabot, and CodeQL security scanning. Includes 12 production-tested workflows and prevents 18 errors: YAML syntax, action pinning, and configuration. Use when: setting up GitHub Actions CI/CD, creating issue/PR templates, enabling Dependabot or CodeQL scanning, deploying to Cloudflare Workers, implementing matrix testing, or troubleshooting YAML indentation, action version pinning, secrets syntax, runner versions, or CodeQL configuration. Keywords: github actions, github workflow, ci/cd, issue templates, pull request templates, dependabot, codeql, security scanning, yaml syntax, github automation, repository setup, workflow templates, github actions matrix, secrets management, branch protection, codeowners, github projects, continuous integration, continuous deployment, workflow syntax error, action version pinning, runner version, github context, yaml indentation error
sf-datacloud
IncludedSalesforce Data Cloud product orchestrator for connect→prepare→harmonize→segment→act workflows. TRIGGER when: user needs a multi-step Data Cloud pipeline, asks to set up or troubleshoot Data Cloud across phases, manages data spaces or data kits, or wants a cross-phase `sf data360` workflow. DO NOT TRIGGER when: work is isolated to a single phase (use the matching sf-datacloud-* skill), the task is STDM/session tracing/parquet telemetry (use sf-ai-agentforce-observability), standard CRM SOQL (use sf-soql), or Apex implementation (use sf-apex).
fabric-cli
IncludedUse this skill for Fabric.so CLI workflows with the `fabric` terminal command: diagnose/install/login, search or browse a Fabric library, save notes/links/files, create folders, ask the Fabric AI assistant, manage tasks/workspaces, generate shell completion, check subscription usage, produce JSON output, and use Fabric as persistent agent memory. Do not use for Microsoft Fabric/Azure/Power BI `fab`, Daniel Miessler's Fabric framework, Python Fabric SSH, Fabric.js, or textile/fashion fabric.
lark
IncludedLark/Feishu CLI skills: lark-cli operations for docs, markdown, sheets, base, calendar, im, mail, task, okr, drive, wiki, slides, whiteboard, apps, approval, attendance, contact, vc, minutes, event. Use when the user needs to operate Lark/Feishu resources via lark-cli, send messages, manage documents, spreadsheets, calendars, tasks, OKRs, deploy web pages, or any Feishu/Lark workspace operations.