Skip to content

Wirasm/worktree-manager-skill / .claude/skills

worktree-manager

Verified

Create, manage, and cleanup git worktrees with Claude Code agents across all projects. USE THIS SKILL when user says "create worktree", "spin up worktrees", "new worktree for X", "worktree status", "cleanup worktrees", "sync worktrees", or wants parallel development branches. Also use when creating PRs from a worktree branch (to update registry with PR number). Handles worktree creation, dependency installation, validation, agent launching in Ghostty, and global registry management.

FileKindSize
SKILL.mdskill md21.9 KB
config.jsonconfig361 B
scripts/allocate-ports.shexecutablescript2.5 KB
scripts/cleanup.shexecutablescript6.5 KB
scripts/launch-agent.shexecutablescript4.7 KB
scripts/register.shexecutablescript3.6 KB
scripts/release-ports.shexecutablescript1.0 KB
scripts/status.shexecutablescript6.2 KB
scripts/sync.shexecutablescript5.0 KB
templates/worktree.jsonconfig581 B

scripts/release-ports.sh

View on GitHub
#!/bin/bash
# release-ports.sh - Release ports back to the global pool
#
# Usage: ./release-ports.sh <port1> [port2] [port3] ...
#
# Example: ./release-ports.sh 8100 8101

set -e

if [ $# -eq 0 ]; then
    echo "Usage: $0 <port1> [port2] [port3] ..."
    exit 1
fi

REGISTRY="${HOME}/.claude/worktree-registry.json"

# Check jq is available
if ! command -v jq &> /dev/null; then
    echo "Error: jq is required. Install with: brew install jq"
    exit 1
fi

# Check if registry exists
if [ ! -f "$REGISTRY" ]; then
    echo "No registry found, nothing to release"
    exit 0
fi

TMP=$(mktemp)
cp "$REGISTRY" "$TMP"

RELEASED=()
for PORT in "$@"; do
    if [[ "$PORT" =~ ^[0-9]+$ ]]; then
        jq ".portPool.allocated = (.portPool.allocated | map(select(. != $PORT)))" "$TMP" > "${TMP}.2" && mv "${TMP}.2" "$TMP"
        RELEASED+=("$PORT")
    else
        echo "Warning: Invalid port number: $PORT" >&2
    fi
done

mv "$TMP" "$REGISTRY"

if [ ${#RELEASED[@]} -gt 0 ]; then
    echo "Released ports: ${RELEASED[*]}"
else
    echo "No ports released"
fi
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall