From forge
Reference skill for git worktree operations used during forge execution. Loaded at session start for context.
npx claudepluginhub ekelhaft-tools/forge-cursorThis skill uses the workspace's default tool permissions.
This skill provides reference knowledge for git worktree operations used by the forge executing skill. It is loaded at session start via the SessionStart hook.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
This skill provides reference knowledge for git worktree operations used by the forge executing skill. It is loaded at session start via the SessionStart hook.
$SESSION_DIR/worktrees/ (where SESSION_DIR = .forge/sessions/<id>/)forge/s<id>/batch-<N>-<timestamp> (e.g., forge/s1/batch-1-1708300000)forge/checkpoint/s<id>/batch-<N>-pre-merge# Get timestamp for unique branch name
TIMESTAMP=$(date +%s)
SESSION_ID=<id>
BRANCH="forge/s${SESSION_ID}/batch-${BATCH_NUM}-${TIMESTAMP}"
WORKTREE_PATH=".forge/sessions/${SESSION_ID}/worktrees/batch-${BATCH_NUM}"
# Ensure worktree base directory exists
mkdir -p ".forge/sessions/${SESSION_ID}/worktrees"
# Create worktree with new branch from current HEAD
git worktree add "$WORKTREE_PATH" -b "$BRANCH"
Implementer agents receive the worktree path as their working directory. All file operations happen within the worktree. The main branch remains untouched during parallel execution.
# From the main working directory (not the worktree)
BRANCH="forge/s${SESSION_ID}/batch-${BATCH_NUM}-${TIMESTAMP}"
WORKTREE_PATH=".forge/sessions/${SESSION_ID}/worktrees/batch-${BATCH_NUM}"
# Merge the batch branch
git merge "$BRANCH" --no-edit
# If merge conflict: STOP and ask the user
# Do NOT auto-resolve conflicts
# Remove worktree
git worktree remove "$WORKTREE_PATH" --force
# Delete the branch
git branch -d "$BRANCH"
SESSION_ID=<id>
SESSION_DIR=".forge/sessions/${SESSION_ID}"
# List all forge worktrees for this session
git worktree list | grep "${SESSION_DIR}/worktrees"
# Remove them all
for wt in "${SESSION_DIR}/worktrees/batch-"*; do
git worktree remove "$wt" --force 2>/dev/null
done
# Clean up any leftover branches for this session
git branch | grep "forge/s${SESSION_ID}/" | xargs -r git branch -D
# See all active forge worktrees across all sessions
git worktree list | grep ".forge/sessions/"
.forge/sessions/*/worktrees/ should be in .gitignore