一键导入
git-worktree-find
Find the worktree path for a branch and create/reuse it when missing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Find the worktree path for a branch and create/reuse it when missing
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Find a git branch by Linear ticket ID prefix (e.g., STU-15)
Create or reuse a dedicated git worktree for a branch using a deterministic path layout
Create and maintain implementation progress documentation for a feature branch
Resolve a properly named git branch from a Linear ticket ID following the convention {type}/{ticket-id}-short-description
Push the current branch to the remote repository with upstream tracking
Fetch unresolved review threads and PR comments for the pull request tied to the resolved target branch
基于 SOC 职业分类
| name | git-worktree-find |
| description | Find the worktree path for a branch and create/reuse it when missing |
Resolve the worktree path for a ticket branch. If a worktree does not exist yet, create it using git-worktree-prepare.
Use shell-safe parsing compatible with bash/zsh and avoid status as a variable name.
branch (required): branch name to locateFind existing worktree assignment for the branch:
existing_path=""
current_path=""
while IFS= read -r line; do
case "$line" in
"worktree "*)
current_path="${line#worktree }"
;;
"branch refs/heads/"*)
current_branch="${line#branch refs/heads/}"
if [ "$current_branch" = "$branch" ]; then
existing_path="$current_path"
break
fi
;;
esac
done < <(git worktree list --porcelain)
If found:
reusedIf not found:
git-worktree-prepare for the same branch.opencode/worktree-local-filescreatedVerify branch in resolved worktree:
git -C "{worktree-path}" branch --show-current
Return:
Branch: <branch>
Worktree: <absolute-path>
Worktree state: <created|reused>
git worktree command fails, return the git error directly.