plugins/hypercore/skills/git-worktree/SKILL.md
[Hyper] Create, enter, list, remove, clean up, or repair Git worktrees for isolated branches and parallel agent sessions, including direct `git-worktree <ARGUMENT>` creation without follow-up questions. Use when the user asks for git worktree setup/removal, branch-per-folder workflows, parallel Codex/Claude/Cursor workspaces, or the repository-local `.hypercore/git-worktree/<folder_name>` convention; when creating and no argument/task is clear, ask what work will happen there in the user's language, derive the folder name, then move subsequent work into the new worktree.
npx skillsauth add alpoxdev/hypercore git-worktreeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
@rules/worktree-lifecycle.md @references/source-survey.md
Make isolated branch workspaces cheap, visible, and safe.
<output_language>
Default all user-facing deliverables, saved artifacts, reports, plans, generated docs, summaries, handoff notes, commit/message drafts, and validation notes to Korean, even when this canonical skill file is written in English.
Preserve source code identifiers, CLI commands, file paths, schema keys, JSON/YAML field names, API names, package names, proper nouns, and quoted source excerpts in their required or original language.
Use a different language only when the user explicitly requests it, an existing target artifact must stay in another language for consistency, or a machine-readable contract requires exact English tokens. If a localized template or reference exists (for example *.ko.md or *.ko.json), prefer it for user-facing artifacts.
</output_language>
<purpose>.hypercore/git-worktree/<folder_name>.<routing_rule>
Use git-worktree when the user wants to:
.hypercore/git-worktree/<folder_name>Do not use git-worktree when:
</routing_rule>
<activation_examples>
Positive requests:
feature/auth and open Codex there."git-worktree fix/api-timeout".hypercore/git-worktree."Negative requests:
Boundary request:
</activation_examples>
<trigger_conditions>
| User intent | Activate |
|------|------|
| Create a branch-specific working directory | yes |
| Parallel AI agent/coding sessions on one repo | yes |
| List or open existing worktrees | yes |
| Remove, prune, lock, unlock, repair, or move worktrees | yes |
| Delete the current linked worktree from inside that worktree | yes |
| Configure project default worktree root | yes |
| Plain git checkout or branch-only operations | no |
| General Git tutorial with no operation | no |
</trigger_conditions>
<argument_handling>
git-worktree <ARGUMENT> or supplies one positional argument after the skill name, treat <ARGUMENT> as an explicit create target and do not ask what worktree to create.<ARGUMENT> as the branch/task label unless it is clearly a PR/issue/ref/path; preserve the branch/ref text and sanitize only the folder label..hypercore/git-worktree/<folder_name>, then move the active agent context into the new worktree.</argument_handling>
<defaults><repo-root>/.hypercore/git-worktree/.<repo-root>/.hypercore/git-worktree/<folder_name>.<folder_name>: ask what work will happen in the worktree when the user has not already supplied a clear task, then derive a concise sanitized slug from that answer.<folder_name> from that context without asking again.cd <path> there; in tool-only environments, set the next command's workdir=<path> and keep subsequent commands there. Do not merely display cd <path> as the final answer..hypercore/git-worktree/ before creating nested worktrees.git worktree commands over installing extra managers.<supported_operations>
git worktree remove from another safe worktree.</supported_operations>
<workflow>git rev-parse --show-toplevel.git worktree list --porcelain.git-worktree <ARGUMENT> argument is present, treat it as a create target and derive branch name, folder name, and base reference from it before any clarification.Use .hypercore/git-worktree/<folder_name> as the default target path unless the user explicitly provides another path. Choose <folder_name> from the stated work intent, not from an arbitrary timestamp.
Before creating the worktree:
<folder_name> from the stated work intent before path construction.hypercore/git-worktree/ is ignored or locally excluded so the main worktree does not treat nested worktrees as normal untracked contentFollow @rules/worktree-lifecycle.md for command patterns, safety checks, and cleanup rules.
Creation preference:
git worktree add <path> <branch>.git worktree add -b <branch> <path> <base-ref>.--detach only when the user is reviewing a commit and does not intend to commit changes.Current-worktree removal preference:
git rev-parse --show-toplevel.git rev-parse --git-dir and git rev-parse --git-common-dir and by reading git worktree list --porcelain.git worktree remove <target-path>.--force only when the user explicitly requested force/discard semantics or has confirmed dirty changes are disposable.After a create operation:
git worktree addcd <path> in that active session and verify with pwdpwd or git status with the tool's workdir=<path> set to the new worktree pathworkdir=<path> unless there is an explicit reason to operate from another worktreecd <path> as the command executed in the persistent session, or as the fallback command the user should run only when the interface cannot mutate the parent shellworkdir=<path> or an equivalent tool working-directory settingAfter any operation, report:
For removal/cleanup, report what was removed and what remains in git worktree list.
If the user only says "create a worktree" and no task is clear, ask first:
What work will happen in this worktree?
Then derive the folder name from the answer:
repo_root="$(git rev-parse --show-toplevel)"
branch="feature/auth-session"
folder="auth-session"
path="$repo_root/.hypercore/git-worktree/$folder"
exclude_file="$(git rev-parse --git-path info/exclude)"
mkdir -p "$(dirname "$path")" "$(dirname "$exclude_file")"
grep -qxF ".hypercore/git-worktree/" "$exclude_file" 2>/dev/null || printf '\n.hypercore/git-worktree/\n' >> "$exclude_file"
git fetch --all --prune
git worktree add -b "$branch" "$path" HEAD
git -C "$path" status --short --branch
cd "$path" && pwd
git worktree list --porcelain
git worktree list --verbose
git -C "$path" status --short
git worktree remove "$path"
git worktree prune --dry-run
git worktree prune
When the user is already inside a linked worktree and says "delete this worktree" / "delete worktree", resolve the target before moving out:
target_path="$(git rev-parse --show-toplevel)"
git_dir="$(git rev-parse --git-dir)"
common_dir="$(git rev-parse --git-common-dir)"
main_path="$(git worktree list --porcelain | awk 'NR==1 && /^worktree / {print substr($0, 10)}')"
# Refuse if this is the main worktree or no safe main worktree is available.
if [ "$(cd "$git_dir" && pwd -P)" = "$(cd "$common_dir" && pwd -P)" ] || [ -z "$main_path" ] || [ "$main_path" = "$target_path" ]; then
echo "Refusing to remove this path as a linked worktree: $target_path" >&2
exit 1
fi
git -C "$target_path" status --short --branch
cd "$main_path"
git worktree remove "$target_path"
git worktree list --porcelain
</examples>
<validation>
Deterministic regression command:
python3 skills/git-worktree/scripts/validate-git-worktree-skill.py
Trigger checks:
Operation checks:
git rev-parse --show-toplevel succeeds before path construction.<folder_name>.git-worktree <ARGUMENT> invocations create from the argument without asking what worktree to create.<folder_name> is derived from the stated work intent and sanitized before path construction..hypercore/git-worktree/ is ignored or locally excluded before nested worktree creation.git worktree list --porcelain is read before mutating existing worktrees.git -C <path> status --short first unless the user explicitly asks for force removal.git worktree prune --dry-run before git worktree prune.cd <path> and says whether the active agent context moved there.cd <path>; a persistent session actually changed directory, or at least one post-create command ran from the new worktree via workdir=<path> or an equivalent tool working-directory setting.Resource placement checks:
SKILL.md.rules/worktree-lifecycle.md.references/source-survey.md.development
[Hyper] Use when working on Vite + TanStack Router projects - enforces architecture rules (layers, routes, hooks, services, conventions) with mandatory validation before any code change. Triggers on file creation, route work, hook patterns, or any structural change in a Vite + TanStack Router codebase.
development
[Hyper] Update semantic versions across node/rust/python projects, keep discovered version files synchronized, and prefer the installed `git-commit` skill for the final git step with a direct fallback when it is unavailable.
development
[Hyper] Use when working on TanStack Start projects and the task involves auth, sessions, cookies, CSRF, secrets, env exposure, server functions/routes, headers/CSP, webhooks, or security review/fixes. Triggers on protecting routes, hardening auth flows, preventing secret leaks, securing server boundaries, or reviewing HTTP/security behavior in a TanStack Start app.
tools
[Hyper] Enforce TanStack Start architecture in existing Start projects, especially project/folder structure, route structure, nested shared folder organization, server functions, loader/client-server boundaries, importProtection, hooks, SSR/hydration, and hypercore conventions. Use before structural code changes, folder-structure reviews, route work, server function work, or architecture audits in TanStack Start codebases.